sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ Textract/ StartExpenseAnalysis.ts

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

/**
 * Runtime binding for `textract:StartExpenseAnalysis` — start an
 * asynchronous invoice/receipt analysis job for a document stored in S3.
 * Poll the returned `JobId` with `GetExpenseAnalysis`. The caller needs
 * `s3:GetObject` on the input bucket.
 *
 * ### Asynchronous Expense Analysis
 * **Example:** Start an Expense Analysis Job
 * ```typescript
 * // init
 * const startExpenseAnalysis = yield* AWS.Textract.StartExpenseAnalysis();
 *
 * // runtime
 * const { JobId } = yield* startExpenseAnalysis({
 *   DocumentLocation: { S3Object: { Bucket: bucketName, Name: "invoice.pdf" } },
 * });
 * ```
 *
 * @binding
 */
export interface StartExpenseAnalysis extends Binding.Service<
  StartExpenseAnalysis,
  "AWS.Textract.StartExpenseAnalysis",
  () => Effect.Effect<
    (
      request: textract.StartExpenseAnalysisRequest,
    ) => Effect.Effect<textract.StartExpenseAnalysisResponse, textract.StartExpenseAnalysisError>
  >
> {}
export const StartExpenseAnalysis = Binding.Service<StartExpenseAnalysis>(
  "AWS.Textract.StartExpenseAnalysis",
);