| 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:SearchTasks`. |
| 8 | * |
| 9 | * Searches the tasks of the bound {@link Queue} (optionally narrowed to one |
| 10 | * `jobId`) with filter and sort expressions. The queue's |
| 11 | * `farmId`/`queueIds: [queueId]` are injected from the binding. Provide the |
| 12 | * implementation with `Effect.provide(AWS.Deadline.SearchTasksHttp)`. |
| 13 | * ### Monitoring Tasks |
| 14 | * **Example:** Page Through A Job's Tasks |
| 15 | * ```typescript |
| 16 | * // init — bind the operation to the queue |
| 17 | * const searchTasks = yield* AWS.Deadline.SearchTasks(queue); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { tasks, totalResults } = yield* searchTasks({ |
| 21 | * itemOffset: 0, |
| 22 | * jobId, |
| 23 | * }); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface SearchTasks extends Binding.Service< |
| 29 | SearchTasks, |
| 30 | "AWS.Deadline.SearchTasks", |
| 31 | ( |
| 32 | queue: Queue, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request: Omit<deadline.SearchTasksRequest, "farmId" | "queueIds">, |
| 36 | ) => Effect.Effect<deadline.SearchTasksResponse, deadline.SearchTasksError> |
| 37 | > |
| 38 | > {} |
| 39 | export const SearchTasks = Binding.Service<SearchTasks>( |
| 40 | "AWS.Deadline.SearchTasks", |
| 41 | ); |