1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2018 Make.org
4  *
5  * This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Affero General Public License as
7  *  published by the Free Software Foundation, either version 3 of the
8  *  License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  *
18  */
19 
20 package org.make.api.technical.job
21 
22 import java.time.ZonedDateTime
23 import akka.http.scaladsl.server.{Directives, PathMatcher1, Route}
24 import enumeratum.{Circe, Enum, EnumEntry}
25 import io.circe.Encoder
26 import io.circe.generic.semiauto.deriveEncoder
27 import io.swagger.annotations._
28 import org.make.api.operation.OperationServiceComponent
29 import org.make.api.question.QuestionServiceComponent
30 
31 import javax.ws.rs.Path
32 import org.make.api.technical.MakeDirectives.MakeDirectivesDependencies
33 import org.make.api.technical.MakeAuthenticationDirectives
34 import org.make.api.technical.directives.FutureDirectivesExtensions._
35 import org.make.core.auth.UserRights
36 import org.make.core.job.Job
37 import org.make.core.job.Job.JobId
38 import org.make.core.job.Job.JobStatus._
39 import org.make.core.{CirceFormatters, HttpCodes}
40 import scalaoauth2.provider.AuthInfo
41 
42 import scala.annotation.meta.field
43 
44 @Api(value = "Admin Job")
45 @Path(value = "/admin/jobs")
46 trait JobApi extends Directives {
47 
48   @ApiOperation(
49     value = "get-job-status",
50     httpMethod = "GET",
51     code = HttpCodes.OK,
52     authorizations = Array(
53       new Authorization(
54         value = "MakeApi",
55         scopes = Array(new AuthorizationScope(scope = "admin", description = "BO Admin"))
56       )
57     )
58   )
59   @ApiImplicitParams(
60     value = Array(
61       new ApiImplicitParam(
62         name = "jobId",
63         paramType = "path",
64         dataType = "string",
65         allowableValues = JobId.swaggerAllowableValues
66       )
67     )
68   )
69   @ApiResponses(value = Array(new ApiResponse(code = HttpCodes.OK, message = "Ok", response = classOf[JobResponse])))
70   @Path(value = "/{jobId}")
71   def status: Route
72 
73   def routes: Route = status
74 
75 }
76 
77 trait JobApiComponent {
78   def jobApi: JobApi
79 }
80 
81 trait DefaultJobApiComponent extends JobApiComponent with MakeAuthenticationDirectives {
82   self: MakeDirectivesDependencies
83     with JobCoordinatorServiceComponent
84     with QuestionServiceComponent
85     with OperationServiceComponent =>
86   override lazy val jobApi: JobApi = new DefaultJobApi
87 
88   class DefaultJobApi extends JobApi {
89 
90     val jobId: PathMatcher1[JobId] = Segment.map(id => JobId(id))
91 
92     override def status: Route = get {
93       path("admin" / "jobs" / jobId) { id =>
94         makeOperation("GetJobStatus") { _ =>
95           makeOAuth2 { userAuth: AuthInfo[UserRights] =>
96             requireAdminRole(userAuth.user) {
97               jobCoordinatorService.get(id).asDirectiveOrNotFound { job =>
98                 complete(JobResponse(job))
99               }
100             }
101           }
102         }
103       }
104     }
105   }
106 }
107 
108 final case class JobResponse(
109   @(ApiModelProperty @field)(dataType = "string", example = "11111111-2222-3333-4444-555555555555", required = true)
110   id: JobId,
111   createdAt: Option[ZonedDateTime],
112   updatedAt: Option[ZonedDateTime],
113   @(ApiModelProperty @field)(
114     dataType = "string",
115     allowableValues = JobResponse.Status.swaggerAllowableValues,
116     required = true
117   )
118   status: JobResponse.Status,
119   details: Option[String]
120 )
121 
122 object JobResponse extends CirceFormatters {
123 
124   def apply(job: Job): JobResponse = {
125     val (status, details) = job.status match {
126       case Running(progress) =>
127         (if (job.isStuck(Job.defaultHeartRate)) Status.Stuck else Status.Running, Some(s"progress = $progress%"))
128       case Finished(error @ Some(_)) =>
129         (Status.Failure, error)
130       case Finished(_) =>
131         (Status.Success, None)
132     }
133     JobResponse(job.id, job.createdAt, job.updatedAt, status, details)
134   }
135 
136   sealed abstract class Status extends EnumEntry with Product with Serializable
137 
138   object Status extends Enum[Status] {
139 
140     case object Running extends Status
141     case object Stuck extends Status
142     case object Success extends Status
143     case object Failure extends Status
144 
145     override val values: IndexedSeq[Status] = findValues
146     final val swaggerAllowableValues = "Running,Stuck,Success,Failure"
147 
148     implicit val encoder: Encoder[Status] = Circe.encoderLowercase(this)
149   }
150 
151   implicit val encoder: Encoder[JobResponse] = deriveEncoder
152 
153 }
Line Stmt Id Pos Tree Symbol Tests Code
73 41629 2413 - 2419 Select org.make.api.technical.job.JobApi.status org.make.api.technical.job.jobapitest JobApi.this.status
90 33772 2841 - 2848 Select akka.http.scaladsl.server.PathMatchers.Segment org.make.api.technical.job.jobapitest DefaultJobApi.this.Segment
90 46515 2859 - 2868 Apply org.make.core.job.Job.JobId.apply org.make.api.technical.job.jobapitest org.make.core.job.Job.JobId.apply(id)
90 38944 2841 - 2869 Apply akka.http.scaladsl.server.PathMatcher.PathMatcher1Ops.map org.make.api.technical.job.jobapitest server.this.PathMatcher.PathMatcher1Ops[String](DefaultJobApi.this.Segment).map[org.make.core.job.Job.JobId](((id: String) => org.make.core.job.Job.JobId.apply(id)))
92 33802 2904 - 3286 Apply scala.Function1.apply org.make.api.technical.job.jobapitest server.this.Directive.addByNameNullaryApply(DefaultJobApi.this.get).apply(server.this.Directive.addDirectiveApply[(org.make.core.job.Job.JobId,)](DefaultJobApi.this.path[(org.make.core.job.Job.JobId,)](DefaultJobApi.this._segmentStringToPathMatcher("admin")./[Unit](DefaultJobApi.this._segmentStringToPathMatcher("jobs"))(TupleOps.this.Join.join0P[Unit])./[(org.make.core.job.Job.JobId,)](DefaultJobApi.this.jobId)(TupleOps.this.Join.join0P[(org.make.core.job.Job.JobId,)])))(util.this.ApplyConverter.hac1[org.make.core.job.Job.JobId]).apply(((id: org.make.core.job.Job.JobId) => server.this.Directive.addDirectiveApply[(org.make.core.RequestContext,)](DefaultJobApiComponent.this.makeOperation("GetJobStatus", DefaultJobApiComponent.this.makeOperation$default$2, DefaultJobApiComponent.this.makeOperation$default$3))(util.this.ApplyConverter.hac1[org.make.core.RequestContext]).apply(((x$1: org.make.core.RequestContext) => server.this.Directive.addDirectiveApply[(scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights],)](DefaultJobApiComponent.this.makeOAuth2)(util.this.ApplyConverter.hac1[scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]]).apply(((userAuth: scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]) => server.this.Directive.addByNameNullaryApply(DefaultJobApiComponent.this.requireAdminRole(userAuth.user)).apply(server.this.Directive.addDirectiveApply[(org.make.core.job.Job,)](org.make.api.technical.directives.FutureDirectivesExtensions.FutureOptionWithRoutes[org.make.core.job.Job](DefaultJobApiComponent.this.jobCoordinatorService.get(id)).asDirectiveOrNotFound)(util.this.ApplyConverter.hac1[org.make.core.job.Job]).apply(((job: org.make.core.job.Job) => DefaultJobApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.api.technical.job.JobResponse](JobResponse.apply(job))(marshalling.this.Marshaller.liftMarshaller[org.make.api.technical.job.JobResponse](DefaultJobApiComponent.this.marshaller[org.make.api.technical.job.JobResponse](job.this.JobResponse.encoder, DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse]))))))))))))))
92 34850 2904 - 2907 Select akka.http.scaladsl.server.directives.MethodDirectives.get org.make.api.technical.job.jobapitest DefaultJobApi.this.get
93 33252 2921 - 2945 ApplyToImplicitArgs akka.http.scaladsl.server.PathMatcher./ org.make.api.technical.job.jobapitest DefaultJobApi.this._segmentStringToPathMatcher("admin")./[Unit](DefaultJobApi.this._segmentStringToPathMatcher("jobs"))(TupleOps.this.Join.join0P[Unit])./[(org.make.core.job.Job.JobId,)](DefaultJobApi.this.jobId)(TupleOps.this.Join.join0P[(org.make.core.job.Job.JobId,)])
93 46551 2916 - 2946 Apply akka.http.scaladsl.server.directives.PathDirectives.path org.make.api.technical.job.jobapitest DefaultJobApi.this.path[(org.make.core.job.Job.JobId,)](DefaultJobApi.this._segmentStringToPathMatcher("admin")./[Unit](DefaultJobApi.this._segmentStringToPathMatcher("jobs"))(TupleOps.this.Join.join0P[Unit])./[(org.make.core.job.Job.JobId,)](DefaultJobApi.this.jobId)(TupleOps.this.Join.join0P[(org.make.core.job.Job.JobId,)]))
93 41380 2916 - 3280 Apply scala.Function1.apply org.make.api.technical.job.jobapitest server.this.Directive.addDirectiveApply[(org.make.core.job.Job.JobId,)](DefaultJobApi.this.path[(org.make.core.job.Job.JobId,)](DefaultJobApi.this._segmentStringToPathMatcher("admin")./[Unit](DefaultJobApi.this._segmentStringToPathMatcher("jobs"))(TupleOps.this.Join.join0P[Unit])./[(org.make.core.job.Job.JobId,)](DefaultJobApi.this.jobId)(TupleOps.this.Join.join0P[(org.make.core.job.Job.JobId,)])))(util.this.ApplyConverter.hac1[org.make.core.job.Job.JobId]).apply(((id: org.make.core.job.Job.JobId) => server.this.Directive.addDirectiveApply[(org.make.core.RequestContext,)](DefaultJobApiComponent.this.makeOperation("GetJobStatus", DefaultJobApiComponent.this.makeOperation$default$2, DefaultJobApiComponent.this.makeOperation$default$3))(util.this.ApplyConverter.hac1[org.make.core.RequestContext]).apply(((x$1: org.make.core.RequestContext) => server.this.Directive.addDirectiveApply[(scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights],)](DefaultJobApiComponent.this.makeOAuth2)(util.this.ApplyConverter.hac1[scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]]).apply(((userAuth: scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]) => server.this.Directive.addByNameNullaryApply(DefaultJobApiComponent.this.requireAdminRole(userAuth.user)).apply(server.this.Directive.addDirectiveApply[(org.make.core.job.Job,)](org.make.api.technical.directives.FutureDirectivesExtensions.FutureOptionWithRoutes[org.make.core.job.Job](DefaultJobApiComponent.this.jobCoordinatorService.get(id)).asDirectiveOrNotFound)(util.this.ApplyConverter.hac1[org.make.core.job.Job]).apply(((job: org.make.core.job.Job) => DefaultJobApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.api.technical.job.JobResponse](JobResponse.apply(job))(marshalling.this.Marshaller.liftMarshaller[org.make.api.technical.job.JobResponse](DefaultJobApiComponent.this.marshaller[org.make.api.technical.job.JobResponse](job.this.JobResponse.encoder, DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse])))))))))))))
93 32151 2929 - 2929 TypeApply akka.http.scaladsl.server.util.TupleOps.Join.join0P org.make.api.technical.job.jobapitest TupleOps.this.Join.join0P[Unit]
93 38697 2920 - 2920 TypeApply akka.http.scaladsl.server.util.ApplyConverterInstances.hac1 org.make.api.technical.job.jobapitest util.this.ApplyConverter.hac1[org.make.core.job.Job.JobId]
93 44917 2940 - 2945 Select org.make.api.technical.job.DefaultJobApiComponent.DefaultJobApi.jobId org.make.api.technical.job.jobapitest DefaultJobApi.this.jobId
93 41390 2938 - 2938 TypeApply akka.http.scaladsl.server.util.TupleOps.Join.join0P org.make.api.technical.job.jobapitest TupleOps.this.Join.join0P[(org.make.core.job.Job.JobId,)]
93 48164 2921 - 2928 Literal <nosymbol> org.make.api.technical.job.jobapitest "admin"
93 39754 2931 - 2937 ApplyImplicitView akka.http.scaladsl.server.ImplicitPathMatcherConstruction._segmentStringToPathMatcher org.make.api.technical.job.jobapitest DefaultJobApi.this._segmentStringToPathMatcher("jobs")
94 45786 2963 - 3272 Apply scala.Function1.apply org.make.api.technical.job.jobapitest server.this.Directive.addDirectiveApply[(org.make.core.RequestContext,)](DefaultJobApiComponent.this.makeOperation("GetJobStatus", DefaultJobApiComponent.this.makeOperation$default$2, DefaultJobApiComponent.this.makeOperation$default$3))(util.this.ApplyConverter.hac1[org.make.core.RequestContext]).apply(((x$1: org.make.core.RequestContext) => server.this.Directive.addDirectiveApply[(scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights],)](DefaultJobApiComponent.this.makeOAuth2)(util.this.ApplyConverter.hac1[scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]]).apply(((userAuth: scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]) => server.this.Directive.addByNameNullaryApply(DefaultJobApiComponent.this.requireAdminRole(userAuth.user)).apply(server.this.Directive.addDirectiveApply[(org.make.core.job.Job,)](org.make.api.technical.directives.FutureDirectivesExtensions.FutureOptionWithRoutes[org.make.core.job.Job](DefaultJobApiComponent.this.jobCoordinatorService.get(id)).asDirectiveOrNotFound)(util.this.ApplyConverter.hac1[org.make.core.job.Job]).apply(((job: org.make.core.job.Job) => DefaultJobApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.api.technical.job.JobResponse](JobResponse.apply(job))(marshalling.this.Marshaller.liftMarshaller[org.make.api.technical.job.JobResponse](DefaultJobApiComponent.this.marshaller[org.make.api.technical.job.JobResponse](job.this.JobResponse.encoder, DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse])))))))))))
94 35605 2977 - 2991 Literal <nosymbol> org.make.api.technical.job.jobapitest "GetJobStatus"
94 39786 2963 - 2963 Select org.make.api.technical.MakeDirectives.makeOperation$default$3 org.make.api.technical.job.jobapitest DefaultJobApiComponent.this.makeOperation$default$3
94 32186 2963 - 2992 Apply org.make.api.technical.MakeDirectives.makeOperation org.make.api.technical.job.jobapitest DefaultJobApiComponent.this.makeOperation("GetJobStatus", DefaultJobApiComponent.this.makeOperation$default$2, DefaultJobApiComponent.this.makeOperation$default$3)
94 47925 2963 - 2963 Select org.make.api.technical.MakeDirectives.makeOperation$default$2 org.make.api.technical.job.jobapitest DefaultJobApiComponent.this.makeOperation$default$2
94 45990 2976 - 2976 TypeApply akka.http.scaladsl.server.util.ApplyConverterInstances.hac1 org.make.api.technical.job.jobapitest util.this.ApplyConverter.hac1[org.make.core.RequestContext]
95 33288 3010 - 3010 TypeApply akka.http.scaladsl.server.util.ApplyConverterInstances.hac1 org.make.api.technical.job.jobapitest util.this.ApplyConverter.hac1[scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]]
95 42129 3010 - 3020 Select org.make.api.technical.auth.MakeAuthentication.makeOAuth2 org.make.api.technical.job.jobapitest DefaultJobApiComponent.this.makeOAuth2
95 32744 3010 - 3262 Apply scala.Function1.apply org.make.api.technical.job.jobapitest server.this.Directive.addDirectiveApply[(scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights],)](DefaultJobApiComponent.this.makeOAuth2)(util.this.ApplyConverter.hac1[scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]]).apply(((userAuth: scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]) => server.this.Directive.addByNameNullaryApply(DefaultJobApiComponent.this.requireAdminRole(userAuth.user)).apply(server.this.Directive.addDirectiveApply[(org.make.core.job.Job,)](org.make.api.technical.directives.FutureDirectivesExtensions.FutureOptionWithRoutes[org.make.core.job.Job](DefaultJobApiComponent.this.jobCoordinatorService.get(id)).asDirectiveOrNotFound)(util.this.ApplyConverter.hac1[org.make.core.job.Job]).apply(((job: org.make.core.job.Job) => DefaultJobApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.api.technical.job.JobResponse](JobResponse.apply(job))(marshalling.this.Marshaller.liftMarshaller[org.make.api.technical.job.JobResponse](DefaultJobApiComponent.this.marshaller[org.make.api.technical.job.JobResponse](job.this.JobResponse.encoder, DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse])))))))))
96 40277 3069 - 3250 Apply scala.Function1.apply server.this.Directive.addByNameNullaryApply(DefaultJobApiComponent.this.requireAdminRole(userAuth.user)).apply(server.this.Directive.addDirectiveApply[(org.make.core.job.Job,)](org.make.api.technical.directives.FutureDirectivesExtensions.FutureOptionWithRoutes[org.make.core.job.Job](DefaultJobApiComponent.this.jobCoordinatorService.get(id)).asDirectiveOrNotFound)(util.this.ApplyConverter.hac1[org.make.core.job.Job]).apply(((job: org.make.core.job.Job) => DefaultJobApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.api.technical.job.JobResponse](JobResponse.apply(job))(marshalling.this.Marshaller.liftMarshaller[org.make.api.technical.job.JobResponse](DefaultJobApiComponent.this.marshaller[org.make.api.technical.job.JobResponse](job.this.JobResponse.encoder, DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse])))))))
96 46312 3086 - 3099 Select scalaoauth2.provider.AuthInfo.user userAuth.user
96 39496 3069 - 3100 Apply org.make.api.technical.MakeAuthenticationDirectives.requireAdminRole DefaultJobApiComponent.this.requireAdminRole(userAuth.user)
97 48118 3117 - 3168 Select org.make.api.technical.directives.FutureDirectivesExtensions.FutureOptionWithRoutes.asDirectiveOrNotFound org.make.api.technical.directives.FutureDirectivesExtensions.FutureOptionWithRoutes[org.make.core.job.Job](DefaultJobApiComponent.this.jobCoordinatorService.get(id)).asDirectiveOrNotFound
97 35350 3117 - 3146 Apply org.make.api.technical.job.JobCoordinatorService.get DefaultJobApiComponent.this.jobCoordinatorService.get(id)
97 48161 3117 - 3236 Apply scala.Function1.apply server.this.Directive.addDirectiveApply[(org.make.core.job.Job,)](org.make.api.technical.directives.FutureDirectivesExtensions.FutureOptionWithRoutes[org.make.core.job.Job](DefaultJobApiComponent.this.jobCoordinatorService.get(id)).asDirectiveOrNotFound)(util.this.ApplyConverter.hac1[org.make.core.job.Job]).apply(((job: org.make.core.job.Job) => DefaultJobApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.api.technical.job.JobResponse](JobResponse.apply(job))(marshalling.this.Marshaller.liftMarshaller[org.make.api.technical.job.JobResponse](DefaultJobApiComponent.this.marshaller[org.make.api.technical.job.JobResponse](job.this.JobResponse.encoder, DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse]))))))
97 39829 3147 - 3147 TypeApply akka.http.scaladsl.server.util.ApplyConverterInstances.hac1 util.this.ApplyConverter.hac1[org.make.core.job.Job]
98 31942 3203 - 3219 Apply org.make.api.technical.job.JobResponse.apply JobResponse.apply(job)
98 46351 3214 - 3214 ApplyToImplicitArgs akka.http.scaladsl.marshalling.LowPriorityToResponseMarshallerImplicits.liftMarshaller marshalling.this.Marshaller.liftMarshaller[org.make.api.technical.job.JobResponse](DefaultJobApiComponent.this.marshaller[org.make.api.technical.job.JobResponse](job.this.JobResponse.encoder, DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse]))
98 31661 3194 - 3220 Apply akka.http.scaladsl.server.directives.RouteDirectives.complete DefaultJobApi.this.complete(marshalling.this.ToResponseMarshallable.apply[org.make.api.technical.job.JobResponse](JobResponse.apply(job))(marshalling.this.Marshaller.liftMarshaller[org.make.api.technical.job.JobResponse](DefaultJobApiComponent.this.marshaller[org.make.api.technical.job.JobResponse](job.this.JobResponse.encoder, DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse]))))
98 39256 3203 - 3219 ApplyToImplicitArgs akka.http.scaladsl.marshalling.ToResponseMarshallable.apply marshalling.this.ToResponseMarshallable.apply[org.make.api.technical.job.JobResponse](JobResponse.apply(job))(marshalling.this.Marshaller.liftMarshaller[org.make.api.technical.job.JobResponse](DefaultJobApiComponent.this.marshaller[org.make.api.technical.job.JobResponse](job.this.JobResponse.encoder, DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse])))
98 33765 3214 - 3214 ApplyToImplicitArgs de.heikoseeberger.akkahttpcirce.BaseCirceSupport.marshaller DefaultJobApiComponent.this.marshaller[org.make.api.technical.job.JobResponse](job.this.JobResponse.encoder, DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse])
98 46029 3214 - 3214 Select org.make.api.technical.job.JobResponse.encoder job.this.JobResponse.encoder
98 41880 3214 - 3214 TypeApply de.heikoseeberger.akkahttpcirce.BaseCirceSupport.marshaller$default$2 DefaultJobApiComponent.this.marshaller$default$2[org.make.api.technical.job.JobResponse]
125 39290 3831 - 3831 Select scala.Tuple2._2 x$2._2
125 46793 3823 - 3823 Select scala.Tuple2._1 x$2._1
133 47912 4166 - 4179 Select org.make.core.job.Job.createdAt job.createdAt
133 40313 4181 - 4194 Select org.make.core.job.Job.updatedAt job.updatedAt
133 31418 4158 - 4164 Select org.make.core.job.Job.id job.id
133 31895 4146 - 4212 Apply org.make.api.technical.job.JobResponse.apply JobResponse.apply(job.id, job.createdAt, job.updatedAt, status, details)
146 45824 4590 - 4621 Literal <nosymbol> "Running,Stuck,Success,Failure"
148 41416 4667 - 4695 Apply enumeratum.Circe.encoderLowercase org.make.api.technical.job.jobapitest enumeratum.Circe.encoderLowercase[org.make.api.technical.job.JobResponse.Status](this)
151 33544 4748 - 4761 ApplyToImplicitArgs io.circe.generic.semiauto.deriveEncoder io.circe.generic.semiauto.deriveEncoder[org.make.api.technical.job.JobResponse]({ val inst$macro$24: io.circe.generic.encoding.DerivedAsObjectEncoder[org.make.api.technical.job.JobResponse] = { final class anon$lazy$macro$23 extends AnyRef with Serializable { def <init>(): anon$lazy$macro$23 = { anon$lazy$macro$23.super.<init>(); () }; <stable> <accessor> lazy val inst$macro$1: io.circe.generic.encoding.DerivedAsObjectEncoder[org.make.api.technical.job.JobResponse] = encoding.this.DerivedAsObjectEncoder.deriveEncoder[org.make.api.technical.job.JobResponse, shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out](shapeless.this.LabelledGeneric.materializeProduct[org.make.api.technical.job.JobResponse, (Symbol @@ String("id")) :: (Symbol @@ String("createdAt")) :: (Symbol @@ String("updatedAt")) :: (Symbol @@ String("status")) :: (Symbol @@ String("details")) :: shapeless.HNil, org.make.core.job.Job.JobId :: Option[java.time.ZonedDateTime] :: Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil, shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out](DefaultSymbolicLabelling.instance[org.make.api.technical.job.JobResponse, (Symbol @@ String("id")) :: (Symbol @@ String("createdAt")) :: (Symbol @@ String("updatedAt")) :: (Symbol @@ String("status")) :: (Symbol @@ String("details")) :: shapeless.HNil](::.apply[Symbol @@ String("id"), (Symbol @@ String("createdAt")) :: (Symbol @@ String("updatedAt")) :: (Symbol @@ String("status")) :: (Symbol @@ String("details")) :: shapeless.HNil.type](scala.Symbol.apply("id").asInstanceOf[Symbol @@ String("id")], ::.apply[Symbol @@ String("createdAt"), (Symbol @@ String("updatedAt")) :: (Symbol @@ String("status")) :: (Symbol @@ String("details")) :: shapeless.HNil.type](scala.Symbol.apply("createdAt").asInstanceOf[Symbol @@ String("createdAt")], ::.apply[Symbol @@ String("updatedAt"), (Symbol @@ String("status")) :: (Symbol @@ String("details")) :: shapeless.HNil.type](scala.Symbol.apply("updatedAt").asInstanceOf[Symbol @@ String("updatedAt")], ::.apply[Symbol @@ String("status"), (Symbol @@ String("details")) :: shapeless.HNil.type](scala.Symbol.apply("status").asInstanceOf[Symbol @@ String("status")], ::.apply[Symbol @@ String("details"), shapeless.HNil.type](scala.Symbol.apply("details").asInstanceOf[Symbol @@ String("details")], HNil)))))), Generic.instance[org.make.api.technical.job.JobResponse, org.make.core.job.Job.JobId :: Option[java.time.ZonedDateTime] :: Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil](((x0$3: org.make.api.technical.job.JobResponse) => x0$3 match { case (id: org.make.core.job.Job.JobId, createdAt: Option[java.time.ZonedDateTime], updatedAt: Option[java.time.ZonedDateTime], status: org.make.api.technical.job.JobResponse.Status, details: Option[String]): org.make.api.technical.job.JobResponse((id$macro$17 @ _), (createdAt$macro$18 @ _), (updatedAt$macro$19 @ _), (status$macro$20 @ _), (details$macro$21 @ _)) => ::.apply[org.make.core.job.Job.JobId, Option[java.time.ZonedDateTime] :: Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil.type](id$macro$17, ::.apply[Option[java.time.ZonedDateTime], Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil.type](createdAt$macro$18, ::.apply[Option[java.time.ZonedDateTime], org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil.type](updatedAt$macro$19, ::.apply[org.make.api.technical.job.JobResponse.Status, Option[String] :: shapeless.HNil.type](status$macro$20, ::.apply[Option[String], shapeless.HNil.type](details$macro$21, HNil))))).asInstanceOf[org.make.core.job.Job.JobId :: Option[java.time.ZonedDateTime] :: Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil] }), ((x0$4: org.make.core.job.Job.JobId :: Option[java.time.ZonedDateTime] :: Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil) => x0$4 match { case (head: org.make.core.job.Job.JobId, tail: Option[java.time.ZonedDateTime] :: Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil): org.make.core.job.Job.JobId :: Option[java.time.ZonedDateTime] :: Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil((id$macro$12 @ _), (head: Option[java.time.ZonedDateTime], tail: Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil): Option[java.time.ZonedDateTime] :: Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil((createdAt$macro$13 @ _), (head: Option[java.time.ZonedDateTime], tail: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil): Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil((updatedAt$macro$14 @ _), (head: org.make.api.technical.job.JobResponse.Status, tail: Option[String] :: shapeless.HNil): org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil((status$macro$15 @ _), (head: Option[String], tail: shapeless.HNil): Option[String] :: shapeless.HNil((details$macro$16 @ _), HNil))))) => job.this.JobResponse.apply(id$macro$12, createdAt$macro$13, updatedAt$macro$14, status$macro$15, details$macro$16) })), hlist.this.ZipWithKeys.hconsZipWithKeys[Symbol @@ String("id"), org.make.core.job.Job.JobId, (Symbol @@ String("createdAt")) :: (Symbol @@ String("updatedAt")) :: (Symbol @@ String("status")) :: (Symbol @@ String("details")) :: shapeless.HNil, Option[java.time.ZonedDateTime] :: Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil, shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out](hlist.this.ZipWithKeys.hconsZipWithKeys[Symbol @@ String("createdAt"), Option[java.time.ZonedDateTime], (Symbol @@ String("updatedAt")) :: (Symbol @@ String("status")) :: (Symbol @@ String("details")) :: shapeless.HNil, Option[java.time.ZonedDateTime] :: org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil, shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out](hlist.this.ZipWithKeys.hconsZipWithKeys[Symbol @@ String("updatedAt"), Option[java.time.ZonedDateTime], (Symbol @@ String("status")) :: (Symbol @@ String("details")) :: shapeless.HNil, org.make.api.technical.job.JobResponse.Status :: Option[String] :: shapeless.HNil, shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out](hlist.this.ZipWithKeys.hconsZipWithKeys[Symbol @@ String("status"), org.make.api.technical.job.JobResponse.Status, (Symbol @@ String("details")) :: shapeless.HNil, Option[String] :: shapeless.HNil, shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out](hlist.this.ZipWithKeys.hconsZipWithKeys[Symbol @@ String("details"), Option[String], shapeless.HNil, shapeless.HNil, shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out](hlist.this.ZipWithKeys.hnilZipWithKeys, Witness.mkWitness[Symbol with shapeless.tag.Tagged[String("details")]](scala.Symbol.apply("details").asInstanceOf[Symbol @@ String("details")].asInstanceOf[Symbol with shapeless.tag.Tagged[String("details")]])), Witness.mkWitness[Symbol with shapeless.tag.Tagged[String("status")]](scala.Symbol.apply("status").asInstanceOf[Symbol @@ String("status")].asInstanceOf[Symbol with shapeless.tag.Tagged[String("status")]])), Witness.mkWitness[Symbol with shapeless.tag.Tagged[String("updatedAt")]](scala.Symbol.apply("updatedAt").asInstanceOf[Symbol @@ String("updatedAt")].asInstanceOf[Symbol with shapeless.tag.Tagged[String("updatedAt")]])), Witness.mkWitness[Symbol with shapeless.tag.Tagged[String("createdAt")]](scala.Symbol.apply("createdAt").asInstanceOf[Symbol @@ String("createdAt")].asInstanceOf[Symbol with shapeless.tag.Tagged[String("createdAt")]])), Witness.mkWitness[Symbol with shapeless.tag.Tagged[String("id")]](scala.Symbol.apply("id").asInstanceOf[Symbol @@ String("id")].asInstanceOf[Symbol with shapeless.tag.Tagged[String("id")]])), scala.this.<:<.refl[shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out]), shapeless.Lazy.apply[io.circe.generic.encoding.ReprAsObjectEncoder[shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out]](anon$lazy$macro$23.this.inst$macro$22)).asInstanceOf[io.circe.generic.encoding.DerivedAsObjectEncoder[org.make.api.technical.job.JobResponse]]; <stable> <accessor> lazy val inst$macro$22: io.circe.generic.encoding.ReprAsObjectEncoder[shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out] = ({ final class $anon extends io.circe.generic.encoding.ReprAsObjectEncoder[shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out] { def <init>(): <$anon: io.circe.generic.encoding.ReprAsObjectEncoder[shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out]> = { $anon.super.<init>(); () }; private[this] val circeGenericEncoderForid: io.circe.Encoder[org.make.core.job.Job.JobId] = JobResponse.this.stringValueEncoder[org.make.core.job.Job.JobId]; private[this] val circeGenericEncoderForupdatedAt: io.circe.Encoder[Option[java.time.ZonedDateTime]] = circe.this.Encoder.encodeOption[java.time.ZonedDateTime](JobResponse.this.zonedDateTimeEncoder); private[this] val circeGenericEncoderForstatus: io.circe.Encoder[org.make.api.technical.job.JobResponse.Status] = JobResponse.this.Status.encoder; private[this] val circeGenericEncoderFordetails: io.circe.Encoder[Option[String]] = circe.this.Encoder.encodeOption[String](circe.this.Encoder.encodeString); final def encodeObject(a: shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out): io.circe.JsonObject = a match { case (head: shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId], tail: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out): shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out((circeGenericHListBindingForid @ _), (head: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]], tail: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out): shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out((circeGenericHListBindingForcreatedAt @ _), (head: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]], tail: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out): shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out((circeGenericHListBindingForupdatedAt @ _), (head: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status], tail: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out): shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out((circeGenericHListBindingForstatus @ _), (head: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]], tail: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out): shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out((circeGenericHListBindingFordetails @ _), shapeless.HNil))))) => io.circe.JsonObject.fromIterable(scala.collection.immutable.Vector.apply[(String, io.circe.Json)](scala.Tuple2.apply[String, io.circe.Json]("id", $anon.this.circeGenericEncoderForid.apply(circeGenericHListBindingForid)), scala.Tuple2.apply[String, io.circe.Json]("createdAt", $anon.this.circeGenericEncoderForupdatedAt.apply(circeGenericHListBindingForcreatedAt)), scala.Tuple2.apply[String, io.circe.Json]("updatedAt", $anon.this.circeGenericEncoderForupdatedAt.apply(circeGenericHListBindingForupdatedAt)), scala.Tuple2.apply[String, io.circe.Json]("status", $anon.this.circeGenericEncoderForstatus.apply(circeGenericHListBindingForstatus)), scala.Tuple2.apply[String, io.circe.Json]("details", $anon.this.circeGenericEncoderFordetails.apply(circeGenericHListBindingFordetails)))) } }; new $anon() }: io.circe.generic.encoding.ReprAsObjectEncoder[shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out]).asInstanceOf[io.circe.generic.encoding.ReprAsObjectEncoder[shapeless.labelled.FieldType[Symbol @@ String("id"),org.make.core.job.Job.JobId] :: shapeless.labelled.FieldType[Symbol @@ String("createdAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("updatedAt"),Option[java.time.ZonedDateTime]] :: shapeless.labelled.FieldType[Symbol @@ String("status"),org.make.api.technical.job.JobResponse.Status] :: shapeless.labelled.FieldType[Symbol @@ String("details"),Option[String]] :: shapeless.ops.hlist.ZipWithKeys.hnilZipWithKeys.Out]] }; new anon$lazy$macro$23().inst$macro$1 }; shapeless.Lazy.apply[io.circe.generic.encoding.DerivedAsObjectEncoder[org.make.api.technical.job.JobResponse]](inst$macro$24) })