1import type * as deadline from "@distilled.cloud/aws/deadline";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Queue } from "./Queue.ts";
5
6/**
7 * Runtime binding for `deadline:SearchSteps`.
8 *
9 * Searches the steps 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.SearchStepsHttp)`.
13 * ### Monitoring Steps
14 * **Example:** Find A Job's Failed Steps
15 * ```typescript
16 * // init — bind the operation to the queue
17 * const searchSteps = yield* AWS.Deadline.SearchSteps(queue);
18 *
19 * // runtime
20 * const { steps } = yield* searchSteps({
21 * itemOffset: 0,
22 * jobId,
23 * filterExpressions: {
24 * operator: "AND",
25 * filters: [
26 * {
27 * stringFilter: {
28 * name: "TASK_RUN_STATUS",
29 * operator: "EQUAL",
30 * value: "FAILED",
31 * },
32 * },
33 * ],
34 * },
35 * });
36 * ```
37 *
38 * @binding
39 */
40export interface SearchSteps extends Binding.Service<
41 SearchSteps,
42 "AWS.Deadline.SearchSteps",
43 (
44 queue: Queue,
45 ) => Effect.Effect<
46 (
47 request: Omit<deadline.SearchStepsRequest, "farmId" | "queueIds">,
48 ) => Effect.Effect<deadline.SearchStepsResponse, deadline.SearchStepsError>
49 >
50> {}
51export const SearchSteps = Binding.Service<SearchSteps>(
52 "AWS.Deadline.SearchSteps",
53);