1import type * as ECS from "@distilled.cloud/aws/ecs";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Service } from "./Service.ts";
5
6export interface ListServiceDeploymentsRequest extends Omit<
7 ECS.ListServiceDeploymentsRequest,
8 "service" | "cluster"
9> {}
10
11/**
12 * Runtime binding for `ecs:ListServiceDeployments`.
13 *
14 * Bind this operation to a `Service` inside a function runtime to get a
15 * callable that lists the bound service's deployments (newest first). The
16 * service and cluster ARNs are injected automatically and the host is
17 * granted `ecs:ListServiceDeployments` on the service.
18 * ### Service Deployments
19 * **Example:** Find the In-Progress Deployment
20 * ```typescript
21 * const listServiceDeployments = yield* AWS.ECS.ListServiceDeployments(service);
22 *
23 * const response = yield* listServiceDeployments({
24 * status: ["IN_PROGRESS"],
25 * });
26 * const deploymentArn = response.serviceDeployments?.[0]?.serviceDeploymentArn;
27 * ```
28 *
29 * @binding
30 */
31export interface ListServiceDeployments extends Binding.Service<
32 ListServiceDeployments,
33 "AWS.ECS.ListServiceDeployments",
34 (
35 service: Service,
36 ) => Effect.Effect<
37 (
38 request: ListServiceDeploymentsRequest,
39 ) => Effect.Effect<
40 ECS.ListServiceDeploymentsResponse,
41 ECS.ListServiceDeploymentsError
42 >
43 >
44> {}
45export const ListServiceDeployments = Binding.Service<ListServiceDeployments>(
46 "AWS.ECS.ListServiceDeployments",
47);