Skip to content

GCP.ContentWarehouse reference

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.

const schema = yield* GCP.ContentWarehouse.DocumentSchema("Note", {});
const document = yield* GCP.ContentWarehouse.Document("Welcome", {
documentSchemaName: schema.name,
displayName: "welcome",
plainText: "hello warehouse",
});

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: {} },
],
});

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.

const getDocument = yield* GCP.ContentWarehouse.GetDocument(document);
const live = yield* getDocument();

Source: src/GCP/ContentWarehouse/GetDocumentHttp.ts Kind: Layer · Provides: GCP.ContentWarehouse.GetDocument

HTTP implementation of GetDocument.

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.

const getSchema = yield* GCP.ContentWarehouse.GetDocumentSchema(schema);
const live = yield* getSchema();

Source: src/GCP/ContentWarehouse/GetDocumentSchemaHttp.ts Kind: Layer · Provides: GCP.ContentWarehouse.GetDocumentSchema

HTTP implementation of GetDocumentSchema.

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.

const getRuleSet = yield* GCP.ContentWarehouse.GetRuleSet(rules);
const live = yield* getRuleSet();

Source: src/GCP/ContentWarehouse/GetRuleSetHttp.ts Kind: 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.

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.

const getSynonyms = yield* GCP.ContentWarehouse.GetSynonymSet(synonyms);
const live = yield* getSynonyms();

Source: src/GCP/ContentWarehouse/GetSynonymSetHttp.ts Kind: 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.

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.

const rules = yield* GCP.ContentWarehouse.RuleSet("Checks", {
source: "alchemy",
rules: [
{
description: "require title",
triggerType: "ON_CREATE",
condition: "true",
actions: [{ dataValidation: { conditions: { display_name: "true" } } }],
},
],
});

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.

const synonyms = yield* GCP.ContentWarehouse.SynonymSet("Sales", {
context: "sales",
synonyms: [{ words: ["sale", "invoice", "bill"] }],
});