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

main
ts 41 lines 1.4 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 GetTopicAttributesRequest extends Omit<sns.GetTopicAttributesInput, "TopicArn"> {}
7
8 /**
9 * Runtime binding for `sns:GetTopicAttributes`.
10 *
11 * Bind this operation to a {@link Topic} inside a function runtime to read
12 * the topic's raw attribute map (policy, delivery status, KMS key, etc.).
13 * The binding grants the host function `sns:GetTopicAttributes` on the
14 * topic. Provide the `GetTopicAttributesHttp` layer on the Function to
15 * implement the binding.
16 * ### Reading Topic Attributes
17 * **Example:** Read a Topic's Attributes
18 * ```typescript
19 * // init (provide SNS.GetTopicAttributesHttp on the Function)
20 * const getTopicAttributes = yield* SNS.GetTopicAttributes(topic);
21 *
22 * // runtime
23 * const response = yield* getTopicAttributes();
24 * const displayName = response.Attributes?.DisplayName;
25 * ```
26 *
27 * @binding
28 */
29 export interface GetTopicAttributes extends Binding.Service<
30 GetTopicAttributes,
31 "AWS.SNS.GetTopicAttributes",
32 (
33 topic: Topic,
34 ) => Effect.Effect<
35 (
36 request?: GetTopicAttributesRequest,
37 ) => Effect.Effect<sns.GetTopicAttributesResponse, sns.GetTopicAttributesError>
38 >
39 > {}
40
41 export const GetTopicAttributes = Binding.Service<GetTopicAttributes>("AWS.SNS.GetTopicAttributes");