@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 43 lines 1.47 KB
Raw
1 import type * as SD from "@distilled.cloud/aws/servicediscovery";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Service } from "./Service.ts";
5
6 /**
7 * `ListInstances` request with `ServiceId` injected from the bound
8 * {@link Service}.
9 */
10 export interface ListInstancesRequest extends Omit<SD.ListInstancesRequest, "ServiceId"> {}
11
12 /**
13 * Runtime binding for `servicediscovery:ListInstances` — lists summary
14 * information (id + attributes) for every instance registered with the
15 * bound {@link Service}. Unlike `DiscoverInstances` this is the
16 * control-plane view: strongly consistent with registration, one page at a
17 * time via `NextToken`. Provide the implementation with
18 * `Effect.provide(AWS.CloudMap.ListInstancesHttp)`.
19 * ### Reading Instances
20 * **Example:** List Registered Instances
21 * ```typescript
22 * const listInstances = yield* AWS.CloudMap.ListInstances(service);
23 *
24 * const { Instances } = yield* listInstances();
25 * for (const instance of Instances ?? []) {
26 * console.log(instance.Id, instance.Attributes);
27 * }
28 * ```
29 *
30 * @binding
31 */
32 export interface ListInstances extends Binding.Service<
33 ListInstances,
34 "AWS.CloudMap.ListInstances",
35 <S extends Service>(
36 service: S,
37 ) => Effect.Effect<
38 (
39 request?: ListInstancesRequest,
40 ) => Effect.Effect<SD.ListInstancesResponse, SD.ListInstancesError>
41 >
42 > {}
43 export const ListInstances = Binding.Service<ListInstances>("AWS.CloudMap.ListInstances");