diff --git a/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto index 56b06af5b79..635bfdb6558 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto +++ b/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/document_service_request.proto @@ -204,7 +204,7 @@ message SearchDocumentsRequest { // // * Histogram facet (aka filterable properties): Facet names with format // <schema id>.<facet>. Facets will have the - // format of: [a-zA-Z][a-zA-Z0-9_:/-.]. If the facet is a child + // format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child // facet, then the parent hierarchy needs to be specified separated by // dots in the prefix after the schema id. Thus, the format for a multi- // level facet is: <schema id>.<parent facet name>. diff --git a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto index 28e588d6c6e..bb841771ade 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/barcode.proto +++ b/packages/google-cloud-contentwarehouse/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-contentwarehouse/protos/google/cloud/documentai/v1/document.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document.proto index d8bbf6b574d..c4fbb21ceca 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document.proto +++ b/packages/google-cloud-contentwarehouse/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-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto index 17630a03592..3240d494e8f 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_io.proto +++ b/packages/google-cloud-contentwarehouse/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-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto index 9c944f259a0..e748ae1f748 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto +++ b/packages/google-cloud-contentwarehouse/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-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto index 24bd42285d9..ceb25a1d69a 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_schema.proto +++ b/packages/google-cloud-contentwarehouse/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-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto index b7eb95ef3f5..3ffe6927df9 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor.proto +++ b/packages/google-cloud-contentwarehouse/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-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto index dd5ef470011..2c9ee923051 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/processor_type.proto +++ b/packages/google-cloud-contentwarehouse/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-contentwarehouse/protos/protos.d.ts b/packages/google-cloud-contentwarehouse/protos/protos.d.ts index b66f07b16d6..f8781b5cb86 100644 --- a/packages/google-cloud-contentwarehouse/protos/protos.d.ts +++ b/packages/google-cloud-contentwarehouse/protos/protos.d.ts @@ -11567,6 +11567,9 @@ export namespace google { /** Style fontSize */ fontSize?: (google.cloud.documentai.v1.Document.Style.IFontSize|null); + + /** Style fontFamily */ + fontFamily?: (string|null); } /** Represents a Style. */ @@ -11599,6 +11602,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 @@ -11831,6 +11837,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); } @@ -11889,6 +11898,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); @@ -13217,6 +13229,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. */ @@ -13240,6 +13255,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 @@ -13877,6 +13895,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. */ diff --git a/packages/google-cloud-contentwarehouse/protos/protos.js b/packages/google-cloud-contentwarehouse/protos/protos.js index 7d4eb85f0a5..6bfcc216d35 100644 --- a/packages/google-cloud-contentwarehouse/protos/protos.js +++ b/packages/google-cloud-contentwarehouse/protos/protos.js @@ -27885,6 +27885,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 */ /** @@ -27958,6 +27959,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 @@ -27996,6 +28005,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; }; @@ -28058,6 +28069,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; @@ -28122,6 +28137,9 @@ if (error) return "fontSize." + error; } + if (message.fontFamily != null && message.hasOwnProperty("fontFamily")) + if (!$util.isString(message.fontFamily)) + return "fontFamily: string expected"; return null; }; @@ -28163,6 +28181,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; }; @@ -28187,6 +28207,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); @@ -28202,6 +28223,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; }; @@ -28482,6 +28505,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 */ @@ -28631,6 +28655,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 @@ -28706,6 +28738,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; }; @@ -28822,6 +28856,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; @@ -28978,6 +29016,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) @@ -29125,6 +29168,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"); @@ -29165,6 +29213,7 @@ object.layout = null; object.image = null; object.provenance = null; + object.imageQualityScores = null; } if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) object.pageNumber = message.pageNumber; @@ -29231,6 +29280,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; }; @@ -32357,6 +32408,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 */ /** @@ -32409,6 +32461,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 @@ -32444,6 +32504,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; }; @@ -32500,6 +32562,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; @@ -32567,6 +32633,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; }; @@ -32617,6 +32688,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; }; @@ -32638,8 +32714,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) { @@ -32657,6 +32735,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; }; @@ -34101,6 +34181,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; })(); diff --git a/packages/google-cloud-contentwarehouse/protos/protos.json b/packages/google-cloud-contentwarehouse/protos/protos.json index 2cbf9a759c3..86463c3306c 100644 --- a/packages/google-cloud-contentwarehouse/protos/protos.json +++ b/packages/google-cloud-contentwarehouse/protos/protos.json @@ -2636,6 +2636,10 @@ "fontSize": { "type": "FontSize", "id": 7 + }, + "fontFamily": { + "type": "string", + "id": 8 } }, "nested": { @@ -2726,9 +2730,16 @@ "type": "DetectedBarcode", "id": 15 }, + "imageQualityScores": { + "type": "ImageQualityScores", + "id": 17 + }, "provenance": { "type": "Provenance", - "id": 16 + "id": 16, + "options": { + "deprecated": true + } } }, "nested": { @@ -2832,7 +2843,10 @@ }, "provenance": { "type": "Provenance", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } } } }, @@ -2849,7 +2863,10 @@ }, "provenance": { "type": "Provenance", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } } } }, @@ -2866,7 +2883,10 @@ }, "provenance": { "type": "Provenance", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } } } }, @@ -2887,7 +2907,10 @@ }, "provenance": { "type": "Provenance", - "id": 4 + "id": 4, + "options": { + "deprecated": true + } } }, "nested": { @@ -2961,6 +2984,10 @@ "rule": "repeated", "type": "DetectedLanguage", "id": 4 + }, + "provenance": { + "type": "Provenance", + "id": 5 } }, "nested": { @@ -3057,6 +3084,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 + } + } + } + } } } }, @@ -3432,7 +3486,10 @@ "provenance": { "rule": "repeated", "type": "Provenance", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } } } } diff --git a/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js b/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js index 4fa0453662e..b98b2b52310 100644 --- a/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js +++ b/packages/google-cloud-contentwarehouse/samples/generated/v1/document_service.search_documents.js @@ -88,7 +88,7 @@ function main(parent) { * Data types: * * Histogram facet (aka filterable properties): Facet names with format * <schema id>.<facet>. Facets will have the - * format of: a-zA-Z a-zA-Z0-9_:/-.. If the facet is a child + * format of: `[a-zA-Z][a-zA-Z0-9_:/-.]`. If the facet is a child * facet, then the parent hierarchy needs to be specified separated by * dots in the prefix after the schema id. Thus, the format for a multi- * level facet is: <schema id>.<parent facet name>. diff --git a/packages/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts b/packages/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts index 7ec8c73211d..9147fa8d2c1 100644 --- a/packages/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts +++ b/packages/google-cloud-contentwarehouse/src/v1/document_link_service_client.ts @@ -121,6 +121,9 @@ export class DocumentLinkServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts b/packages/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts index c2b70e00acd..8bc5837f998 100644 --- a/packages/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts +++ b/packages/google-cloud-contentwarehouse/src/v1/document_schema_service_client.ts @@ -121,6 +121,9 @@ export class DocumentSchemaServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-contentwarehouse/src/v1/document_service_client.ts b/packages/google-cloud-contentwarehouse/src/v1/document_service_client.ts index 9c98e02633e..d0203cda3e9 100644 --- a/packages/google-cloud-contentwarehouse/src/v1/document_service_client.ts +++ b/packages/google-cloud-contentwarehouse/src/v1/document_service_client.ts @@ -120,6 +120,9 @@ export class DocumentServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -1036,7 +1039,7 @@ export class DocumentServiceClient { * * * Histogram facet (aka filterable properties): Facet names with format * <schema id>.<facet>. Facets will have the - * format of: {@link a-zA-Z0-9_:/-.|a-zA-Z}. If the facet is a child + * format of: `{@link a-zA-Z0-9_:/-.|a-zA-Z}`. If the facet is a child * facet, then the parent hierarchy needs to be specified separated by * dots in the prefix after the schema id. Thus, the format for a multi- * level facet is: <schema id>.<parent facet name>. @@ -1213,7 +1216,7 @@ export class DocumentServiceClient { * * * Histogram facet (aka filterable properties): Facet names with format * <schema id>.<facet>. Facets will have the - * format of: {@link a-zA-Z0-9_:/-.|a-zA-Z}. If the facet is a child + * format of: `{@link a-zA-Z0-9_:/-.|a-zA-Z}`. If the facet is a child * facet, then the parent hierarchy needs to be specified separated by * dots in the prefix after the schema id. Thus, the format for a multi- * level facet is: <schema id>.<parent facet name>. @@ -1338,7 +1341,7 @@ export class DocumentServiceClient { * * * Histogram facet (aka filterable properties): Facet names with format * <schema id>.<facet>. Facets will have the - * format of: {@link a-zA-Z0-9_:/-.|a-zA-Z}. If the facet is a child + * format of: `{@link a-zA-Z0-9_:/-.|a-zA-Z}`. If the facet is a child * facet, then the parent hierarchy needs to be specified separated by * dots in the prefix after the schema id. Thus, the format for a multi- * level facet is: <schema id>.<parent facet name>. diff --git a/packages/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts b/packages/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts index 7ec82e1afe2..77978648c91 100644 --- a/packages/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts +++ b/packages/google-cloud-contentwarehouse/src/v1/rule_set_service_client.ts @@ -120,6 +120,9 @@ export class RuleSetServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; diff --git a/packages/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts b/packages/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts index 8b6d1986d8e..6c94eb168ba 100644 --- a/packages/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts +++ b/packages/google-cloud-contentwarehouse/src/v1/synonym_set_service_client.ts @@ -120,6 +120,9 @@ export class SynonymSetServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes;