@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 38 lines 1.18 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 SubscribeRequest extends Omit<sns.SubscribeInput, "TopicArn"> {}
7
8 /**
9 * Runtime binding for `sns:Subscribe`.
10 *
11 * Bind this operation to a {@link Topic} to subscribe endpoints (email,
12 * sms, https, sqs, ...) to the topic at runtime — for example subscribing a
13 * user's email address from an API handler. The `TopicArn` is injected
14 * automatically.
15 * Provide the `SubscribeHttp` layer on the Function to implement the binding.
16 * ### Subscribing Endpoints
17 * **Example:** Subscribe an Email Address
18 * ```typescript
19 * const subscribe = yield* SNS.Subscribe(topic);
20 * const response = yield* subscribe({
21 * Protocol: "email",
22 * Endpoint: "user@example.com",
23 * });
24 * ```
25 *
26 * @binding
27 */
28 export interface Subscribe extends Binding.Service<
29 Subscribe,
30 "AWS.SNS.Subscribe",
31 (
32 topic: Topic,
33 ) => Effect.Effect<
34 (request: SubscribeRequest) => Effect.Effect<sns.SubscribeResponse, sns.SubscribeError>
35 >
36 > {}
37
38 export const Subscribe = Binding.Service<Subscribe>("AWS.SNS.Subscribe");