@googleapis/contentwarehouse
Version:
1,138 lines (1,128 loc) • 386 kB
text/typescript
// Copyright 2020 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-interface */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-irregular-whitespace */
import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
BaseExternalAccountClient,
GaxiosResponseWithHTTP2,
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
GoogleAuth,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';
export namespace contentwarehouse_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?:
| string
| OAuth2Client
| JWT
| Compute
| UserRefreshClient
| BaseExternalAccountClient
| GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Document AI Warehouse API
*
*
*
* @example
* ```js
* const {google} = require('googleapis');
* const contentwarehouse = google.contentwarehouse('v1');
* ```
*/
export class Contentwarehouse {
context: APIRequestContext;
projects: Resource$Projects;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.projects = new Resource$Projects(this.context);
}
}
/**
* The identity to configure a CloudSQL instance provisioned via SLM Terraform.
*/
export interface Schema$CloudAiPlatformTenantresourceCloudSqlInstanceConfig {
/**
* Output only. The CloudSQL instance connection name.
*/
cloudSqlInstanceConnectionName?: string | null;
/**
* Input/Output [Optional]. The CloudSQL instance name within SLM instance. If not set, a random UUIC will be generated as instance name.
*/
cloudSqlInstanceName?: string | null;
/**
* Input [Optional]. The KMS key name or the KMS grant name used for CMEK encryption. Only set this field when provisioning new CloudSQL instances. For existing CloudSQL instances, this field will be ignored because CMEK re-encryption is not supported.
*/
kmsKeyReference?: string | null;
/**
* Input [Optional]. MDB roles for corp access to CloudSQL instance.
*/
mdbRolesForCorpAccess?: string[] | null;
/**
* Output only. The SLM instance's full resource name.
*/
slmInstanceName?: string | null;
/**
* Input [Required]. The SLM instance template to provision CloudSQL.
*/
slmInstanceTemplate?: string | null;
/**
* Input [Required]. The SLM instance type to provision CloudSQL.
*/
slmInstanceType?: string | null;
}
/**
* The identity to configure a GCS bucket.
*/
export interface Schema$CloudAiPlatformTenantresourceGcsBucketConfig {
admins?: string[] | null;
/**
* Input/Output [Optional]. The name of a GCS bucket with max length of 63 chars. If not set, a random UUID will be generated as bucket name.
*/
bucketName?: string | null;
/**
* Input/Output [Optional]. Only needed for per-entity tenant GCP resources. During Deprovision API, the on-demand deletion will only cover the tenant GCP resources with the specified entity name.
*/
entityName?: string | null;
/**
* Input/Output [Optional]. The KMS key name or the KMS grant name used for CMEK encryption. Only set this field when provisioning new GCS bucket. For existing GCS bucket, this field will be ignored because CMEK re-encryption is not supported.
*/
kmsKeyReference?: string | null;
/**
* Input/Output [Optional]. Only needed when the content in bucket need to be garbage collected within some amount of days.
*/
ttlDays?: number | null;
/**
* Input/Output [Required]. IAM roles (viewer/admin) put on the bucket.
*/
viewers?: string[] | null;
}
/**
* The dynamic IAM bindings to be granted after tenant projects are created.
*/
export interface Schema$CloudAiPlatformTenantresourceIamPolicyBinding {
/**
* Input/Output [Required]. The member service accounts with the roles above. Note: placeholders are same as the resource above.
*/
members?: string[] | null;
/**
* Input/Output [Required]. The resource name that will be accessed by members, which also depends on resource_type. Note: placeholders are supported in resource names. For example, ${tpn\} will be used when the tenant project number is not ready.
*/
resource?: string | null;
/**
* Input/Output [Required]. Specifies the type of resource that will be accessed by members.
*/
resourceType?: string | null;
/**
* Input/Output [Required]. The role for members below.
*/
role?: string | null;
}
/**
* The configuration for a spanner database provisioning. Next ID: 8
*/
export interface Schema$CloudAiPlatformTenantresourceInfraSpannerConfig {
/**
* Input [Optional]. The options to create a spanner database. Note: give the right options to ensure the right KMS key access audit logging and AxT logging in expected logging category.
*/
createDatabaseOptions?: Schema$CloudAiPlatformTenantresourceInfraSpannerConfigCreateDatabaseOptions;
/**
* Input [Optional]. The KMS key name or the KMS grant name used for CMEK encryption. Only set this field when provisioning new Infra Spanner databases. For existing Infra Spanner databases, this field will be ignored because CMEK re-encryption is not supported. For example, projects//locations//keyRings//cryptoKeys/
*/
kmsKeyReference?: string | null;
/**
* Input [Required]. The file path to the spanner SDL bundle.
*/
sdlBundlePath?: string | null;
/**
* Input [Optional]. The spanner borg service account for delegating the kms key to. For example, spanner-infra-cmek-nonprod@system.gserviceaccount.com, for the nonprod universe.
*/
spannerBorgServiceAccount?: string | null;
spannerLocalNamePrefix?: string | null;
spannerNamespace?: string | null;
/**
* Input [Required]. Every database in Spanner can be identified by the following path name: /span//:
*/
spannerUniverse?: string | null;
}
/**
* The options to create a spanner database. KMS key access audit logging and AxT logging will be associated with the given resource name, resource type and service name. Please ensure to give right options to enable correct audit logging and AxT logging.
*/
export interface Schema$CloudAiPlatformTenantresourceInfraSpannerConfigCreateDatabaseOptions {
/**
* The cloud resource name for the CMEK encryption. For example, projects//locations/
*/
cmekCloudResourceName?: string | null;
/**
* The cloud resource type for the CMEK encryption. For example, contentwarehouse.googleapis.com/Location
*/
cmekCloudResourceType?: string | null;
/**
* The service name for the CMEK encryption. For example, contentwarehouse.googleapis.com
*/
cmekServiceName?: string | null;
}
/**
* The identity to configure a service account.
*/
export interface Schema$CloudAiPlatformTenantresourceServiceAccountIdentity {
/**
* Output only. The service account email that has been created.
*/
serviceAccountEmail?: string | null;
/**
* Input/Output [Optional]. The tag that configures the service account, as defined in google3/configs/production/cdpush/acl-zanzibar-cloud-prod/activation_grants/activation_grants.gcl. Note: The default P4 service account has the empty tag.
*/
tag?: string | null;
}
/**
* The identity to configure a tenant project.
*/
export interface Schema$CloudAiPlatformTenantresourceTenantProjectConfig {
/**
* Input/Output [Required]. The billing account properties to create the tenant project.
*/
billingConfig?: Schema$GoogleApiServiceconsumermanagementV1BillingConfig;
/**
* Input/Output [Required]. The folder that holds tenant projects and folder-level permissions will be automatically granted to all tenant projects under the folder. Note: the valid folder format is `folders/{folder_number\}`.
*/
folder?: string | null;
/**
* Input/Output [Required]. The policy bindings that are applied to the tenant project during creation. At least one binding must have the role `roles/owner` with either `user` or `group` type.
*/
policyBindings?: Schema$GoogleApiServiceconsumermanagementV1PolicyBinding[];
/**
* Input/Output [Required]. The API services that are enabled on the tenant project during creation.
*/
services?: string[] | null;
}
/**
* The tenant project and tenant resources. Next ID: 10
*/
export interface Schema$CloudAiPlatformTenantresourceTenantProjectResource {
/**
* The CloudSQL instances that are provisioned under the tenant project.
*/
cloudSqlInstances?: Schema$CloudAiPlatformTenantresourceCloudSqlInstanceConfig[];
/**
* The GCS buckets that are provisioned under the tenant project.
*/
gcsBuckets?: Schema$CloudAiPlatformTenantresourceGcsBucketConfig[];
/**
* The dynamic IAM bindings that are granted under the tenant project. Note: this should only add new bindings to the project if they don't exist and the existing bindings won't be affected.
*/
iamPolicyBindings?: Schema$CloudAiPlatformTenantresourceIamPolicyBinding[];
/**
* The Infra Spanner databases that are provisioned under the tenant project. Note: this is an experimental feature.
*/
infraSpannerConfigs?: Schema$CloudAiPlatformTenantresourceInfraSpannerConfig[];
/**
* Input/Output [Required]. The tag that uniquely identifies a tenant project within a tenancy unit. Note: for the same tenant project tag, all tenant manager operations should be idempotent.
*/
tag?: string | null;
/**
* The configurations of a tenant project.
*/
tenantProjectConfig?: Schema$CloudAiPlatformTenantresourceTenantProjectConfig;
/**
* Output only. The tenant project ID that has been created.
*/
tenantProjectId?: string | null;
/**
* Output only. The tenant project number that has been created.
*/
tenantProjectNumber?: string | null;
/**
* The service account identities (or enabled API service's P4SA) that are expclicitly created under the tenant project (before JIT provisioning during enabled API services).
*/
tenantServiceAccounts?: Schema$CloudAiPlatformTenantresourceTenantServiceAccountIdentity[];
}
/**
* A collection of tenant resources.
*/
export interface Schema$CloudAiPlatformTenantresourceTenantResource {
/**
* A list of P4 service accounts (go/p4sa) to provision or deprovision.
*/
p4ServiceAccounts?: Schema$CloudAiPlatformTenantresourceServiceAccountIdentity[];
/**
* A list of tenant projects and tenant resources to provision or deprovision.
*/
tenantProjectResources?: Schema$CloudAiPlatformTenantresourceTenantProjectResource[];
}
/**
* The identity of service accounts that have been explicitly created under tenant projects.
*/
export interface Schema$CloudAiPlatformTenantresourceTenantServiceAccountIdentity {
/**
* Output only. The email address of the generated service account.
*/
serviceAccountEmail?: string | null;
/**
* Input/Output [Required]. The service that the service account belongs to. (e.g. cloudbuild.googleapis.com for GCB service accounts)
*/
serviceName?: string | null;
}
/**
* Describes the billing configuration for a new tenant project.
*/
export interface Schema$GoogleApiServiceconsumermanagementV1BillingConfig {
/**
* Name of the billing account. For example `billingAccounts/012345-567890-ABCDEF`.
*/
billingAccount?: string | null;
}
/**
* Translates to IAM Policy bindings (without auditing at this level)
*/
export interface Schema$GoogleApiServiceconsumermanagementV1PolicyBinding {
/**
* Uses the same format as in IAM policy. `member` must include both a prefix and ID. For example, `user:{emailId\}`, `serviceAccount:{emailId\}`, `group:{emailId\}`.
*/
members?: string[] | null;
/**
* Role. (https://cloud.google.com/iam/docs/understanding-roles) For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
*/
role?: string | null;
}
/**
* Represents the action responsible for access control list management operations.
*/
export interface Schema$GoogleCloudContentwarehouseV1AccessControlAction {
/**
* Identifies the type of operation.
*/
operationType?: string | null;
/**
* Represents the new policy from which bindings are added, removed or replaced based on the type of the operation. the policy is limited to a few 10s of KB.
*/
policy?: Schema$GoogleIamV1Policy;
}
/**
* Represents the action triggered by Rule Engine when the rule is true.
*/
export interface Schema$GoogleCloudContentwarehouseV1Action {
/**
* Action triggering access control operations.
*/
accessControl?: Schema$GoogleCloudContentwarehouseV1AccessControlAction;
/**
* ID of the action. Managed internally.
*/
actionId?: string | null;
/**
* Action triggering create document link operation.
*/
addToFolder?: Schema$GoogleCloudContentwarehouseV1AddToFolderAction;
/**
* Action triggering data update operations.
*/
dataUpdate?: Schema$GoogleCloudContentwarehouseV1DataUpdateAction;
/**
* Action triggering data validation operations.
*/
dataValidation?: Schema$GoogleCloudContentwarehouseV1DataValidationAction;
/**
* Action deleting the document.
*/
deleteDocumentAction?: Schema$GoogleCloudContentwarehouseV1DeleteDocumentAction;
/**
* Action publish to Pub/Sub operation.
*/
publishToPubSub?: Schema$GoogleCloudContentwarehouseV1PublishAction;
/**
* Action removing a document from a folder.
*/
removeFromFolderAction?: Schema$GoogleCloudContentwarehouseV1RemoveFromFolderAction;
}
/**
* Represents the output of the Action Executor.
*/
export interface Schema$GoogleCloudContentwarehouseV1ActionExecutorOutput {
/**
* List of rule and corresponding actions result.
*/
ruleActionsPairs?: Schema$GoogleCloudContentwarehouseV1RuleActionsPair[];
}
/**
* Represents the result of executing an action.
*/
export interface Schema$GoogleCloudContentwarehouseV1ActionOutput {
/**
* ID of the action.
*/
actionId?: string | null;
/**
* State of an action.
*/
actionState?: string | null;
/**
* Action execution output message.
*/
outputMessage?: string | null;
}
/**
* Represents the action responsible for adding document under a folder.
*/
export interface Schema$GoogleCloudContentwarehouseV1AddToFolderAction {
/**
* Names of the folder under which new document is to be added. Format: projects/{project_number\}/locations/{location\}/documents/{document_id\}.
*/
folders?: string[] | null;
}
/**
* Metadata object for CreateDocument request (currently empty).
*/
export interface Schema$GoogleCloudContentwarehouseV1beta1CreateDocumentMetadata {}
/**
* Response message for projectService.InitializeProject
*/
export interface Schema$GoogleCloudContentwarehouseV1beta1InitializeProjectResponse {
/**
* The message of the project initialization process.
*/
message?: string | null;
/**
* The state of the project initialization process.
*/
state?: string | null;
}
/**
* Metadata object for UpdateDocument request (currently empty).
*/
export interface Schema$GoogleCloudContentwarehouseV1beta1UpdateDocumentMetadata {}
/**
* Request Option for processing Cloud AI Document in CW Document.
*/
export interface Schema$GoogleCloudContentwarehouseV1CloudAIDocumentOption {
/**
* If set, only selected entities will be converted to properties.
*/
customizedEntitiesPropertiesConversions?: {[key: string]: string} | null;
/**
* Whether to convert all the entities to properties.
*/
enableEntitiesConversions?: boolean | null;
}
/**
* Request message for DocumentLinkService.CreateDocumentLink.
*/
export interface Schema$GoogleCloudContentwarehouseV1CreateDocumentLinkRequest {
/**
* Required. Document links associated with the source documents (source_document_id).
*/
documentLink?: Schema$GoogleCloudContentwarehouseV1DocumentLink;
/**
* The meta information collected about the document creator, used to enforce access control for the service.
*/
requestMetadata?: Schema$GoogleCloudContentwarehouseV1RequestMetadata;
}
/**
* Metadata object for CreateDocument request (currently empty).
*/
export interface Schema$GoogleCloudContentwarehouseV1CreateDocumentMetadata {}
/**
* Request message for DocumentService.CreateDocument.
*/
export interface Schema$GoogleCloudContentwarehouseV1CreateDocumentRequest {
/**
* Request Option for processing Cloud AI Document in Document Warehouse. This field offers limited support for mapping entities from Cloud AI Document to Warehouse Document. Please consult with product team before using this field and other available options.
*/
cloudAiDocumentOption?: Schema$GoogleCloudContentwarehouseV1CloudAIDocumentOption;
/**
* Field mask for creating Document fields. If mask path is empty, it means all fields are masked. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask.
*/
createMask?: string | null;
/**
* Required. The document to create.
*/
document?: Schema$GoogleCloudContentwarehouseV1Document;
/**
* Default document policy during creation. This refers to an Identity and Access (IAM) policy, which specifies access controls for the Document. Conditions defined in the policy will be ignored.
*/
policy?: Schema$GoogleIamV1Policy;
/**
* The meta information collected about the end user, used to enforce access control for the service.
*/
requestMetadata?: Schema$GoogleCloudContentwarehouseV1RequestMetadata;
}
/**
* Response message for DocumentService.CreateDocument.
*/
export interface Schema$GoogleCloudContentwarehouseV1CreateDocumentResponse {
/**
* Document created after executing create request.
*/
document?: Schema$GoogleCloudContentwarehouseV1Document;
/**
* post-processing LROs
*/
longRunningOperations?: Schema$GoogleLongrunningOperation[];
/**
* Additional information for the API invocation, such as the request tracking id.
*/
metadata?: Schema$GoogleCloudContentwarehouseV1ResponseMetadata;
/**
* Output from Rule Engine recording the rule evaluator and action executor's output. Refer format in: google/cloud/contentwarehouse/v1/rule_engine.proto
*/
ruleEngineOutput?: Schema$GoogleCloudContentwarehouseV1RuleEngineOutput;
}
/**
* To support the custom weighting across document schemas.
*/
export interface Schema$GoogleCloudContentwarehouseV1CustomWeightsMetadata {
/**
* List of schema and property name. Allows a maximum of 10 schemas to be specified for relevance boosting.
*/
weightedSchemaProperties?: Schema$GoogleCloudContentwarehouseV1WeightedSchemaProperty[];
}
/**
* Represents the action responsible for properties update operations.
*/
export interface Schema$GoogleCloudContentwarehouseV1DataUpdateAction {
/**
* Map of (K, V) -\> (valid name of the field, new value of the field) E.g., ("age", "60") entry triggers update of field age with a value of 60. If the field is not present then new entry is added. During update action execution, value strings will be casted to appropriate types.
*/
entries?: {[key: string]: string} | null;
}
/**
* Represents the action responsible for data validation operations.
*/
export interface Schema$GoogleCloudContentwarehouseV1DataValidationAction {
/**
* Map of (K, V) -\> (field, string condition to be evaluated on the field) E.g., ("age", "age \> 18 && age < 60") entry triggers validation of field age with the given condition. Map entries will be ANDed during validation.
*/
conditions?: {[key: string]: string} | null;
}
/**
* DateTime values.
*/
export interface Schema$GoogleCloudContentwarehouseV1DateTimeArray {
/**
* List of datetime values. Both OffsetDateTime and ZonedDateTime are supported.
*/
values?: Schema$GoogleTypeDateTime[];
}
/**
* Configurations for a date time property.
*/
export interface Schema$GoogleCloudContentwarehouseV1DateTimeTypeOptions {}
/**
* Represents the action responsible for deleting the document.
*/
export interface Schema$GoogleCloudContentwarehouseV1DeleteDocumentAction {
/**
* Boolean field to select between hard vs soft delete options. Set 'true' for 'hard delete' and 'false' for 'soft delete'.
*/
enableHardDelete?: boolean | null;
}
/**
* Request message for DocumentLinkService.DeleteDocumentLink.
*/
export interface Schema$GoogleCloudContentwarehouseV1DeleteDocumentLinkRequest {
/**
* The meta information collected about the document creator, used to enforce access control for the service.
*/
requestMetadata?: Schema$GoogleCloudContentwarehouseV1RequestMetadata;
}
/**
* Request message for DocumentService.DeleteDocument.
*/
export interface Schema$GoogleCloudContentwarehouseV1DeleteDocumentRequest {
/**
* The meta information collected about the end user, used to enforce access control for the service.
*/
requestMetadata?: Schema$GoogleCloudContentwarehouseV1RequestMetadata;
}
/**
* Defines the structure for content warehouse document proto.
*/
export interface Schema$GoogleCloudContentwarehouseV1Document {
/**
* Document AI format to save the structured content, including OCR.
*/
cloudAiDocument?: Schema$GoogleCloudDocumentaiV1Document;
/**
* Indicates the category (image, audio, video etc.) of the original content.
*/
contentCategory?: string | null;
/**
* Output only. The time when the document is created.
*/
createTime?: string | null;
/**
* The user who creates the document.
*/
creator?: string | null;
/**
* Required. Display name of the document given by the user. This name will be displayed in the UI. Customer can populate this field with the name of the document. This differs from the 'title' field as 'title' is optional and stores the top heading in the document.
*/
displayName?: string | null;
/**
* Uri to display the document, for example, in the UI.
*/
displayUri?: string | null;
/**
* Output only. If linked to a Collection with RetentionPolicy, the date when the document becomes mutable.
*/
dispositionTime?: string | null;
/**
* The Document schema name. Format: projects/{project_number\}/locations/{location\}/documentSchemas/{document_schema_id\}.
*/
documentSchemaName?: string | null;
/**
* Raw document content.
*/
inlineRawDocument?: string | null;
/**
* Output only. Indicates if the document has a legal hold on it.
*/
legalHold?: boolean | null;
/**
* The resource name of the document. Format: projects/{project_number\}/locations/{location\}/documents/{document_id\}. The name is ignored when creating a document.
*/
name?: string | null;
/**
* Other document format, such as PPTX, XLXS
*/
plainText?: string | null;
/**
* List of values that are user supplied metadata.
*/
properties?: Schema$GoogleCloudContentwarehouseV1Property[];
/**
* This is used when DocAI was not used to load the document and parsing/ extracting is needed for the inline_raw_document. For example, if inline_raw_document is the byte representation of a PDF file, then this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
*/
rawDocumentFileType?: string | null;
/**
* Raw document file in Cloud Storage path.
*/
rawDocumentPath?: string | null;
/**
* The reference ID set by customers. Must be unique per project and location.
*/
referenceId?: string | null;
/**
* If true, text extraction will not be performed.
*/
textExtractionDisabled?: boolean | null;
/**
* If true, text extraction will be performed.
*/
textExtractionEnabled?: boolean | null;
/**
* Title that describes the document. This can be the top heading or text that describes the document.
*/
title?: string | null;
/**
* The user who lastly updates the document.
*/
updater?: string | null;
/**
* Output only. The time when the document is last updated.
*/
updateTime?: string | null;
}
/**
* A document-link between source and target document.
*/
export interface Schema$GoogleCloudContentwarehouseV1DocumentLink {
/**
* Output only. The time when the documentLink is created.
*/
createTime?: string | null;
/**
* Description of this document-link.
*/
description?: string | null;
/**
* Name of this document-link. It is required that the parent derived form the name to be consistent with the source document reference. Otherwise an exception will be thrown. Format: projects/{project_number\}/locations/{location\}/documents/{source_document_id\}/documentLinks/{document_link_id\}.
*/
name?: string | null;
/**
* Document references of the source document.
*/
sourceDocumentReference?: Schema$GoogleCloudContentwarehouseV1DocumentReference;
/**
* The state of the documentlink. If target node has been deleted, the link is marked as invalid. Removing a source node will result in removal of all associated links.
*/
state?: string | null;
/**
* Document references of the target document.
*/
targetDocumentReference?: Schema$GoogleCloudContentwarehouseV1DocumentReference;
/**
* Output only. The time when the documentLink is last updated.
*/
updateTime?: string | null;
}
export interface Schema$GoogleCloudContentwarehouseV1DocumentQuery {
/**
* This filter specifies a structured syntax to match against the [PropertyDefinition].is_filterable marked as `true`. The syntax for this expression is a subset of SQL syntax. Supported operators are: `=`, `!=`, `<`, `<=`, `\>`, and `\>=` where the left of the operator is a property name and the right of the operator is a number or a quoted string. You must escape backslash (\\) and quote (\") characters. Supported functions are `LOWER([property_name])` to perform a case insensitive match and `EMPTY([property_name])` to filter on the existence of a key. Boolean expressions (AND/OR/NOT) are supported up to 3 levels of nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 comparisons or functions are allowed in the expression. The expression must be < 6000 bytes in length. Sample Query: `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND driving_years \> 10`
*/
customPropertyFilter?: string | null;
/**
* To support the custom weighting across document schemas, customers need to provide the properties to be used to boost the ranking in the search request. For a search query with CustomWeightsMetadata specified, only the RetrievalImportance for the properties in the CustomWeightsMetadata will be honored.
*/
customWeightsMetadata?: Schema$GoogleCloudContentwarehouseV1CustomWeightsMetadata;
/**
* The exact creator(s) of the documents to search against. If a value isn't specified, documents within the search results are associated with any creator. If multiple values are specified, documents within the search results may be associated with any of the specified creators.
*/
documentCreatorFilter?: string[] | null;
/**
* Search the documents in the list. Format: projects/{project_number\}/locations/{location\}/documents/{document_id\}.
*/
documentNameFilter?: string[] | null;
/**
* This filter specifies the exact document schema Document.document_schema_name of the documents to search against. If a value isn't specified, documents within the search results are associated with any schema. If multiple values are specified, documents within the search results may be associated with any of the specified schemas. At most 20 document schema names are allowed.
*/
documentSchemaNames?: string[] | null;
/**
* This filter specifies the types of files to return: ALL, FOLDER, or FILE. If FOLDER or FILE is specified, then only either folders or files will be returned, respectively. If ALL is specified, both folders and files will be returned. If no value is specified, ALL files will be returned.
*/
fileTypeFilter?: Schema$GoogleCloudContentwarehouseV1FileTypeFilter;
/**
* Search all the documents under this specified folder. Format: projects/{project_number\}/locations/{location\}/documents/{document_id\}.
*/
folderNameFilter?: string | null;
/**
* Experimental, do not use. If the query is a natural language question. False by default. If true, then the question-answering feature will be used instead of search, and `result_count` in SearchDocumentsRequest must be set. In addition, all other input fields related to search (pagination, histograms, etc.) will be ignored.
*/
isNlQuery?: boolean | null;
/**
* This filter specifies a structured syntax to match against the PropertyDefinition.is_filterable marked as `true`. The relationship between the PropertyFilters is OR.
*/
propertyFilter?: Schema$GoogleCloudContentwarehouseV1PropertyFilter[];
/**
* The query string that matches against the full text of the document and the searchable properties. The query partially supports [Google AIP style syntax](https://google.aip.dev/160). Specifically, the query supports literals, logical operators, negation operators, comparison operators, and functions. Literals: A bare literal value (examples: "42", "Hugo") is a value to be matched against. It searches over the full text of the document and the searchable properties. Logical operators: "AND", "and", "OR", and "or" are binary logical operators (example: "engineer OR developer"). Negation operators: "NOT" and "!" are negation operators (example: "NOT software"). Comparison operators: support the binary comparison operators =, !=, <, \>, <= and \>= for string, numeric, enum, boolean. Also support like operator `~~` for string. It provides semantic search functionality by parsing, stemming and doing synonyms expansion against the input query. To specify a property in the query, the left hand side expression in the comparison must be the property ID including the parent. The right hand side must be literals. For example: "\"projects/123/locations/us\".property_a < 1" matches results whose "property_a" is less than 1 in project 123 and us location. The literals and comparison expression can be connected in a single query (example: "software engineer \"projects/123/locations/us\".salary \> 100"). Functions: supported functions are `LOWER([property_name])` to perform a case insensitive match and `EMPTY([property_name])` to filter on the existence of a key. Support nested expressions connected using parenthesis and logical operators. The default logical operators is `AND` if there is no operators between expressions. The query can be used with other filters e.g. `time_filters` and `folder_name_filter`. They are connected with `AND` operator under the hood. The maximum number of allowed characters is 255.
*/
query?: string | null;
/**
* For custom synonyms. Customers provide the synonyms based on context. One customer can provide multiple set of synonyms based on different context. The search query will be expanded based on the custom synonyms of the query context set. By default, no custom synonyms wll be applied if no query context is provided. It is not supported for CMEK compliant deployment.
*/
queryContext?: string[] | null;
/**
* Documents created/updated within a range specified by this filter are searched against.
*/
timeFilters?: Schema$GoogleCloudContentwarehouseV1TimeFilter[];
}
/**
* References to the documents.
*/
export interface Schema$GoogleCloudContentwarehouseV1DocumentReference {
/**
* Output only. The time when the document is created.
*/
createTime?: string | null;
/**
* Output only. The time when the document is deleted.
*/
deleteTime?: string | null;
/**
* display_name of the referenced document; this name does not need to be consistent to the display_name in the Document proto, depending on the ACL constraint.
*/
displayName?: string | null;
/**
* The document type of the document being referenced.
*/
documentIsFolder?: boolean | null;
/**
* Document is a folder with legal hold.
*/
documentIsLegalHoldFolder?: boolean | null;
/**
* Document is a folder with retention policy.
*/
documentIsRetentionFolder?: boolean | null;
/**
* Required. Name of the referenced document.
*/
documentName?: string | null;
/**
* Stores the subset of the referenced document's content. This is useful to allow user peek the information of the referenced document.
*/
snippet?: string | null;
/**
* Output only. The time when the document is last updated.
*/
updateTime?: string | null;
}
/**
* A document schema used to define document structure.
*/
export interface Schema$GoogleCloudContentwarehouseV1DocumentSchema {
/**
* Output only. The time when the document schema is created.
*/
createTime?: string | null;
/**
* Schema description.
*/
description?: string | null;
/**
* Required. Name of the schema given by the user. Must be unique per project.
*/
displayName?: string | null;
/**
* Document Type, true refers the document is a folder, otherwise it is a typical document.
*/
documentIsFolder?: boolean | null;
/**
* The resource name of the document schema. Format: projects/{project_number\}/locations/{location\}/documentSchemas/{document_schema_id\}. The name is ignored when creating a document schema.
*/
name?: string | null;
/**
* Document details.
*/
propertyDefinitions?: Schema$GoogleCloudContentwarehouseV1PropertyDefinition[];
/**
* Output only. The time when the document schema is last updated.
*/
updateTime?: string | null;
}
/**
* Enum values.
*/
export interface Schema$GoogleCloudContentwarehouseV1EnumArray {
/**
* List of enum values.
*/
values?: string[] | null;
}
/**
* Configurations for an enum/categorical property.
*/
export interface Schema$GoogleCloudContentwarehouseV1EnumTypeOptions {
/**
* Required. List of possible enum values.
*/
possibleValues?: string[] | null;
/**
* Make sure the Enum property value provided in the document is in the possile value list during document creation. The validation check runs by default.
*/
validationCheckDisabled?: boolean | null;
}
/**
* Represents the string value of the enum field.
*/
export interface Schema$GoogleCloudContentwarehouseV1EnumValue {
/**
* String value of the enum field. This must match defined set of enums in document schema using EnumTypeOptions.
*/
value?: string | null;
}
/**
* The configuration of exporting documents from the Document Warehouse to CDW pipeline.
*/
export interface Schema$GoogleCloudContentwarehouseV1ExportToCdwPipeline {
/**
* Optional. The CDW dataset resource name. This field is optional. If not set, the documents will be exported to Cloud Storage only. Format: projects/{project\}/locations/{location\}/processors/{processor\}/dataset
*/
docAiDataset?: string | null;
/**
* The list of all the resource names of the documents to be processed. Format: projects/{project_number\}/locations/{location\}/documents/{document_id\}.
*/
documents?: string[] | null;
/**
* The Cloud Storage folder path used to store the exported documents before being sent to CDW. Format: `gs:///`.
*/
exportFolderPath?: string | null;
/**
* Ratio of training dataset split. When importing into Document AI Workbench, documents will be automatically split into training and test split category with the specified ratio. This field is required if doc_ai_dataset is set.
*/
trainingSplitRatio?: number | null;
}
/**
* Request message for DocumentService.FetchAcl
*/
export interface Schema$GoogleCloudContentwarehouseV1FetchAclRequest {
/**
* For Get Project ACL only. Authorization check for end user will be ignored when project_owner=true.
*/
projectOwner?: boolean | null;
/**
* The meta information collected about the end user, used to enforce access control for the service.
*/
requestMetadata?: Schema$GoogleCloudContentwarehouseV1RequestMetadata;
}
/**
* Response message for DocumentService.FetchAcl.
*/
export interface Schema$GoogleCloudContentwarehouseV1FetchAclResponse {
/**
* Additional information for the API invocation, such as the request tracking id.
*/
metadata?: Schema$GoogleCloudContentwarehouseV1ResponseMetadata;
/**
* The IAM policy.
*/
policy?: Schema$GoogleIamV1Policy;
}
/**
* Filter for the specific types of documents returned.
*/
export interface Schema$GoogleCloudContentwarehouseV1FileTypeFilter {
/**
* The type of files to return.
*/
fileType?: string | null;
}
/**
* Float values.
*/
export interface Schema$GoogleCloudContentwarehouseV1FloatArray {
/**
* List of float values.
*/
values?: number[] | null;
}
/**
* Configurations for a float property.
*/
export interface Schema$GoogleCloudContentwarehouseV1FloatTypeOptions {}
/**
* The configuration of the Cloud Storage Ingestion pipeline.
*/
export interface Schema$GoogleCloudContentwarehouseV1GcsIngestPipeline {
/**
* The input Cloud Storage folder. All files under this folder will be imported to Document Warehouse. Format: `gs:///`.
*/
inputPath?: string | null;
/**
* Optional. The config for the Cloud Storage Ingestion pipeline. It provides additional customization options to run the pipeline and can be skipped if it is not applicable.
*/
pipelineConfig?: Schema$GoogleCloudContentwarehouseV1IngestPipelineConfig;
/**
* The Doc AI processor type name. Only used when the format of ingested files is Doc AI Document proto format.
*/
processorType?: string | null;
/**
* The Document Warehouse schema resource name. All documents processed by this pipeline will use this schema. Format: projects/{project_number\}/locations/{location\}/documentSchemas/{document_schema_id\}.
*/
schemaName?: string | null;
/**
* The flag whether to skip ingested documents. If it is set to true, documents in Cloud Storage contains key "status" with value "status=ingested" in custom metadata will be skipped to ingest.
*/
skipIngestedDocuments?: boolean | null;
}
/**
* The configuration of the Cloud Storage Ingestion with DocAI Processors pipeline.
*/
export interface Schema$GoogleCloudContentwarehouseV1GcsIngestWithDocAiProcessorsPipeline {
/**
* The extract processors information. One matched extract processor will be used to process documents based on the classify processor result. If no classify processor is specified, the first extract processor will be used.
*/
extractProcessorInfos?: Schema$GoogleCloudContentwarehouseV1ProcessorInfo[];
/**
* The input Cloud Storage folder. All files under this folder will be imported to Document Warehouse. Format: `gs:///`.
*/
inputPath?: string | null;
/**
* Optional. The config for the Cloud Storage Ingestion with DocAI Processors pipeline. It provides additional customization options to run the pipeline and can be skipped if it is not applicable.
*/
pipelineConfig?: Schema$GoogleCloudContentwarehouseV1IngestPipelineConfig;
/**
* The Cloud Storage folder path used to store the raw results from processors. Format: `gs:///`.
*/
processorResultsFolderPath?: string | null;
/**
* The flag whether to skip ingested documents. If it is set to true, documents in Cloud Storage contains key "status" with value "status=ingested" in custom metadata will be skipped to ingest.
*/
skipIngestedDocuments?: boolean | null;
/**
* The split and classify processor information. The split and classify result will be used to find a matched extract processor.
*/
splitClassifyProcessorInfo?: Schema$GoogleCloudContentwarehouseV1ProcessorInfo;
}
/**
* Request message for DocumentService.GetDocument.
*/
export interface Schema$GoogleCloudContentwarehouseV1GetDocumentRequest {
/**
* The meta information collected about the end user, used to enforce access control for the service.
*/
requestMetadata?: Schema$GoogleCloudContentwarehouseV1RequestMetadata;
}
/**
* The histogram request.
*/
export interface Schema$GoogleCloudContentwarehouseV1HistogramQuery {
/**
* Optional. Filter the result of histogram query by the property names. It only works with histogram query count('FilterableProperties'). It is an optional. It will perform histogram on all the property names for all the document schemas. Setting this field will have a better performance.
*/
filters?: Schema$GoogleCloudContentwarehouseV1HistogramQueryPropertyNameFilter;
/**
* An expression specifies a histogram request against matching documents for searches. See SearchDocumentsRequest.histogram_queries for details about syntax.
*/
histogramQuery?: string | null;
/**
* Controls if the histogram query requires the return of a precise count. Enable this flag may adversely impact performance. Defaults to true.
*/
requirePreciseResultSize?: boolean | null;
}
export interface Schema$GoogleCloudContentwarehouseV1HistogramQueryPropertyNameFilter {
/**
* This filter specifies the exact document schema(s) Document.document_schema_name to run histogram query against. It is optional. It will perform histogram for property names for all the document schemas if it is not set. At most 10 document schema names are allowed. Format: projects/{project_number\}/locations/{location\}/documentSchemas/{document_schema_id\}.
*/
documentSchemas?: string[] | null;
/**
* It is optional. It will perform histogram for all the property names if it is not set. The properties need to be defined with the is_filterable flag set to true and the name of the property should be in the format: "schemaId.propertyName". The property needs to be defined in the schema. Example: the schema id is abc. Then the name of property for property MORTGAGE_TYPE will be "abc.MORTGAGE_TYPE".
*/
propertyNames?: string[] | null;
/**
* By default, the y_axis is HISTOGRAM_YAXIS_DOCUMENT if this field is not set.
*/
yAxis?: string | null;
}
/**
* Histogram result that matches HistogramQuery specified in searches.
*/
export interface Schema$GoogleCloudContentwarehouseV1HistogramQueryResult {
/**
* A map from the values of the facet associated with distinct values to the number of matching entries with corresponding value. The key format is: * (for string histogram) string values stored in the field.
*/
histogram?: {[key: string]: string} | null;
/**
* Requested histogram expression.
*/
histogramQuery?: string | null;
}
/**
* The ingestion pipeline config.
*/
export interface Schema$GoogleCloudContentwarehouseV1IngestPipelineConfig {
/**
* The Cloud Function resource name. The Cloud Function needs to live inside consumer project and is accessible to Document AI Warehouse P4SA. Only Cloud Functions V2 is supported. Cloud function execution should complete within 5 minutes or this file ingestion may fail due to timeout. Format: `https://{region\}-{project_id\}.cloudfunctions.net/{cloud_function\}` The following keys are available the request json payload. * display_name * properties * plain_text * reference_id * document_schema_name * raw_document_path * raw_document_file_type The following keys from the cloud function json response payload will be ingested to the Document AI Warehouse as part of Document proto content and/or related information. The original values will be overridden if any key is present in the response. * display_name * properties * plain_text * document_acl_policy * folder
*/
cloudFunction?: string | null;
/**
* The document level acl policy config. This refers to an Identity and Access (IAM) policy, which specifies access controls for all documents ingested by the pipeline. The role and members under the policy needs to be specified. The following roles are supported for document level acl control: * roles/contentwarehouse.documentAdmin * roles/contentwarehouse.documentEditor * roles/contentwarehouse.documentViewer The following members are supported for document level acl control: * user:user-email@example.com * group:group-email@example.com Note that for documents searched with LLM, only single level user or group acl check is supported.
*/
documentAclPolicy?: Schema$GoogleIamV1Policy;
/**
* The document text extraction enabled flag. If the flag is set to true, DWH will perform text extraction on the raw document.
*/
enableDocumentTextExtraction?: boolean | null;
/**
* Optional. The name of the folder to which all ingested documents will be linked during ingestion process. Format is `projects/{project\}/locations/{location\}/documents/{folder_id\}`
*/
folder?: string | null;
}
/**
* Request message for projectService.InitializeProject
*/
export interface Schema$GoogleCloudContentwarehouseV1InitializeProjectRequest {
/**
* Required. The access control mode for accessing the customer data
*/
accessControlMode?: string | null;
/**
* Required. The type of database used to store customer data
*/
databaseType?: string | null;
/**
* Optional. The default role for the person who create a document.
*/
documentCreatorDefaultRole?: string | null;
/**
* Optional. Whether to enable CAL user email logging.
*/
enableCalUserEmailLogging?: boolean | null;
/**
* Optional. The KMS key used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key is left empty, no encryption will be enforced.
*/
kmsKey?: string | null;
}
/**
* Response message for projectService.InitializeProject
*/
export interface Schema$GoogleCloudContentwarehouseV1InitializeProjectResponse {
/**
* The message of the project initialization process.
*/
message?: string | null;
/**
* The state of the project initialization process.
*/
state?: string | null;
}
/**
* Integer values.
*/