| 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 RemovePermissionRequest extends Omit< |
| 7 | sns.RemovePermissionInput, |
| 8 | "TopicArn" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `sns:RemovePermission`. |
| 13 | * |
| 14 | * Bind this operation to a {@link Topic} inside a function runtime to remove |
| 15 | * a policy statement previously added with {@link AddPermission} by its |
| 16 | * label. The binding grants the host function `sns:RemovePermission` on the |
| 17 | * topic. Provide the `RemovePermissionHttp` layer on the Function to |
| 18 | * implement the binding. |
| 19 | * ### Managing Topic Permissions |
| 20 | * **Example:** Remove a Permission by Label |
| 21 | * ```typescript |
| 22 | * // init (provide SNS.RemovePermissionHttp on the Function) |
| 23 | * const removePermission = yield* SNS.RemovePermission(topic); |
| 24 | * |
| 25 | * // runtime |
| 26 | * yield* removePermission({ Label: "PartnerPublish" }); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface RemovePermission extends Binding.Service< |
| 32 | RemovePermission, |
| 33 | "AWS.SNS.RemovePermission", |
| 34 | ( |
| 35 | topic: Topic, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: RemovePermissionRequest, |
| 39 | ) => Effect.Effect<sns.RemovePermissionResponse, sns.RemovePermissionError> |
| 40 | > |
| 41 | > {} |
| 42 | |
| 43 | export const RemovePermission = Binding.Service<RemovePermission>( |
| 44 | "AWS.SNS.RemovePermission", |
| 45 | ); |