| 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 GetDataProtectionPolicyRequest extends Omit< |
| 7 | sns.GetDataProtectionPolicyInput, |
| 8 | "ResourceArn" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `sns:GetDataProtectionPolicy`. |
| 13 | * |
| 14 | * Bind this operation to a {@link Topic} inside a function runtime to read |
| 15 | * the topic's data protection policy document; the `ResourceArn` is injected |
| 16 | * automatically. The binding grants the host function |
| 17 | * `sns:GetDataProtectionPolicy` on the topic. Provide the |
| 18 | * `GetDataProtectionPolicyHttp` layer on the Function to implement the |
| 19 | * binding. |
| 20 | * ### Data Protection Policies |
| 21 | * **Example:** Read the Data Protection Policy |
| 22 | * ```typescript |
| 23 | * // init (provide SNS.GetDataProtectionPolicyHttp on the Function) |
| 24 | * const getDataProtectionPolicy = yield* SNS.GetDataProtectionPolicy(topic); |
| 25 | * |
| 26 | * // runtime |
| 27 | * const response = yield* getDataProtectionPolicy(); |
| 28 | * // response.DataProtectionPolicy (JSON document string) |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface GetDataProtectionPolicy extends Binding.Service< |
| 34 | GetDataProtectionPolicy, |
| 35 | "AWS.SNS.GetDataProtectionPolicy", |
| 36 | ( |
| 37 | topic: Topic, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request?: GetDataProtectionPolicyRequest, |
| 41 | ) => Effect.Effect< |
| 42 | sns.GetDataProtectionPolicyResponse, |
| 43 | sns.GetDataProtectionPolicyError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | export const GetDataProtectionPolicy = Binding.Service<GetDataProtectionPolicy>( |
| 48 | "AWS.SNS.GetDataProtectionPolicy", |
| 49 | ); |