@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, 04:45 UTC

main
ts 46 lines 1.6 KB
Raw
1 import type * as RE2 from "@distilled.cloud/aws/resource-explorer-2";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { View } from "./View.ts";
5
6 export interface ListResourcesRequest extends Omit<RE2.ListResourcesInput, "ViewArn"> {}
7
8 /**
9 * Runtime binding for `resource-explorer-2:ListResources`.
10 *
11 * Enumerates the resources visible through the bound {@link View} using a
12 * structured filter (instead of `Search`'s free-form query string) — the
13 * building block of inventory automation: page through every resource the
14 * view exposes and act on each one. The view's ARN is injected from the
15 * binding. Provide the implementation with
16 * `Effect.provide(AWS.ResourceExplorer.ListResourcesHttp)`.
17 * ### Listing Resources
18 * **Example:** List Resources Through a View
19 * ```typescript
20 * // init — bind the operation to the view
21 * const listResources = yield* AWS.ResourceExplorer.ListResources(view);
22 *
23 * // runtime
24 * const page = yield* listResources({
25 * Filters: { FilterString: "service:s3" },
26 * MaxResults: 100,
27 * });
28 * for (const resource of page.Resources ?? []) {
29 * yield* Effect.log(`${resource.ResourceType}: ${resource.Arn}`);
30 * }
31 * ```
32 *
33 * @binding
34 */
35 export interface ListResources extends Binding.Service<
36 ListResources,
37 "AWS.ResourceExplorer.ListResources",
38 <V extends View>(
39 view: V,
40 ) => Effect.Effect<
41 (
42 request?: ListResourcesRequest,
43 ) => Effect.Effect<RE2.ListResourcesOutput, RE2.ListResourcesError>
44 >
45 > {}
46 export const ListResources = Binding.Service<ListResources>("AWS.ResourceExplorer.ListResources");