| 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 { RuleSet } from "./RuleSet.ts"; |
| 6 | |
| 7 | export interface GetRuleSetRequest extends Omit< |
| 8 | cw.GetProjectsLocationsRuleSetsRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Document AI Warehouse `ruleSets.get`. |
| 14 | * |
| 15 | * Grants `roles/contentwarehouse.admin` on the project because |
| 16 | * `contentwarehouse.ruleSets.get` is only in that role and Document AI |
| 17 | * Warehouse has no per-resource IAM. |
| 18 | * |
| 19 | * Bind this operation to a {@link RuleSet} in a Function/Action init |
| 20 | * phase. Provide {@link GetRuleSetHttp}. |
| 21 | * |
| 22 | * ### Reading Rule Sets |
| 23 | * **Example:** Read the bound rule set |
| 24 | * ```typescript |
| 25 | * const getRuleSet = yield* GCP.ContentWarehouse.GetRuleSet(rules); |
| 26 | * const live = yield* getRuleSet(); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | * @category ContentWarehouse |
| 31 | */ |
| 32 | export interface GetRuleSet extends Binding.Service< |
| 33 | GetRuleSet, |
| 34 | "GCP.ContentWarehouse.GetRuleSet", |
| 35 | ( |
| 36 | ruleSet: RuleSet, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request?: GetRuleSetRequest, |
| 40 | ) => Effect.Effect< |
| 41 | cw.GoogleCloudContentwarehouseV1RuleSet, |
| 42 | cw.GetProjectsLocationsRuleSetsError, |
| 43 | RuntimeContext |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | |
| 48 | export const GetRuleSet = Binding.Service<GetRuleSet>( |
| 49 | "GCP.ContentWarehouse.GetRuleSet", |
| 50 | ); |