1import type * as ECS from "@distilled.cloud/aws/ecs";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Cluster } from "./Cluster.ts";
5
6export interface ListServicesRequest extends Omit<
7 ECS.ListServicesRequest,
8 "cluster"
9> {}
10
11/**
12 * Runtime binding for `ecs:ListServices`.
13 *
14 * Bind this operation to a `Cluster` inside a function runtime to get a
15 * callable that lists service ARNs in the bound cluster. The cluster ARN is
16 * injected automatically and the grant is conditioned on the bound cluster.
17 * ### Listing Services
18 * **Example:** List Fargate Services
19 * ```typescript
20 * const listServices = yield* AWS.ECS.ListServices(cluster);
21 *
22 * const response = yield* listServices({ launchType: "FARGATE" });
23 * const serviceArns = response.serviceArns ?? [];
24 * ```
25 *
26 * @binding
27 */
28export interface ListServices extends Binding.Service<
29 ListServices,
30 "AWS.ECS.ListServices",
31 (
32 cluster: Cluster,
33 ) => Effect.Effect<
34 (
35 request: ListServicesRequest,
36 ) => Effect.Effect<ECS.ListServicesResponse, ECS.ListServicesError>
37 >
38> {}
39export const ListServices = Binding.Service<ListServices>(
40 "AWS.ECS.ListServices",
41);