| 1 | import type * as glacier from "@distilled.cloud/aws/glacier"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Vault } from "./Vault.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `DescribeJob` request with `accountId` and `vaultName` injected from the bound |
| 8 | * {@link Vault}. |
| 9 | */ |
| 10 | export interface DescribeJobRequest extends Omit< |
| 11 | glacier.DescribeJobInput, |
| 12 | "accountId" | "vaultName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for the `DescribeJob` operation (IAM action |
| 17 | * `glacier:DescribeJob` on the vault ARN). |
| 18 | * |
| 19 | * Reads the status of a job previously started with {@link InitiateJob} on |
| 20 | * the bound {@link Vault} — its action, status code, and completion flag. |
| 21 | * Provide the implementation with |
| 22 | * `Effect.provide(AWS.Glacier.DescribeJobHttp)`. |
| 23 | * ### Retrieving Archives |
| 24 | * **Example:** Poll a retrieval job |
| 25 | * ```typescript |
| 26 | * const describeJob = yield* AWS.Glacier.DescribeJob(vault); |
| 27 | * |
| 28 | * const job = yield* describeJob({ jobId }); |
| 29 | * if (job.Completed) { |
| 30 | * // fetch with GetJobOutput |
| 31 | * } |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface DescribeJob extends Binding.Service< |
| 37 | DescribeJob, |
| 38 | "AWS.Glacier.DescribeJob", |
| 39 | ( |
| 40 | vault: Vault, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: DescribeJobRequest, |
| 44 | ) => Effect.Effect<glacier.GlacierJobDescription, glacier.DescribeJobError> |
| 45 | > |
| 46 | > {} |
| 47 | export const DescribeJob = Binding.Service<DescribeJob>( |
| 48 | "AWS.Glacier.DescribeJob", |
| 49 | ); |