diff --git a/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto index ababb2821e7..cd490a9902f 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto +++ b/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto @@ -262,6 +262,9 @@ message FileTypeFilter { // Returns only non-folder documents. DOCUMENT = 3; + + // Returns only root folders + ROOT_FOLDER = 4; } // The type of files to return. diff --git a/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto index 27b2d5e4ff6..db34b5c6d62 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto +++ b/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto @@ -29,6 +29,10 @@ option java_outer_classname = "PipelinesProto"; option java_package = "com.google.cloud.contentwarehouse.v1"; option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; option ruby_package = "Google::Cloud::ContentWarehouse::V1"; +option (google.api.resource_definition) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + pattern: "projects/{project}/locations/{location}/functions/{function}" +}; // Response message of RunPipeline method. message RunPipelineResponse {} @@ -146,6 +150,33 @@ message IngestPipelineConfig { // linked during ingestion process. Format is // `projects/{project}/locations/{location}/documents/{folder_id}` string folder = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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 + string cloud_function = 4 [(google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + }]; } // The configuration of the Cloud Storage Ingestion pipeline. diff --git a/packages/google-cloud-contentwarehouse/protos/protos.d.ts b/packages/google-cloud-contentwarehouse/protos/protos.d.ts index 19138897caa..2ab1c7db451 100644 --- a/packages/google-cloud-contentwarehouse/protos/protos.d.ts +++ b/packages/google-cloud-contentwarehouse/protos/protos.d.ts @@ -7850,7 +7850,8 @@ export namespace google { FILE_TYPE_UNSPECIFIED = 0, ALL = 1, FOLDER = 2, - DOCUMENT = 3 + DOCUMENT = 3, + ROOT_FOLDER = 4 } } @@ -11061,6 +11062,9 @@ export namespace google { /** IngestPipelineConfig folder */ folder?: (string|null); + + /** IngestPipelineConfig cloudFunction */ + cloudFunction?: (string|null); } /** Represents an IngestPipelineConfig. */ @@ -11081,6 +11085,9 @@ export namespace google { /** IngestPipelineConfig folder. */ public folder: string; + /** IngestPipelineConfig cloudFunction. */ + public cloudFunction: string; + /** * Creates a new IngestPipelineConfig instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-contentwarehouse/protos/protos.js b/packages/google-cloud-contentwarehouse/protos/protos.js index 69e530e4fcd..95f75f1327b 100644 --- a/packages/google-cloud-contentwarehouse/protos/protos.js +++ b/packages/google-cloud-contentwarehouse/protos/protos.js @@ -19086,6 +19086,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -19126,6 +19127,10 @@ case 3: message.fileType = 3; break; + case "ROOT_FOLDER": + case 4: + message.fileType = 4; + break; } return message; }; @@ -19184,6 +19189,7 @@ * @property {number} ALL=1 ALL value * @property {number} FOLDER=2 FOLDER value * @property {number} DOCUMENT=3 DOCUMENT value + * @property {number} ROOT_FOLDER=4 ROOT_FOLDER value */ FileTypeFilter.FileType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -19191,6 +19197,7 @@ values[valuesById[1] = "ALL"] = 1; values[valuesById[2] = "FOLDER"] = 2; values[valuesById[3] = "DOCUMENT"] = 3; + values[valuesById[4] = "ROOT_FOLDER"] = 4; return values; })(); @@ -27123,6 +27130,7 @@ * @property {google.iam.v1.IPolicy|null} [documentAclPolicy] IngestPipelineConfig documentAclPolicy * @property {boolean|null} [enableDocumentTextExtraction] IngestPipelineConfig enableDocumentTextExtraction * @property {string|null} [folder] IngestPipelineConfig folder + * @property {string|null} [cloudFunction] IngestPipelineConfig cloudFunction */ /** @@ -27164,6 +27172,14 @@ */ IngestPipelineConfig.prototype.folder = ""; + /** + * IngestPipelineConfig cloudFunction. + * @member {string} cloudFunction + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @instance + */ + IngestPipelineConfig.prototype.cloudFunction = ""; + /** * Creates a new IngestPipelineConfig instance using the specified properties. * @function create @@ -27194,6 +27210,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableDocumentTextExtraction); if (message.folder != null && Object.hasOwnProperty.call(message, "folder")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.folder); + if (message.cloudFunction != null && Object.hasOwnProperty.call(message, "cloudFunction")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudFunction); return writer; }; @@ -27240,6 +27258,10 @@ message.folder = reader.string(); break; } + case 4: { + message.cloudFunction = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27286,6 +27308,9 @@ if (message.folder != null && message.hasOwnProperty("folder")) if (!$util.isString(message.folder)) return "folder: string expected"; + if (message.cloudFunction != null && message.hasOwnProperty("cloudFunction")) + if (!$util.isString(message.cloudFunction)) + return "cloudFunction: string expected"; return null; }; @@ -27310,6 +27335,8 @@ message.enableDocumentTextExtraction = Boolean(object.enableDocumentTextExtraction); if (object.folder != null) message.folder = String(object.folder); + if (object.cloudFunction != null) + message.cloudFunction = String(object.cloudFunction); return message; }; @@ -27330,6 +27357,7 @@ object.documentAclPolicy = null; object.enableDocumentTextExtraction = false; object.folder = ""; + object.cloudFunction = ""; } if (message.documentAclPolicy != null && message.hasOwnProperty("documentAclPolicy")) object.documentAclPolicy = $root.google.iam.v1.Policy.toObject(message.documentAclPolicy, options); @@ -27337,6 +27365,8 @@ object.enableDocumentTextExtraction = message.enableDocumentTextExtraction; if (message.folder != null && message.hasOwnProperty("folder")) object.folder = message.folder; + if (message.cloudFunction != null && message.hasOwnProperty("cloudFunction")) + object.cloudFunction = message.cloudFunction; return object; }; diff --git a/packages/google-cloud-contentwarehouse/protos/protos.json b/packages/google-cloud-contentwarehouse/protos/protos.json index 59ccda1ea23..f8d59562fe3 100644 --- a/packages/google-cloud-contentwarehouse/protos/protos.json +++ b/packages/google-cloud-contentwarehouse/protos/protos.json @@ -15,8 +15,8 @@ "java_package": "com.google.cloud.contentwarehouse.v1", "php_namespace": "Google\\Cloud\\ContentWarehouse\\V1", "ruby_package": "Google::Cloud::ContentWarehouse::V1", - "(google.api.resource_definition).type": "contentwarehouse.googleapis.com/Location", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}" + "(google.api.resource_definition).type": "cloudfunctions.googleapis.com/CloudFunction", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/functions/{function}" }, "nested": { "CreateDocumentMetadata": { @@ -1886,7 +1886,8 @@ "FILE_TYPE_UNSPECIFIED": 0, "ALL": 1, "FOLDER": 2, - "DOCUMENT": 3 + "DOCUMENT": 3, + "ROOT_FOLDER": 4 } } } @@ -2478,6 +2479,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "cloudFunction": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "cloudfunctions.googleapis.com/CloudFunction" + } } } },