From 4a45623e119013d27d07075e9fab7b6f15fe3666 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 01:48:17 +0000 Subject: [PATCH] feat: added font_family to document.proto (#377) - [ ] Regenerate this pull request now. feat: added ImageQualityScores message to document.proto feat: added PropertyMetadata and EntityTypeMetadata to document_schema.proto PiperOrigin-RevId: 486975621 Source-Link: https://togithub.com/googleapis/googleapis/commit/398c9f9fccf4dea8d12e0b5a90ed671dec2ee387 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/7cd1f5f4e435777cb824af268dc8d37134613e6a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2NkMWY1ZjRlNDM1Nzc3Y2I4MjRhZjI2OGRjOGQzNzEzNDYxM2U2YSJ9 --- .../google/cloud/documentai/v1/barcode.proto | 56 +- .../google/cloud/documentai/v1/document.proto | 72 +- .../cloud/documentai/v1/document_io.proto | 11 +- .../v1/document_processor_service.proto | 2 + .../cloud/documentai/v1/document_schema.proto | 7 +- .../cloud/documentai/v1/processor.proto | 14 +- .../cloud/documentai/v1/processor_type.proto | 4 +- .../protos/protos.d.ts | 371 +++++-- .../google-cloud-documentai/protos/protos.js | 916 +++++++++++++++--- .../protos/protos.json | 83 +- ...ment_processor_service.process_document.js | 2 + ...t_metadata.google.cloud.documentai.v1.json | 2 +- .../v1/document_processor_service_client.ts | 2 + 13 files changed, 1258 insertions(+), 284 deletions(-) diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto index 28e588d6c6e..bb841771ade 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto @@ -28,40 +28,42 @@ option ruby_package = "Google::Cloud::DocumentAI::V1"; message Barcode { // Format of a barcode. // The supported formats are: - // CODE_128: Code 128 type. - // CODE_39: Code 39 type. - // CODE_93: Code 93 type. - // CODABAR: Codabar type. - // DATA_MATRIX: 2D Data Matrix type. - // ITF: ITF type. - // EAN_13: EAN-13 type. - // EAN_8: EAN-8 type. - // QR_CODE: 2D QR code type. - // UPC_A: UPC-A type. - // UPC_E: UPC-E type. - // PDF417: PDF417 type. - // AZTEC: 2D Aztec code type. - // DATABAR: GS1 DataBar code type. + // + // - `CODE_128`: Code 128 type. + // - `CODE_39`: Code 39 type. + // - `CODE_93`: Code 93 type. + // - `CODABAR`: Codabar type. + // - `DATA_MATRIX`: 2D Data Matrix type. + // - `ITF`: ITF type. + // - `EAN_13`: EAN-13 type. + // - `EAN_8`: EAN-8 type. + // - `QR_CODE`: 2D QR code type. + // - `UPC_A`: UPC-A type. + // - `UPC_E`: UPC-E type. + // - `PDF417`: PDF417 type. + // - `AZTEC`: 2D Aztec code type. + // - `DATABAR`: GS1 DataBar code type. string format = 1; // Value format describes the format of the value that a barcode // encodes. // The supported formats are: - // CONTACT_INFO: Contact information. - // EMAIL: Email address. - // ISBN: ISBN identifier. - // PHONE: Phone number. - // PRODUCT: Product. - // SMS: SMS message. - // TEXT: Text string. - // URL: URL address. - // WIFI: Wifi information. - // GEO: Geo-localization. - // CALENDAR_EVENT: Calendar event. - // DRIVER_LICENSE: Driver's license. + // + // - `CONTACT_INFO`: Contact information. + // - `EMAIL`: Email address. + // - `ISBN`: ISBN identifier. + // - `PHONE`: Phone number. + // - `PRODUCT`: Product. + // - `SMS`: SMS message. + // - `TEXT`: Text string. + // - `URL`: URL address. + // - `WIFI`: Wifi information. + // - `GEO`: Geo-localization. + // - `CALENDAR_EVENT`: Calendar event. + // - `DRIVER_LICENSE`: Driver's license. string value_format = 2; // Raw value encoded in the barcode. - // For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'. + // For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. string raw_value = 3; } diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto index d8bbf6b574d..c4fbb21ceca 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto @@ -91,6 +91,10 @@ message Document { // Font size. FontSize font_size = 7; + + // Font family such as `Arial`, `Times New Roman`. + // https://www.w3schools.com/cssref/pr_font_font-family.asp + string font_family = 8; } // A page in a [Document][google.cloud.documentai.v1.Document]. @@ -169,7 +173,7 @@ message Document { // Confidence of the current [Layout][google.cloud.documentai.v1.Document.Page.Layout] within context of the object this // layout is for. e.g. confidence can be for a single token, a table, - // a visual element, etc. depending on context. Range [0, 1]. + // a visual element, etc. depending on context. Range `[0, 1]`. float confidence = 2; // The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. @@ -189,7 +193,7 @@ message Document { repeated DetectedLanguage detected_languages = 2; // The history of this annotation. - Provenance provenance = 3; + Provenance provenance = 3 [deprecated = true]; } // A collection of lines that a human would perceive as a paragraph. @@ -201,7 +205,7 @@ message Document { repeated DetectedLanguage detected_languages = 2; // The history of this annotation. - Provenance provenance = 3; + Provenance provenance = 3 [deprecated = true]; } // A collection of tokens that a human would perceive as a line. @@ -214,7 +218,7 @@ message Document { repeated DetectedLanguage detected_languages = 2; // The history of this annotation. - Provenance provenance = 3; + Provenance provenance = 3 [deprecated = true]; } // A detected token. @@ -249,8 +253,8 @@ message Document { // A list of detected languages together with confidence. repeated DetectedLanguage detected_languages = 3; - // The history of this annotation. - Provenance provenance = 4; + // The history of this annotation. + Provenance provenance = 4 [deprecated = true]; } // A detected symbol. @@ -309,6 +313,9 @@ message Document { // A list of detected languages together with confidence. repeated DetectedLanguage detected_languages = 4; + + // The history of this table. + Provenance provenance = 5; } // A form field detected on the page. @@ -358,15 +365,43 @@ message Document { // Detected language for a structural component. message DetectedLanguage { - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // The BCP-47 language code, such as `en-US` or `sr-Latn`. For more // information, see // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. string language_code = 1; - // Confidence of detected language. Range [0, 1]. + // Confidence of detected language. Range `[0, 1]`. float confidence = 2; } + // Image Quality Scores for the page image + message ImageQualityScores { + // Image Quality Defects + message DetectedDefect { + // Name of the defect type. Supported values are: + // + // - `quality/defect_blurry` + // - `quality/defect_noisy` + // - `quality/defect_dark` + // - `quality/defect_faint` + // - `quality/defect_text_too_small` + // - `quality/defect_document_cutoff` + // - `quality/defect_text_cutoff` + // - `quality/defect_glare` + string type = 1; + + // Confidence of detected defect. Range `[0, 1]` where 1 indicates + // strong confidence of that the defect exists. + float confidence = 2; + } + + // The overall quality score. Range `[0, 1]` where 1 is perfect quality. + float quality_score = 1; + + // A list of detected defects. + repeated DetectedDefect detected_defects = 2; + } + // 1-based index for current [Page][google.cloud.documentai.v1.Document.Page] in a parent [Document][google.cloud.documentai.v1.Document]. // Useful when a page is taken out of a [Document][google.cloud.documentai.v1.Document] for individual // processing. @@ -422,8 +457,11 @@ message Document { // A list of detected barcodes. repeated DetectedBarcode detected_barcodes = 15; + // Image Quality Scores. + ImageQualityScores image_quality_scores = 17; + // The history of this page. - Provenance provenance = 16; + Provenance provenance = 16 [deprecated = true]; } // An entity that could be a phrase in the text or a property that belongs to @@ -471,6 +509,7 @@ message Document { // or int normalized text by default. // // Below are sample formats mapped to structured values. + // // - Money/Currency type (`money_value`) is in the ISO 4217 text format. // - Date type (`date_value`) is in the ISO 8601 text format. // - Datetime type (`datetime_value`) is in the ISO 8601 text format. @@ -484,14 +523,13 @@ message Document { // Required. Entity type from a schema e.g. `Address`. string type = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity - // is not present in the document, this field will be empty. + // Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. string mention_text = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Deprecated. Use `id` field instead. string mention_id = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Confidence of detected Schema entity. Range [0, 1]. + // Optional. Confidence of detected Schema entity. Range `[0, 1]`. float confidence = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. Represents the provenance of this entity wrt. the location on the @@ -605,7 +643,7 @@ message Document { // Optional. Identifies the bounding polygon of a layout element on the page. BoundingPoly bounding_poly = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Confidence of detected page element, if applicable. Range [0, 1]. + // Optional. Confidence of detected page element, if applicable. Range `[0, 1]`. float confidence = 5 [(google.api.field_behavior) = OPTIONAL]; } @@ -726,7 +764,7 @@ message Document { string changed_text = 2; // The history of this annotation. - repeated Provenance provenance = 3; + repeated Provenance provenance = 3 [deprecated = true]; } // Original source document from the user. @@ -765,9 +803,9 @@ message Document { // Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities]. repeated EntityRelation entity_relations = 8; - // Placeholder. A list of text corrections made to [Document.text]. This is - // usually used for annotating corrections to OCR mistakes. Text changes for - // a given revision may not overlap with each other. + // Placeholder. A list of text corrections made to [Document.text][google.cloud.documentai.v1.Document.text]. This + // is usually used for annotating corrections to OCR mistakes. Text changes + // for a given revision may not overlap with each other. repeated TextChange text_changes = 14; // Information about the sharding if this document is sharded part of a larger 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 17630a03592..3240d494e8f 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 @@ -16,6 +16,8 @@ syntax = "proto3"; package google.cloud.documentai.v1; +import "google/protobuf/field_mask.proto"; + option csharp_namespace = "Google.Cloud.DocumentAI.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1;documentai"; option java_multiple_files = true; @@ -30,7 +32,7 @@ message RawDocument { bytes content = 1; // An IANA MIME type (RFC6838) indicating the nature and format of the - // [content]. + // [content][google.cloud.documentai.v1.RawDocument.content]. string mime_type = 2; } @@ -59,7 +61,7 @@ message GcsPrefix { message BatchDocumentsInputConfig { // The source. oneof source { - // The set of documents that match the specified Cloud Storage [gcs_prefix]. + // The set of documents that match the specified Cloud Storage `gcs_prefix`. GcsPrefix gcs_prefix = 1; // The set of documents individually specified on Cloud Storage. @@ -74,6 +76,11 @@ message DocumentOutputConfig { message GcsOutputConfig { // The Cloud Storage uri (a directory) of the output. string gcs_uri = 1; + + // Specifies which fields to include in the output documents. + // Only supports top level document and pages field so it must be in the + // form of `{document_field_name}` or `pages.{page_field_name}`. + google.protobuf.FieldMask field_mask = 2; } // The destination of the results. 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 9c944f259a0..e748ae1f748 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 @@ -279,6 +279,8 @@ message ProcessRequest { bool skip_human_review = 3; // Specifies which fields to include in ProcessResponse's document. + // Only supports top level document and pages field so it must be in the form + // of `{document_field_name}` or `pages.{page_field_name}`. google.protobuf.FieldMask field_mask = 6; } diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto index 24bd42285d9..ceb25a1d69a 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto @@ -86,15 +86,16 @@ message DocumentSchema { // Name of the type. It must be unique within the schema file and // cannot be a 'Common Type'. Besides that we use the following naming // conventions: - // - *use snake_casing* + // + // - *use `snake_casing`* // - name matching is case-insensitive // - Maximum 64 characters. // - Must start with a letter. // - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward // compatibility internal infrastructure and tooling can handle any ascii // character) - // - The '/' is sometimes used to denote a property of a type. For example - // line_item/amount. This convention is deprecated, but will still be + // - The `/` is sometimes used to denote a property of a type. For example + // `line_item/amount`. This convention is deprecated, but will still be // honored for backward compatibility. string name = 1; 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 b7eb95ef3f5..3ffe6927df9 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 @@ -18,6 +18,7 @@ package google.cloud.documentai.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/documentai/v1/document_schema.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.DocumentAI.V1"; @@ -85,6 +86,9 @@ message ProcessorVersion { // The display name of the processor version. string display_name = 2; + // The schema of the processor version. Describes the output. + DocumentSchema document_schema = 12; + // The state of the processor version. State state = 6; @@ -125,14 +129,14 @@ message Processor { // The processor is disabled. DISABLED = 2; - // The processor is being enabled, will become ENABLED if successful. + // The processor is being enabled, will become `ENABLED` if successful. ENABLING = 3; - // The processor is being disabled, will become DISABLED if successful. + // The processor is being disabled, will become `DISABLED` if successful. DISABLING = 4; - // The processor is being created, will become either ENABLED (for - // successful creation) or FAILED (for failed ones). + // The processor is being created, will become either `ENABLED` (for + // successful creation) or `FAILED` (for failed ones). // Once a processor is in this state, it can then be used for document // processing, but the feature dependencies of the processor might not be // fully created yet. @@ -154,7 +158,7 @@ message Processor { (google.api.field_behavior) = OUTPUT_ONLY ]; - // The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc. + // The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. // To get a list of processors types, see // [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]. string type = 2; diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto index dd5ef470011..2c9ee923051 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto @@ -42,10 +42,10 @@ message ProcessorType { } // The resource name of the processor type. - // Format: projects/{project}/processorTypes/{processor_type} + // Format: `projects/{project}/processorTypes/{processor_type}` string name = 1; - // The type of the processor, e.g., "invoice_parsing". + // The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. string type = 2; // The processor category, used by UI to group processor types. diff --git a/packages/google-cloud-documentai/protos/protos.d.ts b/packages/google-cloud-documentai/protos/protos.d.ts index 383050386aa..af6c5eac483 100644 --- a/packages/google-cloud-documentai/protos/protos.d.ts +++ b/packages/google-cloud-documentai/protos/protos.d.ts @@ -435,6 +435,9 @@ export namespace google { /** Style fontSize */ fontSize?: (google.cloud.documentai.v1.Document.Style.IFontSize|null); + + /** Style fontFamily */ + fontFamily?: (string|null); } /** Represents a Style. */ @@ -467,6 +470,9 @@ export namespace google { /** Style fontSize. */ public fontSize?: (google.cloud.documentai.v1.Document.Style.IFontSize|null); + /** Style fontFamily. */ + public fontFamily: string; + /** * Creates a new Style instance using the specified properties. * @param [properties] Properties to set @@ -699,6 +705,9 @@ export namespace google { /** Page detectedBarcodes */ detectedBarcodes?: (google.cloud.documentai.v1.Document.Page.IDetectedBarcode[]|null); + /** Page imageQualityScores */ + imageQualityScores?: (google.cloud.documentai.v1.Document.Page.IImageQualityScores|null); + /** Page provenance */ provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); } @@ -757,6 +766,9 @@ export namespace google { /** Page detectedBarcodes. */ public detectedBarcodes: google.cloud.documentai.v1.Document.Page.IDetectedBarcode[]; + /** Page imageQualityScores. */ + public imageQualityScores?: (google.cloud.documentai.v1.Document.Page.IImageQualityScores|null); + /** Page provenance. */ public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); @@ -2085,6 +2097,9 @@ export namespace google { /** Table detectedLanguages */ detectedLanguages?: (google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]|null); + + /** Table provenance */ + provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); } /** Represents a Table. */ @@ -2108,6 +2123,9 @@ export namespace google { /** Table detectedLanguages. */ public detectedLanguages: google.cloud.documentai.v1.Document.Page.IDetectedLanguage[]; + /** Table provenance. */ + public provenance?: (google.cloud.documentai.v1.Document.IProvenance|null); + /** * Creates a new Table instance using the specified properties. * @param [properties] Properties to set @@ -2745,6 +2763,215 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of an ImageQualityScores. */ + interface IImageQualityScores { + + /** ImageQualityScores qualityScore */ + qualityScore?: (number|null); + + /** ImageQualityScores detectedDefects */ + detectedDefects?: (google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect[]|null); + } + + /** Represents an ImageQualityScores. */ + class ImageQualityScores implements IImageQualityScores { + + /** + * Constructs a new ImageQualityScores. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.IImageQualityScores); + + /** ImageQualityScores qualityScore. */ + public qualityScore: number; + + /** ImageQualityScores detectedDefects. */ + public detectedDefects: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect[]; + + /** + * Creates a new ImageQualityScores instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageQualityScores instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.IImageQualityScores): google.cloud.documentai.v1.Document.Page.ImageQualityScores; + + /** + * Encodes the specified ImageQualityScores message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. + * @param message ImageQualityScores message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.IImageQualityScores, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageQualityScores message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. + * @param message ImageQualityScores message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.IImageQualityScores, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageQualityScores message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageQualityScores + * @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.Document.Page.ImageQualityScores; + + /** + * Decodes an ImageQualityScores message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageQualityScores + * @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.Document.Page.ImageQualityScores; + + /** + * Verifies an ImageQualityScores 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 an ImageQualityScores message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageQualityScores + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.ImageQualityScores; + + /** + * Creates a plain object from an ImageQualityScores message. Also converts values to other types if specified. + * @param message ImageQualityScores + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageQualityScores to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageQualityScores + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImageQualityScores { + + /** Properties of a DetectedDefect. */ + interface IDetectedDefect { + + /** DetectedDefect type */ + type?: (string|null); + + /** DetectedDefect confidence */ + confidence?: (number|null); + } + + /** Represents a DetectedDefect. */ + class DetectedDefect implements IDetectedDefect { + + /** + * Constructs a new DetectedDefect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect); + + /** DetectedDefect type. */ + public type: string; + + /** DetectedDefect confidence. */ + public confidence: number; + + /** + * Creates a new DetectedDefect instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectedDefect instance + */ + public static create(properties?: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect): google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect; + + /** + * Encodes the specified DetectedDefect message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. + * @param message DetectedDefect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedDefect message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. + * @param message DetectedDefect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectedDefect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectedDefect + * @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.Document.Page.ImageQualityScores.DetectedDefect; + + /** + * Decodes a DetectedDefect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectedDefect + * @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.Document.Page.ImageQualityScores.DetectedDefect; + + /** + * Verifies a DetectedDefect 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 DetectedDefect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectedDefect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect; + + /** + * Creates a plain object from a DetectedDefect message. Also converts values to other types if specified. + * @param message DetectedDefect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectedDefect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DetectedDefect + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } } /** Properties of an Entity. */ @@ -5115,6 +5342,9 @@ export namespace google { /** GcsOutputConfig gcsUri */ gcsUri?: (string|null); + + /** GcsOutputConfig fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); } /** Represents a GcsOutputConfig. */ @@ -5129,6 +5359,9 @@ export namespace google { /** GcsOutputConfig gcsUri. */ public gcsUri: string; + /** GcsOutputConfig fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + /** * Creates a new GcsOutputConfig instance using the specified properties. * @param [properties] Properties to set @@ -10415,6 +10648,9 @@ export namespace google { /** ProcessorVersion displayName */ displayName?: (string|null); + /** ProcessorVersion documentSchema */ + documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); + /** ProcessorVersion state */ state?: (google.cloud.documentai.v1.ProcessorVersion.State|keyof typeof google.cloud.documentai.v1.ProcessorVersion.State|null); @@ -10449,6 +10685,9 @@ export namespace google { /** ProcessorVersion displayName. */ public displayName: string; + /** ProcessorVersion documentSchema. */ + public documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); + /** ProcessorVersion state. */ public state: (google.cloud.documentai.v1.ProcessorVersion.State|keyof typeof google.cloud.documentai.v1.ProcessorVersion.State); @@ -36988,188 +37227,188 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an Empty. */ - interface IEmpty { + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); } - /** Represents an Empty. */ - class Empty implements IEmpty { + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { /** - * Constructs a new Empty. + * Constructs a new FieldMask. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEmpty); + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; /** - * Creates a new Empty instance using the specified properties. + * Creates a new FieldMask instance using the specified properties. * @param [properties] Properties to set - * @returns Empty instance + * @returns FieldMask instance */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Empty + * @returns FieldMask * @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.protobuf.Empty; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Empty + * @returns FieldMask * @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.protobuf.Empty; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; /** - * Verifies an Empty message. + * Verifies a FieldMask 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 an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Empty + * @returns FieldMask */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Empty to JSON. + * Converts this FieldMask to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Empty + * Gets the default type url for FieldMask * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); + /** Properties of an Empty. */ + interface IEmpty { } - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { + /** Represents an Empty. */ + class Empty implements IEmpty { /** - * Constructs a new FieldMask. + * Constructs a new Empty. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; + constructor(properties?: google.protobuf.IEmpty); /** - * Creates a new FieldMask instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @param [properties] Properties to set - * @returns FieldMask instance + * @returns Empty instance */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldMask message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FieldMask + * @returns Empty * @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.protobuf.FieldMask; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldMask + * @returns Empty * @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.protobuf.FieldMask; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; /** - * Verifies a FieldMask message. + * Verifies an Empty 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 FieldMask message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldMask + * @returns Empty */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldMask to JSON. + * Converts this Empty to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FieldMask + * Gets the default type url for Empty * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/packages/google-cloud-documentai/protos/protos.js b/packages/google-cloud-documentai/protos/protos.js index e1286d21a73..3a0d67dc16f 100644 --- a/packages/google-cloud-documentai/protos/protos.js +++ b/packages/google-cloud-documentai/protos/protos.js @@ -1241,6 +1241,7 @@ * @property {string|null} [textStyle] Style textStyle * @property {string|null} [textDecoration] Style textDecoration * @property {google.cloud.documentai.v1.Document.Style.IFontSize|null} [fontSize] Style fontSize + * @property {string|null} [fontFamily] Style fontFamily */ /** @@ -1314,6 +1315,14 @@ */ Style.prototype.fontSize = null; + /** + * Style fontFamily. + * @member {string} fontFamily + * @memberof google.cloud.documentai.v1.Document.Style + * @instance + */ + Style.prototype.fontFamily = ""; + /** * Creates a new Style instance using the specified properties. * @function create @@ -1352,6 +1361,8 @@ writer.uint32(/* id 6, wireType 2 =*/50).string(message.textDecoration); if (message.fontSize != null && Object.hasOwnProperty.call(message, "fontSize")) $root.google.cloud.documentai.v1.Document.Style.FontSize.encode(message.fontSize, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.fontFamily != null && Object.hasOwnProperty.call(message, "fontFamily")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.fontFamily); return writer; }; @@ -1414,6 +1425,10 @@ message.fontSize = $root.google.cloud.documentai.v1.Document.Style.FontSize.decode(reader, reader.uint32()); break; } + case 8: { + message.fontFamily = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1478,6 +1493,9 @@ if (error) return "fontSize." + error; } + if (message.fontFamily != null && message.hasOwnProperty("fontFamily")) + if (!$util.isString(message.fontFamily)) + return "fontFamily: string expected"; return null; }; @@ -1519,6 +1537,8 @@ throw TypeError(".google.cloud.documentai.v1.Document.Style.fontSize: object expected"); message.fontSize = $root.google.cloud.documentai.v1.Document.Style.FontSize.fromObject(object.fontSize); } + if (object.fontFamily != null) + message.fontFamily = String(object.fontFamily); return message; }; @@ -1543,6 +1563,7 @@ object.textStyle = ""; object.textDecoration = ""; object.fontSize = null; + object.fontFamily = ""; } if (message.textAnchor != null && message.hasOwnProperty("textAnchor")) object.textAnchor = $root.google.cloud.documentai.v1.Document.TextAnchor.toObject(message.textAnchor, options); @@ -1558,6 +1579,8 @@ object.textDecoration = message.textDecoration; if (message.fontSize != null && message.hasOwnProperty("fontSize")) object.fontSize = $root.google.cloud.documentai.v1.Document.Style.FontSize.toObject(message.fontSize, options); + if (message.fontFamily != null && message.hasOwnProperty("fontFamily")) + object.fontFamily = message.fontFamily; return object; }; @@ -1838,6 +1861,7 @@ * @property {Array.|null} [formFields] Page formFields * @property {Array.|null} [symbols] Page symbols * @property {Array.|null} [detectedBarcodes] Page detectedBarcodes + * @property {google.cloud.documentai.v1.Document.Page.IImageQualityScores|null} [imageQualityScores] Page imageQualityScores * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Page provenance */ @@ -1987,6 +2011,14 @@ */ Page.prototype.detectedBarcodes = $util.emptyArray; + /** + * Page imageQualityScores. + * @member {google.cloud.documentai.v1.Document.Page.IImageQualityScores|null|undefined} imageQualityScores + * @memberof google.cloud.documentai.v1.Document.Page + * @instance + */ + Page.prototype.imageQualityScores = null; + /** * Page provenance. * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance @@ -2062,6 +2094,8 @@ $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.encode(message.detectedBarcodes[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.imageQualityScores != null && Object.hasOwnProperty.call(message, "imageQualityScores")) + $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.encode(message.imageQualityScores, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -2178,6 +2212,10 @@ message.detectedBarcodes.push($root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.decode(reader, reader.uint32())); break; } + case 17: { + message.imageQualityScores = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.decode(reader, reader.uint32()); + break; + } case 16: { message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); break; @@ -2334,6 +2372,11 @@ return "detectedBarcodes." + error; } } + if (message.imageQualityScores != null && message.hasOwnProperty("imageQualityScores")) { + var error = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify(message.imageQualityScores); + if (error) + return "imageQualityScores." + error; + } if (message.provenance != null && message.hasOwnProperty("provenance")) { var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); if (error) @@ -2481,6 +2524,11 @@ message.detectedBarcodes[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedBarcode.fromObject(object.detectedBarcodes[i]); } } + if (object.imageQualityScores != null) { + if (typeof object.imageQualityScores !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.imageQualityScores: object expected"); + message.imageQualityScores = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.fromObject(object.imageQualityScores); + } if (object.provenance != null) { if (typeof object.provenance !== "object") throw TypeError(".google.cloud.documentai.v1.Document.Page.provenance: object expected"); @@ -2521,6 +2569,7 @@ object.layout = null; object.image = null; object.provenance = null; + object.imageQualityScores = null; } if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) object.pageNumber = message.pageNumber; @@ -2587,6 +2636,8 @@ } if (message.provenance != null && message.hasOwnProperty("provenance")) object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); + if (message.imageQualityScores != null && message.hasOwnProperty("imageQualityScores")) + object.imageQualityScores = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.toObject(message.imageQualityScores, options); return object; }; @@ -5713,6 +5764,7 @@ * @property {Array.|null} [headerRows] Table headerRows * @property {Array.|null} [bodyRows] Table bodyRows * @property {Array.|null} [detectedLanguages] Table detectedLanguages + * @property {google.cloud.documentai.v1.Document.IProvenance|null} [provenance] Table provenance */ /** @@ -5765,6 +5817,14 @@ */ Table.prototype.detectedLanguages = $util.emptyArray; + /** + * Table provenance. + * @member {google.cloud.documentai.v1.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1.Document.Page.Table + * @instance + */ + Table.prototype.provenance = null; + /** * Creates a new Table instance using the specified properties. * @function create @@ -5800,6 +5860,8 @@ if (message.detectedLanguages != null && message.detectedLanguages.length) for (var i = 0; i < message.detectedLanguages.length; ++i) $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.encode(message.detectedLanguages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1.Document.Provenance.encode(message.provenance, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -5856,6 +5918,10 @@ message.detectedLanguages.push($root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); break; } + case 5: { + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5923,6 +5989,11 @@ return "detectedLanguages." + error; } } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } return null; }; @@ -5973,6 +6044,11 @@ message.detectedLanguages[i] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); } } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.Table.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1.Document.Provenance.fromObject(object.provenance); + } return message; }; @@ -5994,8 +6070,10 @@ object.bodyRows = []; object.detectedLanguages = []; } - if (options.defaults) + if (options.defaults) { object.layout = null; + object.provenance = null; + } if (message.layout != null && message.hasOwnProperty("layout")) object.layout = $root.google.cloud.documentai.v1.Document.Page.Layout.toObject(message.layout, options); if (message.headerRows && message.headerRows.length) { @@ -6013,6 +6091,8 @@ for (var j = 0; j < message.detectedLanguages.length; ++j) object.detectedLanguages[j] = $root.google.cloud.documentai.v1.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1.Document.Provenance.toObject(message.provenance, options); return object; }; @@ -7457,6 +7537,481 @@ return DetectedLanguage; })(); + Page.ImageQualityScores = (function() { + + /** + * Properties of an ImageQualityScores. + * @memberof google.cloud.documentai.v1.Document.Page + * @interface IImageQualityScores + * @property {number|null} [qualityScore] ImageQualityScores qualityScore + * @property {Array.|null} [detectedDefects] ImageQualityScores detectedDefects + */ + + /** + * Constructs a new ImageQualityScores. + * @memberof google.cloud.documentai.v1.Document.Page + * @classdesc Represents an ImageQualityScores. + * @implements IImageQualityScores + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores=} [properties] Properties to set + */ + function ImageQualityScores(properties) { + this.detectedDefects = []; + 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]]; + } + + /** + * ImageQualityScores qualityScore. + * @member {number} qualityScore + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @instance + */ + ImageQualityScores.prototype.qualityScore = 0; + + /** + * ImageQualityScores detectedDefects. + * @member {Array.} detectedDefects + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @instance + */ + ImageQualityScores.prototype.detectedDefects = $util.emptyArray; + + /** + * Creates a new ImageQualityScores instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores instance + */ + ImageQualityScores.create = function create(properties) { + return new ImageQualityScores(properties); + }; + + /** + * Encodes the specified ImageQualityScores message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores} message ImageQualityScores message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageQualityScores.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.qualityScore != null && Object.hasOwnProperty.call(message, "qualityScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.qualityScore); + if (message.detectedDefects != null && message.detectedDefects.length) + for (var i = 0; i < message.detectedDefects.length; ++i) + $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.encode(message.detectedDefects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageQualityScores message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1.Document.Page.IImageQualityScores} message ImageQualityScores message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageQualityScores.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageQualityScores message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @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.Document.Page.ImageQualityScores} ImageQualityScores + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageQualityScores.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.Document.Page.ImageQualityScores(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.qualityScore = reader.float(); + break; + } + case 2: { + if (!(message.detectedDefects && message.detectedDefects.length)) + message.detectedDefects = []; + message.detectedDefects.push($root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageQualityScores message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageQualityScores.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageQualityScores message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageQualityScores.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.qualityScore != null && message.hasOwnProperty("qualityScore")) + if (typeof message.qualityScore !== "number") + return "qualityScore: number expected"; + if (message.detectedDefects != null && message.hasOwnProperty("detectedDefects")) { + if (!Array.isArray(message.detectedDefects)) + return "detectedDefects: array expected"; + for (var i = 0; i < message.detectedDefects.length; ++i) { + var error = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify(message.detectedDefects[i]); + if (error) + return "detectedDefects." + error; + } + } + return null; + }; + + /** + * Creates an ImageQualityScores message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores} ImageQualityScores + */ + ImageQualityScores.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores(); + if (object.qualityScore != null) + message.qualityScore = Number(object.qualityScore); + if (object.detectedDefects) { + if (!Array.isArray(object.detectedDefects)) + throw TypeError(".google.cloud.documentai.v1.Document.Page.ImageQualityScores.detectedDefects: array expected"); + message.detectedDefects = []; + for (var i = 0; i < object.detectedDefects.length; ++i) { + if (typeof object.detectedDefects[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Document.Page.ImageQualityScores.detectedDefects: object expected"); + message.detectedDefects[i] = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.fromObject(object.detectedDefects[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImageQualityScores message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores} message ImageQualityScores + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageQualityScores.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.detectedDefects = []; + if (options.defaults) + object.qualityScore = 0; + if (message.qualityScore != null && message.hasOwnProperty("qualityScore")) + object.qualityScore = options.json && !isFinite(message.qualityScore) ? String(message.qualityScore) : message.qualityScore; + if (message.detectedDefects && message.detectedDefects.length) { + object.detectedDefects = []; + for (var j = 0; j < message.detectedDefects.length; ++j) + object.detectedDefects[j] = $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.toObject(message.detectedDefects[j], options); + } + return object; + }; + + /** + * Converts this ImageQualityScores to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @instance + * @returns {Object.} JSON object + */ + ImageQualityScores.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageQualityScores + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageQualityScores.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.ImageQualityScores"; + }; + + ImageQualityScores.DetectedDefect = (function() { + + /** + * Properties of a DetectedDefect. + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @interface IDetectedDefect + * @property {string|null} [type] DetectedDefect type + * @property {number|null} [confidence] DetectedDefect confidence + */ + + /** + * Constructs a new DetectedDefect. + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores + * @classdesc Represents a DetectedDefect. + * @implements IDetectedDefect + * @constructor + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect=} [properties] Properties to set + */ + function DetectedDefect(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]]; + } + + /** + * DetectedDefect type. + * @member {string} type + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @instance + */ + DetectedDefect.prototype.type = ""; + + /** + * DetectedDefect confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @instance + */ + DetectedDefect.prototype.confidence = 0; + + /** + * Creates a new DetectedDefect instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect instance + */ + DetectedDefect.create = function create(properties) { + return new DetectedDefect(properties); + }; + + /** + * Encodes the specified DetectedDefect message. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect} message DetectedDefect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedDefect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified DetectedDefect message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.IDetectedDefect} message DetectedDefect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectedDefect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectedDefect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @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.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedDefect.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.Document.Page.ImageQualityScores.DetectedDefect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectedDefect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectedDefect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectedDefect message. + * @function verify + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectedDefect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a DetectedDefect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect + */ + DetectedDefect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect) + return object; + var message = new $root.google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect(); + if (object.type != null) + message.type = String(object.type); + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a DetectedDefect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect} message DetectedDefect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectedDefect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.confidence = 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this DetectedDefect to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @instance + * @returns {Object.} JSON object + */ + DetectedDefect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DetectedDefect + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DetectedDefect.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect"; + }; + + return DetectedDefect; + })(); + + return ImageQualityScores; + })(); + return Page; })(); @@ -13391,6 +13946,7 @@ * @memberof google.cloud.documentai.v1.DocumentOutputConfig * @interface IGcsOutputConfig * @property {string|null} [gcsUri] GcsOutputConfig gcsUri + * @property {google.protobuf.IFieldMask|null} [fieldMask] GcsOutputConfig fieldMask */ /** @@ -13416,6 +13972,14 @@ */ GcsOutputConfig.prototype.gcsUri = ""; + /** + * GcsOutputConfig fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @instance + */ + GcsOutputConfig.prototype.fieldMask = null; + /** * Creates a new GcsOutputConfig instance using the specified properties. * @function create @@ -13442,6 +14006,8 @@ writer = $Writer.create(); if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -13480,6 +14046,10 @@ message.gcsUri = reader.string(); break; } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -13518,6 +14088,11 @@ if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) if (!$util.isString(message.gcsUri)) return "gcsUri: string expected"; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } return null; }; @@ -13535,6 +14110,11 @@ var message = new $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig(); if (object.gcsUri != null) message.gcsUri = String(object.gcsUri); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } return message; }; @@ -13551,10 +14131,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.gcsUri = ""; + object.fieldMask = null; + } if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) object.gcsUri = message.gcsUri; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); return object; }; @@ -25249,6 +25833,7 @@ * @interface IProcessorVersion * @property {string|null} [name] ProcessorVersion name * @property {string|null} [displayName] ProcessorVersion displayName + * @property {google.cloud.documentai.v1.IDocumentSchema|null} [documentSchema] ProcessorVersion documentSchema * @property {google.cloud.documentai.v1.ProcessorVersion.State|null} [state] ProcessorVersion state * @property {google.protobuf.ITimestamp|null} [createTime] ProcessorVersion createTime * @property {string|null} [kmsKeyName] ProcessorVersion kmsKeyName @@ -25288,6 +25873,14 @@ */ ProcessorVersion.prototype.displayName = ""; + /** + * ProcessorVersion documentSchema. + * @member {google.cloud.documentai.v1.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.documentSchema = null; + /** * ProcessorVersion state. * @member {google.cloud.documentai.v1.ProcessorVersion.State} state @@ -25374,6 +25967,8 @@ writer.uint32(/* id 10, wireType 2 =*/82).string(message.kmsKeyVersionName); if (message.googleManaged != null && Object.hasOwnProperty.call(message, "googleManaged")) writer.uint32(/* id 11, wireType 0 =*/88).bool(message.googleManaged); + if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) + $root.google.cloud.documentai.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.deprecationInfo != null && Object.hasOwnProperty.call(message, "deprecationInfo")) $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.encode(message.deprecationInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; @@ -25418,6 +26013,10 @@ message.displayName = reader.string(); break; } + case 12: { + message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.decode(reader, reader.uint32()); + break; + } case 6: { message.state = reader.int32(); break; @@ -25483,6 +26082,11 @@ if (message.displayName != null && message.hasOwnProperty("displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) { + var error = $root.google.cloud.documentai.v1.DocumentSchema.verify(message.documentSchema); + if (error) + return "documentSchema." + error; + } if (message.state != null && message.hasOwnProperty("state")) switch (message.state) { default: @@ -25535,6 +26139,11 @@ message.name = String(object.name); if (object.displayName != null) message.displayName = String(object.displayName); + if (object.documentSchema != null) { + if (typeof object.documentSchema !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.documentSchema: object expected"); + message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.fromObject(object.documentSchema); + } switch (object.state) { default: if (typeof object.state === "number") { @@ -25615,6 +26224,7 @@ object.kmsKeyName = ""; object.kmsKeyVersionName = ""; object.googleManaged = false; + object.documentSchema = null; object.deprecationInfo = null; } if (message.name != null && message.hasOwnProperty("name")) @@ -25631,6 +26241,8 @@ object.kmsKeyVersionName = message.kmsKeyVersionName; if (message.googleManaged != null && message.hasOwnProperty("googleManaged")) object.googleManaged = message.googleManaged; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) + object.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.toObject(message.documentSchema, options); if (message.deprecationInfo != null && message.hasOwnProperty("deprecationInfo")) object.deprecationInfo = $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.toObject(message.deprecationInfo, options); return object; @@ -92252,23 +92864,25 @@ return Duration; })(); - protobuf.Empty = (function() { + protobuf.FieldMask = (function() { /** - * Properties of an Empty. + * Properties of a FieldMask. * @memberof google.protobuf - * @interface IEmpty + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths */ /** - * Constructs a new Empty. + * Constructs a new FieldMask. * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty + * @classdesc Represents a FieldMask. + * @implements IFieldMask * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @param {google.protobuf.IFieldMask=} [properties] Properties to set */ - function Empty(properties) { + function FieldMask(properties) { + this.paths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -92276,63 +92890,80 @@ } /** - * Creates a new Empty instance using the specified properties. + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. * @function create - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance */ - Empty.create = function create(properties) { - return new Empty(properties); + FieldMask.create = function create(properties) { + return new FieldMask(properties); }; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encode - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encode = function encode(message, writer) { + FieldMask.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); return writer; }; /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Empty.decode = function decode(reader, length) { + FieldMask.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.protobuf.Empty(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -92342,110 +92973,133 @@ }; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Empty.decodeDelimited = function decodeDelimited(reader) { + FieldMask.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Empty message. + * Verifies a FieldMask message. * @function verify - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Empty.verify = function verify(message) { + FieldMask.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } return null; }; /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.FieldMask} FieldMask */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) return object; - return new $root.google.protobuf.Empty(); + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; }; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.Empty} message Empty + * @param {google.protobuf.FieldMask} message FieldMask * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Empty.toObject = function toObject() { - return {}; + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; }; /** - * Converts this Empty to JSON. + * Converts this FieldMask to JSON. * @function toJSON - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @instance * @returns {Object.} JSON object */ - Empty.prototype.toJSON = function toJSON() { + FieldMask.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Empty + * Gets the default type url for FieldMask * @function getTypeUrl - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Empty"; + return typeUrlPrefix + "/google.protobuf.FieldMask"; }; - return Empty; + return FieldMask; })(); - protobuf.FieldMask = (function() { + protobuf.Empty = (function() { /** - * Properties of a FieldMask. + * Properties of an Empty. * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths + * @interface IEmpty */ /** - * Constructs a new FieldMask. + * Constructs a new Empty. * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask + * @classdesc Represents an Empty. + * @implements IEmpty * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @param {google.protobuf.IEmpty=} [properties] Properties to set */ - function FieldMask(properties) { - this.paths = []; + function Empty(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -92453,80 +93107,63 @@ } /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @function create - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); + Empty.create = function create(properties) { + return new Empty(properties); }; /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldMask.encode = function encode(message, writer) { + Empty.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); return writer; }; /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldMask message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FieldMask.decode = function decode(reader, length) { + Empty.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.protobuf.FieldMask(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } default: reader.skipType(tag & 7); break; @@ -92536,114 +93173,89 @@ }; /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { + Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldMask message. + * Verifies an Empty message. * @function verify - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Empty * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FieldMask.verify = function verify(message) { + Empty.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } return null; }; /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Empty * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask + * @returns {google.protobuf.Empty} Empty */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; + return new $root.google.protobuf.Empty(); }; /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * Creates a plain object from an Empty message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.FieldMask} message FieldMask + * @param {google.protobuf.Empty} message Empty * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; + Empty.toObject = function toObject() { + return {}; }; /** - * Converts this FieldMask to JSON. + * Converts this Empty to JSON. * @function toJSON - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Empty * @instance * @returns {Object.} JSON object */ - FieldMask.prototype.toJSON = function toJSON() { + Empty.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FieldMask + * Gets the default type url for Empty * @function getTypeUrl - * @memberof google.protobuf.FieldMask + * @memberof google.protobuf.Empty * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldMask"; + return typeUrlPrefix + "/google.protobuf.Empty"; }; - return FieldMask; + return Empty; })(); return protobuf; diff --git a/packages/google-cloud-documentai/protos/protos.json b/packages/google-cloud-documentai/protos/protos.json index 4045eae1697..f8ada9d376b 100644 --- a/packages/google-cloud-documentai/protos/protos.json +++ b/packages/google-cloud-documentai/protos/protos.json @@ -155,6 +155,10 @@ "fontSize": { "type": "FontSize", "id": 7 + }, + "fontFamily": { + "type": "string", + "id": 8 } }, "nested": { @@ -245,9 +249,16 @@ "type": "DetectedBarcode", "id": 15 }, + "imageQualityScores": { + "type": "ImageQualityScores", + "id": 17 + }, "provenance": { "type": "Provenance", - "id": 16 + "id": 16, + "options": { + "deprecated": true + } } }, "nested": { @@ -351,7 +362,10 @@ }, "provenance": { "type": "Provenance", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } } } }, @@ -368,7 +382,10 @@ }, "provenance": { "type": "Provenance", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } } } }, @@ -385,7 +402,10 @@ }, "provenance": { "type": "Provenance", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } } } }, @@ -406,7 +426,10 @@ }, "provenance": { "type": "Provenance", - "id": 4 + "id": 4, + "options": { + "deprecated": true + } } }, "nested": { @@ -480,6 +503,10 @@ "rule": "repeated", "type": "DetectedLanguage", "id": 4 + }, + "provenance": { + "type": "Provenance", + "id": 5 } }, "nested": { @@ -576,6 +603,33 @@ "id": 2 } } + }, + "ImageQualityScores": { + "fields": { + "qualityScore": { + "type": "float", + "id": 1 + }, + "detectedDefects": { + "rule": "repeated", + "type": "DetectedDefect", + "id": 2 + } + }, + "nested": { + "DetectedDefect": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + } + } } } }, @@ -951,7 +1005,10 @@ "provenance": { "rule": "repeated", "type": "Provenance", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } } } } @@ -1076,6 +1133,10 @@ "gcsUri": { "type": "string", "id": 1 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 } } } @@ -2215,6 +2276,10 @@ "type": "string", "id": 2 }, + "documentSchema": { + "type": "DocumentSchema", + "id": 12 + }, "state": { "type": "State", "id": 6 @@ -7939,9 +8004,6 @@ } } }, - "Empty": { - "fields": {} - }, "FieldMask": { "fields": { "paths": { @@ -7950,6 +8012,9 @@ "id": 1 } } + }, + "Empty": { + "fields": {} } } }, diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js index f32cd03e0f0..dfcb92d5a7d 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js @@ -52,6 +52,8 @@ function main(name) { // const skipHumanReview = true /** * Specifies which fields to include in ProcessResponse's document. + * Only supports top level document and pages field so it must be in the form + * of `{document_field_name}` or `pages.{page_field_name}`. */ // const fieldMask = {} diff --git a/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json b/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json index cf16eb5ab44..75bac43037d 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json +++ b/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata.google.cloud.documentai.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 77, "type": "FULL" } ], diff --git a/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts b/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts index 521d68f6bbb..33fffdda1f0 100644 --- a/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts +++ b/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts @@ -576,6 +576,8 @@ export class DocumentProcessorServiceClient { * false. * @param {google.protobuf.FieldMask} request.fieldMask * Specifies which fields to include in ProcessResponse's document. + * Only supports top level document and pages field so it must be in the form + * of `{document_field_name}` or `pages.{page_field_name}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array.