| 1 | import type * as cw from "@distilled.cloud/gcp/contentwarehouse_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 { Document } from "./Document.ts"; |
| 6 | |
| 7 | export interface GetDocumentRequest extends Omit< |
| 8 | cw.GetProjectsLocationsDocumentsRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Document AI Warehouse `documents.get`. |
| 14 | * |
| 15 | * Bind this operation to a {@link Document} in a Function/Action init |
| 16 | * phase. Provide {@link GetDocumentHttp}. |
| 17 | * |
| 18 | * ### Reading Documents |
| 19 | * **Example:** Read the bound document |
| 20 | * ```typescript |
| 21 | * const getDocument = yield* GCP.ContentWarehouse.GetDocument(document); |
| 22 | * const live = yield* getDocument(); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | * @category ContentWarehouse |
| 27 | */ |
| 28 | export interface GetDocument extends Binding.Service< |
| 29 | GetDocument, |
| 30 | "GCP.ContentWarehouse.GetDocument", |
| 31 | ( |
| 32 | document: Document, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: GetDocumentRequest, |
| 36 | ) => Effect.Effect< |
| 37 | cw.GoogleCloudContentwarehouseV1Document, |
| 38 | cw.GetProjectsLocationsDocumentsError, |
| 39 | RuntimeContext |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | |
| 44 | export const GetDocument = Binding.Service<GetDocument>( |
| 45 | "GCP.ContentWarehouse.GetDocument", |
| 46 | ); |