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 c4fbb21ceca..680cf88282f 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 @@ -50,7 +50,8 @@ message Document { // Total number of shards. int64 shard_count = 2; - // The index of the first character in [Document.text][google.cloud.documentai.v1.Document.text] in the overall + // The index of the first character in + // [Document.text][google.cloud.documentai.v1.Document.text] in the overall // document global text. int64 text_offset = 3; } @@ -67,7 +68,8 @@ message Document { string unit = 2; } - // Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1.Document.text]. TextAnchor text_anchor = 1; // Text color. @@ -168,25 +170,31 @@ message Document { PAGE_LEFT = 4; } - // Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1.Document.text]. TextAnchor text_anchor = 1; - // 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]`. + // 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]`. float confidence = 2; - // The bounding polygon for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + // The bounding polygon for the + // [Layout][google.cloud.documentai.v1.Document.Page.Layout]. BoundingPoly bounding_poly = 3; - // Detected orientation for the [Layout][google.cloud.documentai.v1.Document.Page.Layout]. + // Detected orientation for the + // [Layout][google.cloud.documentai.v1.Document.Page.Layout]. Orientation orientation = 4; } // A block has a set of lines (collected into paragraphs) that have a // common line-spacing and orientation. message Block { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Block][google.cloud.documentai.v1.Document.Page.Block]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Block][google.cloud.documentai.v1.Document.Page.Block]. Layout layout = 1; // A list of detected languages together with confidence. @@ -198,7 +206,8 @@ message Document { // A collection of lines that a human would perceive as a paragraph. message Paragraph { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph]. Layout layout = 1; // A list of detected languages together with confidence. @@ -211,7 +220,8 @@ message Document { // A collection of tokens that a human would perceive as a line. // Does not cross column boundaries, can be horizontal, vertical, etc. message Line { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Line][google.cloud.documentai.v1.Document.Page.Line]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Line][google.cloud.documentai.v1.Document.Page.Line]. Layout layout = 1; // A list of detected languages together with confidence. @@ -223,7 +233,8 @@ message Document { // A detected token. message Token { - // Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token]. + // Detected break at the end of a + // [Token][google.cloud.documentai.v1.Document.Page.Token]. message DetectedBreak { // Enum to denote the type of break found. enum Type { @@ -244,10 +255,12 @@ message Document { Type type = 1; } - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Token][google.cloud.documentai.v1.Document.Page.Token]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Token][google.cloud.documentai.v1.Document.Page.Token]. Layout layout = 1; - // Detected break at the end of a [Token][google.cloud.documentai.v1.Document.Page.Token]. + // Detected break at the end of a + // [Token][google.cloud.documentai.v1.Document.Page.Token]. DetectedBreak detected_break = 2; // A list of detected languages together with confidence. @@ -259,7 +272,8 @@ message Document { // A detected symbol. message Symbol { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Symbol][google.cloud.documentai.v1.Document.Page.Symbol]. Layout layout = 1; // A list of detected languages together with confidence. @@ -269,10 +283,12 @@ message Document { // Detected non-text visual elements e.g. checkbox, signature etc. on the // page. message VisualElement { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. Layout layout = 1; - // Type of the [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. + // Type of the + // [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement]. string type = 2; // A list of detected languages together with confidence. @@ -289,7 +305,8 @@ message Document { // A cell representation inside the table. message TableCell { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell]. Layout layout = 1; // How many rows this cell spans. @@ -302,7 +319,8 @@ message Document { repeated DetectedLanguage detected_languages = 4; } - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [Table][google.cloud.documentai.v1.Document.Page.Table]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [Table][google.cloud.documentai.v1.Document.Page.Table]. Layout layout = 1; // Header rows of the table. @@ -320,11 +338,13 @@ message Document { // A form field detected on the page. message FormField { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. e.g. `Address`, `Email`, - // `Grand total`, `Phone number`, etc. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + // [FormField][google.cloud.documentai.v1.Document.Page.FormField] name. + // e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. Layout field_name = 1; - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the + // [FormField][google.cloud.documentai.v1.Document.Page.FormField] value. Layout field_value = 2; // A list of detected languages for name together with confidence. @@ -335,9 +355,10 @@ message Document { // If the value is non-textual, this field represents the type. Current // valid values are: - // - blank (this indicates the field_value is normal text) - // - "unfilled_checkbox" - // - "filled_checkbox" + // + // - blank (this indicates the `field_value` is normal text) + // - `unfilled_checkbox` + // - `filled_checkbox` string value_type = 5; // Created for Labeling UI to export key text. @@ -356,10 +377,12 @@ message Document { // A detected barcode. message DetectedBarcode { - // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + // [Layout][google.cloud.documentai.v1.Document.Page.Layout] for + // [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. Layout layout = 1; - // Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. + // Detailed barcode information of the + // [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode]. Barcode barcode = 2; } @@ -402,9 +425,11 @@ message Document { 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. + // 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. int32 page_number = 1; // Rendered image for this page. This image is preprocessed to remove any @@ -505,8 +530,8 @@ message Document { // Optional. An optional field to store a normalized string. // For some entity types, one of respective `structured_value` fields may // also be populated. Also not all the types of `structured_value` will be - // normalized. For example, some processors may not generate float - // or int normalized text by default. + // normalized. For example, some processors may not generate `float` + // or `integer` normalized text by default. // // Below are sample formats mapped to structured values. // @@ -517,7 +542,8 @@ message Document { } // Optional. Provenance of the entity. - // Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1.Document.text]. TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL]; // Required. Entity type from a schema e.g. `Address`. @@ -532,32 +558,35 @@ message Document { // 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 - // page where it was found. + // Optional. Represents the provenance of this entity wrt. the location on + // the page where it was found. PageAnchor page_anchor = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. Canonical id. This will be a unique value in the entity list // for this document. string id = 7 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Normalized entity value. Absent if the extracted value could not be - // converted or the type (e.g. address) is not supported for certain + // Optional. Normalized entity value. Absent if the extracted value could + // not be converted or the type (e.g. address) is not supported for certain // parsers. This field is also only populated for certain supported document // types. - NormalizedValue normalized_value = 9 [(google.api.field_behavior) = OPTIONAL]; + NormalizedValue normalized_value = 9 + [(google.api.field_behavior) = OPTIONAL]; - // Optional. Entities can be nested to form a hierarchical data structure representing - // the content in the document. + // Optional. Entities can be nested to form a hierarchical data structure + // representing the content in the document. repeated Entity properties = 10 [(google.api.field_behavior) = OPTIONAL]; // Optional. The history of this annotation. Provenance provenance = 11 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Whether the entity will be redacted for de-identification purposes. + // Optional. Whether the entity will be redacted for de-identification + // purposes. bool redacted = 12 [(google.api.field_behavior) = OPTIONAL]; } - // Relationship between [Entities][google.cloud.documentai.v1.Document.Entity]. + // Relationship between + // [Entities][google.cloud.documentai.v1.Document.Entity]. message EntityRelation { // Subject entity id. string subject_id = 1; @@ -569,21 +598,28 @@ message Document { string relation = 3; } - // Text reference indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. + // Text reference indexing into the + // [Document.text][google.cloud.documentai.v1.Document.text]. message TextAnchor { - // A text segment in the [Document.text][google.cloud.documentai.v1.Document.text]. The indices may be out of bounds - // which indicate that the text extends into another document shard for - // large sharded documents. See [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset] + // A text segment in the + // [Document.text][google.cloud.documentai.v1.Document.text]. The indices + // may be out of bounds which indicate that the text extends into another + // document shard for large sharded documents. See + // [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset] message TextSegment { - // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1.Document.text]. + // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + // start UTF-8 char index in the + // [Document.text][google.cloud.documentai.v1.Document.text]. int64 start_index = 1; - // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the + // [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment] + // half open end UTF-8 char index in the // [Document.text][google.cloud.documentai.v1.Document.text]. int64 end_index = 2; } - // The text segments from the [Document.text][google.cloud.documentai.v1.Document.text]. + // The text segments from the + // [Document.text][google.cloud.documentai.v1.Document.text]. repeated TextSegment text_segments = 1; // Contains the content of the text span so that users do @@ -592,9 +628,10 @@ message Document { string content = 2; } - // Referencing the visual context of the entity in the [Document.pages][google.cloud.documentai.v1.Document.pages]. - // Page anchors can be cross-page, consist of multiple bounding polygons and - // optionally reference specific layout element types. + // Referencing the visual context of the entity in the + // [Document.pages][google.cloud.documentai.v1.Document.pages]. Page anchors + // can be cross-page, consist of multiple bounding polygons and optionally + // reference specific layout element types. message PageAnchor { // Represents a weak reference to a page element within a document. message PageRef { @@ -603,47 +640,65 @@ message Document { // Layout Unspecified. LAYOUT_TYPE_UNSPECIFIED = 0; - // References a [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] element. + // References a + // [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] + // element. BLOCK = 1; - // References a [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] element. + // References a + // [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] + // element. PARAGRAPH = 2; - // References a [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. + // References a + // [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element. LINE = 3; - // References a [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] element. + // References a + // [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] + // element. TOKEN = 4; - // References a [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] element. + // References a + // [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] + // element. VISUAL_ELEMENT = 5; - // Refrrences a [Page.tables][google.cloud.documentai.v1.Document.Page.tables] element. + // Refrrences a + // [Page.tables][google.cloud.documentai.v1.Document.Page.tables] + // element. TABLE = 6; - // References a [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] element. + // References a + // [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] + // element. FORM_FIELD = 7; } - // Required. Index into the [Document.pages][google.cloud.documentai.v1.Document.pages] element, for example using - // [Document.pages][page_refs.page] to locate the related page element. - // This field is skipped when its value is the default 0. See + // Required. Index into the + // [Document.pages][google.cloud.documentai.v1.Document.pages] element, + // for example using + // `[Document.pages][page_refs.page]` to locate the related page element. + // This field is skipped when its value is the default `0`. See // https://developers.google.com/protocol-buffers/docs/proto3#json. int64 page = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The type of the layout element that is being referenced if any. + // Optional. The type of the layout element that is being referenced if + // any. LayoutType layout_type = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Deprecated. Use [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] instead. - string layout_id = 3 [ - deprecated = true, - (google.api.field_behavior) = OPTIONAL - ]; + // Optional. Deprecated. Use + // [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly] + // instead. + string layout_id = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - // Optional. Identifies the bounding polygon of a layout element on the page. + // 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]; } @@ -754,8 +809,9 @@ message Document { // This message is used for text changes aka. OCR corrections. message TextChange { // Provenance of the correction. - // Text anchor indexing into the [Document.text][google.cloud.documentai.v1.Document.text]. There can only be a - // single `TextAnchor.text_segments` element. If the start and + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1.Document.text]. There can + // only be a single `TextAnchor.text_segments` element. If the start and // end index of the text segment are the same, the text change is inserted // before that index. TextAnchor text_anchor = 1; @@ -790,22 +846,25 @@ message Document { // Optional. UTF-8 encoded text in reading order from the document. string text = 4 [(google.api.field_behavior) = OPTIONAL]; - // Placeholder. Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. - repeated Style text_styles = 5; + // Styles for the [Document.text][google.cloud.documentai.v1.Document.text]. + repeated Style text_styles = 5 [deprecated = true]; // Visual page layout for the [Document][google.cloud.documentai.v1.Document]. repeated Page pages = 6; - // A list of entities detected on [Document.text][google.cloud.documentai.v1.Document.text]. For document shards, - // entities in this list may cross shard boundaries. + // A list of entities detected on + // [Document.text][google.cloud.documentai.v1.Document.text]. For document + // shards, entities in this list may cross shard boundaries. repeated Entity entities = 7; - // Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities]. + // 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][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. + // 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_processor_service.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto index e748ae1f748..016d99a8edd 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 @@ -53,7 +53,8 @@ option (google.api.resource_definition) = { // structured information from unstructured or semi-structured documents. service DocumentProcessorService { option (google.api.default_host) = "documentai.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Processes a single document. rpc ProcessDocument(ProcessRequest) returns (ProcessResponse) { @@ -70,7 +71,8 @@ service DocumentProcessorService { // LRO endpoint to batch process many documents. The output is written // to Cloud Storage as JSON in the [Document] format. - rpc BatchProcessDocuments(BatchProcessRequest) returns (google.longrunning.Operation) { + rpc BatchProcessDocuments(BatchProcessRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/processors/*}:batchProcess" body: "*" @@ -88,7 +90,8 @@ service DocumentProcessorService { // Fetches processor types. Note that we do not use ListProcessorTypes here // because it is not paginated. - rpc FetchProcessorTypes(FetchProcessorTypesRequest) returns (FetchProcessorTypesResponse) { + rpc FetchProcessorTypes(FetchProcessorTypesRequest) + returns (FetchProcessorTypesResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes" }; @@ -96,7 +99,8 @@ service DocumentProcessorService { } // Lists the processor types that exist. - rpc ListProcessorTypes(ListProcessorTypesRequest) returns (ListProcessorTypesResponse) { + rpc ListProcessorTypes(ListProcessorTypesRequest) + returns (ListProcessorTypesResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/processorTypes" }; @@ -120,7 +124,8 @@ service DocumentProcessorService { } // Gets a processor version detail. - rpc GetProcessorVersion(GetProcessorVersionRequest) returns (ProcessorVersion) { + rpc GetProcessorVersion(GetProcessorVersionRequest) + returns (ProcessorVersion) { option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" }; @@ -128,7 +133,8 @@ service DocumentProcessorService { } // Lists all versions of a processor. - rpc ListProcessorVersions(ListProcessorVersionsRequest) returns (ListProcessorVersionsResponse) { + rpc ListProcessorVersions(ListProcessorVersionsRequest) + returns (ListProcessorVersionsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions" }; @@ -137,7 +143,8 @@ service DocumentProcessorService { // Deletes the processor version, all artifacts under the processor version // will be deleted. - rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) returns (google.longrunning.Operation) { + rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" }; @@ -149,7 +156,8 @@ service DocumentProcessorService { } // Deploys the processor version. - rpc DeployProcessorVersion(DeployProcessorVersionRequest) returns (google.longrunning.Operation) { + rpc DeployProcessorVersion(DeployProcessorVersionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy" body: "*" @@ -162,7 +170,8 @@ service DocumentProcessorService { } // Undeploys the processor version. - rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) returns (google.longrunning.Operation) { + rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy" body: "*" @@ -186,7 +195,8 @@ service DocumentProcessorService { // Deletes the processor, unloads all deployed model artifacts if it was // enabled and then deletes all artifacts associated with this processor. - rpc DeleteProcessor(DeleteProcessorRequest) returns (google.longrunning.Operation) { + rpc DeleteProcessor(DeleteProcessorRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/processors/*}" }; @@ -198,7 +208,8 @@ service DocumentProcessorService { } // Enables a processor - rpc EnableProcessor(EnableProcessorRequest) returns (google.longrunning.Operation) { + rpc EnableProcessor(EnableProcessorRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/processors/*}:enable" body: "*" @@ -210,7 +221,8 @@ service DocumentProcessorService { } // Disables a processor - rpc DisableProcessor(DisableProcessorRequest) returns (google.longrunning.Operation) { + rpc DisableProcessor(DisableProcessorRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/processors/*}:disable" body: "*" @@ -221,10 +233,13 @@ service DocumentProcessorService { }; } - // Set the default (active) version of a [Processor][google.cloud.documentai.v1.Processor] that will be used in - // [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] and + // Set the default (active) version of a + // [Processor][google.cloud.documentai.v1.Processor] that will be used in + // [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument] + // and // [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]. - rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) returns (google.longrunning.Operation) { + rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion" body: "*" @@ -237,7 +252,8 @@ service DocumentProcessorService { // Send a document for Human Review. The input document should be processed by // the specified processor. - rpc ReviewDocument(ReviewDocumentRequest) returns (google.longrunning.Operation) { + rpc ReviewDocument(ReviewDocumentRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument" body: "*" @@ -261,17 +277,19 @@ message ProcessRequest { RawDocument raw_document = 5; } - // Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] or + // Required. The resource name of the + // [Processor][google.cloud.documentai.v1.Processor] or // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] - // to use for processing. If a [Processor][google.cloud.documentai.v1.Processor] is specified, the server will use - // its [default version][google.cloud.documentai.v1.Processor.default_processor_version]. Format: - // `projects/{project}/locations/{location}/processors/{processor}`, or + // to use for processing. If a + // [Processor][google.cloud.documentai.v1.Processor] is specified, the server + // will use its [default + // version][google.cloud.documentai.v1.Processor.default_processor_version]. + // Format: `projects/{project}/locations/{location}/processors/{processor}`, + // or // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "*" - } + (google.api.resource_reference) = { type: "*" } ]; // Whether Human Review feature should be skipped for this request. Default to @@ -332,16 +350,15 @@ message ProcessResponse { // Request message for batch process document method. message BatchProcessRequest { - // Required. The resource name of [Processor][google.cloud.documentai.v1.Processor] or + // Required. The resource name of + // [Processor][google.cloud.documentai.v1.Processor] or // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. // Format: `projects/{project}/locations/{location}/processors/{processor}`, // or // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "*" - } + (google.api.resource_reference) = { type: "*" } ]; // The input documents for batch process. @@ -356,9 +373,7 @@ message BatchProcessRequest { } // Response message for batch process document method. -message BatchProcessResponse { - -} +message BatchProcessResponse {} // The long running operation metadata for batch process method. message BatchProcessMetadata { @@ -473,8 +488,8 @@ message ListProcessorTypesResponse { // Request message for list all processors belongs to a project. message ListProcessorsRequest { - // Required. The parent (project and location) which owns this collection of Processors. - // Format: `projects/{project}/locations/{location}` + // Required. The parent (project and location) which owns this collection of + // Processors. Format: `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -525,8 +540,9 @@ message GetProcessorVersionRequest { // Request message for list all processor versions belongs to a processor. message ListProcessorVersionsRequest { - // Required. The parent (project, location and processor) to list all versions. - // Format: `projects/{project}/locations/{location}/processors/{processor}` + // Required. The parent (project, location and processor) to list all + // versions. Format: + // `projects/{project}/locations/{location}/processors/{processor}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -582,9 +598,7 @@ message DeployProcessorVersionRequest { } // Response message for the deploy processor version method. -message DeployProcessorVersionResponse { - -} +message DeployProcessorVersionResponse {} // The long running operation metadata for deploy processor version method. message DeployProcessorVersionMetadata { @@ -604,9 +618,7 @@ message UndeployProcessorVersionRequest { } // Response message for the undeploy processor version method. -message UndeployProcessorVersionResponse { - -} +message UndeployProcessorVersionResponse {} // The long running operation metadata for the undeploy processor version // method. @@ -619,8 +631,8 @@ message UndeployProcessorVersionMetadata { // a regionalized backend service, and if the processor type is not available // on that region, the creation will fail. message CreateProcessorRequest { - // Required. The parent (project and location) under which to create the processor. - // Format: `projects/{project}/locations/{location}` + // Required. The parent (project and location) under which to create the + // processor. Format: `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -628,8 +640,9 @@ message CreateProcessorRequest { } ]; - // Required. The processor to be created, requires [processor_type] and [display_name] - // to be set. Also, the processor is under CMEK if CMEK fields are set. + // Required. The processor to be created, requires [processor_type] and + // [display_name] to be set. Also, the processor is under CMEK if CMEK fields + // are set. Processor processor = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -663,9 +676,7 @@ message EnableProcessorRequest { // Response message for the enable processor method. // Intentionally empty proto for adding fields in future. -message EnableProcessorResponse { - -} +message EnableProcessorResponse {} // The long running operation metadata for enable processor method. message EnableProcessorMetadata { @@ -686,9 +697,7 @@ message DisableProcessorRequest { // Response message for the disable processor method. // Intentionally empty proto for adding fields in future. -message DisableProcessorResponse { - -} +message DisableProcessorResponse {} // The long running operation metadata for disable processor method. message DisableProcessorMetadata { @@ -698,7 +707,9 @@ message DisableProcessorMetadata { // Request message for the set default processor version method. message SetDefaultProcessorVersionRequest { - // Required. The resource name of the [Processor][google.cloud.documentai.v1.Processor] to change default version. + // Required. The resource name of the + // [Processor][google.cloud.documentai.v1.Processor] to change default + // version. string processor = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -706,8 +717,9 @@ message SetDefaultProcessorVersionRequest { } ]; - // Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as default. - // Format: + // Required. The resource name of child + // [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as + // default. Format: // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` string default_processor_version = 2 [ (google.api.field_behavior) = REQUIRED, @@ -718,9 +730,7 @@ message SetDefaultProcessorVersionRequest { } // Response message for set default processor version method. -message SetDefaultProcessorVersionResponse { - -} +message SetDefaultProcessorVersionResponse {} // The long running operation metadata for set default processor version // method. @@ -747,8 +757,8 @@ message ReviewDocumentRequest { Document inline_document = 4; } - // Required. The resource name of the HumanReviewConfig that the document will be - // reviewed with. + // Required. The resource name of the HumanReviewConfig that the document will + // be reviewed with. string human_review_config = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { 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 ceb25a1d69a..679a6ee59e8 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 @@ -88,7 +88,7 @@ message DocumentSchema { // conventions: // // - *use `snake_casing`* - // - name matching is case-insensitive + // - name matching is case-sensitive // - Maximum 64 characters. // - Must start with a letter. // - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward 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 3ffe6927df9..ac599e987b6 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 @@ -46,9 +46,10 @@ message ProcessorVersion { google.protobuf.Timestamp deprecation_time = 1; // If set, the processor version that will be used as a replacement. - string replacement_processor_version = 2 [(google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - }]; + string replacement_processor_version = 2 + [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; } // The possible states of the processor version. @@ -171,10 +172,11 @@ message Processor { // The default processor version. string default_processor_version = 9 [(google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - }]; + type: "documentai.googleapis.com/ProcessorVersion" + }]; - // Output only. Immutable. The http endpoint that can be called to invoke processing. + // Output only. Immutable. The http endpoint that can be called to invoke + // processing. string process_endpoint = 6 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.field_behavior) = IMMUTABLE 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 2c9ee923051..a54274532cb 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 @@ -60,4 +60,7 @@ message ProcessorType { // Launch stage of the processor type google.api.LaunchStage launch_stage = 8; + + // A set of Cloud Storage URIs of sample documents for this processor. + repeated string sample_document_uris = 9; } diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto index 2ae46db8e24..89f4d2e2161 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto @@ -50,8 +50,9 @@ message Document { // Total number of shards. int64 shard_count = 2; - // The index of the first character in [Document.text][google.cloud.documentai.v1beta3.Document.text] in the overall - // document global text. + // The index of the first character in + // [Document.text][google.cloud.documentai.v1beta3.Document.text] in the + // overall document global text. int64 text_offset = 3; } @@ -67,7 +68,8 @@ message Document { string unit = 2; } - // Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. TextAnchor text_anchor = 1; // Text color. @@ -168,25 +170,31 @@ message Document { PAGE_LEFT = 4; } - // Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. TextAnchor text_anchor = 1; - // Confidence of the current [Layout][google.cloud.documentai.v1beta3.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]`. + // Confidence of the current + // [Layout][google.cloud.documentai.v1beta3.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]`. float confidence = 2; - // The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout]. + // The bounding polygon for the + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout]. BoundingPoly bounding_poly = 3; - // Detected orientation for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout]. + // Detected orientation for the + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout]. Orientation orientation = 4; } // A block has a set of lines (collected into paragraphs) that have a // common line-spacing and orientation. message Block { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Block][google.cloud.documentai.v1beta3.Document.Page.Block]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for + // [Block][google.cloud.documentai.v1beta3.Document.Page.Block]. Layout layout = 1; // A list of detected languages together with confidence. @@ -198,7 +206,8 @@ message Document { // A collection of lines that a human would perceive as a paragraph. message Paragraph { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for + // [Paragraph][google.cloud.documentai.v1beta3.Document.Page.Paragraph]. Layout layout = 1; // A list of detected languages together with confidence. @@ -211,7 +220,8 @@ message Document { // A collection of tokens that a human would perceive as a line. // Does not cross column boundaries, can be horizontal, vertical, etc. message Line { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Line][google.cloud.documentai.v1beta3.Document.Page.Line]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for + // [Line][google.cloud.documentai.v1beta3.Document.Page.Line]. Layout layout = 1; // A list of detected languages together with confidence. @@ -223,7 +233,8 @@ message Document { // A detected token. message Token { - // Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. + // Detected break at the end of a + // [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. message DetectedBreak { // Enum to denote the type of break found. enum Type { @@ -244,10 +255,12 @@ message Document { Type type = 1; } - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for + // [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. Layout layout = 1; - // Detected break at the end of a [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. + // Detected break at the end of a + // [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. DetectedBreak detected_break = 2; // A list of detected languages together with confidence. @@ -259,7 +272,8 @@ message Document { // A detected symbol. message Symbol { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for + // [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol]. Layout layout = 1; // A list of detected languages together with confidence. @@ -269,10 +283,12 @@ message Document { // Detected non-text visual elements e.g. checkbox, signature etc. on the // page. message VisualElement { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for + // [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement]. Layout layout = 1; - // Type of the [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement]. + // Type of the + // [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement]. string type = 2; // A list of detected languages together with confidence. @@ -289,7 +305,8 @@ message Document { // A cell representation inside the table. message TableCell { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for + // [TableCell][google.cloud.documentai.v1beta3.Document.Page.Table.TableCell]. Layout layout = 1; // How many rows this cell spans. @@ -302,7 +319,8 @@ message Document { repeated DetectedLanguage detected_languages = 4; } - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [Table][google.cloud.documentai.v1beta3.Document.Page.Table]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for + // [Table][google.cloud.documentai.v1beta3.Document.Page.Table]. Layout layout = 1; // Header rows of the table. @@ -320,11 +338,14 @@ message Document { // A form field detected on the page. message FormField { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] name. e.g. `Address`, `Email`, - // `Grand total`, `Phone number`, etc. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the + // [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] + // name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc. Layout field_name = 1; - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] value. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the + // [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] + // value. Layout field_value = 2; // A list of detected languages for name together with confidence. @@ -335,9 +356,10 @@ message Document { // If the value is non-textual, this field represents the type. Current // valid values are: - // - blank (this indicates the field_value is normal text) - // - "unfilled_checkbox" - // - "filled_checkbox" + // + // - blank (this indicates the `field_value` is normal text) + // - `unfilled_checkbox` + // - `filled_checkbox` string value_type = 5; // Created for Labeling UI to export key text. @@ -356,10 +378,12 @@ message Document { // A detected barcode. message DetectedBarcode { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode]. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for + // [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode]. Layout layout = 1; - // Detailed barcode information of the [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode]. + // Detailed barcode information of the + // [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode]. Barcode barcode = 2; } @@ -402,9 +426,11 @@ message Document { repeated DetectedDefect detected_defects = 2; } - // 1-based index for current [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent [Document][google.cloud.documentai.v1beta3.Document]. - // Useful when a page is taken out of a [Document][google.cloud.documentai.v1beta3.Document] for individual - // processing. + // 1-based index for current + // [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent + // [Document][google.cloud.documentai.v1beta3.Document]. Useful when a page + // is taken out of a [Document][google.cloud.documentai.v1beta3.Document] + // for individual processing. int32 page_number = 1; // Rendered image for this page. This image is preprocessed to remove any @@ -413,13 +439,15 @@ message Document { Image image = 13; // Transformation matrices that were applied to the original document image - // to produce [Page.image][google.cloud.documentai.v1beta3.Document.Page.image]. + // to produce + // [Page.image][google.cloud.documentai.v1beta3.Document.Page.image]. repeated Matrix transforms = 14; // Physical dimension of the page. Dimension dimension = 2; - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the page. + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the + // page. Layout layout = 3; // A list of detected languages together with confidence. @@ -505,8 +533,8 @@ message Document { // Optional. An optional field to store a normalized string. // For some entity types, one of respective `structured_value` fields may // also be populated. Also not all the types of `structured_value` will be - // normalized. For example, some processors may not generate float - // or int normalized text by default. + // normalized. For example, some processors may not generate `float` + // or `integer` normalized text by default. // // Below are sample formats mapped to structured values. // @@ -517,7 +545,8 @@ message Document { } // Optional. Provenance of the entity. - // Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL]; // Required. Entity type from a schema e.g. `Address`. @@ -532,32 +561,35 @@ message Document { // 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 - // page where it was found. + // Optional. Represents the provenance of this entity wrt. the location on + // the page where it was found. PageAnchor page_anchor = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. Canonical id. This will be a unique value in the entity list // for this document. string id = 7 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Normalized entity value. Absent if the extracted value could not be - // converted or the type (e.g. address) is not supported for certain + // Optional. Normalized entity value. Absent if the extracted value could + // not be converted or the type (e.g. address) is not supported for certain // parsers. This field is also only populated for certain supported document // types. - NormalizedValue normalized_value = 9 [(google.api.field_behavior) = OPTIONAL]; + NormalizedValue normalized_value = 9 + [(google.api.field_behavior) = OPTIONAL]; - // Optional. Entities can be nested to form a hierarchical data structure representing - // the content in the document. + // Optional. Entities can be nested to form a hierarchical data structure + // representing the content in the document. repeated Entity properties = 10 [(google.api.field_behavior) = OPTIONAL]; // Optional. The history of this annotation. Provenance provenance = 11 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Whether the entity will be redacted for de-identification purposes. + // Optional. Whether the entity will be redacted for de-identification + // purposes. bool redacted = 12 [(google.api.field_behavior) = OPTIONAL]; } - // Relationship between [Entities][google.cloud.documentai.v1beta3.Document.Entity]. + // Relationship between + // [Entities][google.cloud.documentai.v1beta3.Document.Entity]. message EntityRelation { // Subject entity id. string subject_id = 1; @@ -569,21 +601,28 @@ message Document { string relation = 3; } - // Text reference indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // Text reference indexing into the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. message TextAnchor { - // A text segment in the [Document.text][google.cloud.documentai.v1beta3.Document.text]. The indices may be out of bounds - // which indicate that the text extends into another document shard for - // large sharded documents. See [ShardInfo.text_offset][google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset] + // A text segment in the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. The + // indices may be out of bounds which indicate that the text extends into + // another document shard for large sharded documents. See + // [ShardInfo.text_offset][google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset] message TextSegment { - // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] start UTF-8 char index in the [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] + // start UTF-8 char index in the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. int64 start_index = 1; - // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] half open end UTF-8 char index in the + // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] + // half open end UTF-8 char index in the // [Document.text][google.cloud.documentai.v1beta3.Document.text]. int64 end_index = 2; } - // The text segments from the [Document.text][google.cloud.documentai.v1beta3.Document.text]. + // The text segments from the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. repeated TextSegment text_segments = 1; // Contains the content of the text span so that users do @@ -592,8 +631,9 @@ message Document { string content = 2; } - // Referencing the visual context of the entity in the [Document.pages][google.cloud.documentai.v1beta3.Document.pages]. - // Page anchors can be cross-page, consist of multiple bounding polygons and + // Referencing the visual context of the entity in the + // [Document.pages][google.cloud.documentai.v1beta3.Document.pages]. Page + // anchors can be cross-page, consist of multiple bounding polygons and // optionally reference specific layout element types. message PageAnchor { // Represents a weak reference to a page element within a document. @@ -603,47 +643,66 @@ message Document { // Layout Unspecified. LAYOUT_TYPE_UNSPECIFIED = 0; - // References a [Page.blocks][google.cloud.documentai.v1beta3.Document.Page.blocks] element. + // References a + // [Page.blocks][google.cloud.documentai.v1beta3.Document.Page.blocks] + // element. BLOCK = 1; - // References a [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs] element. + // References a + // [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs] + // element. PARAGRAPH = 2; - // References a [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines] element. + // References a + // [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines] + // element. LINE = 3; - // References a [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens] element. + // References a + // [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens] + // element. TOKEN = 4; - // References a [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements] element. + // References a + // [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements] + // element. VISUAL_ELEMENT = 5; - // Refrrences a [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables] element. + // Refrrences a + // [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables] + // element. TABLE = 6; - // References a [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields] element. + // References a + // [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields] + // element. FORM_FIELD = 7; } - // Required. Index into the [Document.pages][google.cloud.documentai.v1beta3.Document.pages] element, for example using - // [Document.pages][page_refs.page] to locate the related page element. - // This field is skipped when its value is the default 0. See + // Required. Index into the + // [Document.pages][google.cloud.documentai.v1beta3.Document.pages] + // element, for example using + // `[Document.pages][page_refs.page]` to locate the related page element. + // This field is skipped when its value is the default `0`. See // https://developers.google.com/protocol-buffers/docs/proto3#json. int64 page = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The type of the layout element that is being referenced if any. + // Optional. The type of the layout element that is being referenced if + // any. LayoutType layout_type = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Deprecated. Use [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] instead. - string layout_id = 3 [ - deprecated = true, - (google.api.field_behavior) = OPTIONAL - ]; + // Optional. Deprecated. Use + // [PageRef.bounding_poly][google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly] + // instead. + string layout_id = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - // Optional. Identifies the bounding polygon of a layout element on the page. + // 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]; } @@ -754,10 +813,11 @@ message Document { // This message is used for text changes aka. OCR corrections. message TextChange { // Provenance of the correction. - // Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. There can only be a - // single `TextAnchor.text_segments` element. If the start and - // end index of the text segment are the same, the text change is inserted - // before that index. + // Text anchor indexing into the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. There + // can only be a single `TextAnchor.text_segments` element. If the start + // and end index of the text segment are the same, the text change is + // inserted before that index. TextAnchor text_anchor = 1; // The text that replaces the text identified in the `text_anchor`. @@ -790,22 +850,27 @@ message Document { // Optional. UTF-8 encoded text in reading order from the document. string text = 4 [(google.api.field_behavior) = OPTIONAL]; - // Placeholder. Styles for the [Document.text][google.cloud.documentai.v1beta3.Document.text]. - repeated Style text_styles = 5; + // Styles for the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. + repeated Style text_styles = 5 [deprecated = true]; - // Visual page layout for the [Document][google.cloud.documentai.v1beta3.Document]. + // Visual page layout for the + // [Document][google.cloud.documentai.v1beta3.Document]. repeated Page pages = 6; - // A list of entities detected on [Document.text][google.cloud.documentai.v1beta3.Document.text]. For document shards, - // entities in this list may cross shard boundaries. + // A list of entities detected on + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. For + // document shards, entities in this list may cross shard boundaries. repeated Entity entities = 7; - // Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities]. + // Placeholder. Relationship among + // [Document.entities][google.cloud.documentai.v1beta3.Document.entities]. repeated EntityRelation entity_relations = 8; - // Placeholder. A list of text corrections made to [Document.text][google.cloud.documentai.v1beta3.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.v1beta3.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/v1beta3/document_io.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto index db905d07079..d6a7fb1c408 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto @@ -101,3 +101,10 @@ message DocumentOutputConfig { GcsOutputConfig gcs_output_config = 1; } } + +// Config for Document OCR. +message OcrConfig { + // Enables special handling for PDFs with existing text information. Results + // in better text extraction quality in such PDF inputs. + bool enable_native_pdf_parsing = 3; +} diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto index 34e3380413b..7561517ec0b 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto @@ -54,7 +54,8 @@ option (google.api.resource_definition) = { // structured information from unstructured or semi-structured documents. service DocumentProcessorService { option (google.api.default_host) = "documentai.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Processes a single document. rpc ProcessDocument(ProcessRequest) returns (ProcessResponse) { @@ -71,7 +72,8 @@ service DocumentProcessorService { // LRO endpoint to batch process many documents. The output is written // to Cloud Storage as JSON in the [Document] format. - rpc BatchProcessDocuments(BatchProcessRequest) returns (google.longrunning.Operation) { + rpc BatchProcessDocuments(BatchProcessRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess" body: "*" @@ -89,7 +91,8 @@ service DocumentProcessorService { // Fetches processor types. Note that we do not use ListProcessorTypes here // because it is not paginated. - rpc FetchProcessorTypes(FetchProcessorTypesRequest) returns (FetchProcessorTypesResponse) { + rpc FetchProcessorTypes(FetchProcessorTypesRequest) + returns (FetchProcessorTypesResponse) { option (google.api.http) = { get: "/v1beta3/{parent=projects/*/locations/*}:fetchProcessorTypes" }; @@ -97,7 +100,8 @@ service DocumentProcessorService { } // Lists the processor types that exist. - rpc ListProcessorTypes(ListProcessorTypesRequest) returns (ListProcessorTypesResponse) { + rpc ListProcessorTypes(ListProcessorTypesRequest) + returns (ListProcessorTypesResponse) { option (google.api.http) = { get: "/v1beta3/{parent=projects/*/locations/*}/processorTypes" }; @@ -123,7 +127,8 @@ service DocumentProcessorService { // Trains a new processor version. // Operation metadata is returned as // cloud_documentai_core.TrainProcessorVersionMetadata. - rpc TrainProcessorVersion(TrainProcessorVersionRequest) returns (google.longrunning.Operation) { + rpc TrainProcessorVersion(TrainProcessorVersionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:train" body: "*" @@ -136,7 +141,8 @@ service DocumentProcessorService { } // Gets a processor version detail. - rpc GetProcessorVersion(GetProcessorVersionRequest) returns (ProcessorVersion) { + rpc GetProcessorVersion(GetProcessorVersionRequest) + returns (ProcessorVersion) { option (google.api.http) = { get: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}" }; @@ -144,7 +150,8 @@ service DocumentProcessorService { } // Lists all versions of a processor. - rpc ListProcessorVersions(ListProcessorVersionsRequest) returns (ListProcessorVersionsResponse) { + rpc ListProcessorVersions(ListProcessorVersionsRequest) + returns (ListProcessorVersionsResponse) { option (google.api.http) = { get: "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions" }; @@ -153,7 +160,8 @@ service DocumentProcessorService { // Deletes the processor version, all artifacts under the processor version // will be deleted. - rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) returns (google.longrunning.Operation) { + rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}" }; @@ -165,7 +173,8 @@ service DocumentProcessorService { } // Deploys the processor version. - rpc DeployProcessorVersion(DeployProcessorVersionRequest) returns (google.longrunning.Operation) { + rpc DeployProcessorVersion(DeployProcessorVersionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy" body: "*" @@ -178,7 +187,8 @@ service DocumentProcessorService { } // Undeploys the processor version. - rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) returns (google.longrunning.Operation) { + rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy" body: "*" @@ -202,7 +212,8 @@ service DocumentProcessorService { // Deletes the processor, unloads all deployed model artifacts if it was // enabled and then deletes all artifacts associated with this processor. - rpc DeleteProcessor(DeleteProcessorRequest) returns (google.longrunning.Operation) { + rpc DeleteProcessor(DeleteProcessorRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta3/{name=projects/*/locations/*/processors/*}" }; @@ -214,7 +225,8 @@ service DocumentProcessorService { } // Enables a processor - rpc EnableProcessor(EnableProcessorRequest) returns (google.longrunning.Operation) { + rpc EnableProcessor(EnableProcessorRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta3/{name=projects/*/locations/*/processors/*}:enable" body: "*" @@ -226,7 +238,8 @@ service DocumentProcessorService { } // Disables a processor - rpc DisableProcessor(DisableProcessorRequest) returns (google.longrunning.Operation) { + rpc DisableProcessor(DisableProcessorRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta3/{name=projects/*/locations/*/processors/*}:disable" body: "*" @@ -237,10 +250,13 @@ service DocumentProcessorService { }; } - // Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in - // [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and + // Set the default (active) version of a + // [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in + // [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] + // and // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. - rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) returns (google.longrunning.Operation) { + rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion" body: "*" @@ -253,7 +269,8 @@ service DocumentProcessorService { // Send a document for Human Review. The input document should be processed by // the specified processor. - rpc ReviewDocument(ReviewDocumentRequest) returns (google.longrunning.Operation) { + rpc ReviewDocument(ReviewDocumentRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument" body: "*" @@ -267,7 +284,8 @@ service DocumentProcessorService { // Evaluates a ProcessorVersion against annotated documents, producing an // Evaluation. - rpc EvaluateProcessorVersion(EvaluateProcessorVersionRequest) returns (google.longrunning.Operation) { + rpc EvaluateProcessorVersion(EvaluateProcessorVersionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion" body: "*" @@ -288,7 +306,8 @@ service DocumentProcessorService { } // Retrieves a set of evaluations for a given processor version. - rpc ListEvaluations(ListEvaluationsRequest) returns (ListEvaluationsResponse) { + rpc ListEvaluations(ListEvaluationsRequest) + returns (ListEvaluationsResponse) { option (google.api.http) = { get: "/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations" }; @@ -296,6 +315,13 @@ service DocumentProcessorService { } } +// Options for Process API +message ProcessOptions { + // Only applicable to "Document OCR Processor". Returns error if set on other + // processor types. + OcrConfig ocr_config = 1; +} + // Request message for the process document method. message ProcessRequest { // The document payload. @@ -307,17 +333,19 @@ message ProcessRequest { RawDocument raw_document = 5; } - // Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or + // Required. The resource name of the + // [Processor][google.cloud.documentai.v1beta3.Processor] or // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] - // to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use - // its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format: - // `projects/{project}/locations/{location}/processors/{processor}`, or + // to use for processing. If a + // [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the + // server will use its [default + // version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. + // Format: `projects/{project}/locations/{location}/processors/{processor}`, + // or // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "*" - } + (google.api.resource_reference) = { type: "*" } ]; // The document payload, the [content] and [mime_type] fields must be set. @@ -331,6 +359,9 @@ message ProcessRequest { // 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; + + // Inference-time options for the process API + ProcessOptions process_options = 7; } // The status of human review on a processed document. @@ -408,16 +439,15 @@ message BatchProcessRequest { string gcs_destination = 1; } - // Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or + // Required. The resource name of + // [Processor][google.cloud.documentai.v1beta3.Processor] or // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]. // Format: `projects/{project}/locations/{location}/processors/{processor}`, // or // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "*" - } + (google.api.resource_reference) = { type: "*" } ]; // The input config for each single document in the batch process. @@ -435,12 +465,13 @@ message BatchProcessRequest { // Whether Human Review feature should be skipped for this request. Default to // false. bool skip_human_review = 4; + + // Inference-time options for the process API + ProcessOptions process_options = 7; } // Response message for batch process document method. -message BatchProcessResponse { - -} +message BatchProcessResponse {} // The long running operation metadata for batch process method. message BatchProcessMetadata { @@ -561,8 +592,8 @@ message ListProcessorTypesResponse { // Request message for list all processors belongs to a project. message ListProcessorsRequest { - // Required. The parent (project and location) which owns this collection of Processors. - // Format: `projects/{project}/locations/{location}` + // Required. The parent (project and location) which owns this collection of + // Processors. Format: `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -613,8 +644,9 @@ message GetProcessorVersionRequest { // Request message for list all processor versions belongs to a processor. message ListProcessorVersionsRequest { - // Required. The parent (project, location and processor) to list all versions. - // Format: `projects/{project}/locations/{location}/processors/{processor}` + // Required. The parent (project, location and processor) to list all + // versions. Format: + // `projects/{project}/locations/{location}/processors/{processor}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -670,9 +702,7 @@ message DeployProcessorVersionRequest { } // Response message for the deploy processor version method. -message DeployProcessorVersionResponse { - -} +message DeployProcessorVersionResponse {} // The long running operation metadata for deploy processor version method. message DeployProcessorVersionMetadata { @@ -692,9 +722,7 @@ message UndeployProcessorVersionRequest { } // Response message for the undeploy processor version method. -message UndeployProcessorVersionResponse { - -} +message UndeployProcessorVersionResponse {} // The long running operation metadata for the undeploy processor version // method. @@ -707,8 +735,8 @@ message UndeployProcessorVersionMetadata { // a regionalized backend service, and if the processor type is not available // on that region, the creation will fail. message CreateProcessorRequest { - // Required. The parent (project and location) under which to create the processor. - // Format: `projects/{project}/locations/{location}` + // Required. The parent (project and location) under which to create the + // processor. Format: `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -716,8 +744,9 @@ message CreateProcessorRequest { } ]; - // Required. The processor to be created, requires [processor_type] and [display_name] - // to be set. Also, the processor is under CMEK if CMEK fields are set. + // Required. The processor to be created, requires [processor_type] and + // [display_name] to be set. Also, the processor is under CMEK if CMEK fields + // are set. Processor processor = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -751,9 +780,7 @@ message EnableProcessorRequest { // Response message for the enable processor method. // Intentionally empty proto for adding fields in future. -message EnableProcessorResponse { - -} +message EnableProcessorResponse {} // The long running operation metadata for enable processor method. message EnableProcessorMetadata { @@ -774,9 +801,7 @@ message DisableProcessorRequest { // Response message for the disable processor method. // Intentionally empty proto for adding fields in future. -message DisableProcessorResponse { - -} +message DisableProcessorResponse {} // The long running operation metadata for disable processor method. message DisableProcessorMetadata { @@ -786,7 +811,9 @@ message DisableProcessorMetadata { // Request message for the set default processor version method. message SetDefaultProcessorVersionRequest { - // Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version. + // Required. The resource name of the + // [Processor][google.cloud.documentai.v1beta3.Processor] to change default + // version. string processor = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -794,8 +821,9 @@ message SetDefaultProcessorVersionRequest { } ]; - // Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default. - // Format: + // Required. The resource name of child + // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use + // as default. Format: // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` string default_processor_version = 2 [ (google.api.field_behavior) = REQUIRED, @@ -806,9 +834,7 @@ message SetDefaultProcessorVersionRequest { } // Response message for set default processor version method. -message SetDefaultProcessorVersionResponse { - -} +message SetDefaultProcessorVersionResponse {} // The long running operation metadata for set default processor version // method. @@ -828,8 +854,9 @@ message TrainProcessorVersionRequest { BatchDocumentsInputConfig test_documents = 4; } - // Required. The parent (project, location and processor) to create the new version for. - // Format: `projects/{project}/locations/{location}/processors/{processor}`. + // Required. The parent (project, location and processor) to create the new + // version for. Format: + // `projects/{project}/locations/{location}/processors/{processor}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -838,7 +865,8 @@ message TrainProcessorVersionRequest { ]; // Required. The processor version to be created. - ProcessorVersion processor_version = 2 [(google.api.field_behavior) = REQUIRED]; + ProcessorVersion processor_version = 2 + [(google.api.field_behavior) = REQUIRED]; // Optional. The schema the processor version will be trained with. DocumentSchema document_schema = 10 [(google.api.field_behavior) = OPTIONAL]; @@ -846,8 +874,8 @@ message TrainProcessorVersionRequest { // Optional. The input data used to train the `ProcessorVersion`. InputData input_data = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The processor version to use as a base for training. This processor version - // must be a child of `parent`. Format: + // Optional. The processor version to use as a base for training. This + // processor version must be a child of `parent`. Format: // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. string base_processor_version = 8 [(google.api.field_behavior) = OPTIONAL]; } @@ -908,8 +936,8 @@ message ReviewDocumentRequest { Document inline_document = 4; } - // Required. The resource name of the HumanReviewConfig that the document will be - // reviewed with. + // Required. The resource name of the HumanReviewConfig that the document will + // be reviewed with. string human_review_config = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1000,7 +1028,9 @@ message ReviewDocumentOperationMetadata { // Evaluates the given ProcessorVersion against the supplied documents. message EvaluateProcessorVersionRequest { - // Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to evaluate. + // Required. The resource name of the + // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to + // evaluate. // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` string processor_version = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1009,9 +1039,10 @@ message EvaluateProcessorVersionRequest { } ]; - // Optional. The documents used in the evaluation. If unspecified, use the processor's - // dataset as evaluation input. - BatchDocumentsInputConfig evaluation_documents = 3 [(google.api.field_behavior) = OPTIONAL]; + // Optional. The documents used in the evaluation. If unspecified, use the + // processor's dataset as evaluation input. + BatchDocumentsInputConfig evaluation_documents = 3 + [(google.api.field_behavior) = OPTIONAL]; } // Metadata of the EvaluateProcessorVersion method. @@ -1028,7 +1059,8 @@ message EvaluateProcessorVersionResponse { // Retrieves a specific Evaluation. message GetEvaluationRequest { - // Required. The resource name of the [Evaluation][google.cloud.documentai.v1beta3.Evaluation] to get. + // Required. The resource name of the + // [Evaluation][google.cloud.documentai.v1beta3.Evaluation] to get. // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` string name = 1 [ (google.api.field_behavior) = REQUIRED, @@ -1040,7 +1072,9 @@ message GetEvaluationRequest { // Retrieves a list of evaluations for a given ProcessorVersion. message ListEvaluationsRequest { - // Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to list evaluations for. + // Required. The resource name of the + // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to + // list evaluations for. // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto index 1e29f7c89d9..5a470dfa162 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto @@ -88,7 +88,7 @@ message DocumentSchema { // conventions: // // - *use `snake_casing`* - // - name matching is case-insensitive + // - name matching is case-sensitive // - Maximum 64 characters. // - Must start with a letter. // - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto index db13e89defa..970e2b97969 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto @@ -46,9 +46,10 @@ message ProcessorVersion { google.protobuf.Timestamp deprecation_time = 1; // If set, the processor version that will be used as a replacement. - string replacement_processor_version = 2 [(google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - }]; + string replacement_processor_version = 2 + [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; } // The possible states of the processor version. @@ -171,10 +172,11 @@ message Processor { // The default processor version. string default_processor_version = 9 [(google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - }]; + type: "documentai.googleapis.com/ProcessorVersion" + }]; - // Output only. Immutable. The http endpoint that can be called to invoke processing. + // Output only. Immutable. The http endpoint that can be called to invoke + // processing. string process_endpoint = 6 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.field_behavior) = IMMUTABLE diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto index 9afbf04d481..1d9f6fa3a7d 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto @@ -60,4 +60,7 @@ message ProcessorType { // Launch stage of the processor type google.api.LaunchStage launch_stage = 8; + + // A set of Cloud Storage URIs of sample documents for this processor. + repeated string sample_document_uris = 9; } diff --git a/packages/google-cloud-documentai/protos/protos.d.ts b/packages/google-cloud-documentai/protos/protos.d.ts index 7b6d5593255..f14e7a02b0c 100644 --- a/packages/google-cloud-documentai/protos/protos.d.ts +++ b/packages/google-cloud-documentai/protos/protos.d.ts @@ -11188,6 +11188,9 @@ export namespace google { /** ProcessorType launchStage */ launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ProcessorType sampleDocumentUris */ + sampleDocumentUris?: (string[]|null); } /** Represents a ProcessorType. */ @@ -11217,6 +11220,9 @@ export namespace google { /** ProcessorType launchStage. */ public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + /** ProcessorType sampleDocumentUris. */ + public sampleDocumentUris: string[]; + /** * Creates a new ProcessorType instance using the specified properties. * @param [properties] Properties to set @@ -26398,6 +26404,103 @@ export namespace google { } } + /** Properties of an OcrConfig. */ + interface IOcrConfig { + + /** OcrConfig enableNativePdfParsing */ + enableNativePdfParsing?: (boolean|null); + } + + /** Represents an OcrConfig. */ + class OcrConfig implements IOcrConfig { + + /** + * Constructs a new OcrConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IOcrConfig); + + /** OcrConfig enableNativePdfParsing. */ + public enableNativePdfParsing: boolean; + + /** + * Creates a new OcrConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OcrConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IOcrConfig): google.cloud.documentai.v1beta3.OcrConfig; + + /** + * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. + * @param message OcrConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. + * @param message OcrConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OcrConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OcrConfig + * @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.v1beta3.OcrConfig; + + /** + * Decodes an OcrConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OcrConfig + * @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.v1beta3.OcrConfig; + + /** + * Verifies an OcrConfig 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 OcrConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OcrConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.OcrConfig; + + /** + * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. + * @param message OcrConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.OcrConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OcrConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OcrConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a DocumentProcessorService */ class DocumentProcessorService extends $protobuf.rpc.Service { @@ -26863,6 +26966,103 @@ export namespace google { type ListEvaluationsCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListEvaluationsResponse) => void; } + /** Properties of a ProcessOptions. */ + interface IProcessOptions { + + /** ProcessOptions ocrConfig */ + ocrConfig?: (google.cloud.documentai.v1beta3.IOcrConfig|null); + } + + /** Represents a ProcessOptions. */ + class ProcessOptions implements IProcessOptions { + + /** + * Constructs a new ProcessOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IProcessOptions); + + /** ProcessOptions ocrConfig. */ + public ocrConfig?: (google.cloud.documentai.v1beta3.IOcrConfig|null); + + /** + * Creates a new ProcessOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessOptions instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IProcessOptions): google.cloud.documentai.v1beta3.ProcessOptions; + + /** + * Encodes the specified ProcessOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. + * @param message ProcessOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IProcessOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. + * @param message ProcessOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessOptions + * @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.v1beta3.ProcessOptions; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessOptions + * @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.v1beta3.ProcessOptions; + + /** + * Verifies a ProcessOptions 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 ProcessOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessOptions; + + /** + * Creates a plain object from a ProcessOptions message. Also converts values to other types if specified. + * @param message ProcessOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ProcessRequest. */ interface IProcessRequest { @@ -26883,6 +27083,9 @@ export namespace google { /** ProcessRequest fieldMask */ fieldMask?: (google.protobuf.IFieldMask|null); + + /** ProcessRequest processOptions */ + processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); } /** Represents a ProcessRequest. */ @@ -26912,6 +27115,9 @@ export namespace google { /** ProcessRequest fieldMask. */ public fieldMask?: (google.protobuf.IFieldMask|null); + /** ProcessRequest processOptions. */ + public processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); + /** ProcessRequest source. */ public source?: ("inlineDocument"|"rawDocument"); @@ -27243,6 +27449,9 @@ export namespace google { /** BatchProcessRequest skipHumanReview */ skipHumanReview?: (boolean|null); + + /** BatchProcessRequest processOptions */ + processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); } /** Represents a BatchProcessRequest. */ @@ -27272,6 +27481,9 @@ export namespace google { /** BatchProcessRequest skipHumanReview. */ public skipHumanReview: boolean; + /** BatchProcessRequest processOptions. */ + public processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); + /** * Creates a new BatchProcessRequest instance using the specified properties. * @param [properties] Properties to set @@ -34203,6 +34415,9 @@ export namespace google { /** ProcessorType launchStage */ launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ProcessorType sampleDocumentUris */ + sampleDocumentUris?: (string[]|null); } /** Represents a ProcessorType. */ @@ -34232,6 +34447,9 @@ export namespace google { /** ProcessorType launchStage. */ public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + /** ProcessorType sampleDocumentUris. */ + public sampleDocumentUris: string[]; + /** * Creates a new ProcessorType instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-documentai/protos/protos.js b/packages/google-cloud-documentai/protos/protos.js index 24edb0743e3..59e7d476aef 100644 --- a/packages/google-cloud-documentai/protos/protos.js +++ b/packages/google-cloud-documentai/protos/protos.js @@ -27247,6 +27247,7 @@ * @property {Array.|null} [availableLocations] ProcessorType availableLocations * @property {boolean|null} [allowCreation] ProcessorType allowCreation * @property {google.api.LaunchStage|null} [launchStage] ProcessorType launchStage + * @property {Array.|null} [sampleDocumentUris] ProcessorType sampleDocumentUris */ /** @@ -27259,6 +27260,7 @@ */ function ProcessorType(properties) { this.availableLocations = []; + this.sampleDocumentUris = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27313,6 +27315,14 @@ */ ProcessorType.prototype.launchStage = 0; + /** + * ProcessorType sampleDocumentUris. + * @member {Array.} sampleDocumentUris + * @memberof google.cloud.documentai.v1.ProcessorType + * @instance + */ + ProcessorType.prototype.sampleDocumentUris = $util.emptyArray; + /** * Creates a new ProcessorType instance using the specified properties. * @function create @@ -27350,6 +27360,9 @@ writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowCreation); if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.launchStage); + if (message.sampleDocumentUris != null && message.sampleDocumentUris.length) + for (var i = 0; i < message.sampleDocumentUris.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.sampleDocumentUris[i]); return writer; }; @@ -27410,6 +27423,12 @@ message.launchStage = reader.int32(); break; } + case 9: { + if (!(message.sampleDocumentUris && message.sampleDocumentUris.length)) + message.sampleDocumentUris = []; + message.sampleDocumentUris.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -27480,6 +27499,13 @@ case 5: break; } + if (message.sampleDocumentUris != null && message.hasOwnProperty("sampleDocumentUris")) { + if (!Array.isArray(message.sampleDocumentUris)) + return "sampleDocumentUris: array expected"; + for (var i = 0; i < message.sampleDocumentUris.length; ++i) + if (!$util.isString(message.sampleDocumentUris[i])) + return "sampleDocumentUris: string[] expected"; + } return null; }; @@ -27553,6 +27579,13 @@ message.launchStage = 5; break; } + if (object.sampleDocumentUris) { + if (!Array.isArray(object.sampleDocumentUris)) + throw TypeError(".google.cloud.documentai.v1.ProcessorType.sampleDocumentUris: array expected"); + message.sampleDocumentUris = []; + for (var i = 0; i < object.sampleDocumentUris.length; ++i) + message.sampleDocumentUris[i] = String(object.sampleDocumentUris[i]); + } return message; }; @@ -27569,8 +27602,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.availableLocations = []; + object.sampleDocumentUris = []; + } if (options.defaults) { object.name = ""; object.type = ""; @@ -27593,6 +27628,11 @@ object.allowCreation = message.allowCreation; if (message.launchStage != null && message.hasOwnProperty("launchStage")) object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.sampleDocumentUris && message.sampleDocumentUris.length) { + object.sampleDocumentUris = []; + for (var j = 0; j < message.sampleDocumentUris.length; ++j) + object.sampleDocumentUris[j] = message.sampleDocumentUris[j]; + } return object; }; @@ -66108,6 +66148,209 @@ return DocumentOutputConfig; })(); + v1beta3.OcrConfig = (function() { + + /** + * Properties of an OcrConfig. + * @memberof google.cloud.documentai.v1beta3 + * @interface IOcrConfig + * @property {boolean|null} [enableNativePdfParsing] OcrConfig enableNativePdfParsing + */ + + /** + * Constructs a new OcrConfig. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an OcrConfig. + * @implements IOcrConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.IOcrConfig=} [properties] Properties to set + */ + function OcrConfig(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]]; + } + + /** + * OcrConfig enableNativePdfParsing. + * @member {boolean} enableNativePdfParsing + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.enableNativePdfParsing = false; + + /** + * Creates a new OcrConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {google.cloud.documentai.v1beta3.IOcrConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig instance + */ + OcrConfig.create = function create(properties) { + return new OcrConfig(properties); + }; + + /** + * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {google.cloud.documentai.v1beta3.IOcrConfig} message OcrConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OcrConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableNativePdfParsing != null && Object.hasOwnProperty.call(message, "enableNativePdfParsing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableNativePdfParsing); + return writer; + }; + + /** + * Encodes the specified OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {google.cloud.documentai.v1beta3.IOcrConfig} message OcrConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OcrConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OcrConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OcrConfig.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.v1beta3.OcrConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.enableNativePdfParsing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OcrConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OcrConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OcrConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OcrConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableNativePdfParsing != null && message.hasOwnProperty("enableNativePdfParsing")) + if (typeof message.enableNativePdfParsing !== "boolean") + return "enableNativePdfParsing: boolean expected"; + return null; + }; + + /** + * Creates an OcrConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig + */ + OcrConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.OcrConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.OcrConfig(); + if (object.enableNativePdfParsing != null) + message.enableNativePdfParsing = Boolean(object.enableNativePdfParsing); + return message; + }; + + /** + * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig} message OcrConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OcrConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableNativePdfParsing = false; + if (message.enableNativePdfParsing != null && message.hasOwnProperty("enableNativePdfParsing")) + object.enableNativePdfParsing = message.enableNativePdfParsing; + return object; + }; + + /** + * Converts this OcrConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + * @returns {Object.} JSON object + */ + OcrConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OcrConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OcrConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.OcrConfig"; + }; + + return OcrConfig; + })(); + v1beta3.DocumentProcessorService = (function() { /** @@ -66836,6 +67079,214 @@ return DocumentProcessorService; })(); + v1beta3.ProcessOptions = (function() { + + /** + * Properties of a ProcessOptions. + * @memberof google.cloud.documentai.v1beta3 + * @interface IProcessOptions + * @property {google.cloud.documentai.v1beta3.IOcrConfig|null} [ocrConfig] ProcessOptions ocrConfig + */ + + /** + * Constructs a new ProcessOptions. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ProcessOptions. + * @implements IProcessOptions + * @constructor + * @param {google.cloud.documentai.v1beta3.IProcessOptions=} [properties] Properties to set + */ + function ProcessOptions(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]]; + } + + /** + * ProcessOptions ocrConfig. + * @member {google.cloud.documentai.v1beta3.IOcrConfig|null|undefined} ocrConfig + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + ProcessOptions.prototype.ocrConfig = null; + + /** + * Creates a new ProcessOptions instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {google.cloud.documentai.v1beta3.IProcessOptions=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions instance + */ + ProcessOptions.create = function create(properties) { + return new ProcessOptions(properties); + }; + + /** + * Encodes the specified ProcessOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {google.cloud.documentai.v1beta3.IProcessOptions} message ProcessOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ocrConfig != null && Object.hasOwnProperty.call(message, "ocrConfig")) + $root.google.cloud.documentai.v1beta3.OcrConfig.encode(message.ocrConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {google.cloud.documentai.v1beta3.IProcessOptions} message ProcessOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessOptions.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.v1beta3.ProcessOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessOptions message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) { + var error = $root.google.cloud.documentai.v1beta3.OcrConfig.verify(message.ocrConfig); + if (error) + return "ocrConfig." + error; + } + return null; + }; + + /** + * Creates a ProcessOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions + */ + ProcessOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions(); + if (object.ocrConfig != null) { + if (typeof object.ocrConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.ocrConfig: object expected"); + message.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.fromObject(object.ocrConfig); + } + return message; + }; + + /** + * Creates a plain object from a ProcessOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions} message ProcessOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ocrConfig = null; + if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) + object.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.toObject(message.ocrConfig, options); + return object; + }; + + /** + * Converts this ProcessOptions to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + * @returns {Object.} JSON object + */ + ProcessOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessOptions + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions"; + }; + + return ProcessOptions; + })(); + v1beta3.ProcessRequest = (function() { /** @@ -66848,6 +67299,7 @@ * @property {google.cloud.documentai.v1beta3.IDocument|null} [document] ProcessRequest document * @property {boolean|null} [skipHumanReview] ProcessRequest skipHumanReview * @property {google.protobuf.IFieldMask|null} [fieldMask] ProcessRequest fieldMask + * @property {google.cloud.documentai.v1beta3.IProcessOptions|null} [processOptions] ProcessRequest processOptions */ /** @@ -66913,6 +67365,14 @@ */ ProcessRequest.prototype.fieldMask = null; + /** + * ProcessRequest processOptions. + * @member {google.cloud.documentai.v1beta3.IProcessOptions|null|undefined} processOptions + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.processOptions = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -66963,6 +67423,8 @@ $root.google.cloud.documentai.v1beta3.RawDocument.encode(message.rawDocument, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.processOptions != null && Object.hasOwnProperty.call(message, "processOptions")) + $root.google.cloud.documentai.v1beta3.ProcessOptions.encode(message.processOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -67021,6 +67483,10 @@ message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } + case 7: { + message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -67091,6 +67557,11 @@ if (error) return "fieldMask." + error; } + if (message.processOptions != null && message.hasOwnProperty("processOptions")) { + var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.verify(message.processOptions); + if (error) + return "processOptions." + error; + } return null; }; @@ -67130,6 +67601,11 @@ throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.fieldMask: object expected"); message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); } + if (object.processOptions != null) { + if (typeof object.processOptions !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.processOptions: object expected"); + message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.fromObject(object.processOptions); + } return message; }; @@ -67151,6 +67627,7 @@ object.document = null; object.skipHumanReview = false; object.fieldMask = null; + object.processOptions = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -67170,6 +67647,8 @@ } if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.processOptions != null && message.hasOwnProperty("processOptions")) + object.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.toObject(message.processOptions, options); return object; }; @@ -67778,6 +68257,7 @@ * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [inputDocuments] BatchProcessRequest inputDocuments * @property {google.cloud.documentai.v1beta3.IDocumentOutputConfig|null} [documentOutputConfig] BatchProcessRequest documentOutputConfig * @property {boolean|null} [skipHumanReview] BatchProcessRequest skipHumanReview + * @property {google.cloud.documentai.v1beta3.IProcessOptions|null} [processOptions] BatchProcessRequest processOptions */ /** @@ -67844,6 +68324,14 @@ */ BatchProcessRequest.prototype.skipHumanReview = false; + /** + * BatchProcessRequest processOptions. + * @member {google.cloud.documentai.v1beta3.IProcessOptions|null|undefined} processOptions + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.processOptions = null; + /** * Creates a new BatchProcessRequest instance using the specified properties. * @function create @@ -67881,6 +68369,8 @@ $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.inputDocuments, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.documentOutputConfig != null && Object.hasOwnProperty.call(message, "documentOutputConfig")) $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.encode(message.documentOutputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.processOptions != null && Object.hasOwnProperty.call(message, "processOptions")) + $root.google.cloud.documentai.v1beta3.ProcessOptions.encode(message.processOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -67941,6 +68431,10 @@ message.skipHumanReview = reader.bool(); break; } + case 7: { + message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -68006,6 +68500,11 @@ if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) if (typeof message.skipHumanReview !== "boolean") return "skipHumanReview: boolean expected"; + if (message.processOptions != null && message.hasOwnProperty("processOptions")) { + var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.verify(message.processOptions); + if (error) + return "processOptions." + error; + } return null; }; @@ -68050,6 +68549,11 @@ } if (object.skipHumanReview != null) message.skipHumanReview = Boolean(object.skipHumanReview); + if (object.processOptions != null) { + if (typeof object.processOptions !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.processOptions: object expected"); + message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.fromObject(object.processOptions); + } return message; }; @@ -68074,6 +68578,7 @@ object.skipHumanReview = false; object.inputDocuments = null; object.documentOutputConfig = null; + object.processOptions = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -68090,6 +68595,8 @@ object.inputDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.inputDocuments, options); if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) object.documentOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.toObject(message.documentOutputConfig, options); + if (message.processOptions != null && message.hasOwnProperty("processOptions")) + object.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.toObject(message.processOptions, options); return object; }; @@ -84261,6 +84768,7 @@ * @property {Array.|null} [availableLocations] ProcessorType availableLocations * @property {boolean|null} [allowCreation] ProcessorType allowCreation * @property {google.api.LaunchStage|null} [launchStage] ProcessorType launchStage + * @property {Array.|null} [sampleDocumentUris] ProcessorType sampleDocumentUris */ /** @@ -84273,6 +84781,7 @@ */ function ProcessorType(properties) { this.availableLocations = []; + this.sampleDocumentUris = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -84327,6 +84836,14 @@ */ ProcessorType.prototype.launchStage = 0; + /** + * ProcessorType sampleDocumentUris. + * @member {Array.} sampleDocumentUris + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @instance + */ + ProcessorType.prototype.sampleDocumentUris = $util.emptyArray; + /** * Creates a new ProcessorType instance using the specified properties. * @function create @@ -84364,6 +84881,9 @@ writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowCreation); if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.launchStage); + if (message.sampleDocumentUris != null && message.sampleDocumentUris.length) + for (var i = 0; i < message.sampleDocumentUris.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.sampleDocumentUris[i]); return writer; }; @@ -84424,6 +84944,12 @@ message.launchStage = reader.int32(); break; } + case 9: { + if (!(message.sampleDocumentUris && message.sampleDocumentUris.length)) + message.sampleDocumentUris = []; + message.sampleDocumentUris.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -84494,6 +85020,13 @@ case 5: break; } + if (message.sampleDocumentUris != null && message.hasOwnProperty("sampleDocumentUris")) { + if (!Array.isArray(message.sampleDocumentUris)) + return "sampleDocumentUris: array expected"; + for (var i = 0; i < message.sampleDocumentUris.length; ++i) + if (!$util.isString(message.sampleDocumentUris[i])) + return "sampleDocumentUris: string[] expected"; + } return null; }; @@ -84567,6 +85100,13 @@ message.launchStage = 5; break; } + if (object.sampleDocumentUris) { + if (!Array.isArray(object.sampleDocumentUris)) + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorType.sampleDocumentUris: array expected"); + message.sampleDocumentUris = []; + for (var i = 0; i < object.sampleDocumentUris.length; ++i) + message.sampleDocumentUris[i] = String(object.sampleDocumentUris[i]); + } return message; }; @@ -84583,8 +85123,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.availableLocations = []; + object.sampleDocumentUris = []; + } if (options.defaults) { object.name = ""; object.type = ""; @@ -84607,6 +85149,11 @@ object.allowCreation = message.allowCreation; if (message.launchStage != null && message.hasOwnProperty("launchStage")) object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.sampleDocumentUris && message.sampleDocumentUris.length) { + object.sampleDocumentUris = []; + for (var j = 0; j < message.sampleDocumentUris.length; ++j) + object.sampleDocumentUris[j] = message.sampleDocumentUris[j]; + } return object; }; diff --git a/packages/google-cloud-documentai/protos/protos.json b/packages/google-cloud-documentai/protos/protos.json index a0d6d65074f..6bce72d4cf1 100644 --- a/packages/google-cloud-documentai/protos/protos.json +++ b/packages/google-cloud-documentai/protos/protos.json @@ -73,7 +73,10 @@ "textStyles": { "rule": "repeated", "type": "Style", - "id": 5 + "id": 5, + "options": { + "deprecated": true + } }, "pages": { "rule": "repeated", @@ -2449,6 +2452,11 @@ "launchStage": { "type": "google.api.LaunchStage", "id": 8 + }, + "sampleDocumentUris": { + "rule": "repeated", + "type": "string", + "id": 9 } }, "nested": { @@ -4350,7 +4358,10 @@ "textStyles": { "rule": "repeated", "type": "Style", - "id": 5 + "id": 5, + "options": { + "deprecated": true + } }, "pages": { "rule": "repeated", @@ -5437,6 +5448,14 @@ } } }, + "OcrConfig": { + "fields": { + "enableNativePdfParsing": { + "type": "bool", + "id": 3 + } + } + }, "DocumentProcessorService": { "options": { "(google.api.default_host)": "documentai.googleapis.com", @@ -5933,6 +5952,14 @@ } } }, + "ProcessOptions": { + "fields": { + "ocrConfig": { + "type": "OcrConfig", + "id": 1 + } + } + }, "ProcessRequest": { "oneofs": { "source": { @@ -5973,6 +6000,10 @@ "fieldMask": { "type": "google.protobuf.FieldMask", "id": 6 + }, + "processOptions": { + "type": "ProcessOptions", + "id": 7 } } }, @@ -6058,6 +6089,10 @@ "skipHumanReview": { "type": "bool", "id": 4 + }, + "processOptions": { + "type": "ProcessOptions", + "id": 7 } }, "nested": { @@ -7260,6 +7295,11 @@ "launchStage": { "type": "google.api.LaunchStage", "id": 8 + }, + "sampleDocumentUris": { + "rule": "repeated", + "type": "string", + "id": 9 } }, "nested": { diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js index c099efd7b6c..73f9d4603cb 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js @@ -29,7 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of Processor google.cloud.documentai.v1.Processor or + * Required. The resource name of + * Processor google.cloud.documentai.v1.Processor or * ProcessorVersion google.cloud.documentai.v1.ProcessorVersion. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js index 24da55f864f..3f2b7311893 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js @@ -29,13 +29,14 @@ function main(parent, processor) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** - * Required. The processor to be created, requires processor_type and display_name - * to be set. Also, the processor is under CMEK if CMEK fields are set. + * Required. The processor to be created, requires processor_type and + * display_name to be set. Also, the processor is under CMEK if CMEK fields + * are set. */ // const processor = {} diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js index 490c0fb5038..8f62027c10c 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js @@ -29,8 +29,9 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js index 62b63c5ce60..5001e10f397 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** 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 dfcb92d5a7d..0e264c66c4a 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 @@ -37,11 +37,15 @@ function main(name) { */ // const rawDocument = {} /** - * Required. The resource name of the Processor google.cloud.documentai.v1.Processor or + * Required. The resource name of the + * Processor google.cloud.documentai.v1.Processor or * ProcessorVersion google.cloud.documentai.v1.ProcessorVersion - * to use for processing. If a Processor google.cloud.documentai.v1.Processor is specified, the server will use - * its default version google.cloud.documentai.v1.Processor.default_processor_version. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * Processor google.cloud.documentai.v1.Processor is specified, the server + * will use its default + * version google.cloud.documentai.v1.Processor.default_processor_version. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` */ // const name = 'abc123' diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js index 583b5a9b150..2c0ac74de17 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js @@ -33,8 +33,8 @@ function main(humanReviewConfig) { */ // const inlineDocument = {} /** - * Required. The resource name of the HumanReviewConfig that the document will be - * reviewed with. + * Required. The resource name of the HumanReviewConfig that the document will + * be reviewed with. */ // const humanReviewConfig = 'abc123' /** diff --git a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js index 64556b986f5..877d9839850 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js +++ b/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js @@ -29,12 +29,15 @@ function main(processor, defaultProcessorVersion) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the Processor google.cloud.documentai.v1.Processor to change default version. + * Required. The resource name of the + * Processor google.cloud.documentai.v1.Processor to change default + * version. */ // const processor = 'abc123' /** - * Required. The resource name of child ProcessorVersion google.cloud.documentai.v1.ProcessorVersion to use as default. - * Format: + * Required. The resource name of child + * ProcessorVersion google.cloud.documentai.v1.ProcessorVersion to use as + * default. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` */ // const defaultProcessorVersion = 'abc123' 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 eae3a1d5f10..04680d69274 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": 77, + "end": 81, "type": "FULL" } ], @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 72, "type": "FULL" } ], @@ -346,7 +346,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 68, "type": "FULL" } ], @@ -514,7 +514,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 61, "type": "FULL" } ], @@ -678,7 +678,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js index 25bd5f659c2..a31dc7f3099 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js @@ -29,7 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of Processor google.cloud.documentai.v1beta3.Processor or + * Required. The resource name of + * Processor google.cloud.documentai.v1beta3.Processor or * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or @@ -57,6 +58,10 @@ function main(name) { * false. */ // const skipHumanReview = true + /** + * Inference-time options for the process API + */ + // const processOptions = {} // Imports the Documentai library const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js index fc1916f0a92..1ca895cb351 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js @@ -29,13 +29,14 @@ function main(parent, processor) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** - * Required. The processor to be created, requires processor_type and display_name - * to be set. Also, the processor is under CMEK if CMEK fields are set. + * Required. The processor to be created, requires processor_type and + * display_name to be set. Also, the processor is under CMEK if CMEK fields + * are set. */ // const processor = {} diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js index e6af3689920..a4743fdef93 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js @@ -29,13 +29,15 @@ function main(processorVersion) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to evaluate. + * Required. The resource name of the + * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to + * evaluate. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` */ // const processorVersion = 'abc123' /** - * Optional. The documents used in the evaluation. If unspecified, use the processor's - * dataset as evaluation input. + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. */ // const evaluationDocuments = {} diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js index 7414abc0a9d..639c41fafe0 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js @@ -29,7 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the Evaluation google.cloud.documentai.v1beta3.Evaluation to get. + * Required. The resource name of the + * Evaluation google.cloud.documentai.v1beta3.Evaluation to get. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` */ // const name = 'abc123' diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js index 05b206dc802..18c51225399 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js @@ -29,7 +29,9 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to list evaluations for. + * Required. The resource name of the + * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to + * list evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` */ // const parent = 'abc123' diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js index c922f46fadc..141987450d9 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js @@ -29,8 +29,9 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js index c136a802329..76740b6e497 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js index b64abecbc4c..1a974e8e3ee 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js @@ -37,11 +37,15 @@ function main(name) { */ // const rawDocument = {} /** - * Required. The resource name of the Processor google.cloud.documentai.v1beta3.Processor or + * Required. The resource name of the + * Processor google.cloud.documentai.v1beta3.Processor or * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion - * to use for processing. If a Processor google.cloud.documentai.v1beta3.Processor is specified, the server will use - * its default version google.cloud.documentai.v1beta3.Processor.default_processor_version. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * Processor google.cloud.documentai.v1beta3.Processor is specified, the + * server will use its default + * version google.cloud.documentai.v1beta3.Processor.default_processor_version. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` */ // const name = 'abc123' @@ -60,6 +64,10 @@ function main(name) { * of `{document_field_name}` or `pages.{page_field_name}`. */ // const fieldMask = {} + /** + * Inference-time options for the process API + */ + // const processOptions = {} // Imports the Documentai library const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js index cb7b942ae57..3099720245d 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js @@ -33,8 +33,8 @@ function main(humanReviewConfig) { */ // const inlineDocument = {} /** - * Required. The resource name of the HumanReviewConfig that the document will be - * reviewed with. + * Required. The resource name of the HumanReviewConfig that the document will + * be reviewed with. */ // const humanReviewConfig = 'abc123' /** diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js index 44d9177db6b..7ed01a858e3 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js @@ -29,12 +29,15 @@ function main(processor, defaultProcessorVersion) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the Processor google.cloud.documentai.v1beta3.Processor to change default version. + * Required. The resource name of the + * Processor google.cloud.documentai.v1beta3.Processor to change default + * version. */ // const processor = 'abc123' /** - * Required. The resource name of child ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to use as default. - * Format: + * Required. The resource name of child + * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to use + * as default. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` */ // const defaultProcessorVersion = 'abc123' diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js index 24015f9da1a..dffbc96d9f0 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js @@ -29,8 +29,9 @@ function main(parent, processorVersion) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent (project, location and processor) to create the new version for. - * Format: `projects/{project}/locations/{location}/processors/{processor}`. + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. */ // const parent = 'abc123' /** @@ -46,8 +47,8 @@ function main(parent, processorVersion) { */ // const inputData = {} /** - * Optional. The processor version to use as a base for training. This processor version - * must be a child of `parent`. Format: + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. */ // const baseProcessorVersion = 'abc123' diff --git a/packages/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json b/packages/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json index ab0ad8ef8f7..78158081eb2 100644 --- a/packages/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json +++ b/packages/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata.google.cloud.documentai.v1beta3.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 81, + "end": 89, "type": "FULL" } ], @@ -54,6 +54,10 @@ { "name": "field_mask", "type": ".google.protobuf.FieldMask" + }, + { + "name": "process_options", + "type": ".google.cloud.documentai.v1beta3.ProcessOptions" } ], "resultType": ".google.cloud.documentai.v1beta3.ProcessResponse", @@ -82,7 +86,7 @@ "segments": [ { "start": 25, - "end": 79, + "end": 84, "type": "FULL" } ], @@ -114,6 +118,10 @@ { "name": "skip_human_review", "type": "TYPE_BOOL" + }, + { + "name": "process_options", + "type": ".google.cloud.documentai.v1beta3.ProcessOptions" } ], "resultType": ".google.longrunning.Operation", @@ -318,7 +326,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 75, "type": "FULL" } ], @@ -414,7 +422,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 68, "type": "FULL" } ], @@ -582,7 +590,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 61, "type": "FULL" } ], @@ -746,7 +754,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -850,7 +858,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 62, "type": "FULL" } ], @@ -894,7 +902,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 55, "type": "FULL" } ], @@ -934,7 +942,7 @@ "segments": [ { "start": 25, - "end": 67, + "end": 69, "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 a1045c0d373..06501ca4445 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 @@ -572,11 +572,15 @@ export class DocumentProcessorServiceClient { * @param {google.cloud.documentai.v1.RawDocument} request.rawDocument * A raw document content (bytes). * @param {string} request.name - * Required. The resource name of the {@link google.cloud.documentai.v1.Processor|Processor} or + * Required. The resource name of the + * {@link google.cloud.documentai.v1.Processor|Processor} or * {@link google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} - * to use for processing. If a {@link google.cloud.documentai.v1.Processor|Processor} is specified, the server will use - * its {@link google.cloud.documentai.v1.Processor.default_processor_version|default version}. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * {@link google.cloud.documentai.v1.Processor|Processor} is specified, the server + * will use its [default + * version][google.cloud.documentai.v1.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {boolean} request.skipHumanReview * Whether Human Review feature should be skipped for this request. Default to @@ -938,11 +942,12 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` * @param {google.cloud.documentai.v1.Processor} request.processor - * Required. The processor to be created, requires [processor_type] and [display_name] - * to be set. Also, the processor is under CMEK if CMEK fields are set. + * Required. The processor to be created, requires [processor_type] and + * [display_name] to be set. Also, the processor is under CMEK if CMEK fields + * are set. * @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. @@ -1035,7 +1040,8 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of {@link google.cloud.documentai.v1.Processor|Processor} or + * Required. The resource name of + * {@link google.cloud.documentai.v1.Processor|Processor} or * {@link google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion}. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or @@ -2021,17 +2027,22 @@ export class DocumentProcessorServiceClient { >; } /** - * Set the default (active) version of a {@link google.cloud.documentai.v1.Processor|Processor} that will be used in - * {@link google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument|ProcessDocument} and + * Set the default (active) version of a + * {@link google.cloud.documentai.v1.Processor|Processor} that will be used in + * {@link google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument|ProcessDocument} + * and * {@link google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments}. * * @param {Object} request * The request object that will be sent. * @param {string} request.processor - * Required. The resource name of the {@link google.cloud.documentai.v1.Processor|Processor} to change default version. + * Required. The resource name of the + * {@link google.cloud.documentai.v1.Processor|Processor} to change default + * version. * @param {string} request.defaultProcessorVersion - * Required. The resource name of child {@link google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to use as default. - * Format: + * Required. The resource name of child + * {@link google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to use as + * default. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -2177,8 +2188,8 @@ export class DocumentProcessorServiceClient { * @param {google.cloud.documentai.v1.Document} request.inlineDocument * An inline document proto. * @param {string} request.humanReviewConfig - * Required. The resource name of the HumanReviewConfig that the document will be - * reviewed with. + * Required. The resource name of the HumanReviewConfig that the document will + * be reviewed with. * @param {boolean} request.enableSchemaValidation * Whether the validation should be performed on the ad-hoc review request. * @param {google.cloud.documentai.v1.ReviewDocumentRequest.Priority} request.priority @@ -2523,8 +2534,8 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * @param {number} request.pageSize * The maximum number of processors to return. * If unspecified, at most 50 processors will be returned. @@ -2625,8 +2636,8 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * @param {number} request.pageSize * The maximum number of processors to return. * If unspecified, at most 50 processors will be returned. @@ -2675,8 +2686,8 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * @param {number} request.pageSize * The maximum number of processors to return. * If unspecified, at most 50 processors will be returned. @@ -2724,8 +2735,9 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * @param {number} request.pageSize * The maximum number of processor versions to return. * If unspecified, at most 10 processor versions will be returned. @@ -2826,8 +2838,9 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * @param {number} request.pageSize * The maximum number of processor versions to return. * If unspecified, at most 10 processor versions will be returned. @@ -2876,8 +2889,9 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * @param {number} request.pageSize * The maximum number of processor versions to return. * If unspecified, at most 10 processor versions will be returned. diff --git a/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts b/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts index 8f17822972f..2ea5587ae7a 100644 --- a/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts +++ b/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts @@ -611,11 +611,15 @@ export class DocumentProcessorServiceClient { * @param {google.cloud.documentai.v1beta3.RawDocument} request.rawDocument * A raw document content (bytes). * @param {string} request.name - * Required. The resource name of the {@link google.cloud.documentai.v1beta3.Processor|Processor} or + * Required. The resource name of the + * {@link google.cloud.documentai.v1beta3.Processor|Processor} or * {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} - * to use for processing. If a {@link google.cloud.documentai.v1beta3.Processor|Processor} is specified, the server will use - * its {@link google.cloud.documentai.v1beta3.Processor.default_processor_version|default version}. Format: - * `projects/{project}/locations/{location}/processors/{processor}`, or + * to use for processing. If a + * {@link google.cloud.documentai.v1beta3.Processor|Processor} is specified, the + * server will use its [default + * version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {google.cloud.documentai.v1beta3.Document} request.document * The document payload, the [content] and [mime_type] fields must be set. @@ -626,6 +630,8 @@ export class DocumentProcessorServiceClient { * 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 {google.cloud.documentai.v1beta3.ProcessOptions} request.processOptions + * Inference-time options for the process API * @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. @@ -999,11 +1005,12 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project and location) under which to create the processor. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` * @param {google.cloud.documentai.v1beta3.Processor} request.processor - * Required. The processor to be created, requires [processor_type] and [display_name] - * to be set. Also, the processor is under CMEK if CMEK fields are set. + * Required. The processor to be created, requires [processor_type] and + * [display_name] to be set. Also, the processor is under CMEK if CMEK fields + * are set. * @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. @@ -1100,7 +1107,8 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the {@link google.cloud.documentai.v1beta3.Evaluation|Evaluation} to get. + * Required. The resource name of the + * {@link google.cloud.documentai.v1beta3.Evaluation|Evaluation} to get. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1194,7 +1202,8 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of {@link google.cloud.documentai.v1beta3.Processor|Processor} or + * Required. The resource name of + * {@link google.cloud.documentai.v1beta3.Processor|Processor} or * {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. * Format: `projects/{project}/locations/{location}/processors/{processor}`, * or @@ -1210,6 +1219,8 @@ export class DocumentProcessorServiceClient { * @param {boolean} request.skipHumanReview * Whether Human Review feature should be skipped for this request. Default to * false. + * @param {google.cloud.documentai.v1beta3.ProcessOptions} request.processOptions + * Inference-time options for the process API * @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. @@ -1349,8 +1360,9 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project, location and processor) to create the new version for. - * Format: `projects/{project}/locations/{location}/processors/{processor}`. + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. * @param {google.cloud.documentai.v1beta3.ProcessorVersion} request.processorVersion * Required. The processor version to be created. * @param {google.cloud.documentai.v1beta3.DocumentSchema} [request.documentSchema] @@ -1358,8 +1370,8 @@ export class DocumentProcessorServiceClient { * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} [request.inputData] * Optional. The input data used to train the `ProcessorVersion`. * @param {string} [request.baseProcessorVersion] - * Optional. The processor version to use as a base for training. This processor version - * must be a child of `parent`. Format: + * Optional. The processor version to use as a base for training. This + * processor version must be a child of `parent`. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -2335,17 +2347,22 @@ export class DocumentProcessorServiceClient { >; } /** - * Set the default (active) version of a {@link google.cloud.documentai.v1beta3.Processor|Processor} that will be used in - * {@link google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument|ProcessDocument} and + * Set the default (active) version of a + * {@link google.cloud.documentai.v1beta3.Processor|Processor} that will be used in + * {@link google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument|ProcessDocument} + * and * {@link google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments}. * * @param {Object} request * The request object that will be sent. * @param {string} request.processor - * Required. The resource name of the {@link google.cloud.documentai.v1beta3.Processor|Processor} to change default version. + * Required. The resource name of the + * {@link google.cloud.documentai.v1beta3.Processor|Processor} to change default + * version. * @param {string} request.defaultProcessorVersion - * Required. The resource name of child {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to use as default. - * Format: + * Required. The resource name of child + * {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to use + * as default. Format: * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -2491,8 +2508,8 @@ export class DocumentProcessorServiceClient { * @param {google.cloud.documentai.v1beta3.Document} request.inlineDocument * An inline document proto. * @param {string} request.humanReviewConfig - * Required. The resource name of the HumanReviewConfig that the document will be - * reviewed with. + * Required. The resource name of the HumanReviewConfig that the document will + * be reviewed with. * @param {google.cloud.documentai.v1beta3.Document} request.document * The document that needs human review. * @param {boolean} request.enableSchemaValidation @@ -2639,11 +2656,13 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.processorVersion - * Required. The resource name of the {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to evaluate. + * Required. The resource name of the + * {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to + * evaluate. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} [request.evaluationDocuments] - * Optional. The documents used in the evaluation. If unspecified, use the processor's - * dataset as evaluation input. + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. * @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. @@ -2986,8 +3005,8 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * @param {number} request.pageSize * The maximum number of processors to return. * If unspecified, at most 50 processors will be returned. @@ -3088,8 +3107,8 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * @param {number} request.pageSize * The maximum number of processors to return. * If unspecified, at most 50 processors will be returned. @@ -3138,8 +3157,8 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project and location) which owns this collection of Processors. - * Format: `projects/{project}/locations/{location}` + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` * @param {number} request.pageSize * The maximum number of processors to return. * If unspecified, at most 50 processors will be returned. @@ -3187,8 +3206,9 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * @param {number} request.pageSize * The maximum number of processor versions to return. * If unspecified, at most 10 processor versions will be returned. @@ -3289,8 +3309,9 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * @param {number} request.pageSize * The maximum number of processor versions to return. * If unspecified, at most 10 processor versions will be returned. @@ -3339,8 +3360,9 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent (project, location and processor) to list all versions. - * Format: `projects/{project}/locations/{location}/processors/{processor}` + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` * @param {number} request.pageSize * The maximum number of processor versions to return. * If unspecified, at most 10 processor versions will be returned. @@ -3388,7 +3410,9 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to list evaluations for. + * Required. The resource name of the + * {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to + * list evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {number} request.pageSize * The standard list page size. @@ -3490,7 +3514,9 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to list evaluations for. + * Required. The resource name of the + * {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to + * list evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {number} request.pageSize * The standard list page size. @@ -3540,7 +3566,9 @@ export class DocumentProcessorServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The resource name of the {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to list evaluations for. + * Required. The resource name of the + * {@link google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to + * list evaluations for. * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` * @param {number} request.pageSize * The standard list page size.