| 1 | import * as sns from "@distilled.cloud/aws/sns"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Topic } from "./Topic.ts"; |
| 5 | |
| 6 | export interface SetTopicAttributesRequest extends Omit< |
| 7 | sns.SetTopicAttributesInput, |
| 8 | "TopicArn" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `sns:SetTopicAttributes`. |
| 13 | * |
| 14 | * Bind this operation to a {@link Topic} inside a function runtime to set a |
| 15 | * single topic attribute by name. The binding grants the host function |
| 16 | * `sns:SetTopicAttributes` on the topic. Provide the |
| 17 | * `SetTopicAttributesHttp` layer on the Function to implement the binding. |
| 18 | * ### Updating Topic Attributes |
| 19 | * **Example:** Set a Topic's Display Name |
| 20 | * ```typescript |
| 21 | * // init (provide SNS.SetTopicAttributesHttp on the Function) |
| 22 | * const setTopicAttributes = yield* SNS.SetTopicAttributes(topic); |
| 23 | * |
| 24 | * // runtime |
| 25 | * yield* setTopicAttributes({ |
| 26 | * AttributeName: "DisplayName", |
| 27 | * AttributeValue: "order-events", |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface SetTopicAttributes extends Binding.Service< |
| 34 | SetTopicAttributes, |
| 35 | "AWS.SNS.SetTopicAttributes", |
| 36 | ( |
| 37 | topic: Topic, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: SetTopicAttributesRequest, |
| 41 | ) => Effect.Effect< |
| 42 | sns.SetTopicAttributesResponse, |
| 43 | sns.SetTopicAttributesError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | |
| 48 | export const SetTopicAttributes = Binding.Service<SetTopicAttributes>( |
| 49 | "AWS.SNS.SetTopicAttributes", |
| 50 | ); |