sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ Signer/ DescribeSigningJob.ts

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

/**
 * Runtime binding for `signer:DescribeSigningJob`.
 *
 * Reads a signing job by the `jobId` returned from `StartSigningJob` /
 * `SignPayload` — its status (`InProgress`, `Succeeded`, `Failed`), the
 * signed object's S3 location, and the signature expiry. Account-level
 * operation — job ids are chosen per request at runtime, so the binding takes
 * no resource argument. Provide the implementation with
 * `Effect.provide(AWS.Signer.DescribeSigningJobHttp)`.
 * ### Observing Signing Jobs
 * **Example:** Wait for a Job to Finish
 * ```typescript
 * // init — account-level binding, no resource argument
 * const describeSigningJob = yield* AWS.Signer.DescribeSigningJob();
 *
 * // runtime
 * const job = yield* describeSigningJob({ jobId });
 * const signedKey = job.signedObject?.s3?.key;
 * ```
 *
 * @binding
 */
export interface DescribeSigningJob extends Binding.Service<
  DescribeSigningJob,
  "AWS.Signer.DescribeSigningJob",
  () => Effect.Effect<
    (
      request: signer.DescribeSigningJobRequest,
    ) => Effect.Effect<signer.DescribeSigningJobResponse, signer.DescribeSigningJobError>
  >
> {}
export const DescribeSigningJob = Binding.Service<DescribeSigningJob>(
  "AWS.Signer.DescribeSigningJob",
);