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

main
ts 38 lines 1.41 KB
Raw
1 import type * as aoss from "@distilled.cloud/aws/opensearchserverless";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Collection } from "./Collection.ts";
5
6 /**
7 * Runtime binding for the `BatchGetCollection` operation scoped to one
8 * collection (IAM action `aoss:BatchGetCollection` on the collection ARN).
9 *
10 * Reads the bound {@link Collection}'s live detail — status, endpoints, KMS
11 * key — from inside a function runtime. Useful for discovering the data-plane
12 * `collectionEndpoint` at runtime. Provide the implementation with
13 * `Effect.provide(AWS.OpenSearchServerless.GetCollectionHttp)`.
14 * ### Inspecting Collections
15 * **Example:** Read the collection's endpoint and status
16 * ```typescript
17 * // init — bind the operation to the collection
18 * const getCollection = yield* AWS.OpenSearchServerless.GetCollection(collection);
19 *
20 * // runtime
21 * const detail = yield* getCollection();
22 * yield* Effect.log(`${detail?.status}: ${detail?.collectionEndpoint}`);
23 * ```
24 *
25 * @binding
26 */
27 export interface GetCollection extends Binding.Service<
28 GetCollection,
29 "AWS.OpenSearchServerless.GetCollection",
30 (
31 collection: Collection,
32 ) => Effect.Effect<
33 () => Effect.Effect<aoss.CollectionDetail | undefined, aoss.BatchGetCollectionError>
34 >
35 > {}
36 export const GetCollection = Binding.Service<GetCollection>(
37 "AWS.OpenSearchServerless.GetCollection",
38 );