| 1 | import type * as serverless from "@distilled.cloud/aws/redshift-serverless"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for the `GetSnapshot` operation (IAM actions |
| 7 | * `redshift-serverless:GetSnapshot`). |
| 8 | * |
| 9 | * Reads one snapshot by name or ARN — e.g. polling a snapshot taken with |
| 10 | * {@link CreateSnapshot} until its `status` reaches `AVAILABLE`. Provide the implementation with |
| 11 | * `Effect.provide(AWS.RedshiftServerless.GetSnapshotHttp)`. |
| 12 | * ### Managing Snapshots |
| 13 | * **Example:** Poll a Snapshot Until Available |
| 14 | * ```typescript |
| 15 | * // init — resolve the runtime client |
| 16 | * const getSnapshot = yield* AWS.RedshiftServerless.GetSnapshot(); |
| 17 | * |
| 18 | * const { snapshot } = yield* getSnapshot({ snapshotName: "pre-migration-1" }); |
| 19 | * // snapshot?.status -> "CREATING" | "AVAILABLE" | ... |
| 20 | * ``` |
| 21 | * |
| 22 | * @binding |
| 23 | */ |
| 24 | export interface GetSnapshot extends Binding.Service< |
| 25 | GetSnapshot, |
| 26 | "AWS.RedshiftServerless.GetSnapshot", |
| 27 | () => Effect.Effect< |
| 28 | ( |
| 29 | request: serverless.GetSnapshotRequest, |
| 30 | ) => Effect.Effect< |
| 31 | serverless.GetSnapshotResponse, |
| 32 | serverless.GetSnapshotError |
| 33 | > |
| 34 | > |
| 35 | > {} |
| 36 | export const GetSnapshot = Binding.Service<GetSnapshot>( |
| 37 | "AWS.RedshiftServerless.GetSnapshot", |
| 38 | ); |