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

main
ts 46 lines 1.55 KB
Raw
1 import * as sns from "@distilled.cloud/aws/sns";
2 import * as Binding from "alchemy/Binding";
3 import * as Effect from "effect/Effect";
4 import type { Topic } from "./Topic.ts";
5
6 export interface ListSubscriptionsByTopicRequest extends Omit<
7 sns.ListSubscriptionsByTopicInput,
8 "TopicArn"
9 > {}
10
11 /**
12 * Runtime binding for `sns:ListSubscriptionsByTopic`.
13 *
14 * Bind this operation to a {@link Topic} inside a function runtime to page
15 * through that topic's subscriptions; the `TopicArn` is injected
16 * automatically. The binding grants the host function
17 * `sns:ListSubscriptionsByTopic` on the topic. Provide the
18 * `ListSubscriptionsByTopicHttp` layer on the Function to implement the
19 * binding.
20 * ### Listing a Topic's Subscriptions
21 * **Example:** List Subscriptions of a Topic
22 * ```typescript
23 * // init (provide SNS.ListSubscriptionsByTopicHttp on the Function)
24 * const listSubscriptionsByTopic = yield* SNS.ListSubscriptionsByTopic(topic);
25 *
26 * // runtime
27 * const response = yield* listSubscriptionsByTopic();
28 * const endpoints = (response.Subscriptions ?? []).map((s) => s.Endpoint);
29 * ```
30 *
31 * @binding
32 */
33 export interface ListSubscriptionsByTopic extends Binding.Service<
34 ListSubscriptionsByTopic,
35 "AWS.SNS.ListSubscriptionsByTopic",
36 (
37 topic: Topic,
38 ) => Effect.Effect<
39 (
40 request?: ListSubscriptionsByTopicRequest,
41 ) => Effect.Effect<sns.ListSubscriptionsByTopicResponse, sns.ListSubscriptionsByTopicError>
42 >
43 > {}
44 export const ListSubscriptionsByTopic = Binding.Service<ListSubscriptionsByTopic>(
45 "AWS.SNS.ListSubscriptionsByTopic",
46 );