1import * as sns from "@distilled.cloud/aws/sns";
2import * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Topic } from "./Topic.ts";
5
6export interface PutDataProtectionPolicyRequest extends Omit<
7 sns.PutDataProtectionPolicyInput,
8 "ResourceArn"
9> {}
10
11/**
12 * Runtime binding for `sns:PutDataProtectionPolicy`.
13 *
14 * Bind this operation to a {@link Topic} inside a function runtime to attach
15 * or replace the topic's data protection policy; the `ResourceArn` is
16 * injected automatically. The binding grants the host function
17 * `sns:PutDataProtectionPolicy` on the topic. Provide the
18 * `PutDataProtectionPolicyHttp` layer on the Function to implement the
19 * binding.
20 * ### Data Protection Policies
21 * **Example:** Attach a Data Protection Policy
22 * ```typescript
23 * // init (provide SNS.PutDataProtectionPolicyHttp on the Function)
24 * const putDataProtectionPolicy = yield* SNS.PutDataProtectionPolicy(topic);
25 *
26 * // runtime
27 * yield* putDataProtectionPolicy({
28 * DataProtectionPolicy: JSON.stringify({
29 * Name: "basic-pii-audit",
30 * Version: "2021-06-01",
31 * Statement: [],
32 * }),
33 * });
34 * ```
35 *
36 * @binding
37 */
38export interface PutDataProtectionPolicy extends Binding.Service<
39 PutDataProtectionPolicy,
40 "AWS.SNS.PutDataProtectionPolicy",
41 (
42 topic: Topic,
43 ) => Effect.Effect<
44 (
45 request: PutDataProtectionPolicyRequest,
46 ) => Effect.Effect<
47 sns.PutDataProtectionPolicyResponse,
48 sns.PutDataProtectionPolicyError
49 >
50 >
51> {}
52export const PutDataProtectionPolicy = Binding.Service<PutDataProtectionPolicy>(
53 "AWS.SNS.PutDataProtectionPolicy",
54);