sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ FSx/ RestoreVolumeFromSnapshot.ts

import type * as fsx from "@distilled.cloud/aws/fsx";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";

/**
 * Runtime binding for the `RestoreVolumeFromSnapshot` operation (IAM action
 * `fsx:RestoreVolumeFromSnapshot` on `*`).
 *
 * Rolls an FSx for OpenZFS volume back to the state saved by a snapshot —
 * the undo half of the runtime snapshot pattern built with
 * {@link CreateSnapshot}. Pass `Options: ["DELETE_INTERMEDIATE_SNAPSHOTS"]`
 * to roll back past newer snapshots. Provide the implementation with
 * `Effect.provide(AWS.FSx.RestoreVolumeFromSnapshotHttp)`.
 * ### Managing Snapshots at Runtime
 * **Example:** Roll back a failed batch of writes
 * ```typescript
 * const restoreVolumeFromSnapshot =
 *   yield* AWS.FSx.RestoreVolumeFromSnapshot();
 *
 * const response = yield* restoreVolumeFromSnapshot({
 *   VolumeId: volumeId,
 *   SnapshotId: snapshot.SnapshotId!,
 * });
 * yield* Effect.log(`volume ${response.VolumeId} restoring`);
 * ```
 *
 * @binding
 */
export interface RestoreVolumeFromSnapshot extends Binding.Service<
  RestoreVolumeFromSnapshot,
  "AWS.FSx.RestoreVolumeFromSnapshot",
  () => Effect.Effect<
    (
      request: fsx.RestoreVolumeFromSnapshotRequest,
    ) => Effect.Effect<fsx.RestoreVolumeFromSnapshotResponse, fsx.RestoreVolumeFromSnapshotError>
  >
> {}
export const RestoreVolumeFromSnapshot = Binding.Service<RestoreVolumeFromSnapshot>(
  "AWS.FSx.RestoreVolumeFromSnapshot",
);