| 1 | import type * as documentai from "@distilled.cloud/gcp/documentai_v1"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { RuntimeContext } from "../../RuntimeContext.ts"; |
| 5 | import type { Schema } from "./Schema.ts"; |
| 6 | |
| 7 | export interface GetSchemaRequest extends Omit< |
| 8 | documentai.GetProjectsLocationsSchemasRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Document AI `schemas.get`. |
| 14 | * |
| 15 | * Bind this operation to a {@link Schema} in a Function/Action init |
| 16 | * phase. Provide {@link GetSchemaHttp}. |
| 17 | * |
| 18 | * ### Reading a Schema |
| 19 | * **Example:** Read the bound schema |
| 20 | * ```typescript |
| 21 | * const getSchema = yield* GCP.DocumentAI.GetSchema(schema); |
| 22 | * const live = yield* getSchema(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | * @category DocumentAI |
| 27 | */ |
| 28 | export interface GetSchema extends Binding.Service< |
| 29 | GetSchema, |
| 30 | "GCP.DocumentAI.GetSchema", |
| 31 | ( |
| 32 | schema: Schema, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: GetSchemaRequest, |
| 36 | ) => Effect.Effect< |
| 37 | documentai.GoogleCloudDocumentaiV1NextSchema, |
| 38 | documentai.GetProjectsLocationsSchemasError, |
| 39 | RuntimeContext |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | |
| 44 | export const GetSchema = Binding.Service<GetSchema>("GCP.DocumentAI.GetSchema"); |