| 1 | import type * as deadline from "@distilled.cloud/aws/deadline"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Queue } from "./Queue.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `deadline:CreateJob`. |
| 8 | * |
| 9 | * Submits a render job to the bound {@link Queue} — the data-plane entry |
| 10 | * point of Deadline Cloud. The job template is an Open Job Description |
| 11 | * (OJD) document (`JSON` or `YAML`). The queue's `farmId`/`queueId` are |
| 12 | * injected from the binding. Provide the implementation with |
| 13 | * `Effect.provide(AWS.Deadline.CreateJobHttp)`. |
| 14 | * ### Submitting Jobs |
| 15 | * **Example:** Submit A Job From A Template |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the queue |
| 18 | * const createJob = yield* AWS.Deadline.CreateJob(queue); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { jobId } = yield* createJob({ |
| 22 | * template: JSON.stringify(jobTemplate), |
| 23 | * templateType: "JSON", |
| 24 | * priority: 50, |
| 25 | * }); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface CreateJob extends Binding.Service< |
| 31 | CreateJob, |
| 32 | "AWS.Deadline.CreateJob", |
| 33 | ( |
| 34 | queue: Queue, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request: Omit<deadline.CreateJobRequest, "farmId" | "queueId">, |
| 38 | ) => Effect.Effect<deadline.CreateJobResponse, deadline.CreateJobError> |
| 39 | > |
| 40 | > {} |
| 41 | export const CreateJob = Binding.Service<CreateJob>("AWS.Deadline.CreateJob"); |