sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ DynamoDB/ DeleteBackup.ts

import type * as DynamoDB from "@distilled.cloud/aws/dynamodb";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { Table } from "./Table.ts";

export interface DeleteBackupRequest extends DynamoDB.DeleteBackupInput {}

/**
 * Runtime binding for `dynamodb:DeleteBackup`.
 *
 * Bind this operation to a `Table` inside a function runtime to get a callable
 * that deletes one of the bound table's on-demand backups by ARN. The IAM
 * grant covers every backup of the bound table (`{tableArn}/backup/*`).
 * Provide the `DeleteBackupHttp` layer on the Function to satisfy the binding.
 * ### Backup and Restore
 * **Example:** Delete an Expired Backup
 * ```typescript
 * const deleteBackup = yield* AWS.DynamoDB.DeleteBackup(table);
 *
 * const response = yield* deleteBackup({ BackupArn: backupArn });
 * const status = response.BackupDescription?.BackupDetails?.BackupStatus;
 * ```
 *
 * @binding
 */
export interface DeleteBackup extends Binding.Service<
  DeleteBackup,
  "AWS.DynamoDB.DeleteBackup",
  <T extends Table>(
    table: T,
  ) => Effect.Effect<
    (
      request: DeleteBackupRequest,
    ) => Effect.Effect<DynamoDB.DeleteBackupOutput, DynamoDB.DeleteBackupError>
  >
> {}
export const DeleteBackup = Binding.Service<DeleteBackup>("AWS.DynamoDB.DeleteBackup");