| 1 | import type * as textract from "@distilled.cloud/aws/textract"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Adapter } from "./Adapter.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `textract:GetAdapter` — read the configuration |
| 8 | * (name, feature types, auto-update, tags) of the bound adapter at |
| 9 | * runtime. The grant is scoped to the adapter's ARN and the `AdapterId` |
| 10 | * is injected automatically. |
| 11 | * |
| 12 | * ### Managing Adapters |
| 13 | * **Example:** Read the Bound Adapter |
| 14 | * ```typescript |
| 15 | * // init |
| 16 | * const getAdapter = yield* AWS.Textract.GetAdapter(adapter); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const result = yield* getAdapter(); |
| 20 | * console.log(result.AdapterName, result.FeatureTypes); |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface GetAdapter extends Binding.Service< |
| 26 | GetAdapter, |
| 27 | "AWS.Textract.GetAdapter", |
| 28 | <A extends Adapter>( |
| 29 | adapter: A, |
| 30 | ) => Effect.Effect< |
| 31 | () => Effect.Effect<textract.GetAdapterResponse, textract.GetAdapterError> |
| 32 | > |
| 33 | > {} |
| 34 | export const GetAdapter = Binding.Service<GetAdapter>( |
| 35 | "AWS.Textract.GetAdapter", |
| 36 | ); |