From effcc26ef80ba3d7fd982d1d3860c147a9046f15 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 14:06:03 -0700 Subject: [PATCH] feat: [documentai] added field Processor.processor_version_aliases (#4689) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: added field Processor.processor_version_aliases feat: added field RawDocument.display_name fix: deprecated OcrConfig.compute_style_info Use PremiumFeatures.compute_style_info instead of OcrConfig.compute_style_info. PiperOrigin-RevId: 567356898 Source-Link: https://github.com/googleapis/googleapis/commit/a32df258919b1437d1e97cba45c8f527b0e4a9d3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f3288e62ed56a2c979a635667bdf91c71131dc93 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6ImYzMjg4ZTYyZWQ1NmEyYzk3OWE2MzU2NjdiZGY5MWM3MTEzMWRjOTMifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../cloud/documentai/v1/document_io.proto | 10 +- .../v1/document_processor_service.proto | 4 +- .../cloud/documentai/v1/processor.proto | 15 + .../protos/protos.d.ts | 115 +++++++ .../google-cloud-documentai/protos/protos.js | 295 ++++++++++++++++++ .../protos/protos.json | 32 +- 6 files changed, 467 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto index 6c2be111734..46620652687 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto @@ -34,6 +34,13 @@ message RawDocument { // An IANA MIME type (RFC6838) indicating the nature and format of the // [content][google.cloud.documentai.v1.RawDocument.content]. string mime_type = 2; + + // The display name of the document, it supports all Unicode characters except + // the following: + // `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,` + // `~`, `=` and `:` are reserved. + // If not specified, a default ID will be generated. + string display_name = 3; } // Specifies a document stored on Cloud Storage. @@ -140,5 +147,6 @@ message OcrConfig { bool enable_symbol = 6; // Turn on font id model and returns font style information. - bool compute_style_info = 8; + // Use PremiumFeatures.compute_style_info instead. + bool compute_style_info = 8 [deprecated = true]; } diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto index 03c3d4090ba..9837de7f43e 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto @@ -914,8 +914,8 @@ message TrainProcessorVersionRequest { // Options to control the training of the Custom Document Extraction (CDE) // Processor. message CustomDocumentExtractionOptions { - // Training Method for CDE. TRAINING_METHOD_UNSPECIFIED will fallback to - // MODEL_BASED. + // Training Method for CDE. `TRAINING_METHOD_UNSPECIFIED` will fall back to + // `MODEL_BASED`. enum TrainingMethod { TRAINING_METHOD_UNSPECIFIED = 0; diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto index 9d3746e7e74..483e79da6a3 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto @@ -115,6 +115,17 @@ message ProcessorVersion { DeprecationInfo deprecation_info = 13; } +// Contains the alias and the aliased resource name of processor version. +message ProcessorVersionAlias { + // The alias in the form of `processor_version` resource name. + string alias = 1; + + // The resource name of aliased processor version. + string processor_version = 2 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; +} + // The first-class citizen for Document AI. Each processor defines how to // extract structural information from a document. message Processor { @@ -181,6 +192,10 @@ message Processor { type: "documentai.googleapis.com/ProcessorVersion" }]; + // Output only. The processor version aliases. + repeated ProcessorVersionAlias processor_version_aliases = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Immutable. The http endpoint that can be called to invoke // processing. string process_endpoint = 6 [ diff --git a/packages/google-cloud-documentai/protos/protos.d.ts b/packages/google-cloud-documentai/protos/protos.d.ts index f4f70c61632..9c24fb76b38 100644 --- a/packages/google-cloud-documentai/protos/protos.d.ts +++ b/packages/google-cloud-documentai/protos/protos.d.ts @@ -4925,6 +4925,9 @@ export namespace google { /** RawDocument mimeType */ mimeType?: (string|null); + + /** RawDocument displayName */ + displayName?: (string|null); } /** Represents a RawDocument. */ @@ -4942,6 +4945,9 @@ export namespace google { /** RawDocument mimeType. */ public mimeType: string; + /** RawDocument displayName. */ + public displayName: string; + /** * Creates a new RawDocument instance using the specified properties. * @param [properties] Properties to set @@ -13794,6 +13800,109 @@ export namespace google { } } + /** Properties of a ProcessorVersionAlias. */ + interface IProcessorVersionAlias { + + /** ProcessorVersionAlias alias */ + alias?: (string|null); + + /** ProcessorVersionAlias processorVersion */ + processorVersion?: (string|null); + } + + /** Represents a ProcessorVersionAlias. */ + class ProcessorVersionAlias implements IProcessorVersionAlias { + + /** + * Constructs a new ProcessorVersionAlias. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IProcessorVersionAlias); + + /** ProcessorVersionAlias alias. */ + public alias: string; + + /** ProcessorVersionAlias processorVersion. */ + public processorVersion: string; + + /** + * Creates a new ProcessorVersionAlias instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessorVersionAlias instance + */ + public static create(properties?: google.cloud.documentai.v1.IProcessorVersionAlias): google.cloud.documentai.v1.ProcessorVersionAlias; + + /** + * Encodes the specified ProcessorVersionAlias message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. + * @param message ProcessorVersionAlias message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IProcessorVersionAlias, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessorVersionAlias message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. + * @param message ProcessorVersionAlias message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IProcessorVersionAlias, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessorVersionAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.documentai.v1.ProcessorVersionAlias; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessorVersionAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.documentai.v1.ProcessorVersionAlias; + + /** + * Verifies a ProcessorVersionAlias message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessorVersionAlias message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessorVersionAlias + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersionAlias; + + /** + * Creates a plain object from a ProcessorVersionAlias message. Also converts values to other types if specified. + * @param message ProcessorVersionAlias + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessorVersionAlias, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessorVersionAlias to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessorVersionAlias + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Processor. */ interface IProcessor { @@ -13812,6 +13921,9 @@ export namespace google { /** Processor defaultProcessorVersion */ defaultProcessorVersion?: (string|null); + /** Processor processorVersionAliases */ + processorVersionAliases?: (google.cloud.documentai.v1.IProcessorVersionAlias[]|null); + /** Processor processEndpoint */ processEndpoint?: (string|null); @@ -13846,6 +13958,9 @@ export namespace google { /** Processor defaultProcessorVersion. */ public defaultProcessorVersion: string; + /** Processor processorVersionAliases. */ + public processorVersionAliases: google.cloud.documentai.v1.IProcessorVersionAlias[]; + /** Processor processEndpoint. */ public processEndpoint: string; diff --git a/packages/google-cloud-documentai/protos/protos.js b/packages/google-cloud-documentai/protos/protos.js index 359ea2e035c..5f37fea0657 100644 --- a/packages/google-cloud-documentai/protos/protos.js +++ b/packages/google-cloud-documentai/protos/protos.js @@ -13142,6 +13142,7 @@ * @interface IRawDocument * @property {Uint8Array|null} [content] RawDocument content * @property {string|null} [mimeType] RawDocument mimeType + * @property {string|null} [displayName] RawDocument displayName */ /** @@ -13175,6 +13176,14 @@ */ RawDocument.prototype.mimeType = ""; + /** + * RawDocument displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1.RawDocument + * @instance + */ + RawDocument.prototype.displayName = ""; + /** * Creates a new RawDocument instance using the specified properties. * @function create @@ -13203,6 +13212,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content); if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); return writer; }; @@ -13245,6 +13256,10 @@ message.mimeType = reader.string(); break; } + case 3: { + message.displayName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -13286,6 +13301,9 @@ if (message.mimeType != null && message.hasOwnProperty("mimeType")) if (!$util.isString(message.mimeType)) return "mimeType: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; return null; }; @@ -13308,6 +13326,8 @@ message.content = object.content; if (object.mimeType != null) message.mimeType = String(object.mimeType); + if (object.displayName != null) + message.displayName = String(object.displayName); return message; }; @@ -13333,11 +13353,14 @@ object.content = $util.newBuffer(object.content); } object.mimeType = ""; + object.displayName = ""; } if (message.content != null && message.hasOwnProperty("content")) object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; if (message.mimeType != null && message.hasOwnProperty("mimeType")) object.mimeType = message.mimeType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; return object; }; @@ -33632,6 +33655,233 @@ return ProcessorVersion; })(); + v1.ProcessorVersionAlias = (function() { + + /** + * Properties of a ProcessorVersionAlias. + * @memberof google.cloud.documentai.v1 + * @interface IProcessorVersionAlias + * @property {string|null} [alias] ProcessorVersionAlias alias + * @property {string|null} [processorVersion] ProcessorVersionAlias processorVersion + */ + + /** + * Constructs a new ProcessorVersionAlias. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ProcessorVersionAlias. + * @implements IProcessorVersionAlias + * @constructor + * @param {google.cloud.documentai.v1.IProcessorVersionAlias=} [properties] Properties to set + */ + function ProcessorVersionAlias(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessorVersionAlias alias. + * @member {string} alias + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @instance + */ + ProcessorVersionAlias.prototype.alias = ""; + + /** + * ProcessorVersionAlias processorVersion. + * @member {string} processorVersion + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @instance + */ + ProcessorVersionAlias.prototype.processorVersion = ""; + + /** + * Creates a new ProcessorVersionAlias instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1.IProcessorVersionAlias=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessorVersionAlias} ProcessorVersionAlias instance + */ + ProcessorVersionAlias.create = function create(properties) { + return new ProcessorVersionAlias(properties); + }; + + /** + * Encodes the specified ProcessorVersionAlias message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1.IProcessorVersionAlias} message ProcessorVersionAlias message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorVersionAlias.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.alias); + if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.processorVersion); + return writer; + }; + + /** + * Encodes the specified ProcessorVersionAlias message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1.IProcessorVersionAlias} message ProcessorVersionAlias message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorVersionAlias.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1.ProcessorVersionAlias} ProcessorVersionAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorVersionAlias.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1.ProcessorVersionAlias(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.alias = reader.string(); + break; + } + case 2: { + message.processorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessorVersionAlias} ProcessorVersionAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorVersionAlias.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessorVersionAlias message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessorVersionAlias.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alias != null && message.hasOwnProperty("alias")) + if (!$util.isString(message.alias)) + return "alias: string expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + if (!$util.isString(message.processorVersion)) + return "processorVersion: string expected"; + return null; + }; + + /** + * Creates a ProcessorVersionAlias message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessorVersionAlias} ProcessorVersionAlias + */ + ProcessorVersionAlias.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersionAlias) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessorVersionAlias(); + if (object.alias != null) + message.alias = String(object.alias); + if (object.processorVersion != null) + message.processorVersion = String(object.processorVersion); + return message; + }; + + /** + * Creates a plain object from a ProcessorVersionAlias message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1.ProcessorVersionAlias} message ProcessorVersionAlias + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessorVersionAlias.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.alias = ""; + object.processorVersion = ""; + } + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = message.alias; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = message.processorVersion; + return object; + }; + + /** + * Converts this ProcessorVersionAlias to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @instance + * @returns {Object.} JSON object + */ + ProcessorVersionAlias.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessorVersionAlias + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessorVersionAlias.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersionAlias"; + }; + + return ProcessorVersionAlias; + })(); + v1.Processor = (function() { /** @@ -33643,6 +33893,7 @@ * @property {string|null} [displayName] Processor displayName * @property {google.cloud.documentai.v1.Processor.State|null} [state] Processor state * @property {string|null} [defaultProcessorVersion] Processor defaultProcessorVersion + * @property {Array.|null} [processorVersionAliases] Processor processorVersionAliases * @property {string|null} [processEndpoint] Processor processEndpoint * @property {google.protobuf.ITimestamp|null} [createTime] Processor createTime * @property {string|null} [kmsKeyName] Processor kmsKeyName @@ -33657,6 +33908,7 @@ * @param {google.cloud.documentai.v1.IProcessor=} [properties] Properties to set */ function Processor(properties) { + this.processorVersionAliases = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33703,6 +33955,14 @@ */ Processor.prototype.defaultProcessorVersion = ""; + /** + * Processor processorVersionAliases. + * @member {Array.} processorVersionAliases + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.processorVersionAliases = $util.emptyArray; + /** * Processor processEndpoint. * @member {string} processEndpoint @@ -33767,6 +34027,9 @@ writer.uint32(/* id 8, wireType 2 =*/66).string(message.kmsKeyName); if (message.defaultProcessorVersion != null && Object.hasOwnProperty.call(message, "defaultProcessorVersion")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.defaultProcessorVersion); + if (message.processorVersionAliases != null && message.processorVersionAliases.length) + for (var i = 0; i < message.processorVersionAliases.length; ++i) + $root.google.cloud.documentai.v1.ProcessorVersionAlias.encode(message.processorVersionAliases[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -33821,6 +34084,12 @@ message.defaultProcessorVersion = reader.string(); break; } + case 10: { + if (!(message.processorVersionAliases && message.processorVersionAliases.length)) + message.processorVersionAliases = []; + message.processorVersionAliases.push($root.google.cloud.documentai.v1.ProcessorVersionAlias.decode(reader, reader.uint32())); + break; + } case 6: { message.processEndpoint = reader.string(); break; @@ -33894,6 +34163,15 @@ if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) if (!$util.isString(message.defaultProcessorVersion)) return "defaultProcessorVersion: string expected"; + if (message.processorVersionAliases != null && message.hasOwnProperty("processorVersionAliases")) { + if (!Array.isArray(message.processorVersionAliases)) + return "processorVersionAliases: array expected"; + for (var i = 0; i < message.processorVersionAliases.length; ++i) { + var error = $root.google.cloud.documentai.v1.ProcessorVersionAlias.verify(message.processorVersionAliases[i]); + if (error) + return "processorVersionAliases." + error; + } + } if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) if (!$util.isString(message.processEndpoint)) return "processEndpoint: string expected"; @@ -33968,6 +34246,16 @@ } if (object.defaultProcessorVersion != null) message.defaultProcessorVersion = String(object.defaultProcessorVersion); + if (object.processorVersionAliases) { + if (!Array.isArray(object.processorVersionAliases)) + throw TypeError(".google.cloud.documentai.v1.Processor.processorVersionAliases: array expected"); + message.processorVersionAliases = []; + for (var i = 0; i < object.processorVersionAliases.length; ++i) { + if (typeof object.processorVersionAliases[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Processor.processorVersionAliases: object expected"); + message.processorVersionAliases[i] = $root.google.cloud.documentai.v1.ProcessorVersionAlias.fromObject(object.processorVersionAliases[i]); + } + } if (object.processEndpoint != null) message.processEndpoint = String(object.processEndpoint); if (object.createTime != null) { @@ -33993,6 +34281,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.processorVersionAliases = []; if (options.defaults) { object.name = ""; object.type = ""; @@ -34019,6 +34309,11 @@ object.kmsKeyName = message.kmsKeyName; if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) object.defaultProcessorVersion = message.defaultProcessorVersion; + if (message.processorVersionAliases && message.processorVersionAliases.length) { + object.processorVersionAliases = []; + for (var j = 0; j < message.processorVersionAliases.length; ++j) + object.processorVersionAliases[j] = $root.google.cloud.documentai.v1.ProcessorVersionAlias.toObject(message.processorVersionAliases[j], options); + } return object; }; diff --git a/packages/google-cloud-documentai/protos/protos.json b/packages/google-cloud-documentai/protos/protos.json index cff06dc29bb..40bdbff030e 100644 --- a/packages/google-cloud-documentai/protos/protos.json +++ b/packages/google-cloud-documentai/protos/protos.json @@ -1150,6 +1150,10 @@ "mimeType": { "type": "string", "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 } } }, @@ -1274,7 +1278,10 @@ }, "computeStyleInfo": { "type": "bool", - "id": 8 + "id": 8, + "options": { + "deprecated": true + } } }, "nested": { @@ -3027,6 +3034,21 @@ } } }, + "ProcessorVersionAlias": { + "fields": { + "alias": { + "type": "string", + "id": 1 + }, + "processorVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, "Processor": { "options": { "(google.api.resource).type": "documentai.googleapis.com/Processor", @@ -3062,6 +3084,14 @@ "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" } }, + "processorVersionAliases": { + "rule": "repeated", + "type": "ProcessorVersionAlias", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "processEndpoint": { "type": "string", "id": 6,