GCP.ContentWarehouse reference
Document
Section titled “Document”Source:
src/GCP/ContentWarehouse/Document.ts
A Document AI Warehouse document — structured content plus metadata
that conforms to a DocumentSchema.
Documents have no labels field, so Alchemy identifies a document by its
referenceId: one found under the generated id is adopted, one found
under an explicit referenceId without state is reported as unowned.
Location, schema, and
reference id are immutable. Display name, title, and plain text update
in place.
Document: Creating a Document
Section titled “Document: Creating a Document”const schema = yield* GCP.ContentWarehouse.DocumentSchema("Note", {});const document = yield* GCP.ContentWarehouse.Document("Welcome", { documentSchemaName: schema.name, displayName: "welcome", plainText: "hello warehouse",});DocumentSchema
Section titled “DocumentSchema”Source:
src/GCP/ContentWarehouse/DocumentSchema.ts
A Document AI Warehouse document schema describing document structure.
Schemas have no labels field — Alchemy stamps ownership into the
description so list / nuke can find them. Location is immutable.
Description and newly appended properties update in place; existing
property definitions cannot be rewritten.
The project must be initialized for Document AI Warehouse in us or
eu before schemas can be created.
DocumentSchema: Creating a Document Schema
Section titled “DocumentSchema: Creating a Document Schema”const schema = yield* GCP.ContentWarehouse.DocumentSchema("Invoice", { displayName: "invoice", propertyDefinitions: [ { name: "title", isSearchable: true, textTypeOptions: {} }, ],});GetDocument
Section titled “GetDocument”Source:
src/GCP/ContentWarehouse/GetDocument.ts
Runtime binding for Document AI Warehouse documents.get.
Bind this operation to a Document in a Function/Action init
phase. Provide GetDocumentHttp.
GetDocument: Reading Documents
Section titled “GetDocument: Reading Documents”const getDocument = yield* GCP.ContentWarehouse.GetDocument(document);const live = yield* getDocument();GetDocumentHttp
Section titled “GetDocumentHttp”Source:
src/GCP/ContentWarehouse/GetDocumentHttp.tsKind: Layer · Provides:GCP.ContentWarehouse.GetDocument
HTTP implementation of GetDocument.
GetDocumentSchema
Section titled “GetDocumentSchema”Source:
src/GCP/ContentWarehouse/GetDocumentSchema.ts
Runtime binding for Document AI Warehouse documentSchemas.get.
Bind this operation to a DocumentSchema in a Function/Action
init phase. Provide GetDocumentSchemaHttp.
GetDocumentSchema: Reading Schemas
Section titled “GetDocumentSchema: Reading Schemas”const getSchema = yield* GCP.ContentWarehouse.GetDocumentSchema(schema);const live = yield* getSchema();GetDocumentSchemaHttp
Section titled “GetDocumentSchemaHttp”Source:
src/GCP/ContentWarehouse/GetDocumentSchemaHttp.tsKind: Layer · Provides:GCP.ContentWarehouse.GetDocumentSchema
HTTP implementation of GetDocumentSchema.
GetRuleSet
Section titled “GetRuleSet”Source:
src/GCP/ContentWarehouse/GetRuleSet.ts
Runtime binding for Document AI Warehouse ruleSets.get.
Grants roles/contentwarehouse.admin on the project because
contentwarehouse.ruleSets.get is only in that role and Document AI
Warehouse has no per-resource IAM.
Bind this operation to a RuleSet in a Function/Action init
phase. Provide GetRuleSetHttp.
GetRuleSet: Reading Rule Sets
Section titled “GetRuleSet: Reading Rule Sets”const getRuleSet = yield* GCP.ContentWarehouse.GetRuleSet(rules);const live = yield* getRuleSet();GetRuleSetHttp
Section titled “GetRuleSetHttp”Source:
src/GCP/ContentWarehouse/GetRuleSetHttp.tsKind: Layer · Provides:GCP.ContentWarehouse.GetRuleSet
HTTP implementation of GetRuleSet.
Grants roles/contentwarehouse.admin on the project because
contentwarehouse.ruleSets.get is in no narrower predefined role.
GetSynonymSet
Section titled “GetSynonymSet”Source:
src/GCP/ContentWarehouse/GetSynonymSet.ts
Runtime binding for Document AI Warehouse synonymSets.get.
Grants roles/contentwarehouse.admin on the project because
contentwarehouse.synonymSets.get is only in that role and Document AI
Warehouse has no per-resource IAM.
Bind this operation to a SynonymSet in a Function/Action init
phase. Provide GetSynonymSetHttp.
GetSynonymSet: Reading Synonym Sets
Section titled “GetSynonymSet: Reading Synonym Sets”const getSynonyms = yield* GCP.ContentWarehouse.GetSynonymSet(synonyms);const live = yield* getSynonyms();GetSynonymSetHttp
Section titled “GetSynonymSetHttp”Source:
src/GCP/ContentWarehouse/GetSynonymSetHttp.tsKind: Layer · Provides:GCP.ContentWarehouse.GetSynonymSet
HTTP implementation of GetSynonymSet.
Grants roles/contentwarehouse.admin on the project because
contentwarehouse.synonymSets.get is in no narrower predefined role.
RuleSet
Section titled “RuleSet”Source:
src/GCP/ContentWarehouse/RuleSet.ts
A Document AI Warehouse rule set — trigger conditions and actions run when documents are created, updated, or linked.
Rule sets have no labels field — Alchemy stamps ownership into the
description so list / nuke can find them. Location is immutable.
Description, source, and rules update in place.
RuleSet: Creating a Rule Set
Section titled “RuleSet: Creating a Rule Set”const rules = yield* GCP.ContentWarehouse.RuleSet("Checks", { source: "alchemy", rules: [ { description: "require title", triggerType: "ON_CREATE", condition: "true", actions: [{ dataValidation: { conditions: { display_name: "true" } } }], }, ],});SynonymSet
Section titled “SynonymSet”Source:
src/GCP/ContentWarehouse/SynonymSet.ts
A Document AI Warehouse synonym set — custom search synonyms for a
query context (sales, engineering, …).
Synonym sets have no labels field; Alchemy identifies one by its
context. Without state, a set found under an explicit context is
reported as unowned. Context and location are immutable. Synonym groups update in place.
SynonymSet: Creating a Synonym Set
Section titled “SynonymSet: Creating a Synonym Set”const synonyms = yield* GCP.ContentWarehouse.SynonymSet("Sales", { context: "sales", synonyms: [{ words: ["sale", "invoice", "bill"] }],});