google_cloud_documentai_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate api;
21extern crate async_trait;
22extern crate bytes;
23extern crate gax;
24extern crate gaxi;
25extern crate gtype;
26extern crate lazy_static;
27extern crate location;
28extern crate longrunning;
29extern crate lro;
30extern crate reqwest;
31extern crate rpc;
32extern crate serde;
33extern crate serde_json;
34extern crate serde_with;
35extern crate std;
36extern crate tracing;
37extern crate wkt;
38
39mod debug;
40mod deserialize;
41mod serialize;
42
43/// Encodes the detailed information of a barcode.
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct Barcode {
47    /// Format of a barcode.
48    /// The supported formats are:
49    ///
50    /// - `CODE_128`: Code 128 type.
51    /// - `CODE_39`: Code 39 type.
52    /// - `CODE_93`: Code 93 type.
53    /// - `CODABAR`: Codabar type.
54    /// - `DATA_MATRIX`: 2D Data Matrix type.
55    /// - `ITF`: ITF type.
56    /// - `EAN_13`: EAN-13 type.
57    /// - `EAN_8`: EAN-8 type.
58    /// - `QR_CODE`: 2D QR code type.
59    /// - `UPC_A`: UPC-A type.
60    /// - `UPC_E`: UPC-E type.
61    /// - `PDF417`: PDF417 type.
62    /// - `AZTEC`: 2D Aztec code type.
63    /// - `DATABAR`: GS1 DataBar code type.
64    pub format: std::string::String,
65
66    /// Value format describes the format of the value that a barcode
67    /// encodes.
68    /// The supported formats are:
69    ///
70    /// - `CONTACT_INFO`: Contact information.
71    /// - `EMAIL`: Email address.
72    /// - `ISBN`: ISBN identifier.
73    /// - `PHONE`: Phone number.
74    /// - `PRODUCT`: Product.
75    /// - `SMS`: SMS message.
76    /// - `TEXT`: Text string.
77    /// - `URL`: URL address.
78    /// - `WIFI`: Wifi information.
79    /// - `GEO`: Geo-localization.
80    /// - `CALENDAR_EVENT`: Calendar event.
81    /// - `DRIVER_LICENSE`: Driver's license.
82    pub value_format: std::string::String,
83
84    /// Raw value encoded in the barcode.
85    /// For example: `'MEBKM:TITLE:Google;URL:<https://www.google.com>;;'`.
86    pub raw_value: std::string::String,
87
88    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
89}
90
91impl Barcode {
92    pub fn new() -> Self {
93        std::default::Default::default()
94    }
95
96    /// Sets the value of [format][crate::model::Barcode::format].
97    pub fn set_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
98        self.format = v.into();
99        self
100    }
101
102    /// Sets the value of [value_format][crate::model::Barcode::value_format].
103    pub fn set_value_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
104        self.value_format = v.into();
105        self
106    }
107
108    /// Sets the value of [raw_value][crate::model::Barcode::raw_value].
109    pub fn set_raw_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
110        self.raw_value = v.into();
111        self
112    }
113}
114
115impl wkt::message::Message for Barcode {
116    fn typename() -> &'static str {
117        "type.googleapis.com/google.cloud.documentai.v1.Barcode"
118    }
119}
120
121/// Document represents the canonical document resource in Document AI. It is an
122/// interchange format that provides insights into documents and allows for
123/// collaboration between users and Document AI to iterate and optimize for
124/// quality.
125#[derive(Clone, Default, PartialEq)]
126#[non_exhaustive]
127pub struct Document {
128    /// Optional. An internal identifier for document. Should be loggable (no PII).
129    pub docid: std::string::String,
130
131    /// An IANA published [media type (MIME
132    /// type)](https://www.iana.org/assignments/media-types/media-types.xhtml).
133    pub mime_type: std::string::String,
134
135    /// Optional. UTF-8 encoded text in reading order from the document.
136    pub text: std::string::String,
137
138    /// Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
139    ///
140    /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
141    #[deprecated]
142    pub text_styles: std::vec::Vec<crate::model::document::Style>,
143
144    /// Visual page layout for the [Document][google.cloud.documentai.v1.Document].
145    ///
146    /// [google.cloud.documentai.v1.Document]: crate::model::Document
147    pub pages: std::vec::Vec<crate::model::document::Page>,
148
149    /// A list of entities detected on
150    /// [Document.text][google.cloud.documentai.v1.Document.text]. For document
151    /// shards, entities in this list may cross shard boundaries.
152    ///
153    /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
154    pub entities: std::vec::Vec<crate::model::document::Entity>,
155
156    /// Placeholder.  Relationship among
157    /// [Document.entities][google.cloud.documentai.v1.Document.entities].
158    ///
159    /// [google.cloud.documentai.v1.Document.entities]: crate::model::Document::entities
160    pub entity_relations: std::vec::Vec<crate::model::document::EntityRelation>,
161
162    /// Placeholder.  A list of text corrections made to
163    /// [Document.text][google.cloud.documentai.v1.Document.text].  This is usually
164    /// used for annotating corrections to OCR mistakes.  Text changes for a given
165    /// revision may not overlap with each other.
166    ///
167    /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
168    pub text_changes: std::vec::Vec<crate::model::document::TextChange>,
169
170    /// Information about the sharding if this document is sharded part of a larger
171    /// document. If the document is not sharded, this message is not specified.
172    pub shard_info: std::option::Option<crate::model::document::ShardInfo>,
173
174    /// Any error that occurred while processing this document.
175    pub error: std::option::Option<rpc::model::Status>,
176
177    /// Placeholder. Revision history of this document.
178    pub revisions: std::vec::Vec<crate::model::document::Revision>,
179
180    /// Parsed layout of the document.
181    pub document_layout: std::option::Option<crate::model::document::DocumentLayout>,
182
183    /// Document chunked based on chunking config.
184    pub chunked_document: std::option::Option<crate::model::document::ChunkedDocument>,
185
186    /// The entity validation output for the document. This is the validation
187    /// output for `document.entities` field.
188    pub entity_validation_output:
189        std::option::Option<crate::model::document::EntityValidationOutput>,
190
191    /// A list of entity revisions. The entity revisions are appended to the
192    /// document in the processing order. This field can be used for comparing the
193    /// entity extraction results at different stages of the processing.
194    pub entities_revisions: std::vec::Vec<crate::model::document::EntitiesRevision>,
195
196    /// The entity revision id that `document.entities` field is based on.
197    /// If this field is set and `entities_revisions` is not empty, the entities in
198    /// `document.entities` field are the entities in the entity revision with this
199    /// id and `document.entity_validation_output` field is the
200    /// `entity_validation_output` field in this entity revision.
201    pub entities_revision_id: std::string::String,
202
203    /// Original source document from the user.
204    pub source: std::option::Option<crate::model::document::Source>,
205
206    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
207}
208
209impl Document {
210    pub fn new() -> Self {
211        std::default::Default::default()
212    }
213
214    /// Sets the value of [docid][crate::model::Document::docid].
215    pub fn set_docid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
216        self.docid = v.into();
217        self
218    }
219
220    /// Sets the value of [mime_type][crate::model::Document::mime_type].
221    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
222        self.mime_type = v.into();
223        self
224    }
225
226    /// Sets the value of [text][crate::model::Document::text].
227    pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
228        self.text = v.into();
229        self
230    }
231
232    /// Sets the value of [text_styles][crate::model::Document::text_styles].
233    #[deprecated]
234    pub fn set_text_styles<T, V>(mut self, v: T) -> Self
235    where
236        T: std::iter::IntoIterator<Item = V>,
237        V: std::convert::Into<crate::model::document::Style>,
238    {
239        use std::iter::Iterator;
240        self.text_styles = v.into_iter().map(|i| i.into()).collect();
241        self
242    }
243
244    /// Sets the value of [pages][crate::model::Document::pages].
245    pub fn set_pages<T, V>(mut self, v: T) -> Self
246    where
247        T: std::iter::IntoIterator<Item = V>,
248        V: std::convert::Into<crate::model::document::Page>,
249    {
250        use std::iter::Iterator;
251        self.pages = v.into_iter().map(|i| i.into()).collect();
252        self
253    }
254
255    /// Sets the value of [entities][crate::model::Document::entities].
256    pub fn set_entities<T, V>(mut self, v: T) -> Self
257    where
258        T: std::iter::IntoIterator<Item = V>,
259        V: std::convert::Into<crate::model::document::Entity>,
260    {
261        use std::iter::Iterator;
262        self.entities = v.into_iter().map(|i| i.into()).collect();
263        self
264    }
265
266    /// Sets the value of [entity_relations][crate::model::Document::entity_relations].
267    pub fn set_entity_relations<T, V>(mut self, v: T) -> Self
268    where
269        T: std::iter::IntoIterator<Item = V>,
270        V: std::convert::Into<crate::model::document::EntityRelation>,
271    {
272        use std::iter::Iterator;
273        self.entity_relations = v.into_iter().map(|i| i.into()).collect();
274        self
275    }
276
277    /// Sets the value of [text_changes][crate::model::Document::text_changes].
278    pub fn set_text_changes<T, V>(mut self, v: T) -> Self
279    where
280        T: std::iter::IntoIterator<Item = V>,
281        V: std::convert::Into<crate::model::document::TextChange>,
282    {
283        use std::iter::Iterator;
284        self.text_changes = v.into_iter().map(|i| i.into()).collect();
285        self
286    }
287
288    /// Sets the value of [shard_info][crate::model::Document::shard_info].
289    pub fn set_shard_info<T>(mut self, v: T) -> Self
290    where
291        T: std::convert::Into<crate::model::document::ShardInfo>,
292    {
293        self.shard_info = std::option::Option::Some(v.into());
294        self
295    }
296
297    /// Sets or clears the value of [shard_info][crate::model::Document::shard_info].
298    pub fn set_or_clear_shard_info<T>(mut self, v: std::option::Option<T>) -> Self
299    where
300        T: std::convert::Into<crate::model::document::ShardInfo>,
301    {
302        self.shard_info = v.map(|x| x.into());
303        self
304    }
305
306    /// Sets the value of [error][crate::model::Document::error].
307    pub fn set_error<T>(mut self, v: T) -> Self
308    where
309        T: std::convert::Into<rpc::model::Status>,
310    {
311        self.error = std::option::Option::Some(v.into());
312        self
313    }
314
315    /// Sets or clears the value of [error][crate::model::Document::error].
316    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
317    where
318        T: std::convert::Into<rpc::model::Status>,
319    {
320        self.error = v.map(|x| x.into());
321        self
322    }
323
324    /// Sets the value of [revisions][crate::model::Document::revisions].
325    pub fn set_revisions<T, V>(mut self, v: T) -> Self
326    where
327        T: std::iter::IntoIterator<Item = V>,
328        V: std::convert::Into<crate::model::document::Revision>,
329    {
330        use std::iter::Iterator;
331        self.revisions = v.into_iter().map(|i| i.into()).collect();
332        self
333    }
334
335    /// Sets the value of [document_layout][crate::model::Document::document_layout].
336    pub fn set_document_layout<T>(mut self, v: T) -> Self
337    where
338        T: std::convert::Into<crate::model::document::DocumentLayout>,
339    {
340        self.document_layout = std::option::Option::Some(v.into());
341        self
342    }
343
344    /// Sets or clears the value of [document_layout][crate::model::Document::document_layout].
345    pub fn set_or_clear_document_layout<T>(mut self, v: std::option::Option<T>) -> Self
346    where
347        T: std::convert::Into<crate::model::document::DocumentLayout>,
348    {
349        self.document_layout = v.map(|x| x.into());
350        self
351    }
352
353    /// Sets the value of [chunked_document][crate::model::Document::chunked_document].
354    pub fn set_chunked_document<T>(mut self, v: T) -> Self
355    where
356        T: std::convert::Into<crate::model::document::ChunkedDocument>,
357    {
358        self.chunked_document = std::option::Option::Some(v.into());
359        self
360    }
361
362    /// Sets or clears the value of [chunked_document][crate::model::Document::chunked_document].
363    pub fn set_or_clear_chunked_document<T>(mut self, v: std::option::Option<T>) -> Self
364    where
365        T: std::convert::Into<crate::model::document::ChunkedDocument>,
366    {
367        self.chunked_document = v.map(|x| x.into());
368        self
369    }
370
371    /// Sets the value of [entity_validation_output][crate::model::Document::entity_validation_output].
372    pub fn set_entity_validation_output<T>(mut self, v: T) -> Self
373    where
374        T: std::convert::Into<crate::model::document::EntityValidationOutput>,
375    {
376        self.entity_validation_output = std::option::Option::Some(v.into());
377        self
378    }
379
380    /// Sets or clears the value of [entity_validation_output][crate::model::Document::entity_validation_output].
381    pub fn set_or_clear_entity_validation_output<T>(mut self, v: std::option::Option<T>) -> Self
382    where
383        T: std::convert::Into<crate::model::document::EntityValidationOutput>,
384    {
385        self.entity_validation_output = v.map(|x| x.into());
386        self
387    }
388
389    /// Sets the value of [entities_revisions][crate::model::Document::entities_revisions].
390    pub fn set_entities_revisions<T, V>(mut self, v: T) -> Self
391    where
392        T: std::iter::IntoIterator<Item = V>,
393        V: std::convert::Into<crate::model::document::EntitiesRevision>,
394    {
395        use std::iter::Iterator;
396        self.entities_revisions = v.into_iter().map(|i| i.into()).collect();
397        self
398    }
399
400    /// Sets the value of [entities_revision_id][crate::model::Document::entities_revision_id].
401    pub fn set_entities_revision_id<T: std::convert::Into<std::string::String>>(
402        mut self,
403        v: T,
404    ) -> Self {
405        self.entities_revision_id = v.into();
406        self
407    }
408
409    /// Sets the value of [source][crate::model::Document::source].
410    ///
411    /// Note that all the setters affecting `source` are mutually
412    /// exclusive.
413    pub fn set_source<
414        T: std::convert::Into<std::option::Option<crate::model::document::Source>>,
415    >(
416        mut self,
417        v: T,
418    ) -> Self {
419        self.source = v.into();
420        self
421    }
422
423    /// The value of [source][crate::model::Document::source]
424    /// if it holds a `Uri`, `None` if the field is not set or
425    /// holds a different branch.
426    pub fn uri(&self) -> std::option::Option<&std::string::String> {
427        #[allow(unreachable_patterns)]
428        self.source.as_ref().and_then(|v| match v {
429            crate::model::document::Source::Uri(v) => std::option::Option::Some(v),
430            _ => std::option::Option::None,
431        })
432    }
433
434    /// Sets the value of [source][crate::model::Document::source]
435    /// to hold a `Uri`.
436    ///
437    /// Note that all the setters affecting `source` are
438    /// mutually exclusive.
439    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
440        self.source = std::option::Option::Some(crate::model::document::Source::Uri(v.into()));
441        self
442    }
443
444    /// The value of [source][crate::model::Document::source]
445    /// if it holds a `Content`, `None` if the field is not set or
446    /// holds a different branch.
447    pub fn content(&self) -> std::option::Option<&::bytes::Bytes> {
448        #[allow(unreachable_patterns)]
449        self.source.as_ref().and_then(|v| match v {
450            crate::model::document::Source::Content(v) => std::option::Option::Some(v),
451            _ => std::option::Option::None,
452        })
453    }
454
455    /// Sets the value of [source][crate::model::Document::source]
456    /// to hold a `Content`.
457    ///
458    /// Note that all the setters affecting `source` are
459    /// mutually exclusive.
460    pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
461        self.source = std::option::Option::Some(crate::model::document::Source::Content(v.into()));
462        self
463    }
464}
465
466impl wkt::message::Message for Document {
467    fn typename() -> &'static str {
468        "type.googleapis.com/google.cloud.documentai.v1.Document"
469    }
470}
471
472/// Defines additional types related to [Document].
473pub mod document {
474    #[allow(unused_imports)]
475    use super::*;
476
477    /// For a large document, sharding may be performed to produce several
478    /// document shards. Each document shard contains this field to detail which
479    /// shard it is.
480    #[derive(Clone, Default, PartialEq)]
481    #[non_exhaustive]
482    pub struct ShardInfo {
483        /// The 0-based index of this shard.
484        pub shard_index: i64,
485
486        /// Total number of shards.
487        pub shard_count: i64,
488
489        /// The index of the first character in
490        /// [Document.text][google.cloud.documentai.v1.Document.text] in the overall
491        /// document global text.
492        ///
493        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
494        pub text_offset: i64,
495
496        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
497    }
498
499    impl ShardInfo {
500        pub fn new() -> Self {
501            std::default::Default::default()
502        }
503
504        /// Sets the value of [shard_index][crate::model::document::ShardInfo::shard_index].
505        pub fn set_shard_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
506            self.shard_index = v.into();
507            self
508        }
509
510        /// Sets the value of [shard_count][crate::model::document::ShardInfo::shard_count].
511        pub fn set_shard_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
512            self.shard_count = v.into();
513            self
514        }
515
516        /// Sets the value of [text_offset][crate::model::document::ShardInfo::text_offset].
517        pub fn set_text_offset<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
518            self.text_offset = v.into();
519            self
520        }
521    }
522
523    impl wkt::message::Message for ShardInfo {
524        fn typename() -> &'static str {
525            "type.googleapis.com/google.cloud.documentai.v1.Document.ShardInfo"
526        }
527    }
528
529    /// Annotation for common text style attributes. This adheres to CSS
530    /// conventions as much as possible.
531    #[derive(Clone, Default, PartialEq)]
532    #[non_exhaustive]
533    pub struct Style {
534        /// Text anchor indexing into the
535        /// [Document.text][google.cloud.documentai.v1.Document.text].
536        ///
537        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
538        pub text_anchor: std::option::Option<crate::model::document::TextAnchor>,
539
540        /// Text color.
541        pub color: std::option::Option<gtype::model::Color>,
542
543        /// Text background color.
544        pub background_color: std::option::Option<gtype::model::Color>,
545
546        /// [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
547        /// Possible values are `normal`, `bold`, `bolder`, and `lighter`.
548        pub font_weight: std::string::String,
549
550        /// [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
551        /// Possible values are `normal`, `italic`, and `oblique`.
552        pub text_style: std::string::String,
553
554        /// [Text
555        /// decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
556        /// Follows CSS standard. \<text-decoration-line\> \<text-decoration-color\>
557        /// \<text-decoration-style\>
558        pub text_decoration: std::string::String,
559
560        /// Font size.
561        pub font_size: std::option::Option<crate::model::document::style::FontSize>,
562
563        /// Font family such as `Arial`, `Times New Roman`.
564        /// <https://www.w3schools.com/cssref/pr_font_font-family.asp>
565        pub font_family: std::string::String,
566
567        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
568    }
569
570    impl Style {
571        pub fn new() -> Self {
572            std::default::Default::default()
573        }
574
575        /// Sets the value of [text_anchor][crate::model::document::Style::text_anchor].
576        pub fn set_text_anchor<T>(mut self, v: T) -> Self
577        where
578            T: std::convert::Into<crate::model::document::TextAnchor>,
579        {
580            self.text_anchor = std::option::Option::Some(v.into());
581            self
582        }
583
584        /// Sets or clears the value of [text_anchor][crate::model::document::Style::text_anchor].
585        pub fn set_or_clear_text_anchor<T>(mut self, v: std::option::Option<T>) -> Self
586        where
587            T: std::convert::Into<crate::model::document::TextAnchor>,
588        {
589            self.text_anchor = v.map(|x| x.into());
590            self
591        }
592
593        /// Sets the value of [color][crate::model::document::Style::color].
594        pub fn set_color<T>(mut self, v: T) -> Self
595        where
596            T: std::convert::Into<gtype::model::Color>,
597        {
598            self.color = std::option::Option::Some(v.into());
599            self
600        }
601
602        /// Sets or clears the value of [color][crate::model::document::Style::color].
603        pub fn set_or_clear_color<T>(mut self, v: std::option::Option<T>) -> Self
604        where
605            T: std::convert::Into<gtype::model::Color>,
606        {
607            self.color = v.map(|x| x.into());
608            self
609        }
610
611        /// Sets the value of [background_color][crate::model::document::Style::background_color].
612        pub fn set_background_color<T>(mut self, v: T) -> Self
613        where
614            T: std::convert::Into<gtype::model::Color>,
615        {
616            self.background_color = std::option::Option::Some(v.into());
617            self
618        }
619
620        /// Sets or clears the value of [background_color][crate::model::document::Style::background_color].
621        pub fn set_or_clear_background_color<T>(mut self, v: std::option::Option<T>) -> Self
622        where
623            T: std::convert::Into<gtype::model::Color>,
624        {
625            self.background_color = v.map(|x| x.into());
626            self
627        }
628
629        /// Sets the value of [font_weight][crate::model::document::Style::font_weight].
630        pub fn set_font_weight<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
631            self.font_weight = v.into();
632            self
633        }
634
635        /// Sets the value of [text_style][crate::model::document::Style::text_style].
636        pub fn set_text_style<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
637            self.text_style = v.into();
638            self
639        }
640
641        /// Sets the value of [text_decoration][crate::model::document::Style::text_decoration].
642        pub fn set_text_decoration<T: std::convert::Into<std::string::String>>(
643            mut self,
644            v: T,
645        ) -> Self {
646            self.text_decoration = v.into();
647            self
648        }
649
650        /// Sets the value of [font_size][crate::model::document::Style::font_size].
651        pub fn set_font_size<T>(mut self, v: T) -> Self
652        where
653            T: std::convert::Into<crate::model::document::style::FontSize>,
654        {
655            self.font_size = std::option::Option::Some(v.into());
656            self
657        }
658
659        /// Sets or clears the value of [font_size][crate::model::document::Style::font_size].
660        pub fn set_or_clear_font_size<T>(mut self, v: std::option::Option<T>) -> Self
661        where
662            T: std::convert::Into<crate::model::document::style::FontSize>,
663        {
664            self.font_size = v.map(|x| x.into());
665            self
666        }
667
668        /// Sets the value of [font_family][crate::model::document::Style::font_family].
669        pub fn set_font_family<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
670            self.font_family = v.into();
671            self
672        }
673    }
674
675    impl wkt::message::Message for Style {
676        fn typename() -> &'static str {
677            "type.googleapis.com/google.cloud.documentai.v1.Document.Style"
678        }
679    }
680
681    /// Defines additional types related to [Style].
682    pub mod style {
683        #[allow(unused_imports)]
684        use super::*;
685
686        /// Font size with unit.
687        #[derive(Clone, Default, PartialEq)]
688        #[non_exhaustive]
689        pub struct FontSize {
690            /// Font size for the text.
691            pub size: f32,
692
693            /// Unit for the font size. Follows CSS naming (such as `in`, `px`, and
694            /// `pt`).
695            pub unit: std::string::String,
696
697            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
698        }
699
700        impl FontSize {
701            pub fn new() -> Self {
702                std::default::Default::default()
703            }
704
705            /// Sets the value of [size][crate::model::document::style::FontSize::size].
706            pub fn set_size<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
707                self.size = v.into();
708                self
709            }
710
711            /// Sets the value of [unit][crate::model::document::style::FontSize::unit].
712            pub fn set_unit<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
713                self.unit = v.into();
714                self
715            }
716        }
717
718        impl wkt::message::Message for FontSize {
719            fn typename() -> &'static str {
720                "type.googleapis.com/google.cloud.documentai.v1.Document.Style.FontSize"
721            }
722        }
723    }
724
725    /// A page in a [Document][google.cloud.documentai.v1.Document].
726    ///
727    /// [google.cloud.documentai.v1.Document]: crate::model::Document
728    #[derive(Clone, Default, PartialEq)]
729    #[non_exhaustive]
730    pub struct Page {
731        /// 1-based index for current
732        /// [Page][google.cloud.documentai.v1.Document.Page] in a parent
733        /// [Document][google.cloud.documentai.v1.Document]. Useful when a page is
734        /// taken out of a [Document][google.cloud.documentai.v1.Document] for
735        /// individual processing.
736        ///
737        /// [google.cloud.documentai.v1.Document]: crate::model::Document
738        /// [google.cloud.documentai.v1.Document.Page]: crate::model::document::Page
739        pub page_number: i32,
740
741        /// Rendered image for this page. This image is preprocessed to remove any
742        /// skew, rotation, and distortions such that the annotation bounding boxes
743        /// can be upright and axis-aligned.
744        pub image: std::option::Option<crate::model::document::page::Image>,
745
746        /// Transformation matrices that were applied to the original document image
747        /// to produce [Page.image][google.cloud.documentai.v1.Document.Page.image].
748        ///
749        /// [google.cloud.documentai.v1.Document.Page.image]: crate::model::document::Page::image
750        pub transforms: std::vec::Vec<crate::model::document::page::Matrix>,
751
752        /// Physical dimension of the page.
753        pub dimension: std::option::Option<crate::model::document::page::Dimension>,
754
755        /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page.
756        ///
757        /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
758        pub layout: std::option::Option<crate::model::document::page::Layout>,
759
760        /// A list of detected languages together with confidence.
761        pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
762
763        /// A list of visually detected text blocks on the page.
764        /// A block has a set of lines (collected into paragraphs) that have a common
765        /// line-spacing and orientation.
766        pub blocks: std::vec::Vec<crate::model::document::page::Block>,
767
768        /// A list of visually detected text paragraphs on the page.
769        /// A collection of lines that a human would perceive as a paragraph.
770        pub paragraphs: std::vec::Vec<crate::model::document::page::Paragraph>,
771
772        /// A list of visually detected text lines on the page.
773        /// A collection of tokens that a human would perceive as a line.
774        pub lines: std::vec::Vec<crate::model::document::page::Line>,
775
776        /// A list of visually detected tokens on the page.
777        pub tokens: std::vec::Vec<crate::model::document::page::Token>,
778
779        /// A list of detected non-text visual elements e.g. checkbox,
780        /// signature etc. on the page.
781        pub visual_elements: std::vec::Vec<crate::model::document::page::VisualElement>,
782
783        /// A list of visually detected tables on the page.
784        pub tables: std::vec::Vec<crate::model::document::page::Table>,
785
786        /// A list of visually detected form fields on the page.
787        pub form_fields: std::vec::Vec<crate::model::document::page::FormField>,
788
789        /// A list of visually detected symbols on the page.
790        pub symbols: std::vec::Vec<crate::model::document::page::Symbol>,
791
792        /// A list of detected barcodes.
793        pub detected_barcodes: std::vec::Vec<crate::model::document::page::DetectedBarcode>,
794
795        /// Image quality scores.
796        pub image_quality_scores:
797            std::option::Option<crate::model::document::page::ImageQualityScores>,
798
799        /// The history of this page.
800        #[deprecated]
801        pub provenance: std::option::Option<crate::model::document::Provenance>,
802
803        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
804    }
805
806    impl Page {
807        pub fn new() -> Self {
808            std::default::Default::default()
809        }
810
811        /// Sets the value of [page_number][crate::model::document::Page::page_number].
812        pub fn set_page_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
813            self.page_number = v.into();
814            self
815        }
816
817        /// Sets the value of [image][crate::model::document::Page::image].
818        pub fn set_image<T>(mut self, v: T) -> Self
819        where
820            T: std::convert::Into<crate::model::document::page::Image>,
821        {
822            self.image = std::option::Option::Some(v.into());
823            self
824        }
825
826        /// Sets or clears the value of [image][crate::model::document::Page::image].
827        pub fn set_or_clear_image<T>(mut self, v: std::option::Option<T>) -> Self
828        where
829            T: std::convert::Into<crate::model::document::page::Image>,
830        {
831            self.image = v.map(|x| x.into());
832            self
833        }
834
835        /// Sets the value of [transforms][crate::model::document::Page::transforms].
836        pub fn set_transforms<T, V>(mut self, v: T) -> Self
837        where
838            T: std::iter::IntoIterator<Item = V>,
839            V: std::convert::Into<crate::model::document::page::Matrix>,
840        {
841            use std::iter::Iterator;
842            self.transforms = v.into_iter().map(|i| i.into()).collect();
843            self
844        }
845
846        /// Sets the value of [dimension][crate::model::document::Page::dimension].
847        pub fn set_dimension<T>(mut self, v: T) -> Self
848        where
849            T: std::convert::Into<crate::model::document::page::Dimension>,
850        {
851            self.dimension = std::option::Option::Some(v.into());
852            self
853        }
854
855        /// Sets or clears the value of [dimension][crate::model::document::Page::dimension].
856        pub fn set_or_clear_dimension<T>(mut self, v: std::option::Option<T>) -> Self
857        where
858            T: std::convert::Into<crate::model::document::page::Dimension>,
859        {
860            self.dimension = v.map(|x| x.into());
861            self
862        }
863
864        /// Sets the value of [layout][crate::model::document::Page::layout].
865        pub fn set_layout<T>(mut self, v: T) -> Self
866        where
867            T: std::convert::Into<crate::model::document::page::Layout>,
868        {
869            self.layout = std::option::Option::Some(v.into());
870            self
871        }
872
873        /// Sets or clears the value of [layout][crate::model::document::Page::layout].
874        pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
875        where
876            T: std::convert::Into<crate::model::document::page::Layout>,
877        {
878            self.layout = v.map(|x| x.into());
879            self
880        }
881
882        /// Sets the value of [detected_languages][crate::model::document::Page::detected_languages].
883        pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
884        where
885            T: std::iter::IntoIterator<Item = V>,
886            V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
887        {
888            use std::iter::Iterator;
889            self.detected_languages = v.into_iter().map(|i| i.into()).collect();
890            self
891        }
892
893        /// Sets the value of [blocks][crate::model::document::Page::blocks].
894        pub fn set_blocks<T, V>(mut self, v: T) -> Self
895        where
896            T: std::iter::IntoIterator<Item = V>,
897            V: std::convert::Into<crate::model::document::page::Block>,
898        {
899            use std::iter::Iterator;
900            self.blocks = v.into_iter().map(|i| i.into()).collect();
901            self
902        }
903
904        /// Sets the value of [paragraphs][crate::model::document::Page::paragraphs].
905        pub fn set_paragraphs<T, V>(mut self, v: T) -> Self
906        where
907            T: std::iter::IntoIterator<Item = V>,
908            V: std::convert::Into<crate::model::document::page::Paragraph>,
909        {
910            use std::iter::Iterator;
911            self.paragraphs = v.into_iter().map(|i| i.into()).collect();
912            self
913        }
914
915        /// Sets the value of [lines][crate::model::document::Page::lines].
916        pub fn set_lines<T, V>(mut self, v: T) -> Self
917        where
918            T: std::iter::IntoIterator<Item = V>,
919            V: std::convert::Into<crate::model::document::page::Line>,
920        {
921            use std::iter::Iterator;
922            self.lines = v.into_iter().map(|i| i.into()).collect();
923            self
924        }
925
926        /// Sets the value of [tokens][crate::model::document::Page::tokens].
927        pub fn set_tokens<T, V>(mut self, v: T) -> Self
928        where
929            T: std::iter::IntoIterator<Item = V>,
930            V: std::convert::Into<crate::model::document::page::Token>,
931        {
932            use std::iter::Iterator;
933            self.tokens = v.into_iter().map(|i| i.into()).collect();
934            self
935        }
936
937        /// Sets the value of [visual_elements][crate::model::document::Page::visual_elements].
938        pub fn set_visual_elements<T, V>(mut self, v: T) -> Self
939        where
940            T: std::iter::IntoIterator<Item = V>,
941            V: std::convert::Into<crate::model::document::page::VisualElement>,
942        {
943            use std::iter::Iterator;
944            self.visual_elements = v.into_iter().map(|i| i.into()).collect();
945            self
946        }
947
948        /// Sets the value of [tables][crate::model::document::Page::tables].
949        pub fn set_tables<T, V>(mut self, v: T) -> Self
950        where
951            T: std::iter::IntoIterator<Item = V>,
952            V: std::convert::Into<crate::model::document::page::Table>,
953        {
954            use std::iter::Iterator;
955            self.tables = v.into_iter().map(|i| i.into()).collect();
956            self
957        }
958
959        /// Sets the value of [form_fields][crate::model::document::Page::form_fields].
960        pub fn set_form_fields<T, V>(mut self, v: T) -> Self
961        where
962            T: std::iter::IntoIterator<Item = V>,
963            V: std::convert::Into<crate::model::document::page::FormField>,
964        {
965            use std::iter::Iterator;
966            self.form_fields = v.into_iter().map(|i| i.into()).collect();
967            self
968        }
969
970        /// Sets the value of [symbols][crate::model::document::Page::symbols].
971        pub fn set_symbols<T, V>(mut self, v: T) -> Self
972        where
973            T: std::iter::IntoIterator<Item = V>,
974            V: std::convert::Into<crate::model::document::page::Symbol>,
975        {
976            use std::iter::Iterator;
977            self.symbols = v.into_iter().map(|i| i.into()).collect();
978            self
979        }
980
981        /// Sets the value of [detected_barcodes][crate::model::document::Page::detected_barcodes].
982        pub fn set_detected_barcodes<T, V>(mut self, v: T) -> Self
983        where
984            T: std::iter::IntoIterator<Item = V>,
985            V: std::convert::Into<crate::model::document::page::DetectedBarcode>,
986        {
987            use std::iter::Iterator;
988            self.detected_barcodes = v.into_iter().map(|i| i.into()).collect();
989            self
990        }
991
992        /// Sets the value of [image_quality_scores][crate::model::document::Page::image_quality_scores].
993        pub fn set_image_quality_scores<T>(mut self, v: T) -> Self
994        where
995            T: std::convert::Into<crate::model::document::page::ImageQualityScores>,
996        {
997            self.image_quality_scores = std::option::Option::Some(v.into());
998            self
999        }
1000
1001        /// Sets or clears the value of [image_quality_scores][crate::model::document::Page::image_quality_scores].
1002        pub fn set_or_clear_image_quality_scores<T>(mut self, v: std::option::Option<T>) -> Self
1003        where
1004            T: std::convert::Into<crate::model::document::page::ImageQualityScores>,
1005        {
1006            self.image_quality_scores = v.map(|x| x.into());
1007            self
1008        }
1009
1010        /// Sets the value of [provenance][crate::model::document::Page::provenance].
1011        #[deprecated]
1012        pub fn set_provenance<T>(mut self, v: T) -> Self
1013        where
1014            T: std::convert::Into<crate::model::document::Provenance>,
1015        {
1016            self.provenance = std::option::Option::Some(v.into());
1017            self
1018        }
1019
1020        /// Sets or clears the value of [provenance][crate::model::document::Page::provenance].
1021        #[deprecated]
1022        pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
1023        where
1024            T: std::convert::Into<crate::model::document::Provenance>,
1025        {
1026            self.provenance = v.map(|x| x.into());
1027            self
1028        }
1029    }
1030
1031    impl wkt::message::Message for Page {
1032        fn typename() -> &'static str {
1033            "type.googleapis.com/google.cloud.documentai.v1.Document.Page"
1034        }
1035    }
1036
1037    /// Defines additional types related to [Page].
1038    pub mod page {
1039        #[allow(unused_imports)]
1040        use super::*;
1041
1042        /// Dimension for the page.
1043        #[derive(Clone, Default, PartialEq)]
1044        #[non_exhaustive]
1045        pub struct Dimension {
1046            /// Page width.
1047            pub width: f32,
1048
1049            /// Page height.
1050            pub height: f32,
1051
1052            /// Dimension unit.
1053            pub unit: std::string::String,
1054
1055            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1056        }
1057
1058        impl Dimension {
1059            pub fn new() -> Self {
1060                std::default::Default::default()
1061            }
1062
1063            /// Sets the value of [width][crate::model::document::page::Dimension::width].
1064            pub fn set_width<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1065                self.width = v.into();
1066                self
1067            }
1068
1069            /// Sets the value of [height][crate::model::document::page::Dimension::height].
1070            pub fn set_height<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1071                self.height = v.into();
1072                self
1073            }
1074
1075            /// Sets the value of [unit][crate::model::document::page::Dimension::unit].
1076            pub fn set_unit<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1077                self.unit = v.into();
1078                self
1079            }
1080        }
1081
1082        impl wkt::message::Message for Dimension {
1083            fn typename() -> &'static str {
1084                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Dimension"
1085            }
1086        }
1087
1088        /// Rendered image contents for this page.
1089        #[derive(Clone, Default, PartialEq)]
1090        #[non_exhaustive]
1091        pub struct Image {
1092            /// Raw byte content of the image.
1093            pub content: ::bytes::Bytes,
1094
1095            /// Encoding [media type (MIME
1096            /// type)](https://www.iana.org/assignments/media-types/media-types.xhtml)
1097            /// for the image.
1098            pub mime_type: std::string::String,
1099
1100            /// Width of the image in pixels.
1101            pub width: i32,
1102
1103            /// Height of the image in pixels.
1104            pub height: i32,
1105
1106            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1107        }
1108
1109        impl Image {
1110            pub fn new() -> Self {
1111                std::default::Default::default()
1112            }
1113
1114            /// Sets the value of [content][crate::model::document::page::Image::content].
1115            pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1116                self.content = v.into();
1117                self
1118            }
1119
1120            /// Sets the value of [mime_type][crate::model::document::page::Image::mime_type].
1121            pub fn set_mime_type<T: std::convert::Into<std::string::String>>(
1122                mut self,
1123                v: T,
1124            ) -> Self {
1125                self.mime_type = v.into();
1126                self
1127            }
1128
1129            /// Sets the value of [width][crate::model::document::page::Image::width].
1130            pub fn set_width<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1131                self.width = v.into();
1132                self
1133            }
1134
1135            /// Sets the value of [height][crate::model::document::page::Image::height].
1136            pub fn set_height<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1137                self.height = v.into();
1138                self
1139            }
1140        }
1141
1142        impl wkt::message::Message for Image {
1143            fn typename() -> &'static str {
1144                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Image"
1145            }
1146        }
1147
1148        /// Representation for transformation matrix, intended to be compatible and
1149        /// used with OpenCV format for image manipulation.
1150        #[derive(Clone, Default, PartialEq)]
1151        #[non_exhaustive]
1152        pub struct Matrix {
1153            /// Number of rows in the matrix.
1154            pub rows: i32,
1155
1156            /// Number of columns in the matrix.
1157            pub cols: i32,
1158
1159            /// This encodes information about what data type the matrix uses.
1160            /// For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list
1161            /// of OpenCV primitive data types, please refer to
1162            /// <https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html>
1163            pub r#type: i32,
1164
1165            /// The matrix data.
1166            pub data: ::bytes::Bytes,
1167
1168            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1169        }
1170
1171        impl Matrix {
1172            pub fn new() -> Self {
1173                std::default::Default::default()
1174            }
1175
1176            /// Sets the value of [rows][crate::model::document::page::Matrix::rows].
1177            pub fn set_rows<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1178                self.rows = v.into();
1179                self
1180            }
1181
1182            /// Sets the value of [cols][crate::model::document::page::Matrix::cols].
1183            pub fn set_cols<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1184                self.cols = v.into();
1185                self
1186            }
1187
1188            /// Sets the value of [r#type][crate::model::document::page::Matrix::type].
1189            pub fn set_type<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1190                self.r#type = v.into();
1191                self
1192            }
1193
1194            /// Sets the value of [data][crate::model::document::page::Matrix::data].
1195            pub fn set_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1196                self.data = v.into();
1197                self
1198            }
1199        }
1200
1201        impl wkt::message::Message for Matrix {
1202            fn typename() -> &'static str {
1203                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Matrix"
1204            }
1205        }
1206
1207        /// Visual element describing a layout unit on a page.
1208        #[derive(Clone, Default, PartialEq)]
1209        #[non_exhaustive]
1210        pub struct Layout {
1211            /// Text anchor indexing into the
1212            /// [Document.text][google.cloud.documentai.v1.Document.text].
1213            ///
1214            /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
1215            pub text_anchor: std::option::Option<crate::model::document::TextAnchor>,
1216
1217            /// Confidence of the current
1218            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] within
1219            /// context of the object this layout is for. e.g. confidence can be for a
1220            /// single token, a table, a visual element, etc. depending on context.
1221            /// Range `[0, 1]`.
1222            ///
1223            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1224            pub confidence: f32,
1225
1226            /// The bounding polygon for the
1227            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout].
1228            ///
1229            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1230            pub bounding_poly: std::option::Option<crate::model::BoundingPoly>,
1231
1232            /// Detected orientation for the
1233            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout].
1234            ///
1235            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1236            pub orientation: crate::model::document::page::layout::Orientation,
1237
1238            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1239        }
1240
1241        impl Layout {
1242            pub fn new() -> Self {
1243                std::default::Default::default()
1244            }
1245
1246            /// Sets the value of [text_anchor][crate::model::document::page::Layout::text_anchor].
1247            pub fn set_text_anchor<T>(mut self, v: T) -> Self
1248            where
1249                T: std::convert::Into<crate::model::document::TextAnchor>,
1250            {
1251                self.text_anchor = std::option::Option::Some(v.into());
1252                self
1253            }
1254
1255            /// Sets or clears the value of [text_anchor][crate::model::document::page::Layout::text_anchor].
1256            pub fn set_or_clear_text_anchor<T>(mut self, v: std::option::Option<T>) -> Self
1257            where
1258                T: std::convert::Into<crate::model::document::TextAnchor>,
1259            {
1260                self.text_anchor = v.map(|x| x.into());
1261                self
1262            }
1263
1264            /// Sets the value of [confidence][crate::model::document::page::Layout::confidence].
1265            pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1266                self.confidence = v.into();
1267                self
1268            }
1269
1270            /// Sets the value of [bounding_poly][crate::model::document::page::Layout::bounding_poly].
1271            pub fn set_bounding_poly<T>(mut self, v: T) -> Self
1272            where
1273                T: std::convert::Into<crate::model::BoundingPoly>,
1274            {
1275                self.bounding_poly = std::option::Option::Some(v.into());
1276                self
1277            }
1278
1279            /// Sets or clears the value of [bounding_poly][crate::model::document::page::Layout::bounding_poly].
1280            pub fn set_or_clear_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
1281            where
1282                T: std::convert::Into<crate::model::BoundingPoly>,
1283            {
1284                self.bounding_poly = v.map(|x| x.into());
1285                self
1286            }
1287
1288            /// Sets the value of [orientation][crate::model::document::page::Layout::orientation].
1289            pub fn set_orientation<
1290                T: std::convert::Into<crate::model::document::page::layout::Orientation>,
1291            >(
1292                mut self,
1293                v: T,
1294            ) -> Self {
1295                self.orientation = v.into();
1296                self
1297            }
1298        }
1299
1300        impl wkt::message::Message for Layout {
1301            fn typename() -> &'static str {
1302                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Layout"
1303            }
1304        }
1305
1306        /// Defines additional types related to [Layout].
1307        pub mod layout {
1308            #[allow(unused_imports)]
1309            use super::*;
1310
1311            /// Detected human reading orientation.
1312            ///
1313            /// # Working with unknown values
1314            ///
1315            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1316            /// additional enum variants at any time. Adding new variants is not considered
1317            /// a breaking change. Applications should write their code in anticipation of:
1318            ///
1319            /// - New values appearing in future releases of the client library, **and**
1320            /// - New values received dynamically, without application changes.
1321            ///
1322            /// Please consult the [Working with enums] section in the user guide for some
1323            /// guidelines.
1324            ///
1325            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1326            #[derive(Clone, Debug, PartialEq)]
1327            #[non_exhaustive]
1328            pub enum Orientation {
1329                /// Unspecified orientation.
1330                Unspecified,
1331                /// Orientation is aligned with page up.
1332                PageUp,
1333                /// Orientation is aligned with page right.
1334                /// Turn the head 90 degrees clockwise from upright to read.
1335                PageRight,
1336                /// Orientation is aligned with page down.
1337                /// Turn the head 180 degrees from upright to read.
1338                PageDown,
1339                /// Orientation is aligned with page left.
1340                /// Turn the head 90 degrees counterclockwise from upright to read.
1341                PageLeft,
1342                /// If set, the enum was initialized with an unknown value.
1343                ///
1344                /// Applications can examine the value using [Orientation::value] or
1345                /// [Orientation::name].
1346                UnknownValue(orientation::UnknownValue),
1347            }
1348
1349            #[doc(hidden)]
1350            pub mod orientation {
1351                #[allow(unused_imports)]
1352                use super::*;
1353                #[derive(Clone, Debug, PartialEq)]
1354                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1355            }
1356
1357            impl Orientation {
1358                /// Gets the enum value.
1359                ///
1360                /// Returns `None` if the enum contains an unknown value deserialized from
1361                /// the string representation of enums.
1362                pub fn value(&self) -> std::option::Option<i32> {
1363                    match self {
1364                        Self::Unspecified => std::option::Option::Some(0),
1365                        Self::PageUp => std::option::Option::Some(1),
1366                        Self::PageRight => std::option::Option::Some(2),
1367                        Self::PageDown => std::option::Option::Some(3),
1368                        Self::PageLeft => std::option::Option::Some(4),
1369                        Self::UnknownValue(u) => u.0.value(),
1370                    }
1371                }
1372
1373                /// Gets the enum value as a string.
1374                ///
1375                /// Returns `None` if the enum contains an unknown value deserialized from
1376                /// the integer representation of enums.
1377                pub fn name(&self) -> std::option::Option<&str> {
1378                    match self {
1379                        Self::Unspecified => std::option::Option::Some("ORIENTATION_UNSPECIFIED"),
1380                        Self::PageUp => std::option::Option::Some("PAGE_UP"),
1381                        Self::PageRight => std::option::Option::Some("PAGE_RIGHT"),
1382                        Self::PageDown => std::option::Option::Some("PAGE_DOWN"),
1383                        Self::PageLeft => std::option::Option::Some("PAGE_LEFT"),
1384                        Self::UnknownValue(u) => u.0.name(),
1385                    }
1386                }
1387            }
1388
1389            impl std::default::Default for Orientation {
1390                fn default() -> Self {
1391                    use std::convert::From;
1392                    Self::from(0)
1393                }
1394            }
1395
1396            impl std::fmt::Display for Orientation {
1397                fn fmt(
1398                    &self,
1399                    f: &mut std::fmt::Formatter<'_>,
1400                ) -> std::result::Result<(), std::fmt::Error> {
1401                    wkt::internal::display_enum(f, self.name(), self.value())
1402                }
1403            }
1404
1405            impl std::convert::From<i32> for Orientation {
1406                fn from(value: i32) -> Self {
1407                    match value {
1408                        0 => Self::Unspecified,
1409                        1 => Self::PageUp,
1410                        2 => Self::PageRight,
1411                        3 => Self::PageDown,
1412                        4 => Self::PageLeft,
1413                        _ => Self::UnknownValue(orientation::UnknownValue(
1414                            wkt::internal::UnknownEnumValue::Integer(value),
1415                        )),
1416                    }
1417                }
1418            }
1419
1420            impl std::convert::From<&str> for Orientation {
1421                fn from(value: &str) -> Self {
1422                    use std::string::ToString;
1423                    match value {
1424                        "ORIENTATION_UNSPECIFIED" => Self::Unspecified,
1425                        "PAGE_UP" => Self::PageUp,
1426                        "PAGE_RIGHT" => Self::PageRight,
1427                        "PAGE_DOWN" => Self::PageDown,
1428                        "PAGE_LEFT" => Self::PageLeft,
1429                        _ => Self::UnknownValue(orientation::UnknownValue(
1430                            wkt::internal::UnknownEnumValue::String(value.to_string()),
1431                        )),
1432                    }
1433                }
1434            }
1435
1436            impl serde::ser::Serialize for Orientation {
1437                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1438                where
1439                    S: serde::Serializer,
1440                {
1441                    match self {
1442                        Self::Unspecified => serializer.serialize_i32(0),
1443                        Self::PageUp => serializer.serialize_i32(1),
1444                        Self::PageRight => serializer.serialize_i32(2),
1445                        Self::PageDown => serializer.serialize_i32(3),
1446                        Self::PageLeft => serializer.serialize_i32(4),
1447                        Self::UnknownValue(u) => u.0.serialize(serializer),
1448                    }
1449                }
1450            }
1451
1452            impl<'de> serde::de::Deserialize<'de> for Orientation {
1453                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1454                where
1455                    D: serde::Deserializer<'de>,
1456                {
1457                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<Orientation>::new(
1458                        ".google.cloud.documentai.v1.Document.Page.Layout.Orientation",
1459                    ))
1460                }
1461            }
1462        }
1463
1464        /// A block has a set of lines (collected into paragraphs) that have a
1465        /// common line-spacing and orientation.
1466        #[derive(Clone, Default, PartialEq)]
1467        #[non_exhaustive]
1468        pub struct Block {
1469            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
1470            /// [Block][google.cloud.documentai.v1.Document.Page.Block].
1471            ///
1472            /// [google.cloud.documentai.v1.Document.Page.Block]: crate::model::document::page::Block
1473            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1474            pub layout: std::option::Option<crate::model::document::page::Layout>,
1475
1476            /// A list of detected languages together with confidence.
1477            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
1478
1479            /// The history of this annotation.
1480            #[deprecated]
1481            pub provenance: std::option::Option<crate::model::document::Provenance>,
1482
1483            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1484        }
1485
1486        impl Block {
1487            pub fn new() -> Self {
1488                std::default::Default::default()
1489            }
1490
1491            /// Sets the value of [layout][crate::model::document::page::Block::layout].
1492            pub fn set_layout<T>(mut self, v: T) -> Self
1493            where
1494                T: std::convert::Into<crate::model::document::page::Layout>,
1495            {
1496                self.layout = std::option::Option::Some(v.into());
1497                self
1498            }
1499
1500            /// Sets or clears the value of [layout][crate::model::document::page::Block::layout].
1501            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
1502            where
1503                T: std::convert::Into<crate::model::document::page::Layout>,
1504            {
1505                self.layout = v.map(|x| x.into());
1506                self
1507            }
1508
1509            /// Sets the value of [detected_languages][crate::model::document::page::Block::detected_languages].
1510            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
1511            where
1512                T: std::iter::IntoIterator<Item = V>,
1513                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
1514            {
1515                use std::iter::Iterator;
1516                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
1517                self
1518            }
1519
1520            /// Sets the value of [provenance][crate::model::document::page::Block::provenance].
1521            #[deprecated]
1522            pub fn set_provenance<T>(mut self, v: T) -> Self
1523            where
1524                T: std::convert::Into<crate::model::document::Provenance>,
1525            {
1526                self.provenance = std::option::Option::Some(v.into());
1527                self
1528            }
1529
1530            /// Sets or clears the value of [provenance][crate::model::document::page::Block::provenance].
1531            #[deprecated]
1532            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
1533            where
1534                T: std::convert::Into<crate::model::document::Provenance>,
1535            {
1536                self.provenance = v.map(|x| x.into());
1537                self
1538            }
1539        }
1540
1541        impl wkt::message::Message for Block {
1542            fn typename() -> &'static str {
1543                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Block"
1544            }
1545        }
1546
1547        /// A collection of lines that a human would perceive as a paragraph.
1548        #[derive(Clone, Default, PartialEq)]
1549        #[non_exhaustive]
1550        pub struct Paragraph {
1551            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
1552            /// [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
1553            ///
1554            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1555            /// [google.cloud.documentai.v1.Document.Page.Paragraph]: crate::model::document::page::Paragraph
1556            pub layout: std::option::Option<crate::model::document::page::Layout>,
1557
1558            /// A list of detected languages together with confidence.
1559            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
1560
1561            /// The  history of this annotation.
1562            #[deprecated]
1563            pub provenance: std::option::Option<crate::model::document::Provenance>,
1564
1565            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1566        }
1567
1568        impl Paragraph {
1569            pub fn new() -> Self {
1570                std::default::Default::default()
1571            }
1572
1573            /// Sets the value of [layout][crate::model::document::page::Paragraph::layout].
1574            pub fn set_layout<T>(mut self, v: T) -> Self
1575            where
1576                T: std::convert::Into<crate::model::document::page::Layout>,
1577            {
1578                self.layout = std::option::Option::Some(v.into());
1579                self
1580            }
1581
1582            /// Sets or clears the value of [layout][crate::model::document::page::Paragraph::layout].
1583            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
1584            where
1585                T: std::convert::Into<crate::model::document::page::Layout>,
1586            {
1587                self.layout = v.map(|x| x.into());
1588                self
1589            }
1590
1591            /// Sets the value of [detected_languages][crate::model::document::page::Paragraph::detected_languages].
1592            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
1593            where
1594                T: std::iter::IntoIterator<Item = V>,
1595                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
1596            {
1597                use std::iter::Iterator;
1598                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
1599                self
1600            }
1601
1602            /// Sets the value of [provenance][crate::model::document::page::Paragraph::provenance].
1603            #[deprecated]
1604            pub fn set_provenance<T>(mut self, v: T) -> Self
1605            where
1606                T: std::convert::Into<crate::model::document::Provenance>,
1607            {
1608                self.provenance = std::option::Option::Some(v.into());
1609                self
1610            }
1611
1612            /// Sets or clears the value of [provenance][crate::model::document::page::Paragraph::provenance].
1613            #[deprecated]
1614            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
1615            where
1616                T: std::convert::Into<crate::model::document::Provenance>,
1617            {
1618                self.provenance = v.map(|x| x.into());
1619                self
1620            }
1621        }
1622
1623        impl wkt::message::Message for Paragraph {
1624            fn typename() -> &'static str {
1625                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Paragraph"
1626            }
1627        }
1628
1629        /// A collection of tokens that a human would perceive as a line.
1630        /// Does not cross column boundaries, can be horizontal, vertical, etc.
1631        #[derive(Clone, Default, PartialEq)]
1632        #[non_exhaustive]
1633        pub struct Line {
1634            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
1635            /// [Line][google.cloud.documentai.v1.Document.Page.Line].
1636            ///
1637            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1638            /// [google.cloud.documentai.v1.Document.Page.Line]: crate::model::document::page::Line
1639            pub layout: std::option::Option<crate::model::document::page::Layout>,
1640
1641            /// A list of detected languages together with confidence.
1642            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
1643
1644            /// The  history of this annotation.
1645            #[deprecated]
1646            pub provenance: std::option::Option<crate::model::document::Provenance>,
1647
1648            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1649        }
1650
1651        impl Line {
1652            pub fn new() -> Self {
1653                std::default::Default::default()
1654            }
1655
1656            /// Sets the value of [layout][crate::model::document::page::Line::layout].
1657            pub fn set_layout<T>(mut self, v: T) -> Self
1658            where
1659                T: std::convert::Into<crate::model::document::page::Layout>,
1660            {
1661                self.layout = std::option::Option::Some(v.into());
1662                self
1663            }
1664
1665            /// Sets or clears the value of [layout][crate::model::document::page::Line::layout].
1666            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
1667            where
1668                T: std::convert::Into<crate::model::document::page::Layout>,
1669            {
1670                self.layout = v.map(|x| x.into());
1671                self
1672            }
1673
1674            /// Sets the value of [detected_languages][crate::model::document::page::Line::detected_languages].
1675            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
1676            where
1677                T: std::iter::IntoIterator<Item = V>,
1678                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
1679            {
1680                use std::iter::Iterator;
1681                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
1682                self
1683            }
1684
1685            /// Sets the value of [provenance][crate::model::document::page::Line::provenance].
1686            #[deprecated]
1687            pub fn set_provenance<T>(mut self, v: T) -> Self
1688            where
1689                T: std::convert::Into<crate::model::document::Provenance>,
1690            {
1691                self.provenance = std::option::Option::Some(v.into());
1692                self
1693            }
1694
1695            /// Sets or clears the value of [provenance][crate::model::document::page::Line::provenance].
1696            #[deprecated]
1697            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
1698            where
1699                T: std::convert::Into<crate::model::document::Provenance>,
1700            {
1701                self.provenance = v.map(|x| x.into());
1702                self
1703            }
1704        }
1705
1706        impl wkt::message::Message for Line {
1707            fn typename() -> &'static str {
1708                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Line"
1709            }
1710        }
1711
1712        /// A detected token.
1713        #[derive(Clone, Default, PartialEq)]
1714        #[non_exhaustive]
1715        pub struct Token {
1716            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
1717            /// [Token][google.cloud.documentai.v1.Document.Page.Token].
1718            ///
1719            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1720            /// [google.cloud.documentai.v1.Document.Page.Token]: crate::model::document::page::Token
1721            pub layout: std::option::Option<crate::model::document::page::Layout>,
1722
1723            /// Detected break at the end of a
1724            /// [Token][google.cloud.documentai.v1.Document.Page.Token].
1725            ///
1726            /// [google.cloud.documentai.v1.Document.Page.Token]: crate::model::document::page::Token
1727            pub detected_break:
1728                std::option::Option<crate::model::document::page::token::DetectedBreak>,
1729
1730            /// A list of detected languages together with confidence.
1731            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
1732
1733            /// The history of this annotation.
1734            #[deprecated]
1735            pub provenance: std::option::Option<crate::model::document::Provenance>,
1736
1737            /// Text style attributes.
1738            pub style_info: std::option::Option<crate::model::document::page::token::StyleInfo>,
1739
1740            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1741        }
1742
1743        impl Token {
1744            pub fn new() -> Self {
1745                std::default::Default::default()
1746            }
1747
1748            /// Sets the value of [layout][crate::model::document::page::Token::layout].
1749            pub fn set_layout<T>(mut self, v: T) -> Self
1750            where
1751                T: std::convert::Into<crate::model::document::page::Layout>,
1752            {
1753                self.layout = std::option::Option::Some(v.into());
1754                self
1755            }
1756
1757            /// Sets or clears the value of [layout][crate::model::document::page::Token::layout].
1758            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
1759            where
1760                T: std::convert::Into<crate::model::document::page::Layout>,
1761            {
1762                self.layout = v.map(|x| x.into());
1763                self
1764            }
1765
1766            /// Sets the value of [detected_break][crate::model::document::page::Token::detected_break].
1767            pub fn set_detected_break<T>(mut self, v: T) -> Self
1768            where
1769                T: std::convert::Into<crate::model::document::page::token::DetectedBreak>,
1770            {
1771                self.detected_break = std::option::Option::Some(v.into());
1772                self
1773            }
1774
1775            /// Sets or clears the value of [detected_break][crate::model::document::page::Token::detected_break].
1776            pub fn set_or_clear_detected_break<T>(mut self, v: std::option::Option<T>) -> Self
1777            where
1778                T: std::convert::Into<crate::model::document::page::token::DetectedBreak>,
1779            {
1780                self.detected_break = v.map(|x| x.into());
1781                self
1782            }
1783
1784            /// Sets the value of [detected_languages][crate::model::document::page::Token::detected_languages].
1785            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
1786            where
1787                T: std::iter::IntoIterator<Item = V>,
1788                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
1789            {
1790                use std::iter::Iterator;
1791                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
1792                self
1793            }
1794
1795            /// Sets the value of [provenance][crate::model::document::page::Token::provenance].
1796            #[deprecated]
1797            pub fn set_provenance<T>(mut self, v: T) -> Self
1798            where
1799                T: std::convert::Into<crate::model::document::Provenance>,
1800            {
1801                self.provenance = std::option::Option::Some(v.into());
1802                self
1803            }
1804
1805            /// Sets or clears the value of [provenance][crate::model::document::page::Token::provenance].
1806            #[deprecated]
1807            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
1808            where
1809                T: std::convert::Into<crate::model::document::Provenance>,
1810            {
1811                self.provenance = v.map(|x| x.into());
1812                self
1813            }
1814
1815            /// Sets the value of [style_info][crate::model::document::page::Token::style_info].
1816            pub fn set_style_info<T>(mut self, v: T) -> Self
1817            where
1818                T: std::convert::Into<crate::model::document::page::token::StyleInfo>,
1819            {
1820                self.style_info = std::option::Option::Some(v.into());
1821                self
1822            }
1823
1824            /// Sets or clears the value of [style_info][crate::model::document::page::Token::style_info].
1825            pub fn set_or_clear_style_info<T>(mut self, v: std::option::Option<T>) -> Self
1826            where
1827                T: std::convert::Into<crate::model::document::page::token::StyleInfo>,
1828            {
1829                self.style_info = v.map(|x| x.into());
1830                self
1831            }
1832        }
1833
1834        impl wkt::message::Message for Token {
1835            fn typename() -> &'static str {
1836                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Token"
1837            }
1838        }
1839
1840        /// Defines additional types related to [Token].
1841        pub mod token {
1842            #[allow(unused_imports)]
1843            use super::*;
1844
1845            /// Detected break at the end of a
1846            /// [Token][google.cloud.documentai.v1.Document.Page.Token].
1847            ///
1848            /// [google.cloud.documentai.v1.Document.Page.Token]: crate::model::document::page::Token
1849            #[derive(Clone, Default, PartialEq)]
1850            #[non_exhaustive]
1851            pub struct DetectedBreak {
1852                /// Detected break type.
1853                pub r#type: crate::model::document::page::token::detected_break::Type,
1854
1855                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1856            }
1857
1858            impl DetectedBreak {
1859                pub fn new() -> Self {
1860                    std::default::Default::default()
1861                }
1862
1863                /// Sets the value of [r#type][crate::model::document::page::token::DetectedBreak::type].
1864                pub fn set_type<
1865                    T: std::convert::Into<crate::model::document::page::token::detected_break::Type>,
1866                >(
1867                    mut self,
1868                    v: T,
1869                ) -> Self {
1870                    self.r#type = v.into();
1871                    self
1872                }
1873            }
1874
1875            impl wkt::message::Message for DetectedBreak {
1876                fn typename() -> &'static str {
1877                    "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Token.DetectedBreak"
1878                }
1879            }
1880
1881            /// Defines additional types related to [DetectedBreak].
1882            pub mod detected_break {
1883                #[allow(unused_imports)]
1884                use super::*;
1885
1886                /// Enum to denote the type of break found.
1887                ///
1888                /// # Working with unknown values
1889                ///
1890                /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1891                /// additional enum variants at any time. Adding new variants is not considered
1892                /// a breaking change. Applications should write their code in anticipation of:
1893                ///
1894                /// - New values appearing in future releases of the client library, **and**
1895                /// - New values received dynamically, without application changes.
1896                ///
1897                /// Please consult the [Working with enums] section in the user guide for some
1898                /// guidelines.
1899                ///
1900                /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1901                #[derive(Clone, Debug, PartialEq)]
1902                #[non_exhaustive]
1903                pub enum Type {
1904                    /// Unspecified break type.
1905                    Unspecified,
1906                    /// A single whitespace.
1907                    Space,
1908                    /// A wider whitespace.
1909                    WideSpace,
1910                    /// A hyphen that indicates that a token has been split across lines.
1911                    Hyphen,
1912                    /// If set, the enum was initialized with an unknown value.
1913                    ///
1914                    /// Applications can examine the value using [Type::value] or
1915                    /// [Type::name].
1916                    UnknownValue(r#type::UnknownValue),
1917                }
1918
1919                #[doc(hidden)]
1920                pub mod r#type {
1921                    #[allow(unused_imports)]
1922                    use super::*;
1923                    #[derive(Clone, Debug, PartialEq)]
1924                    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1925                }
1926
1927                impl Type {
1928                    /// Gets the enum value.
1929                    ///
1930                    /// Returns `None` if the enum contains an unknown value deserialized from
1931                    /// the string representation of enums.
1932                    pub fn value(&self) -> std::option::Option<i32> {
1933                        match self {
1934                            Self::Unspecified => std::option::Option::Some(0),
1935                            Self::Space => std::option::Option::Some(1),
1936                            Self::WideSpace => std::option::Option::Some(2),
1937                            Self::Hyphen => std::option::Option::Some(3),
1938                            Self::UnknownValue(u) => u.0.value(),
1939                        }
1940                    }
1941
1942                    /// Gets the enum value as a string.
1943                    ///
1944                    /// Returns `None` if the enum contains an unknown value deserialized from
1945                    /// the integer representation of enums.
1946                    pub fn name(&self) -> std::option::Option<&str> {
1947                        match self {
1948                            Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1949                            Self::Space => std::option::Option::Some("SPACE"),
1950                            Self::WideSpace => std::option::Option::Some("WIDE_SPACE"),
1951                            Self::Hyphen => std::option::Option::Some("HYPHEN"),
1952                            Self::UnknownValue(u) => u.0.name(),
1953                        }
1954                    }
1955                }
1956
1957                impl std::default::Default for Type {
1958                    fn default() -> Self {
1959                        use std::convert::From;
1960                        Self::from(0)
1961                    }
1962                }
1963
1964                impl std::fmt::Display for Type {
1965                    fn fmt(
1966                        &self,
1967                        f: &mut std::fmt::Formatter<'_>,
1968                    ) -> std::result::Result<(), std::fmt::Error> {
1969                        wkt::internal::display_enum(f, self.name(), self.value())
1970                    }
1971                }
1972
1973                impl std::convert::From<i32> for Type {
1974                    fn from(value: i32) -> Self {
1975                        match value {
1976                            0 => Self::Unspecified,
1977                            1 => Self::Space,
1978                            2 => Self::WideSpace,
1979                            3 => Self::Hyphen,
1980                            _ => Self::UnknownValue(r#type::UnknownValue(
1981                                wkt::internal::UnknownEnumValue::Integer(value),
1982                            )),
1983                        }
1984                    }
1985                }
1986
1987                impl std::convert::From<&str> for Type {
1988                    fn from(value: &str) -> Self {
1989                        use std::string::ToString;
1990                        match value {
1991                            "TYPE_UNSPECIFIED" => Self::Unspecified,
1992                            "SPACE" => Self::Space,
1993                            "WIDE_SPACE" => Self::WideSpace,
1994                            "HYPHEN" => Self::Hyphen,
1995                            _ => Self::UnknownValue(r#type::UnknownValue(
1996                                wkt::internal::UnknownEnumValue::String(value.to_string()),
1997                            )),
1998                        }
1999                    }
2000                }
2001
2002                impl serde::ser::Serialize for Type {
2003                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2004                    where
2005                        S: serde::Serializer,
2006                    {
2007                        match self {
2008                            Self::Unspecified => serializer.serialize_i32(0),
2009                            Self::Space => serializer.serialize_i32(1),
2010                            Self::WideSpace => serializer.serialize_i32(2),
2011                            Self::Hyphen => serializer.serialize_i32(3),
2012                            Self::UnknownValue(u) => u.0.serialize(serializer),
2013                        }
2014                    }
2015                }
2016
2017                impl<'de> serde::de::Deserialize<'de> for Type {
2018                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2019                    where
2020                        D: serde::Deserializer<'de>,
2021                    {
2022                        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
2023                            ".google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type",
2024                        ))
2025                    }
2026                }
2027            }
2028
2029            /// Font and other text style attributes.
2030            #[derive(Clone, Default, PartialEq)]
2031            #[non_exhaustive]
2032            pub struct StyleInfo {
2033                /// Font size in points (`1` point is `¹⁄₇₂` inches).
2034                pub font_size: i32,
2035
2036                /// Font size in pixels, equal to _unrounded
2037                /// [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_
2038                ///
2039                /// * _resolution_ ÷ `72.0`.
2040                ///
2041                /// [google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]: crate::model::document::page::token::StyleInfo::font_size
2042                pub pixel_font_size: f64,
2043
2044                /// Letter spacing in points.
2045                pub letter_spacing: f64,
2046
2047                /// Name or style of the font.
2048                pub font_type: std::string::String,
2049
2050                /// Whether the text is bold (equivalent to
2051                /// [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight]
2052                /// is at least `700`).
2053                ///
2054                /// [google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight]: crate::model::document::page::token::StyleInfo::font_weight
2055                pub bold: bool,
2056
2057                /// Whether the text is italic.
2058                pub italic: bool,
2059
2060                /// Whether the text is underlined.
2061                pub underlined: bool,
2062
2063                /// Whether the text is strikethrough. This feature is not supported yet.
2064                pub strikeout: bool,
2065
2066                /// Whether the text is a subscript. This feature is not supported yet.
2067                pub subscript: bool,
2068
2069                /// Whether the text is a superscript. This feature is not supported yet.
2070                pub superscript: bool,
2071
2072                /// Whether the text is in small caps. This feature is not supported yet.
2073                pub smallcaps: bool,
2074
2075                /// TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy).
2076                /// Normal is `400`, bold is `700`.
2077                pub font_weight: i32,
2078
2079                /// Whether the text is handwritten.
2080                pub handwritten: bool,
2081
2082                /// Color of the text.
2083                pub text_color: std::option::Option<gtype::model::Color>,
2084
2085                /// Color of the background.
2086                pub background_color: std::option::Option<gtype::model::Color>,
2087
2088                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2089            }
2090
2091            impl StyleInfo {
2092                pub fn new() -> Self {
2093                    std::default::Default::default()
2094                }
2095
2096                /// Sets the value of [font_size][crate::model::document::page::token::StyleInfo::font_size].
2097                pub fn set_font_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2098                    self.font_size = v.into();
2099                    self
2100                }
2101
2102                /// Sets the value of [pixel_font_size][crate::model::document::page::token::StyleInfo::pixel_font_size].
2103                pub fn set_pixel_font_size<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2104                    self.pixel_font_size = v.into();
2105                    self
2106                }
2107
2108                /// Sets the value of [letter_spacing][crate::model::document::page::token::StyleInfo::letter_spacing].
2109                pub fn set_letter_spacing<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2110                    self.letter_spacing = v.into();
2111                    self
2112                }
2113
2114                /// Sets the value of [font_type][crate::model::document::page::token::StyleInfo::font_type].
2115                pub fn set_font_type<T: std::convert::Into<std::string::String>>(
2116                    mut self,
2117                    v: T,
2118                ) -> Self {
2119                    self.font_type = v.into();
2120                    self
2121                }
2122
2123                /// Sets the value of [bold][crate::model::document::page::token::StyleInfo::bold].
2124                pub fn set_bold<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2125                    self.bold = v.into();
2126                    self
2127                }
2128
2129                /// Sets the value of [italic][crate::model::document::page::token::StyleInfo::italic].
2130                pub fn set_italic<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2131                    self.italic = v.into();
2132                    self
2133                }
2134
2135                /// Sets the value of [underlined][crate::model::document::page::token::StyleInfo::underlined].
2136                pub fn set_underlined<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2137                    self.underlined = v.into();
2138                    self
2139                }
2140
2141                /// Sets the value of [strikeout][crate::model::document::page::token::StyleInfo::strikeout].
2142                pub fn set_strikeout<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2143                    self.strikeout = v.into();
2144                    self
2145                }
2146
2147                /// Sets the value of [subscript][crate::model::document::page::token::StyleInfo::subscript].
2148                pub fn set_subscript<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2149                    self.subscript = v.into();
2150                    self
2151                }
2152
2153                /// Sets the value of [superscript][crate::model::document::page::token::StyleInfo::superscript].
2154                pub fn set_superscript<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2155                    self.superscript = v.into();
2156                    self
2157                }
2158
2159                /// Sets the value of [smallcaps][crate::model::document::page::token::StyleInfo::smallcaps].
2160                pub fn set_smallcaps<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2161                    self.smallcaps = v.into();
2162                    self
2163                }
2164
2165                /// Sets the value of [font_weight][crate::model::document::page::token::StyleInfo::font_weight].
2166                pub fn set_font_weight<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2167                    self.font_weight = v.into();
2168                    self
2169                }
2170
2171                /// Sets the value of [handwritten][crate::model::document::page::token::StyleInfo::handwritten].
2172                pub fn set_handwritten<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2173                    self.handwritten = v.into();
2174                    self
2175                }
2176
2177                /// Sets the value of [text_color][crate::model::document::page::token::StyleInfo::text_color].
2178                pub fn set_text_color<T>(mut self, v: T) -> Self
2179                where
2180                    T: std::convert::Into<gtype::model::Color>,
2181                {
2182                    self.text_color = std::option::Option::Some(v.into());
2183                    self
2184                }
2185
2186                /// Sets or clears the value of [text_color][crate::model::document::page::token::StyleInfo::text_color].
2187                pub fn set_or_clear_text_color<T>(mut self, v: std::option::Option<T>) -> Self
2188                where
2189                    T: std::convert::Into<gtype::model::Color>,
2190                {
2191                    self.text_color = v.map(|x| x.into());
2192                    self
2193                }
2194
2195                /// Sets the value of [background_color][crate::model::document::page::token::StyleInfo::background_color].
2196                pub fn set_background_color<T>(mut self, v: T) -> Self
2197                where
2198                    T: std::convert::Into<gtype::model::Color>,
2199                {
2200                    self.background_color = std::option::Option::Some(v.into());
2201                    self
2202                }
2203
2204                /// Sets or clears the value of [background_color][crate::model::document::page::token::StyleInfo::background_color].
2205                pub fn set_or_clear_background_color<T>(mut self, v: std::option::Option<T>) -> Self
2206                where
2207                    T: std::convert::Into<gtype::model::Color>,
2208                {
2209                    self.background_color = v.map(|x| x.into());
2210                    self
2211                }
2212            }
2213
2214            impl wkt::message::Message for StyleInfo {
2215                fn typename() -> &'static str {
2216                    "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Token.StyleInfo"
2217                }
2218            }
2219        }
2220
2221        /// A detected symbol.
2222        #[derive(Clone, Default, PartialEq)]
2223        #[non_exhaustive]
2224        pub struct Symbol {
2225            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
2226            /// [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
2227            ///
2228            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2229            /// [google.cloud.documentai.v1.Document.Page.Symbol]: crate::model::document::page::Symbol
2230            pub layout: std::option::Option<crate::model::document::page::Layout>,
2231
2232            /// A list of detected languages together with confidence.
2233            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
2234
2235            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2236        }
2237
2238        impl Symbol {
2239            pub fn new() -> Self {
2240                std::default::Default::default()
2241            }
2242
2243            /// Sets the value of [layout][crate::model::document::page::Symbol::layout].
2244            pub fn set_layout<T>(mut self, v: T) -> Self
2245            where
2246                T: std::convert::Into<crate::model::document::page::Layout>,
2247            {
2248                self.layout = std::option::Option::Some(v.into());
2249                self
2250            }
2251
2252            /// Sets or clears the value of [layout][crate::model::document::page::Symbol::layout].
2253            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
2254            where
2255                T: std::convert::Into<crate::model::document::page::Layout>,
2256            {
2257                self.layout = v.map(|x| x.into());
2258                self
2259            }
2260
2261            /// Sets the value of [detected_languages][crate::model::document::page::Symbol::detected_languages].
2262            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
2263            where
2264                T: std::iter::IntoIterator<Item = V>,
2265                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
2266            {
2267                use std::iter::Iterator;
2268                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
2269                self
2270            }
2271        }
2272
2273        impl wkt::message::Message for Symbol {
2274            fn typename() -> &'static str {
2275                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Symbol"
2276            }
2277        }
2278
2279        /// Detected non-text visual elements e.g. checkbox, signature etc. on the
2280        /// page.
2281        #[derive(Clone, Default, PartialEq)]
2282        #[non_exhaustive]
2283        pub struct VisualElement {
2284            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
2285            /// [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
2286            ///
2287            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2288            /// [google.cloud.documentai.v1.Document.Page.VisualElement]: crate::model::document::page::VisualElement
2289            pub layout: std::option::Option<crate::model::document::page::Layout>,
2290
2291            /// Type of the
2292            /// [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
2293            ///
2294            /// [google.cloud.documentai.v1.Document.Page.VisualElement]: crate::model::document::page::VisualElement
2295            pub r#type: std::string::String,
2296
2297            /// A list of detected languages together with confidence.
2298            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
2299
2300            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2301        }
2302
2303        impl VisualElement {
2304            pub fn new() -> Self {
2305                std::default::Default::default()
2306            }
2307
2308            /// Sets the value of [layout][crate::model::document::page::VisualElement::layout].
2309            pub fn set_layout<T>(mut self, v: T) -> Self
2310            where
2311                T: std::convert::Into<crate::model::document::page::Layout>,
2312            {
2313                self.layout = std::option::Option::Some(v.into());
2314                self
2315            }
2316
2317            /// Sets or clears the value of [layout][crate::model::document::page::VisualElement::layout].
2318            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
2319            where
2320                T: std::convert::Into<crate::model::document::page::Layout>,
2321            {
2322                self.layout = v.map(|x| x.into());
2323                self
2324            }
2325
2326            /// Sets the value of [r#type][crate::model::document::page::VisualElement::type].
2327            pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2328                self.r#type = v.into();
2329                self
2330            }
2331
2332            /// Sets the value of [detected_languages][crate::model::document::page::VisualElement::detected_languages].
2333            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
2334            where
2335                T: std::iter::IntoIterator<Item = V>,
2336                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
2337            {
2338                use std::iter::Iterator;
2339                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
2340                self
2341            }
2342        }
2343
2344        impl wkt::message::Message for VisualElement {
2345            fn typename() -> &'static str {
2346                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.VisualElement"
2347            }
2348        }
2349
2350        /// A table representation similar to HTML table structure.
2351        #[derive(Clone, Default, PartialEq)]
2352        #[non_exhaustive]
2353        pub struct Table {
2354            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
2355            /// [Table][google.cloud.documentai.v1.Document.Page.Table].
2356            ///
2357            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2358            /// [google.cloud.documentai.v1.Document.Page.Table]: crate::model::document::page::Table
2359            pub layout: std::option::Option<crate::model::document::page::Layout>,
2360
2361            /// Header rows of the table.
2362            pub header_rows: std::vec::Vec<crate::model::document::page::table::TableRow>,
2363
2364            /// Body rows of the table.
2365            pub body_rows: std::vec::Vec<crate::model::document::page::table::TableRow>,
2366
2367            /// A list of detected languages together with confidence.
2368            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
2369
2370            /// The history of this table.
2371            #[deprecated]
2372            pub provenance: std::option::Option<crate::model::document::Provenance>,
2373
2374            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2375        }
2376
2377        impl Table {
2378            pub fn new() -> Self {
2379                std::default::Default::default()
2380            }
2381
2382            /// Sets the value of [layout][crate::model::document::page::Table::layout].
2383            pub fn set_layout<T>(mut self, v: T) -> Self
2384            where
2385                T: std::convert::Into<crate::model::document::page::Layout>,
2386            {
2387                self.layout = std::option::Option::Some(v.into());
2388                self
2389            }
2390
2391            /// Sets or clears the value of [layout][crate::model::document::page::Table::layout].
2392            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
2393            where
2394                T: std::convert::Into<crate::model::document::page::Layout>,
2395            {
2396                self.layout = v.map(|x| x.into());
2397                self
2398            }
2399
2400            /// Sets the value of [header_rows][crate::model::document::page::Table::header_rows].
2401            pub fn set_header_rows<T, V>(mut self, v: T) -> Self
2402            where
2403                T: std::iter::IntoIterator<Item = V>,
2404                V: std::convert::Into<crate::model::document::page::table::TableRow>,
2405            {
2406                use std::iter::Iterator;
2407                self.header_rows = v.into_iter().map(|i| i.into()).collect();
2408                self
2409            }
2410
2411            /// Sets the value of [body_rows][crate::model::document::page::Table::body_rows].
2412            pub fn set_body_rows<T, V>(mut self, v: T) -> Self
2413            where
2414                T: std::iter::IntoIterator<Item = V>,
2415                V: std::convert::Into<crate::model::document::page::table::TableRow>,
2416            {
2417                use std::iter::Iterator;
2418                self.body_rows = v.into_iter().map(|i| i.into()).collect();
2419                self
2420            }
2421
2422            /// Sets the value of [detected_languages][crate::model::document::page::Table::detected_languages].
2423            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
2424            where
2425                T: std::iter::IntoIterator<Item = V>,
2426                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
2427            {
2428                use std::iter::Iterator;
2429                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
2430                self
2431            }
2432
2433            /// Sets the value of [provenance][crate::model::document::page::Table::provenance].
2434            #[deprecated]
2435            pub fn set_provenance<T>(mut self, v: T) -> Self
2436            where
2437                T: std::convert::Into<crate::model::document::Provenance>,
2438            {
2439                self.provenance = std::option::Option::Some(v.into());
2440                self
2441            }
2442
2443            /// Sets or clears the value of [provenance][crate::model::document::page::Table::provenance].
2444            #[deprecated]
2445            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
2446            where
2447                T: std::convert::Into<crate::model::document::Provenance>,
2448            {
2449                self.provenance = v.map(|x| x.into());
2450                self
2451            }
2452        }
2453
2454        impl wkt::message::Message for Table {
2455            fn typename() -> &'static str {
2456                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Table"
2457            }
2458        }
2459
2460        /// Defines additional types related to [Table].
2461        pub mod table {
2462            #[allow(unused_imports)]
2463            use super::*;
2464
2465            /// A row of table cells.
2466            #[derive(Clone, Default, PartialEq)]
2467            #[non_exhaustive]
2468            pub struct TableRow {
2469                /// Cells that make up this row.
2470                pub cells: std::vec::Vec<crate::model::document::page::table::TableCell>,
2471
2472                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2473            }
2474
2475            impl TableRow {
2476                pub fn new() -> Self {
2477                    std::default::Default::default()
2478                }
2479
2480                /// Sets the value of [cells][crate::model::document::page::table::TableRow::cells].
2481                pub fn set_cells<T, V>(mut self, v: T) -> Self
2482                where
2483                    T: std::iter::IntoIterator<Item = V>,
2484                    V: std::convert::Into<crate::model::document::page::table::TableCell>,
2485                {
2486                    use std::iter::Iterator;
2487                    self.cells = v.into_iter().map(|i| i.into()).collect();
2488                    self
2489                }
2490            }
2491
2492            impl wkt::message::Message for TableRow {
2493                fn typename() -> &'static str {
2494                    "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Table.TableRow"
2495                }
2496            }
2497
2498            /// A cell representation inside the table.
2499            #[derive(Clone, Default, PartialEq)]
2500            #[non_exhaustive]
2501            pub struct TableCell {
2502                /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
2503                /// [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
2504                ///
2505                /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2506                /// [google.cloud.documentai.v1.Document.Page.Table.TableCell]: crate::model::document::page::table::TableCell
2507                pub layout: std::option::Option<crate::model::document::page::Layout>,
2508
2509                /// How many rows this cell spans.
2510                pub row_span: i32,
2511
2512                /// How many columns this cell spans.
2513                pub col_span: i32,
2514
2515                /// A list of detected languages together with confidence.
2516                pub detected_languages:
2517                    std::vec::Vec<crate::model::document::page::DetectedLanguage>,
2518
2519                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2520            }
2521
2522            impl TableCell {
2523                pub fn new() -> Self {
2524                    std::default::Default::default()
2525                }
2526
2527                /// Sets the value of [layout][crate::model::document::page::table::TableCell::layout].
2528                pub fn set_layout<T>(mut self, v: T) -> Self
2529                where
2530                    T: std::convert::Into<crate::model::document::page::Layout>,
2531                {
2532                    self.layout = std::option::Option::Some(v.into());
2533                    self
2534                }
2535
2536                /// Sets or clears the value of [layout][crate::model::document::page::table::TableCell::layout].
2537                pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
2538                where
2539                    T: std::convert::Into<crate::model::document::page::Layout>,
2540                {
2541                    self.layout = v.map(|x| x.into());
2542                    self
2543                }
2544
2545                /// Sets the value of [row_span][crate::model::document::page::table::TableCell::row_span].
2546                pub fn set_row_span<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2547                    self.row_span = v.into();
2548                    self
2549                }
2550
2551                /// Sets the value of [col_span][crate::model::document::page::table::TableCell::col_span].
2552                pub fn set_col_span<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2553                    self.col_span = v.into();
2554                    self
2555                }
2556
2557                /// Sets the value of [detected_languages][crate::model::document::page::table::TableCell::detected_languages].
2558                pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
2559                where
2560                    T: std::iter::IntoIterator<Item = V>,
2561                    V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
2562                {
2563                    use std::iter::Iterator;
2564                    self.detected_languages = v.into_iter().map(|i| i.into()).collect();
2565                    self
2566                }
2567            }
2568
2569            impl wkt::message::Message for TableCell {
2570                fn typename() -> &'static str {
2571                    "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Table.TableCell"
2572                }
2573            }
2574        }
2575
2576        /// A form field detected on the page.
2577        #[derive(Clone, Default, PartialEq)]
2578        #[non_exhaustive]
2579        pub struct FormField {
2580            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
2581            /// [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
2582            /// e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
2583            ///
2584            /// [google.cloud.documentai.v1.Document.Page.FormField]: crate::model::document::page::FormField
2585            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2586            pub field_name: std::option::Option<crate::model::document::page::Layout>,
2587
2588            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
2589            /// [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
2590            ///
2591            /// [google.cloud.documentai.v1.Document.Page.FormField]: crate::model::document::page::FormField
2592            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2593            pub field_value: std::option::Option<crate::model::document::page::Layout>,
2594
2595            /// A list of detected languages for name together with confidence.
2596            pub name_detected_languages:
2597                std::vec::Vec<crate::model::document::page::DetectedLanguage>,
2598
2599            /// A list of detected languages for value together with confidence.
2600            pub value_detected_languages:
2601                std::vec::Vec<crate::model::document::page::DetectedLanguage>,
2602
2603            /// If the value is non-textual, this field represents the type. Current
2604            /// valid values are:
2605            ///
2606            /// - blank (this indicates the `field_value` is normal text)
2607            /// - `unfilled_checkbox`
2608            /// - `filled_checkbox`
2609            pub value_type: std::string::String,
2610
2611            /// Created for Labeling UI to export key text.
2612            /// If corrections were made to the text identified by the
2613            /// `field_name.text_anchor`, this field will contain the correction.
2614            pub corrected_key_text: std::string::String,
2615
2616            /// Created for Labeling UI to export value text.
2617            /// If corrections were made to the text identified by the
2618            /// `field_value.text_anchor`, this field will contain the correction.
2619            pub corrected_value_text: std::string::String,
2620
2621            /// The history of this annotation.
2622            pub provenance: std::option::Option<crate::model::document::Provenance>,
2623
2624            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2625        }
2626
2627        impl FormField {
2628            pub fn new() -> Self {
2629                std::default::Default::default()
2630            }
2631
2632            /// Sets the value of [field_name][crate::model::document::page::FormField::field_name].
2633            pub fn set_field_name<T>(mut self, v: T) -> Self
2634            where
2635                T: std::convert::Into<crate::model::document::page::Layout>,
2636            {
2637                self.field_name = std::option::Option::Some(v.into());
2638                self
2639            }
2640
2641            /// Sets or clears the value of [field_name][crate::model::document::page::FormField::field_name].
2642            pub fn set_or_clear_field_name<T>(mut self, v: std::option::Option<T>) -> Self
2643            where
2644                T: std::convert::Into<crate::model::document::page::Layout>,
2645            {
2646                self.field_name = v.map(|x| x.into());
2647                self
2648            }
2649
2650            /// Sets the value of [field_value][crate::model::document::page::FormField::field_value].
2651            pub fn set_field_value<T>(mut self, v: T) -> Self
2652            where
2653                T: std::convert::Into<crate::model::document::page::Layout>,
2654            {
2655                self.field_value = std::option::Option::Some(v.into());
2656                self
2657            }
2658
2659            /// Sets or clears the value of [field_value][crate::model::document::page::FormField::field_value].
2660            pub fn set_or_clear_field_value<T>(mut self, v: std::option::Option<T>) -> Self
2661            where
2662                T: std::convert::Into<crate::model::document::page::Layout>,
2663            {
2664                self.field_value = v.map(|x| x.into());
2665                self
2666            }
2667
2668            /// Sets the value of [name_detected_languages][crate::model::document::page::FormField::name_detected_languages].
2669            pub fn set_name_detected_languages<T, V>(mut self, v: T) -> Self
2670            where
2671                T: std::iter::IntoIterator<Item = V>,
2672                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
2673            {
2674                use std::iter::Iterator;
2675                self.name_detected_languages = v.into_iter().map(|i| i.into()).collect();
2676                self
2677            }
2678
2679            /// Sets the value of [value_detected_languages][crate::model::document::page::FormField::value_detected_languages].
2680            pub fn set_value_detected_languages<T, V>(mut self, v: T) -> Self
2681            where
2682                T: std::iter::IntoIterator<Item = V>,
2683                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
2684            {
2685                use std::iter::Iterator;
2686                self.value_detected_languages = v.into_iter().map(|i| i.into()).collect();
2687                self
2688            }
2689
2690            /// Sets the value of [value_type][crate::model::document::page::FormField::value_type].
2691            pub fn set_value_type<T: std::convert::Into<std::string::String>>(
2692                mut self,
2693                v: T,
2694            ) -> Self {
2695                self.value_type = v.into();
2696                self
2697            }
2698
2699            /// Sets the value of [corrected_key_text][crate::model::document::page::FormField::corrected_key_text].
2700            pub fn set_corrected_key_text<T: std::convert::Into<std::string::String>>(
2701                mut self,
2702                v: T,
2703            ) -> Self {
2704                self.corrected_key_text = v.into();
2705                self
2706            }
2707
2708            /// Sets the value of [corrected_value_text][crate::model::document::page::FormField::corrected_value_text].
2709            pub fn set_corrected_value_text<T: std::convert::Into<std::string::String>>(
2710                mut self,
2711                v: T,
2712            ) -> Self {
2713                self.corrected_value_text = v.into();
2714                self
2715            }
2716
2717            /// Sets the value of [provenance][crate::model::document::page::FormField::provenance].
2718            pub fn set_provenance<T>(mut self, v: T) -> Self
2719            where
2720                T: std::convert::Into<crate::model::document::Provenance>,
2721            {
2722                self.provenance = std::option::Option::Some(v.into());
2723                self
2724            }
2725
2726            /// Sets or clears the value of [provenance][crate::model::document::page::FormField::provenance].
2727            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
2728            where
2729                T: std::convert::Into<crate::model::document::Provenance>,
2730            {
2731                self.provenance = v.map(|x| x.into());
2732                self
2733            }
2734        }
2735
2736        impl wkt::message::Message for FormField {
2737            fn typename() -> &'static str {
2738                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.FormField"
2739            }
2740        }
2741
2742        /// A detected barcode.
2743        #[derive(Clone, Default, PartialEq)]
2744        #[non_exhaustive]
2745        pub struct DetectedBarcode {
2746            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
2747            /// [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
2748            ///
2749            /// [google.cloud.documentai.v1.Document.Page.DetectedBarcode]: crate::model::document::page::DetectedBarcode
2750            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2751            pub layout: std::option::Option<crate::model::document::page::Layout>,
2752
2753            /// Detailed barcode information of the
2754            /// [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
2755            ///
2756            /// [google.cloud.documentai.v1.Document.Page.DetectedBarcode]: crate::model::document::page::DetectedBarcode
2757            pub barcode: std::option::Option<crate::model::Barcode>,
2758
2759            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2760        }
2761
2762        impl DetectedBarcode {
2763            pub fn new() -> Self {
2764                std::default::Default::default()
2765            }
2766
2767            /// Sets the value of [layout][crate::model::document::page::DetectedBarcode::layout].
2768            pub fn set_layout<T>(mut self, v: T) -> Self
2769            where
2770                T: std::convert::Into<crate::model::document::page::Layout>,
2771            {
2772                self.layout = std::option::Option::Some(v.into());
2773                self
2774            }
2775
2776            /// Sets or clears the value of [layout][crate::model::document::page::DetectedBarcode::layout].
2777            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
2778            where
2779                T: std::convert::Into<crate::model::document::page::Layout>,
2780            {
2781                self.layout = v.map(|x| x.into());
2782                self
2783            }
2784
2785            /// Sets the value of [barcode][crate::model::document::page::DetectedBarcode::barcode].
2786            pub fn set_barcode<T>(mut self, v: T) -> Self
2787            where
2788                T: std::convert::Into<crate::model::Barcode>,
2789            {
2790                self.barcode = std::option::Option::Some(v.into());
2791                self
2792            }
2793
2794            /// Sets or clears the value of [barcode][crate::model::document::page::DetectedBarcode::barcode].
2795            pub fn set_or_clear_barcode<T>(mut self, v: std::option::Option<T>) -> Self
2796            where
2797                T: std::convert::Into<crate::model::Barcode>,
2798            {
2799                self.barcode = v.map(|x| x.into());
2800                self
2801            }
2802        }
2803
2804        impl wkt::message::Message for DetectedBarcode {
2805            fn typename() -> &'static str {
2806                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.DetectedBarcode"
2807            }
2808        }
2809
2810        /// Detected language for a structural component.
2811        #[derive(Clone, Default, PartialEq)]
2812        #[non_exhaustive]
2813        pub struct DetectedLanguage {
2814            /// The [BCP-47 language
2815            /// code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier),
2816            /// such as `en-US` or `sr-Latn`.
2817            pub language_code: std::string::String,
2818
2819            /// Confidence of detected language. Range `[0, 1]`.
2820            pub confidence: f32,
2821
2822            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2823        }
2824
2825        impl DetectedLanguage {
2826            pub fn new() -> Self {
2827                std::default::Default::default()
2828            }
2829
2830            /// Sets the value of [language_code][crate::model::document::page::DetectedLanguage::language_code].
2831            pub fn set_language_code<T: std::convert::Into<std::string::String>>(
2832                mut self,
2833                v: T,
2834            ) -> Self {
2835                self.language_code = v.into();
2836                self
2837            }
2838
2839            /// Sets the value of [confidence][crate::model::document::page::DetectedLanguage::confidence].
2840            pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
2841                self.confidence = v.into();
2842                self
2843            }
2844        }
2845
2846        impl wkt::message::Message for DetectedLanguage {
2847            fn typename() -> &'static str {
2848                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.DetectedLanguage"
2849            }
2850        }
2851
2852        /// Image quality scores for the page image.
2853        #[derive(Clone, Default, PartialEq)]
2854        #[non_exhaustive]
2855        pub struct ImageQualityScores {
2856            /// The overall quality score. Range `[0, 1]` where `1` is perfect quality.
2857            pub quality_score: f32,
2858
2859            /// A list of detected defects.
2860            pub detected_defects:
2861                std::vec::Vec<crate::model::document::page::image_quality_scores::DetectedDefect>,
2862
2863            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2864        }
2865
2866        impl ImageQualityScores {
2867            pub fn new() -> Self {
2868                std::default::Default::default()
2869            }
2870
2871            /// Sets the value of [quality_score][crate::model::document::page::ImageQualityScores::quality_score].
2872            pub fn set_quality_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
2873                self.quality_score = v.into();
2874                self
2875            }
2876
2877            /// Sets the value of [detected_defects][crate::model::document::page::ImageQualityScores::detected_defects].
2878            pub fn set_detected_defects<T, V>(mut self, v: T) -> Self
2879            where
2880                T: std::iter::IntoIterator<Item = V>,
2881                V: std::convert::Into<
2882                        crate::model::document::page::image_quality_scores::DetectedDefect,
2883                    >,
2884            {
2885                use std::iter::Iterator;
2886                self.detected_defects = v.into_iter().map(|i| i.into()).collect();
2887                self
2888            }
2889        }
2890
2891        impl wkt::message::Message for ImageQualityScores {
2892            fn typename() -> &'static str {
2893                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.ImageQualityScores"
2894            }
2895        }
2896
2897        /// Defines additional types related to [ImageQualityScores].
2898        pub mod image_quality_scores {
2899            #[allow(unused_imports)]
2900            use super::*;
2901
2902            /// Image Quality Defects
2903            #[derive(Clone, Default, PartialEq)]
2904            #[non_exhaustive]
2905            pub struct DetectedDefect {
2906                /// Name of the defect type. Supported values are:
2907                ///
2908                /// - `quality/defect_blurry`
2909                /// - `quality/defect_noisy`
2910                /// - `quality/defect_dark`
2911                /// - `quality/defect_faint`
2912                /// - `quality/defect_text_too_small`
2913                /// - `quality/defect_document_cutoff`
2914                /// - `quality/defect_text_cutoff`
2915                /// - `quality/defect_glare`
2916                pub r#type: std::string::String,
2917
2918                /// Confidence of detected defect. Range `[0, 1]` where `1` indicates
2919                /// strong confidence that the defect exists.
2920                pub confidence: f32,
2921
2922                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2923            }
2924
2925            impl DetectedDefect {
2926                pub fn new() -> Self {
2927                    std::default::Default::default()
2928                }
2929
2930                /// Sets the value of [r#type][crate::model::document::page::image_quality_scores::DetectedDefect::type].
2931                pub fn set_type<T: std::convert::Into<std::string::String>>(
2932                    mut self,
2933                    v: T,
2934                ) -> Self {
2935                    self.r#type = v.into();
2936                    self
2937                }
2938
2939                /// Sets the value of [confidence][crate::model::document::page::image_quality_scores::DetectedDefect::confidence].
2940                pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
2941                    self.confidence = v.into();
2942                    self
2943                }
2944            }
2945
2946            impl wkt::message::Message for DetectedDefect {
2947                fn typename() -> &'static str {
2948                    "type.googleapis.com/google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect"
2949                }
2950            }
2951        }
2952    }
2953
2954    /// An entity that could be a phrase in the text or a property that belongs to
2955    /// the document. It is a known entity type, such as a person, an organization,
2956    /// or location.
2957    #[derive(Clone, Default, PartialEq)]
2958    #[non_exhaustive]
2959    pub struct Entity {
2960        /// Optional. Provenance of the entity.
2961        /// Text anchor indexing into the
2962        /// [Document.text][google.cloud.documentai.v1.Document.text].
2963        ///
2964        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
2965        pub text_anchor: std::option::Option<crate::model::document::TextAnchor>,
2966
2967        /// Required. Entity type from a schema e.g. `Address`.
2968        pub r#type: std::string::String,
2969
2970        /// Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`.
2971        pub mention_text: std::string::String,
2972
2973        /// Optional. Deprecated.  Use `id` field instead.
2974        pub mention_id: std::string::String,
2975
2976        /// Optional. Confidence of detected Schema entity. Range `[0, 1]`.
2977        pub confidence: f32,
2978
2979        /// Optional. Represents the provenance of this entity wrt. the location on
2980        /// the page where it was found.
2981        pub page_anchor: std::option::Option<crate::model::document::PageAnchor>,
2982
2983        /// Optional. Canonical id. This will be a unique value in the entity list
2984        /// for this document.
2985        pub id: std::string::String,
2986
2987        /// Optional. Normalized entity value. Absent if the extracted value could
2988        /// not be converted or the type (e.g. address) is not supported for certain
2989        /// parsers. This field is also only populated for certain supported document
2990        /// types.
2991        pub normalized_value: std::option::Option<crate::model::document::entity::NormalizedValue>,
2992
2993        /// Optional. Entities can be nested to form a hierarchical data structure
2994        /// representing the content in the document.
2995        pub properties: std::vec::Vec<crate::model::document::Entity>,
2996
2997        /// Optional. The history of this annotation.
2998        pub provenance: std::option::Option<crate::model::document::Provenance>,
2999
3000        /// Optional. Whether the entity will be redacted for de-identification
3001        /// purposes.
3002        pub redacted: bool,
3003
3004        /// Optional. Specifies how the entity's value is obtained.
3005        pub method: crate::model::document::entity::Method,
3006
3007        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3008    }
3009
3010    impl Entity {
3011        pub fn new() -> Self {
3012            std::default::Default::default()
3013        }
3014
3015        /// Sets the value of [text_anchor][crate::model::document::Entity::text_anchor].
3016        pub fn set_text_anchor<T>(mut self, v: T) -> Self
3017        where
3018            T: std::convert::Into<crate::model::document::TextAnchor>,
3019        {
3020            self.text_anchor = std::option::Option::Some(v.into());
3021            self
3022        }
3023
3024        /// Sets or clears the value of [text_anchor][crate::model::document::Entity::text_anchor].
3025        pub fn set_or_clear_text_anchor<T>(mut self, v: std::option::Option<T>) -> Self
3026        where
3027            T: std::convert::Into<crate::model::document::TextAnchor>,
3028        {
3029            self.text_anchor = v.map(|x| x.into());
3030            self
3031        }
3032
3033        /// Sets the value of [r#type][crate::model::document::Entity::type].
3034        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3035            self.r#type = v.into();
3036            self
3037        }
3038
3039        /// Sets the value of [mention_text][crate::model::document::Entity::mention_text].
3040        pub fn set_mention_text<T: std::convert::Into<std::string::String>>(
3041            mut self,
3042            v: T,
3043        ) -> Self {
3044            self.mention_text = v.into();
3045            self
3046        }
3047
3048        /// Sets the value of [mention_id][crate::model::document::Entity::mention_id].
3049        pub fn set_mention_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3050            self.mention_id = v.into();
3051            self
3052        }
3053
3054        /// Sets the value of [confidence][crate::model::document::Entity::confidence].
3055        pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
3056            self.confidence = v.into();
3057            self
3058        }
3059
3060        /// Sets the value of [page_anchor][crate::model::document::Entity::page_anchor].
3061        pub fn set_page_anchor<T>(mut self, v: T) -> Self
3062        where
3063            T: std::convert::Into<crate::model::document::PageAnchor>,
3064        {
3065            self.page_anchor = std::option::Option::Some(v.into());
3066            self
3067        }
3068
3069        /// Sets or clears the value of [page_anchor][crate::model::document::Entity::page_anchor].
3070        pub fn set_or_clear_page_anchor<T>(mut self, v: std::option::Option<T>) -> Self
3071        where
3072            T: std::convert::Into<crate::model::document::PageAnchor>,
3073        {
3074            self.page_anchor = v.map(|x| x.into());
3075            self
3076        }
3077
3078        /// Sets the value of [id][crate::model::document::Entity::id].
3079        pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3080            self.id = v.into();
3081            self
3082        }
3083
3084        /// Sets the value of [normalized_value][crate::model::document::Entity::normalized_value].
3085        pub fn set_normalized_value<T>(mut self, v: T) -> Self
3086        where
3087            T: std::convert::Into<crate::model::document::entity::NormalizedValue>,
3088        {
3089            self.normalized_value = std::option::Option::Some(v.into());
3090            self
3091        }
3092
3093        /// Sets or clears the value of [normalized_value][crate::model::document::Entity::normalized_value].
3094        pub fn set_or_clear_normalized_value<T>(mut self, v: std::option::Option<T>) -> Self
3095        where
3096            T: std::convert::Into<crate::model::document::entity::NormalizedValue>,
3097        {
3098            self.normalized_value = v.map(|x| x.into());
3099            self
3100        }
3101
3102        /// Sets the value of [properties][crate::model::document::Entity::properties].
3103        pub fn set_properties<T, V>(mut self, v: T) -> Self
3104        where
3105            T: std::iter::IntoIterator<Item = V>,
3106            V: std::convert::Into<crate::model::document::Entity>,
3107        {
3108            use std::iter::Iterator;
3109            self.properties = v.into_iter().map(|i| i.into()).collect();
3110            self
3111        }
3112
3113        /// Sets the value of [provenance][crate::model::document::Entity::provenance].
3114        pub fn set_provenance<T>(mut self, v: T) -> Self
3115        where
3116            T: std::convert::Into<crate::model::document::Provenance>,
3117        {
3118            self.provenance = std::option::Option::Some(v.into());
3119            self
3120        }
3121
3122        /// Sets or clears the value of [provenance][crate::model::document::Entity::provenance].
3123        pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
3124        where
3125            T: std::convert::Into<crate::model::document::Provenance>,
3126        {
3127            self.provenance = v.map(|x| x.into());
3128            self
3129        }
3130
3131        /// Sets the value of [redacted][crate::model::document::Entity::redacted].
3132        pub fn set_redacted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3133            self.redacted = v.into();
3134            self
3135        }
3136
3137        /// Sets the value of [method][crate::model::document::Entity::method].
3138        pub fn set_method<T: std::convert::Into<crate::model::document::entity::Method>>(
3139            mut self,
3140            v: T,
3141        ) -> Self {
3142            self.method = v.into();
3143            self
3144        }
3145    }
3146
3147    impl wkt::message::Message for Entity {
3148        fn typename() -> &'static str {
3149            "type.googleapis.com/google.cloud.documentai.v1.Document.Entity"
3150        }
3151    }
3152
3153    /// Defines additional types related to [Entity].
3154    pub mod entity {
3155        #[allow(unused_imports)]
3156        use super::*;
3157
3158        /// Parsed and normalized entity value.
3159        #[derive(Clone, Default, PartialEq)]
3160        #[non_exhaustive]
3161        pub struct NormalizedValue {
3162            /// Optional. An optional field to store a normalized string.
3163            /// For some entity types, one of respective `structured_value` fields may
3164            /// also be populated. Also not all the types of `structured_value` will be
3165            /// normalized. For example, some processors may not generate `float`
3166            /// or `integer` normalized text by default.
3167            ///
3168            /// Below are sample formats mapped to structured values.
3169            ///
3170            /// - Money/Currency type (`money_value`) is in the ISO 4217 text format.
3171            /// - Date type (`date_value`) is in the ISO 8601 text format.
3172            /// - Datetime type (`datetime_value`) is in the ISO 8601 text format.
3173            pub text: std::string::String,
3174
3175            /// An optional structured entity value.
3176            /// Must match entity type defined in schema if
3177            /// known. If this field is present, the `text` field could also be
3178            /// populated.
3179            pub structured_value: std::option::Option<
3180                crate::model::document::entity::normalized_value::StructuredValue,
3181            >,
3182
3183            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3184        }
3185
3186        impl NormalizedValue {
3187            pub fn new() -> Self {
3188                std::default::Default::default()
3189            }
3190
3191            /// Sets the value of [text][crate::model::document::entity::NormalizedValue::text].
3192            pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3193                self.text = v.into();
3194                self
3195            }
3196
3197            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value].
3198            ///
3199            /// Note that all the setters affecting `structured_value` are mutually
3200            /// exclusive.
3201            pub fn set_structured_value<
3202                T: std::convert::Into<
3203                        std::option::Option<
3204                            crate::model::document::entity::normalized_value::StructuredValue,
3205                        >,
3206                    >,
3207            >(
3208                mut self,
3209                v: T,
3210            ) -> Self {
3211                self.structured_value = v.into();
3212                self
3213            }
3214
3215            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3216            /// if it holds a `MoneyValue`, `None` if the field is not set or
3217            /// holds a different branch.
3218            pub fn money_value(
3219                &self,
3220            ) -> std::option::Option<&std::boxed::Box<gtype::model::Money>> {
3221                #[allow(unreachable_patterns)]
3222                self.structured_value.as_ref().and_then(|v| match v {
3223                    crate::model::document::entity::normalized_value::StructuredValue::MoneyValue(v) => std::option::Option::Some(v),
3224                    _ => std::option::Option::None,
3225                })
3226            }
3227
3228            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3229            /// to hold a `MoneyValue`.
3230            ///
3231            /// Note that all the setters affecting `structured_value` are
3232            /// mutually exclusive.
3233            pub fn set_money_value<T: std::convert::Into<std::boxed::Box<gtype::model::Money>>>(
3234                mut self,
3235                v: T,
3236            ) -> Self {
3237                self.structured_value = std::option::Option::Some(
3238                    crate::model::document::entity::normalized_value::StructuredValue::MoneyValue(
3239                        v.into(),
3240                    ),
3241                );
3242                self
3243            }
3244
3245            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3246            /// if it holds a `DateValue`, `None` if the field is not set or
3247            /// holds a different branch.
3248            pub fn date_value(&self) -> std::option::Option<&std::boxed::Box<gtype::model::Date>> {
3249                #[allow(unreachable_patterns)]
3250                self.structured_value.as_ref().and_then(|v| match v {
3251                    crate::model::document::entity::normalized_value::StructuredValue::DateValue(v) => std::option::Option::Some(v),
3252                    _ => std::option::Option::None,
3253                })
3254            }
3255
3256            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3257            /// to hold a `DateValue`.
3258            ///
3259            /// Note that all the setters affecting `structured_value` are
3260            /// mutually exclusive.
3261            pub fn set_date_value<T: std::convert::Into<std::boxed::Box<gtype::model::Date>>>(
3262                mut self,
3263                v: T,
3264            ) -> Self {
3265                self.structured_value = std::option::Option::Some(
3266                    crate::model::document::entity::normalized_value::StructuredValue::DateValue(
3267                        v.into(),
3268                    ),
3269                );
3270                self
3271            }
3272
3273            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3274            /// if it holds a `DatetimeValue`, `None` if the field is not set or
3275            /// holds a different branch.
3276            pub fn datetime_value(
3277                &self,
3278            ) -> std::option::Option<&std::boxed::Box<gtype::model::DateTime>> {
3279                #[allow(unreachable_patterns)]
3280                self.structured_value.as_ref().and_then(|v| match v {
3281                    crate::model::document::entity::normalized_value::StructuredValue::DatetimeValue(v) => std::option::Option::Some(v),
3282                    _ => std::option::Option::None,
3283                })
3284            }
3285
3286            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3287            /// to hold a `DatetimeValue`.
3288            ///
3289            /// Note that all the setters affecting `structured_value` are
3290            /// mutually exclusive.
3291            pub fn set_datetime_value<
3292                T: std::convert::Into<std::boxed::Box<gtype::model::DateTime>>,
3293            >(
3294                mut self,
3295                v: T,
3296            ) -> Self {
3297                self.structured_value = std::option::Option::Some(
3298                    crate::model::document::entity::normalized_value::StructuredValue::DatetimeValue(
3299                        v.into()
3300                    )
3301                );
3302                self
3303            }
3304
3305            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3306            /// if it holds a `AddressValue`, `None` if the field is not set or
3307            /// holds a different branch.
3308            pub fn address_value(
3309                &self,
3310            ) -> std::option::Option<&std::boxed::Box<gtype::model::PostalAddress>> {
3311                #[allow(unreachable_patterns)]
3312                self.structured_value.as_ref().and_then(|v| match v {
3313                    crate::model::document::entity::normalized_value::StructuredValue::AddressValue(v) => std::option::Option::Some(v),
3314                    _ => std::option::Option::None,
3315                })
3316            }
3317
3318            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3319            /// to hold a `AddressValue`.
3320            ///
3321            /// Note that all the setters affecting `structured_value` are
3322            /// mutually exclusive.
3323            pub fn set_address_value<
3324                T: std::convert::Into<std::boxed::Box<gtype::model::PostalAddress>>,
3325            >(
3326                mut self,
3327                v: T,
3328            ) -> Self {
3329                self.structured_value = std::option::Option::Some(
3330                    crate::model::document::entity::normalized_value::StructuredValue::AddressValue(
3331                        v.into(),
3332                    ),
3333                );
3334                self
3335            }
3336
3337            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3338            /// if it holds a `BooleanValue`, `None` if the field is not set or
3339            /// holds a different branch.
3340            pub fn boolean_value(&self) -> std::option::Option<&bool> {
3341                #[allow(unreachable_patterns)]
3342                self.structured_value.as_ref().and_then(|v| match v {
3343                    crate::model::document::entity::normalized_value::StructuredValue::BooleanValue(v) => std::option::Option::Some(v),
3344                    _ => std::option::Option::None,
3345                })
3346            }
3347
3348            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3349            /// to hold a `BooleanValue`.
3350            ///
3351            /// Note that all the setters affecting `structured_value` are
3352            /// mutually exclusive.
3353            pub fn set_boolean_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3354                self.structured_value = std::option::Option::Some(
3355                    crate::model::document::entity::normalized_value::StructuredValue::BooleanValue(
3356                        v.into(),
3357                    ),
3358                );
3359                self
3360            }
3361
3362            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3363            /// if it holds a `IntegerValue`, `None` if the field is not set or
3364            /// holds a different branch.
3365            pub fn integer_value(&self) -> std::option::Option<&i32> {
3366                #[allow(unreachable_patterns)]
3367                self.structured_value.as_ref().and_then(|v| match v {
3368                    crate::model::document::entity::normalized_value::StructuredValue::IntegerValue(v) => std::option::Option::Some(v),
3369                    _ => std::option::Option::None,
3370                })
3371            }
3372
3373            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3374            /// to hold a `IntegerValue`.
3375            ///
3376            /// Note that all the setters affecting `structured_value` are
3377            /// mutually exclusive.
3378            pub fn set_integer_value<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3379                self.structured_value = std::option::Option::Some(
3380                    crate::model::document::entity::normalized_value::StructuredValue::IntegerValue(
3381                        v.into(),
3382                    ),
3383                );
3384                self
3385            }
3386
3387            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3388            /// if it holds a `FloatValue`, `None` if the field is not set or
3389            /// holds a different branch.
3390            pub fn float_value(&self) -> std::option::Option<&f32> {
3391                #[allow(unreachable_patterns)]
3392                self.structured_value.as_ref().and_then(|v| match v {
3393                    crate::model::document::entity::normalized_value::StructuredValue::FloatValue(v) => std::option::Option::Some(v),
3394                    _ => std::option::Option::None,
3395                })
3396            }
3397
3398            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3399            /// to hold a `FloatValue`.
3400            ///
3401            /// Note that all the setters affecting `structured_value` are
3402            /// mutually exclusive.
3403            pub fn set_float_value<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
3404                self.structured_value = std::option::Option::Some(
3405                    crate::model::document::entity::normalized_value::StructuredValue::FloatValue(
3406                        v.into(),
3407                    ),
3408                );
3409                self
3410            }
3411
3412            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3413            /// if it holds a `SignatureValue`, `None` if the field is not set or
3414            /// holds a different branch.
3415            pub fn signature_value(&self) -> std::option::Option<&bool> {
3416                #[allow(unreachable_patterns)]
3417                self.structured_value.as_ref().and_then(|v| match v {
3418                    crate::model::document::entity::normalized_value::StructuredValue::SignatureValue(v) => std::option::Option::Some(v),
3419                    _ => std::option::Option::None,
3420                })
3421            }
3422
3423            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
3424            /// to hold a `SignatureValue`.
3425            ///
3426            /// Note that all the setters affecting `structured_value` are
3427            /// mutually exclusive.
3428            pub fn set_signature_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3429                self.structured_value = std::option::Option::Some(
3430                    crate::model::document::entity::normalized_value::StructuredValue::SignatureValue(
3431                        v.into()
3432                    )
3433                );
3434                self
3435            }
3436        }
3437
3438        impl wkt::message::Message for NormalizedValue {
3439            fn typename() -> &'static str {
3440                "type.googleapis.com/google.cloud.documentai.v1.Document.Entity.NormalizedValue"
3441            }
3442        }
3443
3444        /// Defines additional types related to [NormalizedValue].
3445        pub mod normalized_value {
3446            #[allow(unused_imports)]
3447            use super::*;
3448
3449            /// An optional structured entity value.
3450            /// Must match entity type defined in schema if
3451            /// known. If this field is present, the `text` field could also be
3452            /// populated.
3453            #[derive(Clone, Debug, PartialEq)]
3454            #[non_exhaustive]
3455            pub enum StructuredValue {
3456                /// Money value. See also:
3457                /// <https://github.com/googleapis/googleapis/blob/master/google/type/money.proto>
3458                MoneyValue(std::boxed::Box<gtype::model::Money>),
3459                /// Date value. Includes year, month, day. See also:
3460                /// <https://github.com/googleapis/googleapis/blob/master/google/type/date.proto>
3461                DateValue(std::boxed::Box<gtype::model::Date>),
3462                /// DateTime value. Includes date, time, and timezone. See also:
3463                /// <https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto>
3464                DatetimeValue(std::boxed::Box<gtype::model::DateTime>),
3465                /// Postal address. See also:
3466                /// <https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto>
3467                AddressValue(std::boxed::Box<gtype::model::PostalAddress>),
3468                /// Boolean value. Can be used for entities with binary values, or for
3469                /// checkboxes.
3470                BooleanValue(bool),
3471                /// Integer value.
3472                IntegerValue(i32),
3473                /// Float value.
3474                FloatValue(f32),
3475                SignatureValue(bool),
3476            }
3477        }
3478
3479        /// Specifies how the entity's value is obtained.
3480        ///
3481        /// # Working with unknown values
3482        ///
3483        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3484        /// additional enum variants at any time. Adding new variants is not considered
3485        /// a breaking change. Applications should write their code in anticipation of:
3486        ///
3487        /// - New values appearing in future releases of the client library, **and**
3488        /// - New values received dynamically, without application changes.
3489        ///
3490        /// Please consult the [Working with enums] section in the user guide for some
3491        /// guidelines.
3492        ///
3493        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3494        #[derive(Clone, Debug, PartialEq)]
3495        #[non_exhaustive]
3496        pub enum Method {
3497            /// When the method is not specified, it should be treated as `EXTRACT`.
3498            Unspecified,
3499            /// The entity's value is directly extracted as-is from the document
3500            /// text.
3501            Extract,
3502            /// The entity's value is derived through inference and is not
3503            /// necessarily an exact text extraction from the document.
3504            Derive,
3505            /// If set, the enum was initialized with an unknown value.
3506            ///
3507            /// Applications can examine the value using [Method::value] or
3508            /// [Method::name].
3509            UnknownValue(method::UnknownValue),
3510        }
3511
3512        #[doc(hidden)]
3513        pub mod method {
3514            #[allow(unused_imports)]
3515            use super::*;
3516            #[derive(Clone, Debug, PartialEq)]
3517            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3518        }
3519
3520        impl Method {
3521            /// Gets the enum value.
3522            ///
3523            /// Returns `None` if the enum contains an unknown value deserialized from
3524            /// the string representation of enums.
3525            pub fn value(&self) -> std::option::Option<i32> {
3526                match self {
3527                    Self::Unspecified => std::option::Option::Some(0),
3528                    Self::Extract => std::option::Option::Some(1),
3529                    Self::Derive => std::option::Option::Some(2),
3530                    Self::UnknownValue(u) => u.0.value(),
3531                }
3532            }
3533
3534            /// Gets the enum value as a string.
3535            ///
3536            /// Returns `None` if the enum contains an unknown value deserialized from
3537            /// the integer representation of enums.
3538            pub fn name(&self) -> std::option::Option<&str> {
3539                match self {
3540                    Self::Unspecified => std::option::Option::Some("METHOD_UNSPECIFIED"),
3541                    Self::Extract => std::option::Option::Some("EXTRACT"),
3542                    Self::Derive => std::option::Option::Some("DERIVE"),
3543                    Self::UnknownValue(u) => u.0.name(),
3544                }
3545            }
3546        }
3547
3548        impl std::default::Default for Method {
3549            fn default() -> Self {
3550                use std::convert::From;
3551                Self::from(0)
3552            }
3553        }
3554
3555        impl std::fmt::Display for Method {
3556            fn fmt(
3557                &self,
3558                f: &mut std::fmt::Formatter<'_>,
3559            ) -> std::result::Result<(), std::fmt::Error> {
3560                wkt::internal::display_enum(f, self.name(), self.value())
3561            }
3562        }
3563
3564        impl std::convert::From<i32> for Method {
3565            fn from(value: i32) -> Self {
3566                match value {
3567                    0 => Self::Unspecified,
3568                    1 => Self::Extract,
3569                    2 => Self::Derive,
3570                    _ => Self::UnknownValue(method::UnknownValue(
3571                        wkt::internal::UnknownEnumValue::Integer(value),
3572                    )),
3573                }
3574            }
3575        }
3576
3577        impl std::convert::From<&str> for Method {
3578            fn from(value: &str) -> Self {
3579                use std::string::ToString;
3580                match value {
3581                    "METHOD_UNSPECIFIED" => Self::Unspecified,
3582                    "EXTRACT" => Self::Extract,
3583                    "DERIVE" => Self::Derive,
3584                    _ => Self::UnknownValue(method::UnknownValue(
3585                        wkt::internal::UnknownEnumValue::String(value.to_string()),
3586                    )),
3587                }
3588            }
3589        }
3590
3591        impl serde::ser::Serialize for Method {
3592            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3593            where
3594                S: serde::Serializer,
3595            {
3596                match self {
3597                    Self::Unspecified => serializer.serialize_i32(0),
3598                    Self::Extract => serializer.serialize_i32(1),
3599                    Self::Derive => serializer.serialize_i32(2),
3600                    Self::UnknownValue(u) => u.0.serialize(serializer),
3601                }
3602            }
3603        }
3604
3605        impl<'de> serde::de::Deserialize<'de> for Method {
3606            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3607            where
3608                D: serde::Deserializer<'de>,
3609            {
3610                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Method>::new(
3611                    ".google.cloud.documentai.v1.Document.Entity.Method",
3612                ))
3613            }
3614        }
3615    }
3616
3617    /// Relationship between
3618    /// [Entities][google.cloud.documentai.v1.Document.Entity].
3619    ///
3620    /// [google.cloud.documentai.v1.Document.Entity]: crate::model::document::Entity
3621    #[derive(Clone, Default, PartialEq)]
3622    #[non_exhaustive]
3623    pub struct EntityRelation {
3624        /// Subject entity id.
3625        pub subject_id: std::string::String,
3626
3627        /// Object entity id.
3628        pub object_id: std::string::String,
3629
3630        /// Relationship description.
3631        pub relation: std::string::String,
3632
3633        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3634    }
3635
3636    impl EntityRelation {
3637        pub fn new() -> Self {
3638            std::default::Default::default()
3639        }
3640
3641        /// Sets the value of [subject_id][crate::model::document::EntityRelation::subject_id].
3642        pub fn set_subject_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3643            self.subject_id = v.into();
3644            self
3645        }
3646
3647        /// Sets the value of [object_id][crate::model::document::EntityRelation::object_id].
3648        pub fn set_object_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3649            self.object_id = v.into();
3650            self
3651        }
3652
3653        /// Sets the value of [relation][crate::model::document::EntityRelation::relation].
3654        pub fn set_relation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3655            self.relation = v.into();
3656            self
3657        }
3658    }
3659
3660    impl wkt::message::Message for EntityRelation {
3661        fn typename() -> &'static str {
3662            "type.googleapis.com/google.cloud.documentai.v1.Document.EntityRelation"
3663        }
3664    }
3665
3666    /// Text reference indexing into the
3667    /// [Document.text][google.cloud.documentai.v1.Document.text].
3668    ///
3669    /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
3670    #[derive(Clone, Default, PartialEq)]
3671    #[non_exhaustive]
3672    pub struct TextAnchor {
3673        /// The text segments from the
3674        /// [Document.text][google.cloud.documentai.v1.Document.text].
3675        ///
3676        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
3677        pub text_segments: std::vec::Vec<crate::model::document::text_anchor::TextSegment>,
3678
3679        /// Contains the content of the text span so that users do
3680        /// not have to look it up in the text_segments.  It is always
3681        /// populated for formFields.
3682        pub content: std::string::String,
3683
3684        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3685    }
3686
3687    impl TextAnchor {
3688        pub fn new() -> Self {
3689            std::default::Default::default()
3690        }
3691
3692        /// Sets the value of [text_segments][crate::model::document::TextAnchor::text_segments].
3693        pub fn set_text_segments<T, V>(mut self, v: T) -> Self
3694        where
3695            T: std::iter::IntoIterator<Item = V>,
3696            V: std::convert::Into<crate::model::document::text_anchor::TextSegment>,
3697        {
3698            use std::iter::Iterator;
3699            self.text_segments = v.into_iter().map(|i| i.into()).collect();
3700            self
3701        }
3702
3703        /// Sets the value of [content][crate::model::document::TextAnchor::content].
3704        pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3705            self.content = v.into();
3706            self
3707        }
3708    }
3709
3710    impl wkt::message::Message for TextAnchor {
3711        fn typename() -> &'static str {
3712            "type.googleapis.com/google.cloud.documentai.v1.Document.TextAnchor"
3713        }
3714    }
3715
3716    /// Defines additional types related to [TextAnchor].
3717    pub mod text_anchor {
3718        #[allow(unused_imports)]
3719        use super::*;
3720
3721        /// A text segment in the
3722        /// [Document.text][google.cloud.documentai.v1.Document.text]. The indices
3723        /// may be out of bounds which indicate that the text extends into another
3724        /// document shard for large sharded documents. See
3725        /// [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset]
3726        ///
3727        /// [google.cloud.documentai.v1.Document.ShardInfo.text_offset]: crate::model::document::ShardInfo::text_offset
3728        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
3729        #[derive(Clone, Default, PartialEq)]
3730        #[non_exhaustive]
3731        pub struct TextSegment {
3732            /// [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
3733            /// start UTF-8 char index in the
3734            /// [Document.text][google.cloud.documentai.v1.Document.text].
3735            ///
3736            /// [google.cloud.documentai.v1.Document.TextAnchor.TextSegment]: crate::model::document::text_anchor::TextSegment
3737            /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
3738            pub start_index: i64,
3739
3740            /// [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
3741            /// half open end UTF-8 char index in the
3742            /// [Document.text][google.cloud.documentai.v1.Document.text].
3743            ///
3744            /// [google.cloud.documentai.v1.Document.TextAnchor.TextSegment]: crate::model::document::text_anchor::TextSegment
3745            /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
3746            pub end_index: i64,
3747
3748            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3749        }
3750
3751        impl TextSegment {
3752            pub fn new() -> Self {
3753                std::default::Default::default()
3754            }
3755
3756            /// Sets the value of [start_index][crate::model::document::text_anchor::TextSegment::start_index].
3757            pub fn set_start_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3758                self.start_index = v.into();
3759                self
3760            }
3761
3762            /// Sets the value of [end_index][crate::model::document::text_anchor::TextSegment::end_index].
3763            pub fn set_end_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3764                self.end_index = v.into();
3765                self
3766            }
3767        }
3768
3769        impl wkt::message::Message for TextSegment {
3770            fn typename() -> &'static str {
3771                "type.googleapis.com/google.cloud.documentai.v1.Document.TextAnchor.TextSegment"
3772            }
3773        }
3774    }
3775
3776    /// Referencing the visual context of the entity in the
3777    /// [Document.pages][google.cloud.documentai.v1.Document.pages]. Page anchors
3778    /// can be cross-page, consist of multiple bounding polygons and optionally
3779    /// reference specific layout element types.
3780    ///
3781    /// [google.cloud.documentai.v1.Document.pages]: crate::model::Document::pages
3782    #[derive(Clone, Default, PartialEq)]
3783    #[non_exhaustive]
3784    pub struct PageAnchor {
3785        /// One or more references to visual page elements
3786        pub page_refs: std::vec::Vec<crate::model::document::page_anchor::PageRef>,
3787
3788        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3789    }
3790
3791    impl PageAnchor {
3792        pub fn new() -> Self {
3793            std::default::Default::default()
3794        }
3795
3796        /// Sets the value of [page_refs][crate::model::document::PageAnchor::page_refs].
3797        pub fn set_page_refs<T, V>(mut self, v: T) -> Self
3798        where
3799            T: std::iter::IntoIterator<Item = V>,
3800            V: std::convert::Into<crate::model::document::page_anchor::PageRef>,
3801        {
3802            use std::iter::Iterator;
3803            self.page_refs = v.into_iter().map(|i| i.into()).collect();
3804            self
3805        }
3806    }
3807
3808    impl wkt::message::Message for PageAnchor {
3809        fn typename() -> &'static str {
3810            "type.googleapis.com/google.cloud.documentai.v1.Document.PageAnchor"
3811        }
3812    }
3813
3814    /// Defines additional types related to [PageAnchor].
3815    pub mod page_anchor {
3816        #[allow(unused_imports)]
3817        use super::*;
3818
3819        /// Represents a weak reference to a page element within a document.
3820        #[derive(Clone, Default, PartialEq)]
3821        #[non_exhaustive]
3822        pub struct PageRef {
3823            /// Required. Index into the
3824            /// [Document.pages][google.cloud.documentai.v1.Document.pages] element,
3825            /// for example using
3826            /// `[Document.pages][page_refs.page]` to locate the related page element.
3827            /// This field is skipped when its value is the default `0`. See
3828            /// <https://developers.google.com/protocol-buffers/docs/proto3#json>.
3829            ///
3830            /// [google.cloud.documentai.v1.Document.pages]: crate::model::Document::pages
3831            pub page: i64,
3832
3833            /// Optional. The type of the layout element that is being referenced if
3834            /// any.
3835            pub layout_type: crate::model::document::page_anchor::page_ref::LayoutType,
3836
3837            /// Optional. Deprecated.  Use
3838            /// [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
3839            /// instead.
3840            ///
3841            /// [google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]: crate::model::document::page_anchor::PageRef::bounding_poly
3842            #[deprecated]
3843            pub layout_id: std::string::String,
3844
3845            /// Optional. Identifies the bounding polygon of a layout element on the
3846            /// page. If `layout_type` is set, the bounding polygon must be exactly the
3847            /// same to the layout element it's referring to.
3848            pub bounding_poly: std::option::Option<crate::model::BoundingPoly>,
3849
3850            /// Optional. Confidence of detected page element, if applicable. Range
3851            /// `[0, 1]`.
3852            pub confidence: f32,
3853
3854            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3855        }
3856
3857        impl PageRef {
3858            pub fn new() -> Self {
3859                std::default::Default::default()
3860            }
3861
3862            /// Sets the value of [page][crate::model::document::page_anchor::PageRef::page].
3863            pub fn set_page<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3864                self.page = v.into();
3865                self
3866            }
3867
3868            /// Sets the value of [layout_type][crate::model::document::page_anchor::PageRef::layout_type].
3869            pub fn set_layout_type<
3870                T: std::convert::Into<crate::model::document::page_anchor::page_ref::LayoutType>,
3871            >(
3872                mut self,
3873                v: T,
3874            ) -> Self {
3875                self.layout_type = v.into();
3876                self
3877            }
3878
3879            /// Sets the value of [layout_id][crate::model::document::page_anchor::PageRef::layout_id].
3880            #[deprecated]
3881            pub fn set_layout_id<T: std::convert::Into<std::string::String>>(
3882                mut self,
3883                v: T,
3884            ) -> Self {
3885                self.layout_id = v.into();
3886                self
3887            }
3888
3889            /// Sets the value of [bounding_poly][crate::model::document::page_anchor::PageRef::bounding_poly].
3890            pub fn set_bounding_poly<T>(mut self, v: T) -> Self
3891            where
3892                T: std::convert::Into<crate::model::BoundingPoly>,
3893            {
3894                self.bounding_poly = std::option::Option::Some(v.into());
3895                self
3896            }
3897
3898            /// Sets or clears the value of [bounding_poly][crate::model::document::page_anchor::PageRef::bounding_poly].
3899            pub fn set_or_clear_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
3900            where
3901                T: std::convert::Into<crate::model::BoundingPoly>,
3902            {
3903                self.bounding_poly = v.map(|x| x.into());
3904                self
3905            }
3906
3907            /// Sets the value of [confidence][crate::model::document::page_anchor::PageRef::confidence].
3908            pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
3909                self.confidence = v.into();
3910                self
3911            }
3912        }
3913
3914        impl wkt::message::Message for PageRef {
3915            fn typename() -> &'static str {
3916                "type.googleapis.com/google.cloud.documentai.v1.Document.PageAnchor.PageRef"
3917            }
3918        }
3919
3920        /// Defines additional types related to [PageRef].
3921        pub mod page_ref {
3922            #[allow(unused_imports)]
3923            use super::*;
3924
3925            /// The type of layout that is being referenced.
3926            ///
3927            /// # Working with unknown values
3928            ///
3929            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3930            /// additional enum variants at any time. Adding new variants is not considered
3931            /// a breaking change. Applications should write their code in anticipation of:
3932            ///
3933            /// - New values appearing in future releases of the client library, **and**
3934            /// - New values received dynamically, without application changes.
3935            ///
3936            /// Please consult the [Working with enums] section in the user guide for some
3937            /// guidelines.
3938            ///
3939            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3940            #[derive(Clone, Debug, PartialEq)]
3941            #[non_exhaustive]
3942            pub enum LayoutType {
3943                /// Layout Unspecified.
3944                Unspecified,
3945                /// References a
3946                /// [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks]
3947                /// element.
3948                ///
3949                /// [google.cloud.documentai.v1.Document.Page.blocks]: crate::model::document::Page::blocks
3950                Block,
3951                /// References a
3952                /// [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs]
3953                /// element.
3954                ///
3955                /// [google.cloud.documentai.v1.Document.Page.paragraphs]: crate::model::document::Page::paragraphs
3956                Paragraph,
3957                /// References a
3958                /// [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element.
3959                ///
3960                /// [google.cloud.documentai.v1.Document.Page.lines]: crate::model::document::Page::lines
3961                Line,
3962                /// References a
3963                /// [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens]
3964                /// element.
3965                ///
3966                /// [google.cloud.documentai.v1.Document.Page.tokens]: crate::model::document::Page::tokens
3967                Token,
3968                /// References a
3969                /// [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements]
3970                /// element.
3971                ///
3972                /// [google.cloud.documentai.v1.Document.Page.visual_elements]: crate::model::document::Page::visual_elements
3973                VisualElement,
3974                /// Refrrences a
3975                /// [Page.tables][google.cloud.documentai.v1.Document.Page.tables]
3976                /// element.
3977                ///
3978                /// [google.cloud.documentai.v1.Document.Page.tables]: crate::model::document::Page::tables
3979                Table,
3980                /// References a
3981                /// [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields]
3982                /// element.
3983                ///
3984                /// [google.cloud.documentai.v1.Document.Page.form_fields]: crate::model::document::Page::form_fields
3985                FormField,
3986                /// If set, the enum was initialized with an unknown value.
3987                ///
3988                /// Applications can examine the value using [LayoutType::value] or
3989                /// [LayoutType::name].
3990                UnknownValue(layout_type::UnknownValue),
3991            }
3992
3993            #[doc(hidden)]
3994            pub mod layout_type {
3995                #[allow(unused_imports)]
3996                use super::*;
3997                #[derive(Clone, Debug, PartialEq)]
3998                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3999            }
4000
4001            impl LayoutType {
4002                /// Gets the enum value.
4003                ///
4004                /// Returns `None` if the enum contains an unknown value deserialized from
4005                /// the string representation of enums.
4006                pub fn value(&self) -> std::option::Option<i32> {
4007                    match self {
4008                        Self::Unspecified => std::option::Option::Some(0),
4009                        Self::Block => std::option::Option::Some(1),
4010                        Self::Paragraph => std::option::Option::Some(2),
4011                        Self::Line => std::option::Option::Some(3),
4012                        Self::Token => std::option::Option::Some(4),
4013                        Self::VisualElement => std::option::Option::Some(5),
4014                        Self::Table => std::option::Option::Some(6),
4015                        Self::FormField => std::option::Option::Some(7),
4016                        Self::UnknownValue(u) => u.0.value(),
4017                    }
4018                }
4019
4020                /// Gets the enum value as a string.
4021                ///
4022                /// Returns `None` if the enum contains an unknown value deserialized from
4023                /// the integer representation of enums.
4024                pub fn name(&self) -> std::option::Option<&str> {
4025                    match self {
4026                        Self::Unspecified => std::option::Option::Some("LAYOUT_TYPE_UNSPECIFIED"),
4027                        Self::Block => std::option::Option::Some("BLOCK"),
4028                        Self::Paragraph => std::option::Option::Some("PARAGRAPH"),
4029                        Self::Line => std::option::Option::Some("LINE"),
4030                        Self::Token => std::option::Option::Some("TOKEN"),
4031                        Self::VisualElement => std::option::Option::Some("VISUAL_ELEMENT"),
4032                        Self::Table => std::option::Option::Some("TABLE"),
4033                        Self::FormField => std::option::Option::Some("FORM_FIELD"),
4034                        Self::UnknownValue(u) => u.0.name(),
4035                    }
4036                }
4037            }
4038
4039            impl std::default::Default for LayoutType {
4040                fn default() -> Self {
4041                    use std::convert::From;
4042                    Self::from(0)
4043                }
4044            }
4045
4046            impl std::fmt::Display for LayoutType {
4047                fn fmt(
4048                    &self,
4049                    f: &mut std::fmt::Formatter<'_>,
4050                ) -> std::result::Result<(), std::fmt::Error> {
4051                    wkt::internal::display_enum(f, self.name(), self.value())
4052                }
4053            }
4054
4055            impl std::convert::From<i32> for LayoutType {
4056                fn from(value: i32) -> Self {
4057                    match value {
4058                        0 => Self::Unspecified,
4059                        1 => Self::Block,
4060                        2 => Self::Paragraph,
4061                        3 => Self::Line,
4062                        4 => Self::Token,
4063                        5 => Self::VisualElement,
4064                        6 => Self::Table,
4065                        7 => Self::FormField,
4066                        _ => Self::UnknownValue(layout_type::UnknownValue(
4067                            wkt::internal::UnknownEnumValue::Integer(value),
4068                        )),
4069                    }
4070                }
4071            }
4072
4073            impl std::convert::From<&str> for LayoutType {
4074                fn from(value: &str) -> Self {
4075                    use std::string::ToString;
4076                    match value {
4077                        "LAYOUT_TYPE_UNSPECIFIED" => Self::Unspecified,
4078                        "BLOCK" => Self::Block,
4079                        "PARAGRAPH" => Self::Paragraph,
4080                        "LINE" => Self::Line,
4081                        "TOKEN" => Self::Token,
4082                        "VISUAL_ELEMENT" => Self::VisualElement,
4083                        "TABLE" => Self::Table,
4084                        "FORM_FIELD" => Self::FormField,
4085                        _ => Self::UnknownValue(layout_type::UnknownValue(
4086                            wkt::internal::UnknownEnumValue::String(value.to_string()),
4087                        )),
4088                    }
4089                }
4090            }
4091
4092            impl serde::ser::Serialize for LayoutType {
4093                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4094                where
4095                    S: serde::Serializer,
4096                {
4097                    match self {
4098                        Self::Unspecified => serializer.serialize_i32(0),
4099                        Self::Block => serializer.serialize_i32(1),
4100                        Self::Paragraph => serializer.serialize_i32(2),
4101                        Self::Line => serializer.serialize_i32(3),
4102                        Self::Token => serializer.serialize_i32(4),
4103                        Self::VisualElement => serializer.serialize_i32(5),
4104                        Self::Table => serializer.serialize_i32(6),
4105                        Self::FormField => serializer.serialize_i32(7),
4106                        Self::UnknownValue(u) => u.0.serialize(serializer),
4107                    }
4108                }
4109            }
4110
4111            impl<'de> serde::de::Deserialize<'de> for LayoutType {
4112                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4113                where
4114                    D: serde::Deserializer<'de>,
4115                {
4116                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<LayoutType>::new(
4117                        ".google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType",
4118                    ))
4119                }
4120            }
4121        }
4122    }
4123
4124    /// Structure to identify provenance relationships between annotations in
4125    /// different revisions.
4126    #[derive(Clone, Default, PartialEq)]
4127    #[non_exhaustive]
4128    pub struct Provenance {
4129        /// The index of the revision that produced this element.
4130        #[deprecated]
4131        pub revision: i32,
4132
4133        /// The Id of this operation.  Needs to be unique within the scope of the
4134        /// revision.
4135        #[deprecated]
4136        pub id: i32,
4137
4138        /// References to the original elements that are replaced.
4139        pub parents: std::vec::Vec<crate::model::document::provenance::Parent>,
4140
4141        /// The type of provenance operation.
4142        pub r#type: crate::model::document::provenance::OperationType,
4143
4144        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4145    }
4146
4147    impl Provenance {
4148        pub fn new() -> Self {
4149            std::default::Default::default()
4150        }
4151
4152        /// Sets the value of [revision][crate::model::document::Provenance::revision].
4153        #[deprecated]
4154        pub fn set_revision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4155            self.revision = v.into();
4156            self
4157        }
4158
4159        /// Sets the value of [id][crate::model::document::Provenance::id].
4160        #[deprecated]
4161        pub fn set_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4162            self.id = v.into();
4163            self
4164        }
4165
4166        /// Sets the value of [parents][crate::model::document::Provenance::parents].
4167        pub fn set_parents<T, V>(mut self, v: T) -> Self
4168        where
4169            T: std::iter::IntoIterator<Item = V>,
4170            V: std::convert::Into<crate::model::document::provenance::Parent>,
4171        {
4172            use std::iter::Iterator;
4173            self.parents = v.into_iter().map(|i| i.into()).collect();
4174            self
4175        }
4176
4177        /// Sets the value of [r#type][crate::model::document::Provenance::type].
4178        pub fn set_type<
4179            T: std::convert::Into<crate::model::document::provenance::OperationType>,
4180        >(
4181            mut self,
4182            v: T,
4183        ) -> Self {
4184            self.r#type = v.into();
4185            self
4186        }
4187    }
4188
4189    impl wkt::message::Message for Provenance {
4190        fn typename() -> &'static str {
4191            "type.googleapis.com/google.cloud.documentai.v1.Document.Provenance"
4192        }
4193    }
4194
4195    /// Defines additional types related to [Provenance].
4196    pub mod provenance {
4197        #[allow(unused_imports)]
4198        use super::*;
4199
4200        /// The parent element the current element is based on. Used for
4201        /// referencing/aligning, removal and replacement operations.
4202        #[derive(Clone, Default, PartialEq)]
4203        #[non_exhaustive]
4204        pub struct Parent {
4205            /// The index of the index into current revision's parent_ids list.
4206            pub revision: i32,
4207
4208            /// The index of the parent item in the corresponding item list (eg. list
4209            /// of entities, properties within entities, etc.) in the parent revision.
4210            pub index: i32,
4211
4212            /// The id of the parent provenance.
4213            #[deprecated]
4214            pub id: i32,
4215
4216            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4217        }
4218
4219        impl Parent {
4220            pub fn new() -> Self {
4221                std::default::Default::default()
4222            }
4223
4224            /// Sets the value of [revision][crate::model::document::provenance::Parent::revision].
4225            pub fn set_revision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4226                self.revision = v.into();
4227                self
4228            }
4229
4230            /// Sets the value of [index][crate::model::document::provenance::Parent::index].
4231            pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4232                self.index = v.into();
4233                self
4234            }
4235
4236            /// Sets the value of [id][crate::model::document::provenance::Parent::id].
4237            #[deprecated]
4238            pub fn set_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4239                self.id = v.into();
4240                self
4241            }
4242        }
4243
4244        impl wkt::message::Message for Parent {
4245            fn typename() -> &'static str {
4246                "type.googleapis.com/google.cloud.documentai.v1.Document.Provenance.Parent"
4247            }
4248        }
4249
4250        /// If a processor or agent does an explicit operation on existing elements.
4251        ///
4252        /// # Working with unknown values
4253        ///
4254        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4255        /// additional enum variants at any time. Adding new variants is not considered
4256        /// a breaking change. Applications should write their code in anticipation of:
4257        ///
4258        /// - New values appearing in future releases of the client library, **and**
4259        /// - New values received dynamically, without application changes.
4260        ///
4261        /// Please consult the [Working with enums] section in the user guide for some
4262        /// guidelines.
4263        ///
4264        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4265        #[derive(Clone, Debug, PartialEq)]
4266        #[non_exhaustive]
4267        pub enum OperationType {
4268            /// Operation type unspecified. If no operation is specified a provenance
4269            /// entry is simply used to match against a `parent`.
4270            Unspecified,
4271            /// Add an element.
4272            Add,
4273            /// Remove an element identified by `parent`.
4274            Remove,
4275            /// Updates any fields within the given provenance scope of the message. It
4276            /// overwrites the fields rather than replacing them.  Use this when you
4277            /// want to update a field value of an entity without also updating all the
4278            /// child properties.
4279            Update,
4280            /// Currently unused. Replace an element identified by `parent`.
4281            Replace,
4282            /// Deprecated. Request human review for the element identified by
4283            /// `parent`.
4284            #[deprecated]
4285            EvalRequested,
4286            /// Deprecated. Element is reviewed and approved at human review,
4287            /// confidence will be set to 1.0.
4288            #[deprecated]
4289            EvalApproved,
4290            /// Deprecated. Element is skipped in the validation process.
4291            #[deprecated]
4292            EvalSkipped,
4293            /// If set, the enum was initialized with an unknown value.
4294            ///
4295            /// Applications can examine the value using [OperationType::value] or
4296            /// [OperationType::name].
4297            UnknownValue(operation_type::UnknownValue),
4298        }
4299
4300        #[doc(hidden)]
4301        pub mod operation_type {
4302            #[allow(unused_imports)]
4303            use super::*;
4304            #[derive(Clone, Debug, PartialEq)]
4305            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4306        }
4307
4308        impl OperationType {
4309            /// Gets the enum value.
4310            ///
4311            /// Returns `None` if the enum contains an unknown value deserialized from
4312            /// the string representation of enums.
4313            pub fn value(&self) -> std::option::Option<i32> {
4314                match self {
4315                    Self::Unspecified => std::option::Option::Some(0),
4316                    Self::Add => std::option::Option::Some(1),
4317                    Self::Remove => std::option::Option::Some(2),
4318                    Self::Update => std::option::Option::Some(7),
4319                    Self::Replace => std::option::Option::Some(3),
4320                    Self::EvalRequested => std::option::Option::Some(4),
4321                    Self::EvalApproved => std::option::Option::Some(5),
4322                    Self::EvalSkipped => std::option::Option::Some(6),
4323                    Self::UnknownValue(u) => u.0.value(),
4324                }
4325            }
4326
4327            /// Gets the enum value as a string.
4328            ///
4329            /// Returns `None` if the enum contains an unknown value deserialized from
4330            /// the integer representation of enums.
4331            pub fn name(&self) -> std::option::Option<&str> {
4332                match self {
4333                    Self::Unspecified => std::option::Option::Some("OPERATION_TYPE_UNSPECIFIED"),
4334                    Self::Add => std::option::Option::Some("ADD"),
4335                    Self::Remove => std::option::Option::Some("REMOVE"),
4336                    Self::Update => std::option::Option::Some("UPDATE"),
4337                    Self::Replace => std::option::Option::Some("REPLACE"),
4338                    Self::EvalRequested => std::option::Option::Some("EVAL_REQUESTED"),
4339                    Self::EvalApproved => std::option::Option::Some("EVAL_APPROVED"),
4340                    Self::EvalSkipped => std::option::Option::Some("EVAL_SKIPPED"),
4341                    Self::UnknownValue(u) => u.0.name(),
4342                }
4343            }
4344        }
4345
4346        impl std::default::Default for OperationType {
4347            fn default() -> Self {
4348                use std::convert::From;
4349                Self::from(0)
4350            }
4351        }
4352
4353        impl std::fmt::Display for OperationType {
4354            fn fmt(
4355                &self,
4356                f: &mut std::fmt::Formatter<'_>,
4357            ) -> std::result::Result<(), std::fmt::Error> {
4358                wkt::internal::display_enum(f, self.name(), self.value())
4359            }
4360        }
4361
4362        impl std::convert::From<i32> for OperationType {
4363            fn from(value: i32) -> Self {
4364                match value {
4365                    0 => Self::Unspecified,
4366                    1 => Self::Add,
4367                    2 => Self::Remove,
4368                    3 => Self::Replace,
4369                    4 => Self::EvalRequested,
4370                    5 => Self::EvalApproved,
4371                    6 => Self::EvalSkipped,
4372                    7 => Self::Update,
4373                    _ => Self::UnknownValue(operation_type::UnknownValue(
4374                        wkt::internal::UnknownEnumValue::Integer(value),
4375                    )),
4376                }
4377            }
4378        }
4379
4380        impl std::convert::From<&str> for OperationType {
4381            fn from(value: &str) -> Self {
4382                use std::string::ToString;
4383                match value {
4384                    "OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
4385                    "ADD" => Self::Add,
4386                    "REMOVE" => Self::Remove,
4387                    "UPDATE" => Self::Update,
4388                    "REPLACE" => Self::Replace,
4389                    "EVAL_REQUESTED" => Self::EvalRequested,
4390                    "EVAL_APPROVED" => Self::EvalApproved,
4391                    "EVAL_SKIPPED" => Self::EvalSkipped,
4392                    _ => Self::UnknownValue(operation_type::UnknownValue(
4393                        wkt::internal::UnknownEnumValue::String(value.to_string()),
4394                    )),
4395                }
4396            }
4397        }
4398
4399        impl serde::ser::Serialize for OperationType {
4400            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4401            where
4402                S: serde::Serializer,
4403            {
4404                match self {
4405                    Self::Unspecified => serializer.serialize_i32(0),
4406                    Self::Add => serializer.serialize_i32(1),
4407                    Self::Remove => serializer.serialize_i32(2),
4408                    Self::Update => serializer.serialize_i32(7),
4409                    Self::Replace => serializer.serialize_i32(3),
4410                    Self::EvalRequested => serializer.serialize_i32(4),
4411                    Self::EvalApproved => serializer.serialize_i32(5),
4412                    Self::EvalSkipped => serializer.serialize_i32(6),
4413                    Self::UnknownValue(u) => u.0.serialize(serializer),
4414                }
4415            }
4416        }
4417
4418        impl<'de> serde::de::Deserialize<'de> for OperationType {
4419            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4420            where
4421                D: serde::Deserializer<'de>,
4422            {
4423                deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
4424                    ".google.cloud.documentai.v1.Document.Provenance.OperationType",
4425                ))
4426            }
4427        }
4428    }
4429
4430    /// Contains past or forward revisions of this document.
4431    #[derive(Clone, Default, PartialEq)]
4432    #[non_exhaustive]
4433    pub struct Revision {
4434        /// Id of the revision, internally generated by doc proto storage.
4435        /// Unique within the context of the document.
4436        pub id: std::string::String,
4437
4438        /// The revisions that this revision is based on.  This can include one or
4439        /// more parent (when documents are merged.)  This field represents the
4440        /// index into the `revisions` field.
4441        #[deprecated]
4442        pub parent: std::vec::Vec<i32>,
4443
4444        /// The revisions that this revision is based on. Must include all the ids
4445        /// that have anything to do with this revision - eg. there are
4446        /// `provenance.parent.revision` fields that index into this field.
4447        pub parent_ids: std::vec::Vec<std::string::String>,
4448
4449        /// The time that the revision was created, internally generated by
4450        /// doc proto storage at the time of create.
4451        pub create_time: std::option::Option<wkt::Timestamp>,
4452
4453        /// Human Review information of this revision.
4454        pub human_review: std::option::Option<crate::model::document::revision::HumanReview>,
4455
4456        /// Who/what made the change
4457        pub source: std::option::Option<crate::model::document::revision::Source>,
4458
4459        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4460    }
4461
4462    impl Revision {
4463        pub fn new() -> Self {
4464            std::default::Default::default()
4465        }
4466
4467        /// Sets the value of [id][crate::model::document::Revision::id].
4468        pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4469            self.id = v.into();
4470            self
4471        }
4472
4473        /// Sets the value of [parent][crate::model::document::Revision::parent].
4474        #[deprecated]
4475        pub fn set_parent<T, V>(mut self, v: T) -> Self
4476        where
4477            T: std::iter::IntoIterator<Item = V>,
4478            V: std::convert::Into<i32>,
4479        {
4480            use std::iter::Iterator;
4481            self.parent = v.into_iter().map(|i| i.into()).collect();
4482            self
4483        }
4484
4485        /// Sets the value of [parent_ids][crate::model::document::Revision::parent_ids].
4486        pub fn set_parent_ids<T, V>(mut self, v: T) -> Self
4487        where
4488            T: std::iter::IntoIterator<Item = V>,
4489            V: std::convert::Into<std::string::String>,
4490        {
4491            use std::iter::Iterator;
4492            self.parent_ids = v.into_iter().map(|i| i.into()).collect();
4493            self
4494        }
4495
4496        /// Sets the value of [create_time][crate::model::document::Revision::create_time].
4497        pub fn set_create_time<T>(mut self, v: T) -> Self
4498        where
4499            T: std::convert::Into<wkt::Timestamp>,
4500        {
4501            self.create_time = std::option::Option::Some(v.into());
4502            self
4503        }
4504
4505        /// Sets or clears the value of [create_time][crate::model::document::Revision::create_time].
4506        pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4507        where
4508            T: std::convert::Into<wkt::Timestamp>,
4509        {
4510            self.create_time = v.map(|x| x.into());
4511            self
4512        }
4513
4514        /// Sets the value of [human_review][crate::model::document::Revision::human_review].
4515        pub fn set_human_review<T>(mut self, v: T) -> Self
4516        where
4517            T: std::convert::Into<crate::model::document::revision::HumanReview>,
4518        {
4519            self.human_review = std::option::Option::Some(v.into());
4520            self
4521        }
4522
4523        /// Sets or clears the value of [human_review][crate::model::document::Revision::human_review].
4524        pub fn set_or_clear_human_review<T>(mut self, v: std::option::Option<T>) -> Self
4525        where
4526            T: std::convert::Into<crate::model::document::revision::HumanReview>,
4527        {
4528            self.human_review = v.map(|x| x.into());
4529            self
4530        }
4531
4532        /// Sets the value of [source][crate::model::document::Revision::source].
4533        ///
4534        /// Note that all the setters affecting `source` are mutually
4535        /// exclusive.
4536        pub fn set_source<
4537            T: std::convert::Into<std::option::Option<crate::model::document::revision::Source>>,
4538        >(
4539            mut self,
4540            v: T,
4541        ) -> Self {
4542            self.source = v.into();
4543            self
4544        }
4545
4546        /// The value of [source][crate::model::document::Revision::source]
4547        /// if it holds a `Agent`, `None` if the field is not set or
4548        /// holds a different branch.
4549        pub fn agent(&self) -> std::option::Option<&std::string::String> {
4550            #[allow(unreachable_patterns)]
4551            self.source.as_ref().and_then(|v| match v {
4552                crate::model::document::revision::Source::Agent(v) => std::option::Option::Some(v),
4553                _ => std::option::Option::None,
4554            })
4555        }
4556
4557        /// Sets the value of [source][crate::model::document::Revision::source]
4558        /// to hold a `Agent`.
4559        ///
4560        /// Note that all the setters affecting `source` are
4561        /// mutually exclusive.
4562        pub fn set_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4563            self.source = std::option::Option::Some(
4564                crate::model::document::revision::Source::Agent(v.into()),
4565            );
4566            self
4567        }
4568
4569        /// The value of [source][crate::model::document::Revision::source]
4570        /// if it holds a `Processor`, `None` if the field is not set or
4571        /// holds a different branch.
4572        pub fn processor(&self) -> std::option::Option<&std::string::String> {
4573            #[allow(unreachable_patterns)]
4574            self.source.as_ref().and_then(|v| match v {
4575                crate::model::document::revision::Source::Processor(v) => {
4576                    std::option::Option::Some(v)
4577                }
4578                _ => std::option::Option::None,
4579            })
4580        }
4581
4582        /// Sets the value of [source][crate::model::document::Revision::source]
4583        /// to hold a `Processor`.
4584        ///
4585        /// Note that all the setters affecting `source` are
4586        /// mutually exclusive.
4587        pub fn set_processor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4588            self.source = std::option::Option::Some(
4589                crate::model::document::revision::Source::Processor(v.into()),
4590            );
4591            self
4592        }
4593    }
4594
4595    impl wkt::message::Message for Revision {
4596        fn typename() -> &'static str {
4597            "type.googleapis.com/google.cloud.documentai.v1.Document.Revision"
4598        }
4599    }
4600
4601    /// Defines additional types related to [Revision].
4602    pub mod revision {
4603        #[allow(unused_imports)]
4604        use super::*;
4605
4606        /// Human Review information of the document.
4607        #[derive(Clone, Default, PartialEq)]
4608        #[non_exhaustive]
4609        pub struct HumanReview {
4610            /// Human review state. e.g. `requested`, `succeeded`, `rejected`.
4611            pub state: std::string::String,
4612
4613            /// A message providing more details about the current state of processing.
4614            /// For example, the rejection reason when the state is `rejected`.
4615            pub state_message: std::string::String,
4616
4617            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4618        }
4619
4620        impl HumanReview {
4621            pub fn new() -> Self {
4622                std::default::Default::default()
4623            }
4624
4625            /// Sets the value of [state][crate::model::document::revision::HumanReview::state].
4626            pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4627                self.state = v.into();
4628                self
4629            }
4630
4631            /// Sets the value of [state_message][crate::model::document::revision::HumanReview::state_message].
4632            pub fn set_state_message<T: std::convert::Into<std::string::String>>(
4633                mut self,
4634                v: T,
4635            ) -> Self {
4636                self.state_message = v.into();
4637                self
4638            }
4639        }
4640
4641        impl wkt::message::Message for HumanReview {
4642            fn typename() -> &'static str {
4643                "type.googleapis.com/google.cloud.documentai.v1.Document.Revision.HumanReview"
4644            }
4645        }
4646
4647        /// Who/what made the change
4648        #[derive(Clone, Debug, PartialEq)]
4649        #[non_exhaustive]
4650        pub enum Source {
4651            /// If the change was made by a person specify the name or id of that
4652            /// person.
4653            Agent(std::string::String),
4654            /// If the annotation was made by processor identify the processor by its
4655            /// resource name.
4656            Processor(std::string::String),
4657        }
4658    }
4659
4660    /// This message is used for text changes aka. OCR corrections.
4661    #[derive(Clone, Default, PartialEq)]
4662    #[non_exhaustive]
4663    pub struct TextChange {
4664        /// Provenance of the correction.
4665        /// Text anchor indexing into the
4666        /// [Document.text][google.cloud.documentai.v1.Document.text].  There can
4667        /// only be a single `TextAnchor.text_segments` element.  If the start and
4668        /// end index of the text segment are the same, the text change is inserted
4669        /// before that index.
4670        ///
4671        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
4672        pub text_anchor: std::option::Option<crate::model::document::TextAnchor>,
4673
4674        /// The text that replaces the text identified in the `text_anchor`.
4675        pub changed_text: std::string::String,
4676
4677        /// The history of this annotation.
4678        #[deprecated]
4679        pub provenance: std::vec::Vec<crate::model::document::Provenance>,
4680
4681        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4682    }
4683
4684    impl TextChange {
4685        pub fn new() -> Self {
4686            std::default::Default::default()
4687        }
4688
4689        /// Sets the value of [text_anchor][crate::model::document::TextChange::text_anchor].
4690        pub fn set_text_anchor<T>(mut self, v: T) -> Self
4691        where
4692            T: std::convert::Into<crate::model::document::TextAnchor>,
4693        {
4694            self.text_anchor = std::option::Option::Some(v.into());
4695            self
4696        }
4697
4698        /// Sets or clears the value of [text_anchor][crate::model::document::TextChange::text_anchor].
4699        pub fn set_or_clear_text_anchor<T>(mut self, v: std::option::Option<T>) -> Self
4700        where
4701            T: std::convert::Into<crate::model::document::TextAnchor>,
4702        {
4703            self.text_anchor = v.map(|x| x.into());
4704            self
4705        }
4706
4707        /// Sets the value of [changed_text][crate::model::document::TextChange::changed_text].
4708        pub fn set_changed_text<T: std::convert::Into<std::string::String>>(
4709            mut self,
4710            v: T,
4711        ) -> Self {
4712            self.changed_text = v.into();
4713            self
4714        }
4715
4716        /// Sets the value of [provenance][crate::model::document::TextChange::provenance].
4717        #[deprecated]
4718        pub fn set_provenance<T, V>(mut self, v: T) -> Self
4719        where
4720            T: std::iter::IntoIterator<Item = V>,
4721            V: std::convert::Into<crate::model::document::Provenance>,
4722        {
4723            use std::iter::Iterator;
4724            self.provenance = v.into_iter().map(|i| i.into()).collect();
4725            self
4726        }
4727    }
4728
4729    impl wkt::message::Message for TextChange {
4730        fn typename() -> &'static str {
4731            "type.googleapis.com/google.cloud.documentai.v1.Document.TextChange"
4732        }
4733    }
4734
4735    /// Represents the parsed layout of a document as a collection of blocks that
4736    /// the document is divided into.
4737    #[derive(Clone, Default, PartialEq)]
4738    #[non_exhaustive]
4739    pub struct DocumentLayout {
4740        /// List of blocks in the document.
4741        pub blocks: std::vec::Vec<crate::model::document::document_layout::DocumentLayoutBlock>,
4742
4743        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4744    }
4745
4746    impl DocumentLayout {
4747        pub fn new() -> Self {
4748            std::default::Default::default()
4749        }
4750
4751        /// Sets the value of [blocks][crate::model::document::DocumentLayout::blocks].
4752        pub fn set_blocks<T, V>(mut self, v: T) -> Self
4753        where
4754            T: std::iter::IntoIterator<Item = V>,
4755            V: std::convert::Into<crate::model::document::document_layout::DocumentLayoutBlock>,
4756        {
4757            use std::iter::Iterator;
4758            self.blocks = v.into_iter().map(|i| i.into()).collect();
4759            self
4760        }
4761    }
4762
4763    impl wkt::message::Message for DocumentLayout {
4764        fn typename() -> &'static str {
4765            "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout"
4766        }
4767    }
4768
4769    /// Defines additional types related to [DocumentLayout].
4770    pub mod document_layout {
4771        #[allow(unused_imports)]
4772        use super::*;
4773
4774        /// Represents a block. A block could be one of the various types (text,
4775        /// table, list) supported.
4776        #[derive(Clone, Default, PartialEq)]
4777        #[non_exhaustive]
4778        pub struct DocumentLayoutBlock {
4779            /// ID of the block.
4780            pub block_id: std::string::String,
4781
4782            /// Page span of the block.
4783            pub page_span: std::option::Option<
4784                crate::model::document::document_layout::document_layout_block::LayoutPageSpan,
4785            >,
4786
4787            /// Identifies the bounding box for the block.
4788            pub bounding_box: std::option::Option<crate::model::BoundingPoly>,
4789
4790            pub block: std::option::Option<
4791                crate::model::document::document_layout::document_layout_block::Block,
4792            >,
4793
4794            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4795        }
4796
4797        impl DocumentLayoutBlock {
4798            pub fn new() -> Self {
4799                std::default::Default::default()
4800            }
4801
4802            /// Sets the value of [block_id][crate::model::document::document_layout::DocumentLayoutBlock::block_id].
4803            pub fn set_block_id<T: std::convert::Into<std::string::String>>(
4804                mut self,
4805                v: T,
4806            ) -> Self {
4807                self.block_id = v.into();
4808                self
4809            }
4810
4811            /// Sets the value of [page_span][crate::model::document::document_layout::DocumentLayoutBlock::page_span].
4812            pub fn set_page_span<T>(mut self, v: T) -> Self
4813            where T: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutPageSpan>
4814            {
4815                self.page_span = std::option::Option::Some(v.into());
4816                self
4817            }
4818
4819            /// Sets or clears the value of [page_span][crate::model::document::document_layout::DocumentLayoutBlock::page_span].
4820            pub fn set_or_clear_page_span<T>(mut self, v: std::option::Option<T>) -> Self
4821            where T: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutPageSpan>
4822            {
4823                self.page_span = v.map(|x| x.into());
4824                self
4825            }
4826
4827            /// Sets the value of [bounding_box][crate::model::document::document_layout::DocumentLayoutBlock::bounding_box].
4828            pub fn set_bounding_box<T>(mut self, v: T) -> Self
4829            where
4830                T: std::convert::Into<crate::model::BoundingPoly>,
4831            {
4832                self.bounding_box = std::option::Option::Some(v.into());
4833                self
4834            }
4835
4836            /// Sets or clears the value of [bounding_box][crate::model::document::document_layout::DocumentLayoutBlock::bounding_box].
4837            pub fn set_or_clear_bounding_box<T>(mut self, v: std::option::Option<T>) -> Self
4838            where
4839                T: std::convert::Into<crate::model::BoundingPoly>,
4840            {
4841                self.bounding_box = v.map(|x| x.into());
4842                self
4843            }
4844
4845            /// Sets the value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block].
4846            ///
4847            /// Note that all the setters affecting `block` are mutually
4848            /// exclusive.
4849            pub fn set_block<
4850                T: std::convert::Into<
4851                        std::option::Option<
4852                            crate::model::document::document_layout::document_layout_block::Block,
4853                        >,
4854                    >,
4855            >(
4856                mut self,
4857                v: T,
4858            ) -> Self {
4859                self.block = v.into();
4860                self
4861            }
4862
4863            /// The value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
4864            /// if it holds a `TextBlock`, `None` if the field is not set or
4865            /// holds a different branch.
4866            pub fn text_block(
4867                &self,
4868            ) -> std::option::Option<
4869                &std::boxed::Box<
4870                    crate::model::document::document_layout::document_layout_block::LayoutTextBlock,
4871                >,
4872            > {
4873                #[allow(unreachable_patterns)]
4874                self.block.as_ref().and_then(|v| match v {
4875                    crate::model::document::document_layout::document_layout_block::Block::TextBlock(v) => std::option::Option::Some(v),
4876                    _ => std::option::Option::None,
4877                })
4878            }
4879
4880            /// Sets the value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
4881            /// to hold a `TextBlock`.
4882            ///
4883            /// Note that all the setters affecting `block` are
4884            /// mutually exclusive.
4885            pub fn set_text_block<T: std::convert::Into<std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutTextBlock>>>(mut self, v: T) -> Self{
4886                self.block = std::option::Option::Some(
4887                    crate::model::document::document_layout::document_layout_block::Block::TextBlock(
4888                        v.into()
4889                    )
4890                );
4891                self
4892            }
4893
4894            /// The value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
4895            /// if it holds a `TableBlock`, `None` if the field is not set or
4896            /// holds a different branch.
4897            pub fn table_block(&self) -> std::option::Option<&std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutTableBlock>>{
4898                #[allow(unreachable_patterns)]
4899                self.block.as_ref().and_then(|v| match v {
4900                    crate::model::document::document_layout::document_layout_block::Block::TableBlock(v) => std::option::Option::Some(v),
4901                    _ => std::option::Option::None,
4902                })
4903            }
4904
4905            /// Sets the value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
4906            /// to hold a `TableBlock`.
4907            ///
4908            /// Note that all the setters affecting `block` are
4909            /// mutually exclusive.
4910            pub fn set_table_block<T: std::convert::Into<std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutTableBlock>>>(mut self, v: T) -> Self{
4911                self.block = std::option::Option::Some(
4912                    crate::model::document::document_layout::document_layout_block::Block::TableBlock(
4913                        v.into()
4914                    )
4915                );
4916                self
4917            }
4918
4919            /// The value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
4920            /// if it holds a `ListBlock`, `None` if the field is not set or
4921            /// holds a different branch.
4922            pub fn list_block(
4923                &self,
4924            ) -> std::option::Option<
4925                &std::boxed::Box<
4926                    crate::model::document::document_layout::document_layout_block::LayoutListBlock,
4927                >,
4928            > {
4929                #[allow(unreachable_patterns)]
4930                self.block.as_ref().and_then(|v| match v {
4931                    crate::model::document::document_layout::document_layout_block::Block::ListBlock(v) => std::option::Option::Some(v),
4932                    _ => std::option::Option::None,
4933                })
4934            }
4935
4936            /// Sets the value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
4937            /// to hold a `ListBlock`.
4938            ///
4939            /// Note that all the setters affecting `block` are
4940            /// mutually exclusive.
4941            pub fn set_list_block<T: std::convert::Into<std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutListBlock>>>(mut self, v: T) -> Self{
4942                self.block = std::option::Option::Some(
4943                    crate::model::document::document_layout::document_layout_block::Block::ListBlock(
4944                        v.into()
4945                    )
4946                );
4947                self
4948            }
4949        }
4950
4951        impl wkt::message::Message for DocumentLayoutBlock {
4952            fn typename() -> &'static str {
4953                "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock"
4954            }
4955        }
4956
4957        /// Defines additional types related to [DocumentLayoutBlock].
4958        pub mod document_layout_block {
4959            #[allow(unused_imports)]
4960            use super::*;
4961
4962            /// Represents where the block starts and ends in the document.
4963            #[derive(Clone, Default, PartialEq)]
4964            #[non_exhaustive]
4965            pub struct LayoutPageSpan {
4966                /// Page where block starts in the document.
4967                pub page_start: i32,
4968
4969                /// Page where block ends in the document.
4970                pub page_end: i32,
4971
4972                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4973            }
4974
4975            impl LayoutPageSpan {
4976                pub fn new() -> Self {
4977                    std::default::Default::default()
4978                }
4979
4980                /// Sets the value of [page_start][crate::model::document::document_layout::document_layout_block::LayoutPageSpan::page_start].
4981                pub fn set_page_start<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4982                    self.page_start = v.into();
4983                    self
4984                }
4985
4986                /// Sets the value of [page_end][crate::model::document::document_layout::document_layout_block::LayoutPageSpan::page_end].
4987                pub fn set_page_end<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4988                    self.page_end = v.into();
4989                    self
4990                }
4991            }
4992
4993            impl wkt::message::Message for LayoutPageSpan {
4994                fn typename() -> &'static str {
4995                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan"
4996                }
4997            }
4998
4999            /// Represents a text type block.
5000            #[derive(Clone, Default, PartialEq)]
5001            #[non_exhaustive]
5002            pub struct LayoutTextBlock {
5003                /// Text content stored in the block.
5004                pub text: std::string::String,
5005
5006                /// Type of the text in the block. Available options are: `paragraph`,
5007                /// `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`,
5008                /// `heading-5`, `header`, `footer`.
5009                pub r#type: std::string::String,
5010
5011                /// A text block could further have child blocks.
5012                /// Repeated blocks support further hierarchies and nested blocks.
5013                pub blocks:
5014                    std::vec::Vec<crate::model::document::document_layout::DocumentLayoutBlock>,
5015
5016                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5017            }
5018
5019            impl LayoutTextBlock {
5020                pub fn new() -> Self {
5021                    std::default::Default::default()
5022                }
5023
5024                /// Sets the value of [text][crate::model::document::document_layout::document_layout_block::LayoutTextBlock::text].
5025                pub fn set_text<T: std::convert::Into<std::string::String>>(
5026                    mut self,
5027                    v: T,
5028                ) -> Self {
5029                    self.text = v.into();
5030                    self
5031                }
5032
5033                /// Sets the value of [r#type][crate::model::document::document_layout::document_layout_block::LayoutTextBlock::type].
5034                pub fn set_type<T: std::convert::Into<std::string::String>>(
5035                    mut self,
5036                    v: T,
5037                ) -> Self {
5038                    self.r#type = v.into();
5039                    self
5040                }
5041
5042                /// Sets the value of [blocks][crate::model::document::document_layout::document_layout_block::LayoutTextBlock::blocks].
5043                pub fn set_blocks<T, V>(mut self, v: T) -> Self
5044                where
5045                    T: std::iter::IntoIterator<Item = V>,
5046                    V: std::convert::Into<
5047                            crate::model::document::document_layout::DocumentLayoutBlock,
5048                        >,
5049                {
5050                    use std::iter::Iterator;
5051                    self.blocks = v.into_iter().map(|i| i.into()).collect();
5052                    self
5053                }
5054            }
5055
5056            impl wkt::message::Message for LayoutTextBlock {
5057                fn typename() -> &'static str {
5058                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock"
5059                }
5060            }
5061
5062            /// Represents a table type block.
5063            #[derive(Clone, Default, PartialEq)]
5064            #[non_exhaustive]
5065            pub struct LayoutTableBlock {
5066                /// Header rows at the top of the table.
5067                pub header_rows: std::vec::Vec<
5068                    crate::model::document::document_layout::document_layout_block::LayoutTableRow,
5069                >,
5070
5071                /// Body rows containing main table content.
5072                pub body_rows: std::vec::Vec<
5073                    crate::model::document::document_layout::document_layout_block::LayoutTableRow,
5074                >,
5075
5076                /// Table caption/title.
5077                pub caption: std::string::String,
5078
5079                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5080            }
5081
5082            impl LayoutTableBlock {
5083                pub fn new() -> Self {
5084                    std::default::Default::default()
5085                }
5086
5087                /// Sets the value of [header_rows][crate::model::document::document_layout::document_layout_block::LayoutTableBlock::header_rows].
5088                pub fn set_header_rows<T, V>(mut self, v: T) -> Self
5089                where
5090                    T: std::iter::IntoIterator<Item = V>,
5091                    V: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutTableRow>
5092                {
5093                    use std::iter::Iterator;
5094                    self.header_rows = v.into_iter().map(|i| i.into()).collect();
5095                    self
5096                }
5097
5098                /// Sets the value of [body_rows][crate::model::document::document_layout::document_layout_block::LayoutTableBlock::body_rows].
5099                pub fn set_body_rows<T, V>(mut self, v: T) -> Self
5100                where
5101                    T: std::iter::IntoIterator<Item = V>,
5102                    V: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutTableRow>
5103                {
5104                    use std::iter::Iterator;
5105                    self.body_rows = v.into_iter().map(|i| i.into()).collect();
5106                    self
5107                }
5108
5109                /// Sets the value of [caption][crate::model::document::document_layout::document_layout_block::LayoutTableBlock::caption].
5110                pub fn set_caption<T: std::convert::Into<std::string::String>>(
5111                    mut self,
5112                    v: T,
5113                ) -> Self {
5114                    self.caption = v.into();
5115                    self
5116                }
5117            }
5118
5119            impl wkt::message::Message for LayoutTableBlock {
5120                fn typename() -> &'static str {
5121                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock"
5122                }
5123            }
5124
5125            /// Represents a row in a table.
5126            #[derive(Clone, Default, PartialEq)]
5127            #[non_exhaustive]
5128            pub struct LayoutTableRow {
5129                /// A table row is a list of table cells.
5130                pub cells: std::vec::Vec<
5131                    crate::model::document::document_layout::document_layout_block::LayoutTableCell,
5132                >,
5133
5134                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5135            }
5136
5137            impl LayoutTableRow {
5138                pub fn new() -> Self {
5139                    std::default::Default::default()
5140                }
5141
5142                /// Sets the value of [cells][crate::model::document::document_layout::document_layout_block::LayoutTableRow::cells].
5143                pub fn set_cells<T, V>(mut self, v: T) -> Self
5144                where
5145                    T: std::iter::IntoIterator<Item = V>,
5146                    V: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutTableCell>
5147                {
5148                    use std::iter::Iterator;
5149                    self.cells = v.into_iter().map(|i| i.into()).collect();
5150                    self
5151                }
5152            }
5153
5154            impl wkt::message::Message for LayoutTableRow {
5155                fn typename() -> &'static str {
5156                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow"
5157                }
5158            }
5159
5160            /// Represents a cell in a table row.
5161            #[derive(Clone, Default, PartialEq)]
5162            #[non_exhaustive]
5163            pub struct LayoutTableCell {
5164                /// A table cell is a list of blocks.
5165                /// Repeated blocks support further hierarchies and nested blocks.
5166                pub blocks:
5167                    std::vec::Vec<crate::model::document::document_layout::DocumentLayoutBlock>,
5168
5169                /// How many rows this cell spans.
5170                pub row_span: i32,
5171
5172                /// How many columns this cell spans.
5173                pub col_span: i32,
5174
5175                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5176            }
5177
5178            impl LayoutTableCell {
5179                pub fn new() -> Self {
5180                    std::default::Default::default()
5181                }
5182
5183                /// Sets the value of [blocks][crate::model::document::document_layout::document_layout_block::LayoutTableCell::blocks].
5184                pub fn set_blocks<T, V>(mut self, v: T) -> Self
5185                where
5186                    T: std::iter::IntoIterator<Item = V>,
5187                    V: std::convert::Into<
5188                            crate::model::document::document_layout::DocumentLayoutBlock,
5189                        >,
5190                {
5191                    use std::iter::Iterator;
5192                    self.blocks = v.into_iter().map(|i| i.into()).collect();
5193                    self
5194                }
5195
5196                /// Sets the value of [row_span][crate::model::document::document_layout::document_layout_block::LayoutTableCell::row_span].
5197                pub fn set_row_span<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5198                    self.row_span = v.into();
5199                    self
5200                }
5201
5202                /// Sets the value of [col_span][crate::model::document::document_layout::document_layout_block::LayoutTableCell::col_span].
5203                pub fn set_col_span<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5204                    self.col_span = v.into();
5205                    self
5206                }
5207            }
5208
5209            impl wkt::message::Message for LayoutTableCell {
5210                fn typename() -> &'static str {
5211                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell"
5212                }
5213            }
5214
5215            /// Represents a list type block.
5216            #[derive(Clone, Default, PartialEq)]
5217            #[non_exhaustive]
5218            pub struct LayoutListBlock {
5219                /// List entries that constitute a list block.
5220                pub list_entries: std::vec::Vec<
5221                    crate::model::document::document_layout::document_layout_block::LayoutListEntry,
5222                >,
5223
5224                /// Type of the list_entries (if exist). Available options are `ordered`
5225                /// and `unordered`.
5226                pub r#type: std::string::String,
5227
5228                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5229            }
5230
5231            impl LayoutListBlock {
5232                pub fn new() -> Self {
5233                    std::default::Default::default()
5234                }
5235
5236                /// Sets the value of [list_entries][crate::model::document::document_layout::document_layout_block::LayoutListBlock::list_entries].
5237                pub fn set_list_entries<T, V>(mut self, v: T) -> Self
5238                where
5239                    T: std::iter::IntoIterator<Item = V>,
5240                    V: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutListEntry>
5241                {
5242                    use std::iter::Iterator;
5243                    self.list_entries = v.into_iter().map(|i| i.into()).collect();
5244                    self
5245                }
5246
5247                /// Sets the value of [r#type][crate::model::document::document_layout::document_layout_block::LayoutListBlock::type].
5248                pub fn set_type<T: std::convert::Into<std::string::String>>(
5249                    mut self,
5250                    v: T,
5251                ) -> Self {
5252                    self.r#type = v.into();
5253                    self
5254                }
5255            }
5256
5257            impl wkt::message::Message for LayoutListBlock {
5258                fn typename() -> &'static str {
5259                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock"
5260                }
5261            }
5262
5263            /// Represents an entry in the list.
5264            #[derive(Clone, Default, PartialEq)]
5265            #[non_exhaustive]
5266            pub struct LayoutListEntry {
5267                /// A list entry is a list of blocks.
5268                /// Repeated blocks support further hierarchies and nested blocks.
5269                pub blocks:
5270                    std::vec::Vec<crate::model::document::document_layout::DocumentLayoutBlock>,
5271
5272                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5273            }
5274
5275            impl LayoutListEntry {
5276                pub fn new() -> Self {
5277                    std::default::Default::default()
5278                }
5279
5280                /// Sets the value of [blocks][crate::model::document::document_layout::document_layout_block::LayoutListEntry::blocks].
5281                pub fn set_blocks<T, V>(mut self, v: T) -> Self
5282                where
5283                    T: std::iter::IntoIterator<Item = V>,
5284                    V: std::convert::Into<
5285                            crate::model::document::document_layout::DocumentLayoutBlock,
5286                        >,
5287                {
5288                    use std::iter::Iterator;
5289                    self.blocks = v.into_iter().map(|i| i.into()).collect();
5290                    self
5291                }
5292            }
5293
5294            impl wkt::message::Message for LayoutListEntry {
5295                fn typename() -> &'static str {
5296                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry"
5297                }
5298            }
5299
5300            #[derive(Clone, Debug, PartialEq)]
5301            #[non_exhaustive]
5302            pub enum Block {
5303                /// Block consisting of text content.
5304                TextBlock(std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutTextBlock>),
5305                /// Block consisting of table content/structure.
5306                TableBlock(std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutTableBlock>),
5307                /// Block consisting of list content/structure.
5308                ListBlock(std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutListBlock>),
5309            }
5310        }
5311    }
5312
5313    /// Represents the chunks that the document is divided into.
5314    #[derive(Clone, Default, PartialEq)]
5315    #[non_exhaustive]
5316    pub struct ChunkedDocument {
5317        /// List of chunks.
5318        pub chunks: std::vec::Vec<crate::model::document::chunked_document::Chunk>,
5319
5320        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5321    }
5322
5323    impl ChunkedDocument {
5324        pub fn new() -> Self {
5325            std::default::Default::default()
5326        }
5327
5328        /// Sets the value of [chunks][crate::model::document::ChunkedDocument::chunks].
5329        pub fn set_chunks<T, V>(mut self, v: T) -> Self
5330        where
5331            T: std::iter::IntoIterator<Item = V>,
5332            V: std::convert::Into<crate::model::document::chunked_document::Chunk>,
5333        {
5334            use std::iter::Iterator;
5335            self.chunks = v.into_iter().map(|i| i.into()).collect();
5336            self
5337        }
5338    }
5339
5340    impl wkt::message::Message for ChunkedDocument {
5341        fn typename() -> &'static str {
5342            "type.googleapis.com/google.cloud.documentai.v1.Document.ChunkedDocument"
5343        }
5344    }
5345
5346    /// Defines additional types related to [ChunkedDocument].
5347    pub mod chunked_document {
5348        #[allow(unused_imports)]
5349        use super::*;
5350
5351        /// Represents a chunk.
5352        #[derive(Clone, Default, PartialEq)]
5353        #[non_exhaustive]
5354        pub struct Chunk {
5355            /// ID of the chunk.
5356            pub chunk_id: std::string::String,
5357
5358            /// Unused.
5359            pub source_block_ids: std::vec::Vec<std::string::String>,
5360
5361            /// Text content of the chunk.
5362            pub content: std::string::String,
5363
5364            /// Page span of the chunk.
5365            pub page_span:
5366                std::option::Option<crate::model::document::chunked_document::chunk::ChunkPageSpan>,
5367
5368            /// Page headers associated with the chunk.
5369            pub page_headers:
5370                std::vec::Vec<crate::model::document::chunked_document::chunk::ChunkPageHeader>,
5371
5372            /// Page footers associated with the chunk.
5373            pub page_footers:
5374                std::vec::Vec<crate::model::document::chunked_document::chunk::ChunkPageFooter>,
5375
5376            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5377        }
5378
5379        impl Chunk {
5380            pub fn new() -> Self {
5381                std::default::Default::default()
5382            }
5383
5384            /// Sets the value of [chunk_id][crate::model::document::chunked_document::Chunk::chunk_id].
5385            pub fn set_chunk_id<T: std::convert::Into<std::string::String>>(
5386                mut self,
5387                v: T,
5388            ) -> Self {
5389                self.chunk_id = v.into();
5390                self
5391            }
5392
5393            /// Sets the value of [source_block_ids][crate::model::document::chunked_document::Chunk::source_block_ids].
5394            pub fn set_source_block_ids<T, V>(mut self, v: T) -> Self
5395            where
5396                T: std::iter::IntoIterator<Item = V>,
5397                V: std::convert::Into<std::string::String>,
5398            {
5399                use std::iter::Iterator;
5400                self.source_block_ids = v.into_iter().map(|i| i.into()).collect();
5401                self
5402            }
5403
5404            /// Sets the value of [content][crate::model::document::chunked_document::Chunk::content].
5405            pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5406                self.content = v.into();
5407                self
5408            }
5409
5410            /// Sets the value of [page_span][crate::model::document::chunked_document::Chunk::page_span].
5411            pub fn set_page_span<T>(mut self, v: T) -> Self
5412            where
5413                T: std::convert::Into<
5414                        crate::model::document::chunked_document::chunk::ChunkPageSpan,
5415                    >,
5416            {
5417                self.page_span = std::option::Option::Some(v.into());
5418                self
5419            }
5420
5421            /// Sets or clears the value of [page_span][crate::model::document::chunked_document::Chunk::page_span].
5422            pub fn set_or_clear_page_span<T>(mut self, v: std::option::Option<T>) -> Self
5423            where
5424                T: std::convert::Into<
5425                        crate::model::document::chunked_document::chunk::ChunkPageSpan,
5426                    >,
5427            {
5428                self.page_span = v.map(|x| x.into());
5429                self
5430            }
5431
5432            /// Sets the value of [page_headers][crate::model::document::chunked_document::Chunk::page_headers].
5433            pub fn set_page_headers<T, V>(mut self, v: T) -> Self
5434            where
5435                T: std::iter::IntoIterator<Item = V>,
5436                V: std::convert::Into<
5437                        crate::model::document::chunked_document::chunk::ChunkPageHeader,
5438                    >,
5439            {
5440                use std::iter::Iterator;
5441                self.page_headers = v.into_iter().map(|i| i.into()).collect();
5442                self
5443            }
5444
5445            /// Sets the value of [page_footers][crate::model::document::chunked_document::Chunk::page_footers].
5446            pub fn set_page_footers<T, V>(mut self, v: T) -> Self
5447            where
5448                T: std::iter::IntoIterator<Item = V>,
5449                V: std::convert::Into<
5450                        crate::model::document::chunked_document::chunk::ChunkPageFooter,
5451                    >,
5452            {
5453                use std::iter::Iterator;
5454                self.page_footers = v.into_iter().map(|i| i.into()).collect();
5455                self
5456            }
5457        }
5458
5459        impl wkt::message::Message for Chunk {
5460            fn typename() -> &'static str {
5461                "type.googleapis.com/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk"
5462            }
5463        }
5464
5465        /// Defines additional types related to [Chunk].
5466        pub mod chunk {
5467            #[allow(unused_imports)]
5468            use super::*;
5469
5470            /// Represents where the chunk starts and ends in the document.
5471            #[derive(Clone, Default, PartialEq)]
5472            #[non_exhaustive]
5473            pub struct ChunkPageSpan {
5474                /// Page where chunk starts in the document.
5475                pub page_start: i32,
5476
5477                /// Page where chunk ends in the document.
5478                pub page_end: i32,
5479
5480                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5481            }
5482
5483            impl ChunkPageSpan {
5484                pub fn new() -> Self {
5485                    std::default::Default::default()
5486                }
5487
5488                /// Sets the value of [page_start][crate::model::document::chunked_document::chunk::ChunkPageSpan::page_start].
5489                pub fn set_page_start<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5490                    self.page_start = v.into();
5491                    self
5492                }
5493
5494                /// Sets the value of [page_end][crate::model::document::chunked_document::chunk::ChunkPageSpan::page_end].
5495                pub fn set_page_end<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5496                    self.page_end = v.into();
5497                    self
5498                }
5499            }
5500
5501            impl wkt::message::Message for ChunkPageSpan {
5502                fn typename() -> &'static str {
5503                    "type.googleapis.com/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan"
5504                }
5505            }
5506
5507            /// Represents the page header associated with the chunk.
5508            #[derive(Clone, Default, PartialEq)]
5509            #[non_exhaustive]
5510            pub struct ChunkPageHeader {
5511                /// Header in text format.
5512                pub text: std::string::String,
5513
5514                /// Page span of the header.
5515                pub page_span: std::option::Option<
5516                    crate::model::document::chunked_document::chunk::ChunkPageSpan,
5517                >,
5518
5519                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5520            }
5521
5522            impl ChunkPageHeader {
5523                pub fn new() -> Self {
5524                    std::default::Default::default()
5525                }
5526
5527                /// Sets the value of [text][crate::model::document::chunked_document::chunk::ChunkPageHeader::text].
5528                pub fn set_text<T: std::convert::Into<std::string::String>>(
5529                    mut self,
5530                    v: T,
5531                ) -> Self {
5532                    self.text = v.into();
5533                    self
5534                }
5535
5536                /// Sets the value of [page_span][crate::model::document::chunked_document::chunk::ChunkPageHeader::page_span].
5537                pub fn set_page_span<T>(mut self, v: T) -> Self
5538                where
5539                    T: std::convert::Into<
5540                            crate::model::document::chunked_document::chunk::ChunkPageSpan,
5541                        >,
5542                {
5543                    self.page_span = std::option::Option::Some(v.into());
5544                    self
5545                }
5546
5547                /// Sets or clears the value of [page_span][crate::model::document::chunked_document::chunk::ChunkPageHeader::page_span].
5548                pub fn set_or_clear_page_span<T>(mut self, v: std::option::Option<T>) -> Self
5549                where
5550                    T: std::convert::Into<
5551                            crate::model::document::chunked_document::chunk::ChunkPageSpan,
5552                        >,
5553                {
5554                    self.page_span = v.map(|x| x.into());
5555                    self
5556                }
5557            }
5558
5559            impl wkt::message::Message for ChunkPageHeader {
5560                fn typename() -> &'static str {
5561                    "type.googleapis.com/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader"
5562                }
5563            }
5564
5565            /// Represents the page footer associated with the chunk.
5566            #[derive(Clone, Default, PartialEq)]
5567            #[non_exhaustive]
5568            pub struct ChunkPageFooter {
5569                /// Footer in text format.
5570                pub text: std::string::String,
5571
5572                /// Page span of the footer.
5573                pub page_span: std::option::Option<
5574                    crate::model::document::chunked_document::chunk::ChunkPageSpan,
5575                >,
5576
5577                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5578            }
5579
5580            impl ChunkPageFooter {
5581                pub fn new() -> Self {
5582                    std::default::Default::default()
5583                }
5584
5585                /// Sets the value of [text][crate::model::document::chunked_document::chunk::ChunkPageFooter::text].
5586                pub fn set_text<T: std::convert::Into<std::string::String>>(
5587                    mut self,
5588                    v: T,
5589                ) -> Self {
5590                    self.text = v.into();
5591                    self
5592                }
5593
5594                /// Sets the value of [page_span][crate::model::document::chunked_document::chunk::ChunkPageFooter::page_span].
5595                pub fn set_page_span<T>(mut self, v: T) -> Self
5596                where
5597                    T: std::convert::Into<
5598                            crate::model::document::chunked_document::chunk::ChunkPageSpan,
5599                        >,
5600                {
5601                    self.page_span = std::option::Option::Some(v.into());
5602                    self
5603                }
5604
5605                /// Sets or clears the value of [page_span][crate::model::document::chunked_document::chunk::ChunkPageFooter::page_span].
5606                pub fn set_or_clear_page_span<T>(mut self, v: std::option::Option<T>) -> Self
5607                where
5608                    T: std::convert::Into<
5609                            crate::model::document::chunked_document::chunk::ChunkPageSpan,
5610                        >,
5611                {
5612                    self.page_span = v.map(|x| x.into());
5613                    self
5614                }
5615            }
5616
5617            impl wkt::message::Message for ChunkPageFooter {
5618                fn typename() -> &'static str {
5619                    "type.googleapis.com/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter"
5620                }
5621            }
5622        }
5623    }
5624
5625    /// The output of the validation given the document and the validation rules.
5626    #[derive(Clone, Default, PartialEq)]
5627    #[non_exhaustive]
5628    pub struct EntityValidationOutput {
5629        /// The result of each validation rule.
5630        pub validation_results:
5631            std::vec::Vec<crate::model::document::entity_validation_output::ValidationResult>,
5632
5633        /// The overall result of the validation, true if all applicable rules are
5634        /// valid.
5635        pub pass_all_rules: bool,
5636
5637        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5638    }
5639
5640    impl EntityValidationOutput {
5641        pub fn new() -> Self {
5642            std::default::Default::default()
5643        }
5644
5645        /// Sets the value of [validation_results][crate::model::document::EntityValidationOutput::validation_results].
5646        pub fn set_validation_results<T, V>(mut self, v: T) -> Self
5647        where
5648            T: std::iter::IntoIterator<Item = V>,
5649            V: std::convert::Into<
5650                    crate::model::document::entity_validation_output::ValidationResult,
5651                >,
5652        {
5653            use std::iter::Iterator;
5654            self.validation_results = v.into_iter().map(|i| i.into()).collect();
5655            self
5656        }
5657
5658        /// Sets the value of [pass_all_rules][crate::model::document::EntityValidationOutput::pass_all_rules].
5659        pub fn set_pass_all_rules<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5660            self.pass_all_rules = v.into();
5661            self
5662        }
5663    }
5664
5665    impl wkt::message::Message for EntityValidationOutput {
5666        fn typename() -> &'static str {
5667            "type.googleapis.com/google.cloud.documentai.v1.Document.EntityValidationOutput"
5668        }
5669    }
5670
5671    /// Defines additional types related to [EntityValidationOutput].
5672    pub mod entity_validation_output {
5673        #[allow(unused_imports)]
5674        use super::*;
5675
5676        /// Validation result for a single validation rule.
5677        #[derive(Clone, Default, PartialEq)]
5678        #[non_exhaustive]
5679        pub struct ValidationResult {
5680
5681            /// The name of the validation rule.
5682            pub rule_name: std::string::String,
5683
5684            /// The description of the validation rule.
5685            pub rule_description: std::string::String,
5686
5687            /// The result of the validation rule.
5688            pub validation_result_type: crate::model::document::entity_validation_output::validation_result::ValidationResultType,
5689
5690            /// The detailed information of the running the validation process using
5691            /// the entity from the document based on the validation rule.
5692            pub validation_details: std::string::String,
5693
5694            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5695        }
5696
5697        impl ValidationResult {
5698            pub fn new() -> Self {
5699                std::default::Default::default()
5700            }
5701
5702            /// Sets the value of [rule_name][crate::model::document::entity_validation_output::ValidationResult::rule_name].
5703            pub fn set_rule_name<T: std::convert::Into<std::string::String>>(
5704                mut self,
5705                v: T,
5706            ) -> Self {
5707                self.rule_name = v.into();
5708                self
5709            }
5710
5711            /// Sets the value of [rule_description][crate::model::document::entity_validation_output::ValidationResult::rule_description].
5712            pub fn set_rule_description<T: std::convert::Into<std::string::String>>(
5713                mut self,
5714                v: T,
5715            ) -> Self {
5716                self.rule_description = v.into();
5717                self
5718            }
5719
5720            /// Sets the value of [validation_result_type][crate::model::document::entity_validation_output::ValidationResult::validation_result_type].
5721            pub fn set_validation_result_type<T: std::convert::Into<crate::model::document::entity_validation_output::validation_result::ValidationResultType>>(mut self, v: T) -> Self{
5722                self.validation_result_type = v.into();
5723                self
5724            }
5725
5726            /// Sets the value of [validation_details][crate::model::document::entity_validation_output::ValidationResult::validation_details].
5727            pub fn set_validation_details<T: std::convert::Into<std::string::String>>(
5728                mut self,
5729                v: T,
5730            ) -> Self {
5731                self.validation_details = v.into();
5732                self
5733            }
5734        }
5735
5736        impl wkt::message::Message for ValidationResult {
5737            fn typename() -> &'static str {
5738                "type.googleapis.com/google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult"
5739            }
5740        }
5741
5742        /// Defines additional types related to [ValidationResult].
5743        pub mod validation_result {
5744            #[allow(unused_imports)]
5745            use super::*;
5746
5747            /// The result of the validation rule.
5748            ///
5749            /// # Working with unknown values
5750            ///
5751            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5752            /// additional enum variants at any time. Adding new variants is not considered
5753            /// a breaking change. Applications should write their code in anticipation of:
5754            ///
5755            /// - New values appearing in future releases of the client library, **and**
5756            /// - New values received dynamically, without application changes.
5757            ///
5758            /// Please consult the [Working with enums] section in the user guide for some
5759            /// guidelines.
5760            ///
5761            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5762            #[derive(Clone, Debug, PartialEq)]
5763            #[non_exhaustive]
5764            pub enum ValidationResultType {
5765                /// The validation result type is unspecified.
5766                Unspecified,
5767                /// The validation is valid.
5768                Valid,
5769                /// The validation is invalid.
5770                Invalid,
5771                /// The validation is skipped.
5772                Skipped,
5773                /// The validation is not applicable.
5774                NotApplicable,
5775                /// If set, the enum was initialized with an unknown value.
5776                ///
5777                /// Applications can examine the value using [ValidationResultType::value] or
5778                /// [ValidationResultType::name].
5779                UnknownValue(validation_result_type::UnknownValue),
5780            }
5781
5782            #[doc(hidden)]
5783            pub mod validation_result_type {
5784                #[allow(unused_imports)]
5785                use super::*;
5786                #[derive(Clone, Debug, PartialEq)]
5787                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5788            }
5789
5790            impl ValidationResultType {
5791                /// Gets the enum value.
5792                ///
5793                /// Returns `None` if the enum contains an unknown value deserialized from
5794                /// the string representation of enums.
5795                pub fn value(&self) -> std::option::Option<i32> {
5796                    match self {
5797                        Self::Unspecified => std::option::Option::Some(0),
5798                        Self::Valid => std::option::Option::Some(1),
5799                        Self::Invalid => std::option::Option::Some(2),
5800                        Self::Skipped => std::option::Option::Some(3),
5801                        Self::NotApplicable => std::option::Option::Some(4),
5802                        Self::UnknownValue(u) => u.0.value(),
5803                    }
5804                }
5805
5806                /// Gets the enum value as a string.
5807                ///
5808                /// Returns `None` if the enum contains an unknown value deserialized from
5809                /// the integer representation of enums.
5810                pub fn name(&self) -> std::option::Option<&str> {
5811                    match self {
5812                        Self::Unspecified => {
5813                            std::option::Option::Some("VALIDATION_RESULT_TYPE_UNSPECIFIED")
5814                        }
5815                        Self::Valid => std::option::Option::Some("VALIDATION_RESULT_TYPE_VALID"),
5816                        Self::Invalid => {
5817                            std::option::Option::Some("VALIDATION_RESULT_TYPE_INVALID")
5818                        }
5819                        Self::Skipped => {
5820                            std::option::Option::Some("VALIDATION_RESULT_TYPE_SKIPPED")
5821                        }
5822                        Self::NotApplicable => {
5823                            std::option::Option::Some("VALIDATION_RESULT_TYPE_NOT_APPLICABLE")
5824                        }
5825                        Self::UnknownValue(u) => u.0.name(),
5826                    }
5827                }
5828            }
5829
5830            impl std::default::Default for ValidationResultType {
5831                fn default() -> Self {
5832                    use std::convert::From;
5833                    Self::from(0)
5834                }
5835            }
5836
5837            impl std::fmt::Display for ValidationResultType {
5838                fn fmt(
5839                    &self,
5840                    f: &mut std::fmt::Formatter<'_>,
5841                ) -> std::result::Result<(), std::fmt::Error> {
5842                    wkt::internal::display_enum(f, self.name(), self.value())
5843                }
5844            }
5845
5846            impl std::convert::From<i32> for ValidationResultType {
5847                fn from(value: i32) -> Self {
5848                    match value {
5849                        0 => Self::Unspecified,
5850                        1 => Self::Valid,
5851                        2 => Self::Invalid,
5852                        3 => Self::Skipped,
5853                        4 => Self::NotApplicable,
5854                        _ => Self::UnknownValue(validation_result_type::UnknownValue(
5855                            wkt::internal::UnknownEnumValue::Integer(value),
5856                        )),
5857                    }
5858                }
5859            }
5860
5861            impl std::convert::From<&str> for ValidationResultType {
5862                fn from(value: &str) -> Self {
5863                    use std::string::ToString;
5864                    match value {
5865                        "VALIDATION_RESULT_TYPE_UNSPECIFIED" => Self::Unspecified,
5866                        "VALIDATION_RESULT_TYPE_VALID" => Self::Valid,
5867                        "VALIDATION_RESULT_TYPE_INVALID" => Self::Invalid,
5868                        "VALIDATION_RESULT_TYPE_SKIPPED" => Self::Skipped,
5869                        "VALIDATION_RESULT_TYPE_NOT_APPLICABLE" => Self::NotApplicable,
5870                        _ => Self::UnknownValue(validation_result_type::UnknownValue(
5871                            wkt::internal::UnknownEnumValue::String(value.to_string()),
5872                        )),
5873                    }
5874                }
5875            }
5876
5877            impl serde::ser::Serialize for ValidationResultType {
5878                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5879                where
5880                    S: serde::Serializer,
5881                {
5882                    match self {
5883                        Self::Unspecified => serializer.serialize_i32(0),
5884                        Self::Valid => serializer.serialize_i32(1),
5885                        Self::Invalid => serializer.serialize_i32(2),
5886                        Self::Skipped => serializer.serialize_i32(3),
5887                        Self::NotApplicable => serializer.serialize_i32(4),
5888                        Self::UnknownValue(u) => u.0.serialize(serializer),
5889                    }
5890                }
5891            }
5892
5893            impl<'de> serde::de::Deserialize<'de> for ValidationResultType {
5894                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5895                where
5896                    D: serde::Deserializer<'de>,
5897                {
5898                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValidationResultType>::new(
5899                        ".google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType"))
5900                }
5901            }
5902        }
5903    }
5904
5905    /// Entity revision.
5906    #[derive(Clone, Default, PartialEq)]
5907    #[non_exhaustive]
5908    pub struct EntitiesRevision {
5909        /// The revision id.
5910        pub revision_id: std::string::String,
5911
5912        /// The entities in this revision.
5913        pub entities: std::vec::Vec<crate::model::document::Entity>,
5914
5915        /// The entity validation output for this revision.
5916        pub entity_validation_output:
5917            std::option::Option<crate::model::document::EntityValidationOutput>,
5918
5919        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5920    }
5921
5922    impl EntitiesRevision {
5923        pub fn new() -> Self {
5924            std::default::Default::default()
5925        }
5926
5927        /// Sets the value of [revision_id][crate::model::document::EntitiesRevision::revision_id].
5928        pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5929            self.revision_id = v.into();
5930            self
5931        }
5932
5933        /// Sets the value of [entities][crate::model::document::EntitiesRevision::entities].
5934        pub fn set_entities<T, V>(mut self, v: T) -> Self
5935        where
5936            T: std::iter::IntoIterator<Item = V>,
5937            V: std::convert::Into<crate::model::document::Entity>,
5938        {
5939            use std::iter::Iterator;
5940            self.entities = v.into_iter().map(|i| i.into()).collect();
5941            self
5942        }
5943
5944        /// Sets the value of [entity_validation_output][crate::model::document::EntitiesRevision::entity_validation_output].
5945        pub fn set_entity_validation_output<T>(mut self, v: T) -> Self
5946        where
5947            T: std::convert::Into<crate::model::document::EntityValidationOutput>,
5948        {
5949            self.entity_validation_output = std::option::Option::Some(v.into());
5950            self
5951        }
5952
5953        /// Sets or clears the value of [entity_validation_output][crate::model::document::EntitiesRevision::entity_validation_output].
5954        pub fn set_or_clear_entity_validation_output<T>(mut self, v: std::option::Option<T>) -> Self
5955        where
5956            T: std::convert::Into<crate::model::document::EntityValidationOutput>,
5957        {
5958            self.entity_validation_output = v.map(|x| x.into());
5959            self
5960        }
5961    }
5962
5963    impl wkt::message::Message for EntitiesRevision {
5964        fn typename() -> &'static str {
5965            "type.googleapis.com/google.cloud.documentai.v1.Document.EntitiesRevision"
5966        }
5967    }
5968
5969    /// Original source document from the user.
5970    #[derive(Clone, Debug, PartialEq)]
5971    #[non_exhaustive]
5972    pub enum Source {
5973        /// Optional. Currently supports Google Cloud Storage URI of the form
5974        /// `gs://bucket_name/object_name`. Object versioning is not supported.
5975        /// For more information, refer to [Google Cloud Storage Request
5976        /// URIs](https://cloud.google.com/storage/docs/reference-uris).
5977        Uri(std::string::String),
5978        /// Optional. Inline document content, represented as a stream of bytes.
5979        /// Note: As with all `bytes` fields, protobuffers use a pure binary
5980        /// representation, whereas JSON representations use base64.
5981        Content(::bytes::Bytes),
5982    }
5983}
5984
5985/// Payload message of raw document content (bytes).
5986#[derive(Clone, Default, PartialEq)]
5987#[non_exhaustive]
5988pub struct RawDocument {
5989    /// Inline document content.
5990    pub content: ::bytes::Bytes,
5991
5992    /// An IANA MIME type (RFC6838) indicating the nature and format of the
5993    /// [content][google.cloud.documentai.v1.RawDocument.content].
5994    ///
5995    /// [google.cloud.documentai.v1.RawDocument.content]: crate::model::RawDocument::content
5996    pub mime_type: std::string::String,
5997
5998    /// The display name of the document, it supports all Unicode characters except
5999    /// the following:
6000    /// `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,`
6001    /// `~`, `=` and `:` are reserved.
6002    /// If not specified, a default ID is generated.
6003    pub display_name: std::string::String,
6004
6005    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6006}
6007
6008impl RawDocument {
6009    pub fn new() -> Self {
6010        std::default::Default::default()
6011    }
6012
6013    /// Sets the value of [content][crate::model::RawDocument::content].
6014    pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6015        self.content = v.into();
6016        self
6017    }
6018
6019    /// Sets the value of [mime_type][crate::model::RawDocument::mime_type].
6020    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6021        self.mime_type = v.into();
6022        self
6023    }
6024
6025    /// Sets the value of [display_name][crate::model::RawDocument::display_name].
6026    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6027        self.display_name = v.into();
6028        self
6029    }
6030}
6031
6032impl wkt::message::Message for RawDocument {
6033    fn typename() -> &'static str {
6034        "type.googleapis.com/google.cloud.documentai.v1.RawDocument"
6035    }
6036}
6037
6038/// Specifies a document stored on Cloud Storage.
6039#[derive(Clone, Default, PartialEq)]
6040#[non_exhaustive]
6041pub struct GcsDocument {
6042    /// The Cloud Storage object uri.
6043    pub gcs_uri: std::string::String,
6044
6045    /// An IANA MIME type (RFC6838) of the content.
6046    pub mime_type: std::string::String,
6047
6048    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6049}
6050
6051impl GcsDocument {
6052    pub fn new() -> Self {
6053        std::default::Default::default()
6054    }
6055
6056    /// Sets the value of [gcs_uri][crate::model::GcsDocument::gcs_uri].
6057    pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6058        self.gcs_uri = v.into();
6059        self
6060    }
6061
6062    /// Sets the value of [mime_type][crate::model::GcsDocument::mime_type].
6063    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6064        self.mime_type = v.into();
6065        self
6066    }
6067}
6068
6069impl wkt::message::Message for GcsDocument {
6070    fn typename() -> &'static str {
6071        "type.googleapis.com/google.cloud.documentai.v1.GcsDocument"
6072    }
6073}
6074
6075/// Specifies a set of documents on Cloud Storage.
6076#[derive(Clone, Default, PartialEq)]
6077#[non_exhaustive]
6078pub struct GcsDocuments {
6079    /// The list of documents.
6080    pub documents: std::vec::Vec<crate::model::GcsDocument>,
6081
6082    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6083}
6084
6085impl GcsDocuments {
6086    pub fn new() -> Self {
6087        std::default::Default::default()
6088    }
6089
6090    /// Sets the value of [documents][crate::model::GcsDocuments::documents].
6091    pub fn set_documents<T, V>(mut self, v: T) -> Self
6092    where
6093        T: std::iter::IntoIterator<Item = V>,
6094        V: std::convert::Into<crate::model::GcsDocument>,
6095    {
6096        use std::iter::Iterator;
6097        self.documents = v.into_iter().map(|i| i.into()).collect();
6098        self
6099    }
6100}
6101
6102impl wkt::message::Message for GcsDocuments {
6103    fn typename() -> &'static str {
6104        "type.googleapis.com/google.cloud.documentai.v1.GcsDocuments"
6105    }
6106}
6107
6108/// Specifies all documents on Cloud Storage with a common prefix.
6109#[derive(Clone, Default, PartialEq)]
6110#[non_exhaustive]
6111pub struct GcsPrefix {
6112    /// The URI prefix.
6113    pub gcs_uri_prefix: std::string::String,
6114
6115    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6116}
6117
6118impl GcsPrefix {
6119    pub fn new() -> Self {
6120        std::default::Default::default()
6121    }
6122
6123    /// Sets the value of [gcs_uri_prefix][crate::model::GcsPrefix::gcs_uri_prefix].
6124    pub fn set_gcs_uri_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6125        self.gcs_uri_prefix = v.into();
6126        self
6127    }
6128}
6129
6130impl wkt::message::Message for GcsPrefix {
6131    fn typename() -> &'static str {
6132        "type.googleapis.com/google.cloud.documentai.v1.GcsPrefix"
6133    }
6134}
6135
6136/// The common config to specify a set of documents used as input.
6137#[derive(Clone, Default, PartialEq)]
6138#[non_exhaustive]
6139pub struct BatchDocumentsInputConfig {
6140    /// The source. Make sure that the caller of the API has storage.objects.get
6141    /// access to the buckets.
6142    pub source: std::option::Option<crate::model::batch_documents_input_config::Source>,
6143
6144    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6145}
6146
6147impl BatchDocumentsInputConfig {
6148    pub fn new() -> Self {
6149        std::default::Default::default()
6150    }
6151
6152    /// Sets the value of [source][crate::model::BatchDocumentsInputConfig::source].
6153    ///
6154    /// Note that all the setters affecting `source` are mutually
6155    /// exclusive.
6156    pub fn set_source<
6157        T: std::convert::Into<std::option::Option<crate::model::batch_documents_input_config::Source>>,
6158    >(
6159        mut self,
6160        v: T,
6161    ) -> Self {
6162        self.source = v.into();
6163        self
6164    }
6165
6166    /// The value of [source][crate::model::BatchDocumentsInputConfig::source]
6167    /// if it holds a `GcsPrefix`, `None` if the field is not set or
6168    /// holds a different branch.
6169    pub fn gcs_prefix(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsPrefix>> {
6170        #[allow(unreachable_patterns)]
6171        self.source.as_ref().and_then(|v| match v {
6172            crate::model::batch_documents_input_config::Source::GcsPrefix(v) => {
6173                std::option::Option::Some(v)
6174            }
6175            _ => std::option::Option::None,
6176        })
6177    }
6178
6179    /// Sets the value of [source][crate::model::BatchDocumentsInputConfig::source]
6180    /// to hold a `GcsPrefix`.
6181    ///
6182    /// Note that all the setters affecting `source` are
6183    /// mutually exclusive.
6184    pub fn set_gcs_prefix<T: std::convert::Into<std::boxed::Box<crate::model::GcsPrefix>>>(
6185        mut self,
6186        v: T,
6187    ) -> Self {
6188        self.source = std::option::Option::Some(
6189            crate::model::batch_documents_input_config::Source::GcsPrefix(v.into()),
6190        );
6191        self
6192    }
6193
6194    /// The value of [source][crate::model::BatchDocumentsInputConfig::source]
6195    /// if it holds a `GcsDocuments`, `None` if the field is not set or
6196    /// holds a different branch.
6197    pub fn gcs_documents(
6198        &self,
6199    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDocuments>> {
6200        #[allow(unreachable_patterns)]
6201        self.source.as_ref().and_then(|v| match v {
6202            crate::model::batch_documents_input_config::Source::GcsDocuments(v) => {
6203                std::option::Option::Some(v)
6204            }
6205            _ => std::option::Option::None,
6206        })
6207    }
6208
6209    /// Sets the value of [source][crate::model::BatchDocumentsInputConfig::source]
6210    /// to hold a `GcsDocuments`.
6211    ///
6212    /// Note that all the setters affecting `source` are
6213    /// mutually exclusive.
6214    pub fn set_gcs_documents<T: std::convert::Into<std::boxed::Box<crate::model::GcsDocuments>>>(
6215        mut self,
6216        v: T,
6217    ) -> Self {
6218        self.source = std::option::Option::Some(
6219            crate::model::batch_documents_input_config::Source::GcsDocuments(v.into()),
6220        );
6221        self
6222    }
6223}
6224
6225impl wkt::message::Message for BatchDocumentsInputConfig {
6226    fn typename() -> &'static str {
6227        "type.googleapis.com/google.cloud.documentai.v1.BatchDocumentsInputConfig"
6228    }
6229}
6230
6231/// Defines additional types related to [BatchDocumentsInputConfig].
6232pub mod batch_documents_input_config {
6233    #[allow(unused_imports)]
6234    use super::*;
6235
6236    /// The source. Make sure that the caller of the API has storage.objects.get
6237    /// access to the buckets.
6238    #[derive(Clone, Debug, PartialEq)]
6239    #[non_exhaustive]
6240    pub enum Source {
6241        /// The set of documents that match the specified Cloud Storage `gcs_prefix`.
6242        GcsPrefix(std::boxed::Box<crate::model::GcsPrefix>),
6243        /// The set of documents individually specified on Cloud Storage.
6244        GcsDocuments(std::boxed::Box<crate::model::GcsDocuments>),
6245    }
6246}
6247
6248/// Config that controls the output of documents. All documents will be written
6249/// as a JSON file.
6250#[derive(Clone, Default, PartialEq)]
6251#[non_exhaustive]
6252pub struct DocumentOutputConfig {
6253    /// The destination of the results.
6254    pub destination: std::option::Option<crate::model::document_output_config::Destination>,
6255
6256    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6257}
6258
6259impl DocumentOutputConfig {
6260    pub fn new() -> Self {
6261        std::default::Default::default()
6262    }
6263
6264    /// Sets the value of [destination][crate::model::DocumentOutputConfig::destination].
6265    ///
6266    /// Note that all the setters affecting `destination` are mutually
6267    /// exclusive.
6268    pub fn set_destination<
6269        T: std::convert::Into<std::option::Option<crate::model::document_output_config::Destination>>,
6270    >(
6271        mut self,
6272        v: T,
6273    ) -> Self {
6274        self.destination = v.into();
6275        self
6276    }
6277
6278    /// The value of [destination][crate::model::DocumentOutputConfig::destination]
6279    /// if it holds a `GcsOutputConfig`, `None` if the field is not set or
6280    /// holds a different branch.
6281    pub fn gcs_output_config(
6282        &self,
6283    ) -> std::option::Option<&std::boxed::Box<crate::model::document_output_config::GcsOutputConfig>>
6284    {
6285        #[allow(unreachable_patterns)]
6286        self.destination.as_ref().and_then(|v| match v {
6287            crate::model::document_output_config::Destination::GcsOutputConfig(v) => {
6288                std::option::Option::Some(v)
6289            }
6290            _ => std::option::Option::None,
6291        })
6292    }
6293
6294    /// Sets the value of [destination][crate::model::DocumentOutputConfig::destination]
6295    /// to hold a `GcsOutputConfig`.
6296    ///
6297    /// Note that all the setters affecting `destination` are
6298    /// mutually exclusive.
6299    pub fn set_gcs_output_config<
6300        T: std::convert::Into<std::boxed::Box<crate::model::document_output_config::GcsOutputConfig>>,
6301    >(
6302        mut self,
6303        v: T,
6304    ) -> Self {
6305        self.destination = std::option::Option::Some(
6306            crate::model::document_output_config::Destination::GcsOutputConfig(v.into()),
6307        );
6308        self
6309    }
6310}
6311
6312impl wkt::message::Message for DocumentOutputConfig {
6313    fn typename() -> &'static str {
6314        "type.googleapis.com/google.cloud.documentai.v1.DocumentOutputConfig"
6315    }
6316}
6317
6318/// Defines additional types related to [DocumentOutputConfig].
6319pub mod document_output_config {
6320    #[allow(unused_imports)]
6321    use super::*;
6322
6323    /// The configuration used when outputting documents.
6324    #[derive(Clone, Default, PartialEq)]
6325    #[non_exhaustive]
6326    pub struct GcsOutputConfig {
6327        /// The Cloud Storage uri (a directory) of the output.
6328        pub gcs_uri: std::string::String,
6329
6330        /// Specifies which fields to include in the output documents.
6331        /// Only supports top level document and pages field so it must be in the
6332        /// form of `{document_field_name}` or `pages.{page_field_name}`.
6333        pub field_mask: std::option::Option<wkt::FieldMask>,
6334
6335        /// Specifies the sharding config for the output document.
6336        pub sharding_config: std::option::Option<
6337            crate::model::document_output_config::gcs_output_config::ShardingConfig,
6338        >,
6339
6340        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6341    }
6342
6343    impl GcsOutputConfig {
6344        pub fn new() -> Self {
6345            std::default::Default::default()
6346        }
6347
6348        /// Sets the value of [gcs_uri][crate::model::document_output_config::GcsOutputConfig::gcs_uri].
6349        pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6350            self.gcs_uri = v.into();
6351            self
6352        }
6353
6354        /// Sets the value of [field_mask][crate::model::document_output_config::GcsOutputConfig::field_mask].
6355        pub fn set_field_mask<T>(mut self, v: T) -> Self
6356        where
6357            T: std::convert::Into<wkt::FieldMask>,
6358        {
6359            self.field_mask = std::option::Option::Some(v.into());
6360            self
6361        }
6362
6363        /// Sets or clears the value of [field_mask][crate::model::document_output_config::GcsOutputConfig::field_mask].
6364        pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
6365        where
6366            T: std::convert::Into<wkt::FieldMask>,
6367        {
6368            self.field_mask = v.map(|x| x.into());
6369            self
6370        }
6371
6372        /// Sets the value of [sharding_config][crate::model::document_output_config::GcsOutputConfig::sharding_config].
6373        pub fn set_sharding_config<T>(mut self, v: T) -> Self
6374        where
6375            T: std::convert::Into<
6376                    crate::model::document_output_config::gcs_output_config::ShardingConfig,
6377                >,
6378        {
6379            self.sharding_config = std::option::Option::Some(v.into());
6380            self
6381        }
6382
6383        /// Sets or clears the value of [sharding_config][crate::model::document_output_config::GcsOutputConfig::sharding_config].
6384        pub fn set_or_clear_sharding_config<T>(mut self, v: std::option::Option<T>) -> Self
6385        where
6386            T: std::convert::Into<
6387                    crate::model::document_output_config::gcs_output_config::ShardingConfig,
6388                >,
6389        {
6390            self.sharding_config = v.map(|x| x.into());
6391            self
6392        }
6393    }
6394
6395    impl wkt::message::Message for GcsOutputConfig {
6396        fn typename() -> &'static str {
6397            "type.googleapis.com/google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig"
6398        }
6399    }
6400
6401    /// Defines additional types related to [GcsOutputConfig].
6402    pub mod gcs_output_config {
6403        #[allow(unused_imports)]
6404        use super::*;
6405
6406        /// The sharding config for the output document.
6407        #[derive(Clone, Default, PartialEq)]
6408        #[non_exhaustive]
6409        pub struct ShardingConfig {
6410            /// The number of pages per shard.
6411            pub pages_per_shard: i32,
6412
6413            /// The number of overlapping pages between consecutive shards.
6414            pub pages_overlap: i32,
6415
6416            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6417        }
6418
6419        impl ShardingConfig {
6420            pub fn new() -> Self {
6421                std::default::Default::default()
6422            }
6423
6424            /// Sets the value of [pages_per_shard][crate::model::document_output_config::gcs_output_config::ShardingConfig::pages_per_shard].
6425            pub fn set_pages_per_shard<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6426                self.pages_per_shard = v.into();
6427                self
6428            }
6429
6430            /// Sets the value of [pages_overlap][crate::model::document_output_config::gcs_output_config::ShardingConfig::pages_overlap].
6431            pub fn set_pages_overlap<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6432                self.pages_overlap = v.into();
6433                self
6434            }
6435        }
6436
6437        impl wkt::message::Message for ShardingConfig {
6438            fn typename() -> &'static str {
6439                "type.googleapis.com/google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig"
6440            }
6441        }
6442    }
6443
6444    /// The destination of the results.
6445    #[derive(Clone, Debug, PartialEq)]
6446    #[non_exhaustive]
6447    pub enum Destination {
6448        /// Output config to write the results to Cloud Storage.
6449        GcsOutputConfig(std::boxed::Box<crate::model::document_output_config::GcsOutputConfig>),
6450    }
6451}
6452
6453/// Config for Document OCR.
6454#[derive(Clone, Default, PartialEq)]
6455#[non_exhaustive]
6456pub struct OcrConfig {
6457    /// Hints for the OCR model.
6458    pub hints: std::option::Option<crate::model::ocr_config::Hints>,
6459
6460    /// Enables special handling for PDFs with existing text information. Results
6461    /// in better text extraction quality in such PDF inputs.
6462    pub enable_native_pdf_parsing: bool,
6463
6464    /// Enables intelligent document quality scores after OCR. Can help with
6465    /// diagnosing why OCR responses are of poor quality for a given input.
6466    /// Adds additional latency comparable to regular OCR to the process call.
6467    pub enable_image_quality_scores: bool,
6468
6469    /// A list of advanced OCR options to further fine-tune OCR behavior. Current
6470    /// valid values are:
6471    ///
6472    /// - `legacy_layout`: a heuristics layout detection algorithm, which serves as
6473    ///   an alternative to the current ML-based layout detection algorithm.
6474    ///   Customers can choose the best suitable layout algorithm based on their
6475    ///   situation.
6476    pub advanced_ocr_options: std::vec::Vec<std::string::String>,
6477
6478    /// Includes symbol level OCR information if set to true.
6479    pub enable_symbol: bool,
6480
6481    /// Turn on font identification model and return font style information.
6482    /// Deprecated, use
6483    /// [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info]
6484    /// instead.
6485    ///
6486    /// [google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info]: crate::model::ocr_config::PremiumFeatures::compute_style_info
6487    #[deprecated]
6488    pub compute_style_info: bool,
6489
6490    /// Turn off character box detector in OCR engine. Character box detection is
6491    /// enabled by default in OCR 2.0 (and later) processors.
6492    pub disable_character_boxes_detection: bool,
6493
6494    /// Configurations for premium OCR features.
6495    pub premium_features: std::option::Option<crate::model::ocr_config::PremiumFeatures>,
6496
6497    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6498}
6499
6500impl OcrConfig {
6501    pub fn new() -> Self {
6502        std::default::Default::default()
6503    }
6504
6505    /// Sets the value of [hints][crate::model::OcrConfig::hints].
6506    pub fn set_hints<T>(mut self, v: T) -> Self
6507    where
6508        T: std::convert::Into<crate::model::ocr_config::Hints>,
6509    {
6510        self.hints = std::option::Option::Some(v.into());
6511        self
6512    }
6513
6514    /// Sets or clears the value of [hints][crate::model::OcrConfig::hints].
6515    pub fn set_or_clear_hints<T>(mut self, v: std::option::Option<T>) -> Self
6516    where
6517        T: std::convert::Into<crate::model::ocr_config::Hints>,
6518    {
6519        self.hints = v.map(|x| x.into());
6520        self
6521    }
6522
6523    /// Sets the value of [enable_native_pdf_parsing][crate::model::OcrConfig::enable_native_pdf_parsing].
6524    pub fn set_enable_native_pdf_parsing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6525        self.enable_native_pdf_parsing = v.into();
6526        self
6527    }
6528
6529    /// Sets the value of [enable_image_quality_scores][crate::model::OcrConfig::enable_image_quality_scores].
6530    pub fn set_enable_image_quality_scores<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6531        self.enable_image_quality_scores = v.into();
6532        self
6533    }
6534
6535    /// Sets the value of [advanced_ocr_options][crate::model::OcrConfig::advanced_ocr_options].
6536    pub fn set_advanced_ocr_options<T, V>(mut self, v: T) -> Self
6537    where
6538        T: std::iter::IntoIterator<Item = V>,
6539        V: std::convert::Into<std::string::String>,
6540    {
6541        use std::iter::Iterator;
6542        self.advanced_ocr_options = v.into_iter().map(|i| i.into()).collect();
6543        self
6544    }
6545
6546    /// Sets the value of [enable_symbol][crate::model::OcrConfig::enable_symbol].
6547    pub fn set_enable_symbol<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6548        self.enable_symbol = v.into();
6549        self
6550    }
6551
6552    /// Sets the value of [compute_style_info][crate::model::OcrConfig::compute_style_info].
6553    #[deprecated]
6554    pub fn set_compute_style_info<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6555        self.compute_style_info = v.into();
6556        self
6557    }
6558
6559    /// Sets the value of [disable_character_boxes_detection][crate::model::OcrConfig::disable_character_boxes_detection].
6560    pub fn set_disable_character_boxes_detection<T: std::convert::Into<bool>>(
6561        mut self,
6562        v: T,
6563    ) -> Self {
6564        self.disable_character_boxes_detection = v.into();
6565        self
6566    }
6567
6568    /// Sets the value of [premium_features][crate::model::OcrConfig::premium_features].
6569    pub fn set_premium_features<T>(mut self, v: T) -> Self
6570    where
6571        T: std::convert::Into<crate::model::ocr_config::PremiumFeatures>,
6572    {
6573        self.premium_features = std::option::Option::Some(v.into());
6574        self
6575    }
6576
6577    /// Sets or clears the value of [premium_features][crate::model::OcrConfig::premium_features].
6578    pub fn set_or_clear_premium_features<T>(mut self, v: std::option::Option<T>) -> Self
6579    where
6580        T: std::convert::Into<crate::model::ocr_config::PremiumFeatures>,
6581    {
6582        self.premium_features = v.map(|x| x.into());
6583        self
6584    }
6585}
6586
6587impl wkt::message::Message for OcrConfig {
6588    fn typename() -> &'static str {
6589        "type.googleapis.com/google.cloud.documentai.v1.OcrConfig"
6590    }
6591}
6592
6593/// Defines additional types related to [OcrConfig].
6594pub mod ocr_config {
6595    #[allow(unused_imports)]
6596    use super::*;
6597
6598    /// Hints for OCR Engine
6599    #[derive(Clone, Default, PartialEq)]
6600    #[non_exhaustive]
6601    pub struct Hints {
6602        /// List of BCP-47 language codes to use for OCR. In most cases, not
6603        /// specifying it yields the best results since it enables automatic language
6604        /// detection. For languages based on the Latin alphabet, setting hints is
6605        /// not needed. In rare cases, when the language of the text in the
6606        /// image is known, setting a hint will help get better results (although it
6607        /// will be a significant hindrance if the hint is wrong).
6608        pub language_hints: std::vec::Vec<std::string::String>,
6609
6610        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6611    }
6612
6613    impl Hints {
6614        pub fn new() -> Self {
6615            std::default::Default::default()
6616        }
6617
6618        /// Sets the value of [language_hints][crate::model::ocr_config::Hints::language_hints].
6619        pub fn set_language_hints<T, V>(mut self, v: T) -> Self
6620        where
6621            T: std::iter::IntoIterator<Item = V>,
6622            V: std::convert::Into<std::string::String>,
6623        {
6624            use std::iter::Iterator;
6625            self.language_hints = v.into_iter().map(|i| i.into()).collect();
6626            self
6627        }
6628    }
6629
6630    impl wkt::message::Message for Hints {
6631        fn typename() -> &'static str {
6632            "type.googleapis.com/google.cloud.documentai.v1.OcrConfig.Hints"
6633        }
6634    }
6635
6636    /// Configurations for premium OCR features.
6637    #[derive(Clone, Default, PartialEq)]
6638    #[non_exhaustive]
6639    pub struct PremiumFeatures {
6640        /// Turn on selection mark detector in OCR engine. Only available in OCR 2.0
6641        /// (and later) processors.
6642        pub enable_selection_mark_detection: bool,
6643
6644        /// Turn on font identification model and return font style information.
6645        pub compute_style_info: bool,
6646
6647        /// Turn on the model that can extract LaTeX math formulas.
6648        pub enable_math_ocr: bool,
6649
6650        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6651    }
6652
6653    impl PremiumFeatures {
6654        pub fn new() -> Self {
6655            std::default::Default::default()
6656        }
6657
6658        /// Sets the value of [enable_selection_mark_detection][crate::model::ocr_config::PremiumFeatures::enable_selection_mark_detection].
6659        pub fn set_enable_selection_mark_detection<T: std::convert::Into<bool>>(
6660            mut self,
6661            v: T,
6662        ) -> Self {
6663            self.enable_selection_mark_detection = v.into();
6664            self
6665        }
6666
6667        /// Sets the value of [compute_style_info][crate::model::ocr_config::PremiumFeatures::compute_style_info].
6668        pub fn set_compute_style_info<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6669            self.compute_style_info = v.into();
6670            self
6671        }
6672
6673        /// Sets the value of [enable_math_ocr][crate::model::ocr_config::PremiumFeatures::enable_math_ocr].
6674        pub fn set_enable_math_ocr<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6675            self.enable_math_ocr = v.into();
6676            self
6677        }
6678    }
6679
6680    impl wkt::message::Message for PremiumFeatures {
6681        fn typename() -> &'static str {
6682            "type.googleapis.com/google.cloud.documentai.v1.OcrConfig.PremiumFeatures"
6683        }
6684    }
6685}
6686
6687/// Options for Process API
6688#[derive(Clone, Default, PartialEq)]
6689#[non_exhaustive]
6690pub struct ProcessOptions {
6691    /// Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`.
6692    /// Returns error if set on other processor types.
6693    pub ocr_config: std::option::Option<crate::model::OcrConfig>,
6694
6695    /// Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`.
6696    /// Returns error if set on other processor types.
6697    pub layout_config: std::option::Option<crate::model::process_options::LayoutConfig>,
6698
6699    /// Optional. Override the schema of the
6700    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will
6701    /// return an Invalid Argument error if this field is set when the underlying
6702    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't
6703    /// support schema override.
6704    ///
6705    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
6706    pub schema_override: std::option::Option<crate::model::DocumentSchema>,
6707
6708    /// A subset of pages to process. If not specified, all pages are processed.
6709    /// If a page range is set, only the given pages are extracted and processed
6710    /// from the document. In the output document,
6711    /// [Document.Page.page_number][google.cloud.documentai.v1.Document.Page.page_number]
6712    /// refers to the page number in the original document.
6713    /// This configuration only applies to online processing with
6714    /// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument].
6715    ///
6716    /// [google.cloud.documentai.v1.Document.Page.page_number]: crate::model::document::Page::page_number
6717    /// [google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]: crate::client::DocumentProcessorService::process_document
6718    pub page_range: std::option::Option<crate::model::process_options::PageRange>,
6719
6720    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6721}
6722
6723impl ProcessOptions {
6724    pub fn new() -> Self {
6725        std::default::Default::default()
6726    }
6727
6728    /// Sets the value of [ocr_config][crate::model::ProcessOptions::ocr_config].
6729    pub fn set_ocr_config<T>(mut self, v: T) -> Self
6730    where
6731        T: std::convert::Into<crate::model::OcrConfig>,
6732    {
6733        self.ocr_config = std::option::Option::Some(v.into());
6734        self
6735    }
6736
6737    /// Sets or clears the value of [ocr_config][crate::model::ProcessOptions::ocr_config].
6738    pub fn set_or_clear_ocr_config<T>(mut self, v: std::option::Option<T>) -> Self
6739    where
6740        T: std::convert::Into<crate::model::OcrConfig>,
6741    {
6742        self.ocr_config = v.map(|x| x.into());
6743        self
6744    }
6745
6746    /// Sets the value of [layout_config][crate::model::ProcessOptions::layout_config].
6747    pub fn set_layout_config<T>(mut self, v: T) -> Self
6748    where
6749        T: std::convert::Into<crate::model::process_options::LayoutConfig>,
6750    {
6751        self.layout_config = std::option::Option::Some(v.into());
6752        self
6753    }
6754
6755    /// Sets or clears the value of [layout_config][crate::model::ProcessOptions::layout_config].
6756    pub fn set_or_clear_layout_config<T>(mut self, v: std::option::Option<T>) -> Self
6757    where
6758        T: std::convert::Into<crate::model::process_options::LayoutConfig>,
6759    {
6760        self.layout_config = v.map(|x| x.into());
6761        self
6762    }
6763
6764    /// Sets the value of [schema_override][crate::model::ProcessOptions::schema_override].
6765    pub fn set_schema_override<T>(mut self, v: T) -> Self
6766    where
6767        T: std::convert::Into<crate::model::DocumentSchema>,
6768    {
6769        self.schema_override = std::option::Option::Some(v.into());
6770        self
6771    }
6772
6773    /// Sets or clears the value of [schema_override][crate::model::ProcessOptions::schema_override].
6774    pub fn set_or_clear_schema_override<T>(mut self, v: std::option::Option<T>) -> Self
6775    where
6776        T: std::convert::Into<crate::model::DocumentSchema>,
6777    {
6778        self.schema_override = v.map(|x| x.into());
6779        self
6780    }
6781
6782    /// Sets the value of [page_range][crate::model::ProcessOptions::page_range].
6783    ///
6784    /// Note that all the setters affecting `page_range` are mutually
6785    /// exclusive.
6786    pub fn set_page_range<
6787        T: std::convert::Into<std::option::Option<crate::model::process_options::PageRange>>,
6788    >(
6789        mut self,
6790        v: T,
6791    ) -> Self {
6792        self.page_range = v.into();
6793        self
6794    }
6795
6796    /// The value of [page_range][crate::model::ProcessOptions::page_range]
6797    /// if it holds a `IndividualPageSelector`, `None` if the field is not set or
6798    /// holds a different branch.
6799    pub fn individual_page_selector(
6800        &self,
6801    ) -> std::option::Option<&std::boxed::Box<crate::model::process_options::IndividualPageSelector>>
6802    {
6803        #[allow(unreachable_patterns)]
6804        self.page_range.as_ref().and_then(|v| match v {
6805            crate::model::process_options::PageRange::IndividualPageSelector(v) => {
6806                std::option::Option::Some(v)
6807            }
6808            _ => std::option::Option::None,
6809        })
6810    }
6811
6812    /// Sets the value of [page_range][crate::model::ProcessOptions::page_range]
6813    /// to hold a `IndividualPageSelector`.
6814    ///
6815    /// Note that all the setters affecting `page_range` are
6816    /// mutually exclusive.
6817    pub fn set_individual_page_selector<
6818        T: std::convert::Into<std::boxed::Box<crate::model::process_options::IndividualPageSelector>>,
6819    >(
6820        mut self,
6821        v: T,
6822    ) -> Self {
6823        self.page_range = std::option::Option::Some(
6824            crate::model::process_options::PageRange::IndividualPageSelector(v.into()),
6825        );
6826        self
6827    }
6828
6829    /// The value of [page_range][crate::model::ProcessOptions::page_range]
6830    /// if it holds a `FromStart`, `None` if the field is not set or
6831    /// holds a different branch.
6832    pub fn from_start(&self) -> std::option::Option<&i32> {
6833        #[allow(unreachable_patterns)]
6834        self.page_range.as_ref().and_then(|v| match v {
6835            crate::model::process_options::PageRange::FromStart(v) => std::option::Option::Some(v),
6836            _ => std::option::Option::None,
6837        })
6838    }
6839
6840    /// Sets the value of [page_range][crate::model::ProcessOptions::page_range]
6841    /// to hold a `FromStart`.
6842    ///
6843    /// Note that all the setters affecting `page_range` are
6844    /// mutually exclusive.
6845    pub fn set_from_start<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6846        self.page_range = std::option::Option::Some(
6847            crate::model::process_options::PageRange::FromStart(v.into()),
6848        );
6849        self
6850    }
6851
6852    /// The value of [page_range][crate::model::ProcessOptions::page_range]
6853    /// if it holds a `FromEnd`, `None` if the field is not set or
6854    /// holds a different branch.
6855    pub fn from_end(&self) -> std::option::Option<&i32> {
6856        #[allow(unreachable_patterns)]
6857        self.page_range.as_ref().and_then(|v| match v {
6858            crate::model::process_options::PageRange::FromEnd(v) => std::option::Option::Some(v),
6859            _ => std::option::Option::None,
6860        })
6861    }
6862
6863    /// Sets the value of [page_range][crate::model::ProcessOptions::page_range]
6864    /// to hold a `FromEnd`.
6865    ///
6866    /// Note that all the setters affecting `page_range` are
6867    /// mutually exclusive.
6868    pub fn set_from_end<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6869        self.page_range =
6870            std::option::Option::Some(crate::model::process_options::PageRange::FromEnd(v.into()));
6871        self
6872    }
6873}
6874
6875impl wkt::message::Message for ProcessOptions {
6876    fn typename() -> &'static str {
6877        "type.googleapis.com/google.cloud.documentai.v1.ProcessOptions"
6878    }
6879}
6880
6881/// Defines additional types related to [ProcessOptions].
6882pub mod process_options {
6883    #[allow(unused_imports)]
6884    use super::*;
6885
6886    /// Serving config for layout parser processor.
6887    #[derive(Clone, Default, PartialEq)]
6888    #[non_exhaustive]
6889    pub struct LayoutConfig {
6890        /// Optional. Config for chunking in layout parser processor.
6891        pub chunking_config:
6892            std::option::Option<crate::model::process_options::layout_config::ChunkingConfig>,
6893
6894        /// Optional. Whether to include images in layout parser processor response.
6895        pub return_images: bool,
6896
6897        /// Optional. Whether to include bounding boxes in layout parser processor
6898        /// response.
6899        pub return_bounding_boxes: bool,
6900
6901        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6902    }
6903
6904    impl LayoutConfig {
6905        pub fn new() -> Self {
6906            std::default::Default::default()
6907        }
6908
6909        /// Sets the value of [chunking_config][crate::model::process_options::LayoutConfig::chunking_config].
6910        pub fn set_chunking_config<T>(mut self, v: T) -> Self
6911        where
6912            T: std::convert::Into<crate::model::process_options::layout_config::ChunkingConfig>,
6913        {
6914            self.chunking_config = std::option::Option::Some(v.into());
6915            self
6916        }
6917
6918        /// Sets or clears the value of [chunking_config][crate::model::process_options::LayoutConfig::chunking_config].
6919        pub fn set_or_clear_chunking_config<T>(mut self, v: std::option::Option<T>) -> Self
6920        where
6921            T: std::convert::Into<crate::model::process_options::layout_config::ChunkingConfig>,
6922        {
6923            self.chunking_config = v.map(|x| x.into());
6924            self
6925        }
6926
6927        /// Sets the value of [return_images][crate::model::process_options::LayoutConfig::return_images].
6928        pub fn set_return_images<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6929            self.return_images = v.into();
6930            self
6931        }
6932
6933        /// Sets the value of [return_bounding_boxes][crate::model::process_options::LayoutConfig::return_bounding_boxes].
6934        pub fn set_return_bounding_boxes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6935            self.return_bounding_boxes = v.into();
6936            self
6937        }
6938    }
6939
6940    impl wkt::message::Message for LayoutConfig {
6941        fn typename() -> &'static str {
6942            "type.googleapis.com/google.cloud.documentai.v1.ProcessOptions.LayoutConfig"
6943        }
6944    }
6945
6946    /// Defines additional types related to [LayoutConfig].
6947    pub mod layout_config {
6948        #[allow(unused_imports)]
6949        use super::*;
6950
6951        /// Serving config for chunking.
6952        #[derive(Clone, Default, PartialEq)]
6953        #[non_exhaustive]
6954        pub struct ChunkingConfig {
6955            /// Optional. The chunk sizes to use when splitting documents, in order of
6956            /// level.
6957            pub chunk_size: i32,
6958
6959            /// Optional. Whether or not to include ancestor headings when splitting.
6960            pub include_ancestor_headings: bool,
6961
6962            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6963        }
6964
6965        impl ChunkingConfig {
6966            pub fn new() -> Self {
6967                std::default::Default::default()
6968            }
6969
6970            /// Sets the value of [chunk_size][crate::model::process_options::layout_config::ChunkingConfig::chunk_size].
6971            pub fn set_chunk_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6972                self.chunk_size = v.into();
6973                self
6974            }
6975
6976            /// Sets the value of [include_ancestor_headings][crate::model::process_options::layout_config::ChunkingConfig::include_ancestor_headings].
6977            pub fn set_include_ancestor_headings<T: std::convert::Into<bool>>(
6978                mut self,
6979                v: T,
6980            ) -> Self {
6981                self.include_ancestor_headings = v.into();
6982                self
6983            }
6984        }
6985
6986        impl wkt::message::Message for ChunkingConfig {
6987            fn typename() -> &'static str {
6988                "type.googleapis.com/google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig"
6989            }
6990        }
6991    }
6992
6993    /// A list of individual page numbers.
6994    #[derive(Clone, Default, PartialEq)]
6995    #[non_exhaustive]
6996    pub struct IndividualPageSelector {
6997        /// Optional. Indices of the pages (starting from 1).
6998        pub pages: std::vec::Vec<i32>,
6999
7000        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7001    }
7002
7003    impl IndividualPageSelector {
7004        pub fn new() -> Self {
7005            std::default::Default::default()
7006        }
7007
7008        /// Sets the value of [pages][crate::model::process_options::IndividualPageSelector::pages].
7009        pub fn set_pages<T, V>(mut self, v: T) -> Self
7010        where
7011            T: std::iter::IntoIterator<Item = V>,
7012            V: std::convert::Into<i32>,
7013        {
7014            use std::iter::Iterator;
7015            self.pages = v.into_iter().map(|i| i.into()).collect();
7016            self
7017        }
7018    }
7019
7020    impl wkt::message::Message for IndividualPageSelector {
7021        fn typename() -> &'static str {
7022            "type.googleapis.com/google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector"
7023        }
7024    }
7025
7026    /// A subset of pages to process. If not specified, all pages are processed.
7027    /// If a page range is set, only the given pages are extracted and processed
7028    /// from the document. In the output document,
7029    /// [Document.Page.page_number][google.cloud.documentai.v1.Document.Page.page_number]
7030    /// refers to the page number in the original document.
7031    /// This configuration only applies to online processing with
7032    /// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument].
7033    ///
7034    /// [google.cloud.documentai.v1.Document.Page.page_number]: crate::model::document::Page::page_number
7035    /// [google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]: crate::client::DocumentProcessorService::process_document
7036    #[derive(Clone, Debug, PartialEq)]
7037    #[non_exhaustive]
7038    pub enum PageRange {
7039        /// Which pages to process (1-indexed).
7040        IndividualPageSelector(
7041            std::boxed::Box<crate::model::process_options::IndividualPageSelector>,
7042        ),
7043        /// Only process certain pages from the start. Process all if the document
7044        /// has fewer pages.
7045        FromStart(i32),
7046        /// Only process certain pages from the end, same as above.
7047        FromEnd(i32),
7048    }
7049}
7050
7051/// Request message for the
7052/// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]
7053/// method.
7054///
7055/// [google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]: crate::client::DocumentProcessorService::process_document
7056#[derive(Clone, Default, PartialEq)]
7057#[non_exhaustive]
7058pub struct ProcessRequest {
7059    /// Required. The resource name of the
7060    /// [Processor][google.cloud.documentai.v1.Processor] or
7061    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
7062    /// to use for processing. If a
7063    /// [Processor][google.cloud.documentai.v1.Processor] is specified, the server
7064    /// will use its [default
7065    /// version][google.cloud.documentai.v1.Processor.default_processor_version].
7066    /// Format: `projects/{project}/locations/{location}/processors/{processor}`,
7067    /// or
7068    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
7069    ///
7070    /// [google.cloud.documentai.v1.Processor]: crate::model::Processor
7071    /// [google.cloud.documentai.v1.Processor.default_processor_version]: crate::model::Processor::default_processor_version
7072    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
7073    pub name: std::string::String,
7074
7075    /// Whether human review should be skipped for this request. Default to
7076    /// `false`.
7077    pub skip_human_review: bool,
7078
7079    /// Specifies which fields to include in the
7080    /// [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document]
7081    /// output. Only supports top-level document and pages field, so it must be in
7082    /// the form of `{document_field_name}` or `pages.{page_field_name}`.
7083    ///
7084    /// [google.cloud.documentai.v1.ProcessResponse.document]: crate::model::ProcessResponse::document
7085    pub field_mask: std::option::Option<wkt::FieldMask>,
7086
7087    /// Inference-time options for the process API
7088    pub process_options: std::option::Option<crate::model::ProcessOptions>,
7089
7090    /// Optional. The labels with user-defined metadata for the request.
7091    ///
7092    /// Label keys and values can be no longer than 63 characters
7093    /// (Unicode codepoints) and can only contain lowercase letters, numeric
7094    /// characters, underscores, and dashes. International characters are allowed.
7095    /// Label values are optional. Label keys must start with a letter.
7096    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7097
7098    /// Optional. Option to remove images from the document.
7099    pub imageless_mode: bool,
7100
7101    /// The document payload.
7102    pub source: std::option::Option<crate::model::process_request::Source>,
7103
7104    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7105}
7106
7107impl ProcessRequest {
7108    pub fn new() -> Self {
7109        std::default::Default::default()
7110    }
7111
7112    /// Sets the value of [name][crate::model::ProcessRequest::name].
7113    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7114        self.name = v.into();
7115        self
7116    }
7117
7118    /// Sets the value of [skip_human_review][crate::model::ProcessRequest::skip_human_review].
7119    pub fn set_skip_human_review<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7120        self.skip_human_review = v.into();
7121        self
7122    }
7123
7124    /// Sets the value of [field_mask][crate::model::ProcessRequest::field_mask].
7125    pub fn set_field_mask<T>(mut self, v: T) -> Self
7126    where
7127        T: std::convert::Into<wkt::FieldMask>,
7128    {
7129        self.field_mask = std::option::Option::Some(v.into());
7130        self
7131    }
7132
7133    /// Sets or clears the value of [field_mask][crate::model::ProcessRequest::field_mask].
7134    pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
7135    where
7136        T: std::convert::Into<wkt::FieldMask>,
7137    {
7138        self.field_mask = v.map(|x| x.into());
7139        self
7140    }
7141
7142    /// Sets the value of [process_options][crate::model::ProcessRequest::process_options].
7143    pub fn set_process_options<T>(mut self, v: T) -> Self
7144    where
7145        T: std::convert::Into<crate::model::ProcessOptions>,
7146    {
7147        self.process_options = std::option::Option::Some(v.into());
7148        self
7149    }
7150
7151    /// Sets or clears the value of [process_options][crate::model::ProcessRequest::process_options].
7152    pub fn set_or_clear_process_options<T>(mut self, v: std::option::Option<T>) -> Self
7153    where
7154        T: std::convert::Into<crate::model::ProcessOptions>,
7155    {
7156        self.process_options = v.map(|x| x.into());
7157        self
7158    }
7159
7160    /// Sets the value of [labels][crate::model::ProcessRequest::labels].
7161    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7162    where
7163        T: std::iter::IntoIterator<Item = (K, V)>,
7164        K: std::convert::Into<std::string::String>,
7165        V: std::convert::Into<std::string::String>,
7166    {
7167        use std::iter::Iterator;
7168        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7169        self
7170    }
7171
7172    /// Sets the value of [imageless_mode][crate::model::ProcessRequest::imageless_mode].
7173    pub fn set_imageless_mode<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7174        self.imageless_mode = v.into();
7175        self
7176    }
7177
7178    /// Sets the value of [source][crate::model::ProcessRequest::source].
7179    ///
7180    /// Note that all the setters affecting `source` are mutually
7181    /// exclusive.
7182    pub fn set_source<
7183        T: std::convert::Into<std::option::Option<crate::model::process_request::Source>>,
7184    >(
7185        mut self,
7186        v: T,
7187    ) -> Self {
7188        self.source = v.into();
7189        self
7190    }
7191
7192    /// The value of [source][crate::model::ProcessRequest::source]
7193    /// if it holds a `InlineDocument`, `None` if the field is not set or
7194    /// holds a different branch.
7195    pub fn inline_document(&self) -> std::option::Option<&std::boxed::Box<crate::model::Document>> {
7196        #[allow(unreachable_patterns)]
7197        self.source.as_ref().and_then(|v| match v {
7198            crate::model::process_request::Source::InlineDocument(v) => {
7199                std::option::Option::Some(v)
7200            }
7201            _ => std::option::Option::None,
7202        })
7203    }
7204
7205    /// Sets the value of [source][crate::model::ProcessRequest::source]
7206    /// to hold a `InlineDocument`.
7207    ///
7208    /// Note that all the setters affecting `source` are
7209    /// mutually exclusive.
7210    pub fn set_inline_document<T: std::convert::Into<std::boxed::Box<crate::model::Document>>>(
7211        mut self,
7212        v: T,
7213    ) -> Self {
7214        self.source = std::option::Option::Some(
7215            crate::model::process_request::Source::InlineDocument(v.into()),
7216        );
7217        self
7218    }
7219
7220    /// The value of [source][crate::model::ProcessRequest::source]
7221    /// if it holds a `RawDocument`, `None` if the field is not set or
7222    /// holds a different branch.
7223    pub fn raw_document(&self) -> std::option::Option<&std::boxed::Box<crate::model::RawDocument>> {
7224        #[allow(unreachable_patterns)]
7225        self.source.as_ref().and_then(|v| match v {
7226            crate::model::process_request::Source::RawDocument(v) => std::option::Option::Some(v),
7227            _ => std::option::Option::None,
7228        })
7229    }
7230
7231    /// Sets the value of [source][crate::model::ProcessRequest::source]
7232    /// to hold a `RawDocument`.
7233    ///
7234    /// Note that all the setters affecting `source` are
7235    /// mutually exclusive.
7236    pub fn set_raw_document<T: std::convert::Into<std::boxed::Box<crate::model::RawDocument>>>(
7237        mut self,
7238        v: T,
7239    ) -> Self {
7240        self.source =
7241            std::option::Option::Some(crate::model::process_request::Source::RawDocument(v.into()));
7242        self
7243    }
7244
7245    /// The value of [source][crate::model::ProcessRequest::source]
7246    /// if it holds a `GcsDocument`, `None` if the field is not set or
7247    /// holds a different branch.
7248    pub fn gcs_document(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsDocument>> {
7249        #[allow(unreachable_patterns)]
7250        self.source.as_ref().and_then(|v| match v {
7251            crate::model::process_request::Source::GcsDocument(v) => std::option::Option::Some(v),
7252            _ => std::option::Option::None,
7253        })
7254    }
7255
7256    /// Sets the value of [source][crate::model::ProcessRequest::source]
7257    /// to hold a `GcsDocument`.
7258    ///
7259    /// Note that all the setters affecting `source` are
7260    /// mutually exclusive.
7261    pub fn set_gcs_document<T: std::convert::Into<std::boxed::Box<crate::model::GcsDocument>>>(
7262        mut self,
7263        v: T,
7264    ) -> Self {
7265        self.source =
7266            std::option::Option::Some(crate::model::process_request::Source::GcsDocument(v.into()));
7267        self
7268    }
7269}
7270
7271impl wkt::message::Message for ProcessRequest {
7272    fn typename() -> &'static str {
7273        "type.googleapis.com/google.cloud.documentai.v1.ProcessRequest"
7274    }
7275}
7276
7277/// Defines additional types related to [ProcessRequest].
7278pub mod process_request {
7279    #[allow(unused_imports)]
7280    use super::*;
7281
7282    /// The document payload.
7283    #[derive(Clone, Debug, PartialEq)]
7284    #[non_exhaustive]
7285    pub enum Source {
7286        /// An inline document proto.
7287        InlineDocument(std::boxed::Box<crate::model::Document>),
7288        /// A raw document content (bytes).
7289        RawDocument(std::boxed::Box<crate::model::RawDocument>),
7290        /// A raw document on Google Cloud Storage.
7291        GcsDocument(std::boxed::Box<crate::model::GcsDocument>),
7292    }
7293}
7294
7295/// The status of human review on a processed document.
7296#[derive(Clone, Default, PartialEq)]
7297#[non_exhaustive]
7298pub struct HumanReviewStatus {
7299    /// The state of human review on the processing request.
7300    pub state: crate::model::human_review_status::State,
7301
7302    /// A message providing more details about the human review state.
7303    pub state_message: std::string::String,
7304
7305    /// The name of the operation triggered by the processed document. This field
7306    /// is populated only when the
7307    /// [state][google.cloud.documentai.v1.HumanReviewStatus.state] is
7308    /// `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as
7309    /// the long-running operation returned by
7310    /// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument].
7311    ///
7312    /// [google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]: crate::client::DocumentProcessorService::review_document
7313    /// [google.cloud.documentai.v1.HumanReviewStatus.state]: crate::model::HumanReviewStatus::state
7314    pub human_review_operation: std::string::String,
7315
7316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7317}
7318
7319impl HumanReviewStatus {
7320    pub fn new() -> Self {
7321        std::default::Default::default()
7322    }
7323
7324    /// Sets the value of [state][crate::model::HumanReviewStatus::state].
7325    pub fn set_state<T: std::convert::Into<crate::model::human_review_status::State>>(
7326        mut self,
7327        v: T,
7328    ) -> Self {
7329        self.state = v.into();
7330        self
7331    }
7332
7333    /// Sets the value of [state_message][crate::model::HumanReviewStatus::state_message].
7334    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7335        self.state_message = v.into();
7336        self
7337    }
7338
7339    /// Sets the value of [human_review_operation][crate::model::HumanReviewStatus::human_review_operation].
7340    pub fn set_human_review_operation<T: std::convert::Into<std::string::String>>(
7341        mut self,
7342        v: T,
7343    ) -> Self {
7344        self.human_review_operation = v.into();
7345        self
7346    }
7347}
7348
7349impl wkt::message::Message for HumanReviewStatus {
7350    fn typename() -> &'static str {
7351        "type.googleapis.com/google.cloud.documentai.v1.HumanReviewStatus"
7352    }
7353}
7354
7355/// Defines additional types related to [HumanReviewStatus].
7356pub mod human_review_status {
7357    #[allow(unused_imports)]
7358    use super::*;
7359
7360    /// The final state of human review on a processed document.
7361    ///
7362    /// # Working with unknown values
7363    ///
7364    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7365    /// additional enum variants at any time. Adding new variants is not considered
7366    /// a breaking change. Applications should write their code in anticipation of:
7367    ///
7368    /// - New values appearing in future releases of the client library, **and**
7369    /// - New values received dynamically, without application changes.
7370    ///
7371    /// Please consult the [Working with enums] section in the user guide for some
7372    /// guidelines.
7373    ///
7374    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7375    #[derive(Clone, Debug, PartialEq)]
7376    #[non_exhaustive]
7377    pub enum State {
7378        /// Human review state is unspecified. Most likely due to an internal error.
7379        Unspecified,
7380        /// Human review is skipped for the document. This can happen because human
7381        /// review isn't enabled on the processor or the processing request has
7382        /// been set to skip this document.
7383        Skipped,
7384        /// Human review validation is triggered and passed, so no review is needed.
7385        ValidationPassed,
7386        /// Human review validation is triggered and the document is under review.
7387        InProgress,
7388        /// Some error happened during triggering human review, see the
7389        /// [state_message][google.cloud.documentai.v1.HumanReviewStatus.state_message]
7390        /// for details.
7391        ///
7392        /// [google.cloud.documentai.v1.HumanReviewStatus.state_message]: crate::model::HumanReviewStatus::state_message
7393        Error,
7394        /// If set, the enum was initialized with an unknown value.
7395        ///
7396        /// Applications can examine the value using [State::value] or
7397        /// [State::name].
7398        UnknownValue(state::UnknownValue),
7399    }
7400
7401    #[doc(hidden)]
7402    pub mod state {
7403        #[allow(unused_imports)]
7404        use super::*;
7405        #[derive(Clone, Debug, PartialEq)]
7406        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7407    }
7408
7409    impl State {
7410        /// Gets the enum value.
7411        ///
7412        /// Returns `None` if the enum contains an unknown value deserialized from
7413        /// the string representation of enums.
7414        pub fn value(&self) -> std::option::Option<i32> {
7415            match self {
7416                Self::Unspecified => std::option::Option::Some(0),
7417                Self::Skipped => std::option::Option::Some(1),
7418                Self::ValidationPassed => std::option::Option::Some(2),
7419                Self::InProgress => std::option::Option::Some(3),
7420                Self::Error => std::option::Option::Some(4),
7421                Self::UnknownValue(u) => u.0.value(),
7422            }
7423        }
7424
7425        /// Gets the enum value as a string.
7426        ///
7427        /// Returns `None` if the enum contains an unknown value deserialized from
7428        /// the integer representation of enums.
7429        pub fn name(&self) -> std::option::Option<&str> {
7430            match self {
7431                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7432                Self::Skipped => std::option::Option::Some("SKIPPED"),
7433                Self::ValidationPassed => std::option::Option::Some("VALIDATION_PASSED"),
7434                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
7435                Self::Error => std::option::Option::Some("ERROR"),
7436                Self::UnknownValue(u) => u.0.name(),
7437            }
7438        }
7439    }
7440
7441    impl std::default::Default for State {
7442        fn default() -> Self {
7443            use std::convert::From;
7444            Self::from(0)
7445        }
7446    }
7447
7448    impl std::fmt::Display for State {
7449        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7450            wkt::internal::display_enum(f, self.name(), self.value())
7451        }
7452    }
7453
7454    impl std::convert::From<i32> for State {
7455        fn from(value: i32) -> Self {
7456            match value {
7457                0 => Self::Unspecified,
7458                1 => Self::Skipped,
7459                2 => Self::ValidationPassed,
7460                3 => Self::InProgress,
7461                4 => Self::Error,
7462                _ => Self::UnknownValue(state::UnknownValue(
7463                    wkt::internal::UnknownEnumValue::Integer(value),
7464                )),
7465            }
7466        }
7467    }
7468
7469    impl std::convert::From<&str> for State {
7470        fn from(value: &str) -> Self {
7471            use std::string::ToString;
7472            match value {
7473                "STATE_UNSPECIFIED" => Self::Unspecified,
7474                "SKIPPED" => Self::Skipped,
7475                "VALIDATION_PASSED" => Self::ValidationPassed,
7476                "IN_PROGRESS" => Self::InProgress,
7477                "ERROR" => Self::Error,
7478                _ => Self::UnknownValue(state::UnknownValue(
7479                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7480                )),
7481            }
7482        }
7483    }
7484
7485    impl serde::ser::Serialize for State {
7486        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7487        where
7488            S: serde::Serializer,
7489        {
7490            match self {
7491                Self::Unspecified => serializer.serialize_i32(0),
7492                Self::Skipped => serializer.serialize_i32(1),
7493                Self::ValidationPassed => serializer.serialize_i32(2),
7494                Self::InProgress => serializer.serialize_i32(3),
7495                Self::Error => serializer.serialize_i32(4),
7496                Self::UnknownValue(u) => u.0.serialize(serializer),
7497            }
7498        }
7499    }
7500
7501    impl<'de> serde::de::Deserialize<'de> for State {
7502        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7503        where
7504            D: serde::Deserializer<'de>,
7505        {
7506            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7507                ".google.cloud.documentai.v1.HumanReviewStatus.State",
7508            ))
7509        }
7510    }
7511}
7512
7513/// Response message for the
7514/// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]
7515/// method.
7516///
7517/// [google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]: crate::client::DocumentProcessorService::process_document
7518#[derive(Clone, Default, PartialEq)]
7519#[non_exhaustive]
7520pub struct ProcessResponse {
7521    /// The document payload, will populate fields based on the processor's
7522    /// behavior.
7523    pub document: std::option::Option<crate::model::Document>,
7524
7525    /// The status of human review on the processed document.
7526    pub human_review_status: std::option::Option<crate::model::HumanReviewStatus>,
7527
7528    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7529}
7530
7531impl ProcessResponse {
7532    pub fn new() -> Self {
7533        std::default::Default::default()
7534    }
7535
7536    /// Sets the value of [document][crate::model::ProcessResponse::document].
7537    pub fn set_document<T>(mut self, v: T) -> Self
7538    where
7539        T: std::convert::Into<crate::model::Document>,
7540    {
7541        self.document = std::option::Option::Some(v.into());
7542        self
7543    }
7544
7545    /// Sets or clears the value of [document][crate::model::ProcessResponse::document].
7546    pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
7547    where
7548        T: std::convert::Into<crate::model::Document>,
7549    {
7550        self.document = v.map(|x| x.into());
7551        self
7552    }
7553
7554    /// Sets the value of [human_review_status][crate::model::ProcessResponse::human_review_status].
7555    pub fn set_human_review_status<T>(mut self, v: T) -> Self
7556    where
7557        T: std::convert::Into<crate::model::HumanReviewStatus>,
7558    {
7559        self.human_review_status = std::option::Option::Some(v.into());
7560        self
7561    }
7562
7563    /// Sets or clears the value of [human_review_status][crate::model::ProcessResponse::human_review_status].
7564    pub fn set_or_clear_human_review_status<T>(mut self, v: std::option::Option<T>) -> Self
7565    where
7566        T: std::convert::Into<crate::model::HumanReviewStatus>,
7567    {
7568        self.human_review_status = v.map(|x| x.into());
7569        self
7570    }
7571}
7572
7573impl wkt::message::Message for ProcessResponse {
7574    fn typename() -> &'static str {
7575        "type.googleapis.com/google.cloud.documentai.v1.ProcessResponse"
7576    }
7577}
7578
7579/// Request message for
7580/// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
7581///
7582/// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: crate::client::DocumentProcessorService::batch_process_documents
7583#[derive(Clone, Default, PartialEq)]
7584#[non_exhaustive]
7585pub struct BatchProcessRequest {
7586    /// Required. The resource name of
7587    /// [Processor][google.cloud.documentai.v1.Processor] or
7588    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
7589    /// Format: `projects/{project}/locations/{location}/processors/{processor}`,
7590    /// or
7591    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
7592    ///
7593    /// [google.cloud.documentai.v1.Processor]: crate::model::Processor
7594    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
7595    pub name: std::string::String,
7596
7597    /// The input documents for the
7598    /// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
7599    /// method.
7600    ///
7601    /// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: crate::client::DocumentProcessorService::batch_process_documents
7602    pub input_documents: std::option::Option<crate::model::BatchDocumentsInputConfig>,
7603
7604    /// The output configuration for the
7605    /// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
7606    /// method.
7607    ///
7608    /// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: crate::client::DocumentProcessorService::batch_process_documents
7609    pub document_output_config: std::option::Option<crate::model::DocumentOutputConfig>,
7610
7611    /// Whether human review should be skipped for this request. Default to
7612    /// `false`.
7613    pub skip_human_review: bool,
7614
7615    /// Inference-time options for the process API
7616    pub process_options: std::option::Option<crate::model::ProcessOptions>,
7617
7618    /// Optional. The labels with user-defined metadata for the request.
7619    ///
7620    /// Label keys and values can be no longer than 63 characters
7621    /// (Unicode codepoints) and can only contain lowercase letters, numeric
7622    /// characters, underscores, and dashes. International characters are allowed.
7623    /// Label values are optional. Label keys must start with a letter.
7624    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7625
7626    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7627}
7628
7629impl BatchProcessRequest {
7630    pub fn new() -> Self {
7631        std::default::Default::default()
7632    }
7633
7634    /// Sets the value of [name][crate::model::BatchProcessRequest::name].
7635    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7636        self.name = v.into();
7637        self
7638    }
7639
7640    /// Sets the value of [input_documents][crate::model::BatchProcessRequest::input_documents].
7641    pub fn set_input_documents<T>(mut self, v: T) -> Self
7642    where
7643        T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
7644    {
7645        self.input_documents = std::option::Option::Some(v.into());
7646        self
7647    }
7648
7649    /// Sets or clears the value of [input_documents][crate::model::BatchProcessRequest::input_documents].
7650    pub fn set_or_clear_input_documents<T>(mut self, v: std::option::Option<T>) -> Self
7651    where
7652        T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
7653    {
7654        self.input_documents = v.map(|x| x.into());
7655        self
7656    }
7657
7658    /// Sets the value of [document_output_config][crate::model::BatchProcessRequest::document_output_config].
7659    pub fn set_document_output_config<T>(mut self, v: T) -> Self
7660    where
7661        T: std::convert::Into<crate::model::DocumentOutputConfig>,
7662    {
7663        self.document_output_config = std::option::Option::Some(v.into());
7664        self
7665    }
7666
7667    /// Sets or clears the value of [document_output_config][crate::model::BatchProcessRequest::document_output_config].
7668    pub fn set_or_clear_document_output_config<T>(mut self, v: std::option::Option<T>) -> Self
7669    where
7670        T: std::convert::Into<crate::model::DocumentOutputConfig>,
7671    {
7672        self.document_output_config = v.map(|x| x.into());
7673        self
7674    }
7675
7676    /// Sets the value of [skip_human_review][crate::model::BatchProcessRequest::skip_human_review].
7677    pub fn set_skip_human_review<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7678        self.skip_human_review = v.into();
7679        self
7680    }
7681
7682    /// Sets the value of [process_options][crate::model::BatchProcessRequest::process_options].
7683    pub fn set_process_options<T>(mut self, v: T) -> Self
7684    where
7685        T: std::convert::Into<crate::model::ProcessOptions>,
7686    {
7687        self.process_options = std::option::Option::Some(v.into());
7688        self
7689    }
7690
7691    /// Sets or clears the value of [process_options][crate::model::BatchProcessRequest::process_options].
7692    pub fn set_or_clear_process_options<T>(mut self, v: std::option::Option<T>) -> Self
7693    where
7694        T: std::convert::Into<crate::model::ProcessOptions>,
7695    {
7696        self.process_options = v.map(|x| x.into());
7697        self
7698    }
7699
7700    /// Sets the value of [labels][crate::model::BatchProcessRequest::labels].
7701    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7702    where
7703        T: std::iter::IntoIterator<Item = (K, V)>,
7704        K: std::convert::Into<std::string::String>,
7705        V: std::convert::Into<std::string::String>,
7706    {
7707        use std::iter::Iterator;
7708        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7709        self
7710    }
7711}
7712
7713impl wkt::message::Message for BatchProcessRequest {
7714    fn typename() -> &'static str {
7715        "type.googleapis.com/google.cloud.documentai.v1.BatchProcessRequest"
7716    }
7717}
7718
7719/// Response message for
7720/// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
7721///
7722/// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: crate::client::DocumentProcessorService::batch_process_documents
7723#[derive(Clone, Default, PartialEq)]
7724#[non_exhaustive]
7725pub struct BatchProcessResponse {
7726    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7727}
7728
7729impl BatchProcessResponse {
7730    pub fn new() -> Self {
7731        std::default::Default::default()
7732    }
7733}
7734
7735impl wkt::message::Message for BatchProcessResponse {
7736    fn typename() -> &'static str {
7737        "type.googleapis.com/google.cloud.documentai.v1.BatchProcessResponse"
7738    }
7739}
7740
7741/// The long-running operation metadata for
7742/// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
7743///
7744/// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: crate::client::DocumentProcessorService::batch_process_documents
7745#[derive(Clone, Default, PartialEq)]
7746#[non_exhaustive]
7747pub struct BatchProcessMetadata {
7748    /// The state of the current batch processing.
7749    pub state: crate::model::batch_process_metadata::State,
7750
7751    /// A message providing more details about the current state of processing.
7752    /// For example, the error message if the operation is failed.
7753    pub state_message: std::string::String,
7754
7755    /// The creation time of the operation.
7756    pub create_time: std::option::Option<wkt::Timestamp>,
7757
7758    /// The last update time of the operation.
7759    pub update_time: std::option::Option<wkt::Timestamp>,
7760
7761    /// The list of response details of each document.
7762    pub individual_process_statuses:
7763        std::vec::Vec<crate::model::batch_process_metadata::IndividualProcessStatus>,
7764
7765    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7766}
7767
7768impl BatchProcessMetadata {
7769    pub fn new() -> Self {
7770        std::default::Default::default()
7771    }
7772
7773    /// Sets the value of [state][crate::model::BatchProcessMetadata::state].
7774    pub fn set_state<T: std::convert::Into<crate::model::batch_process_metadata::State>>(
7775        mut self,
7776        v: T,
7777    ) -> Self {
7778        self.state = v.into();
7779        self
7780    }
7781
7782    /// Sets the value of [state_message][crate::model::BatchProcessMetadata::state_message].
7783    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7784        self.state_message = v.into();
7785        self
7786    }
7787
7788    /// Sets the value of [create_time][crate::model::BatchProcessMetadata::create_time].
7789    pub fn set_create_time<T>(mut self, v: T) -> Self
7790    where
7791        T: std::convert::Into<wkt::Timestamp>,
7792    {
7793        self.create_time = std::option::Option::Some(v.into());
7794        self
7795    }
7796
7797    /// Sets or clears the value of [create_time][crate::model::BatchProcessMetadata::create_time].
7798    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7799    where
7800        T: std::convert::Into<wkt::Timestamp>,
7801    {
7802        self.create_time = v.map(|x| x.into());
7803        self
7804    }
7805
7806    /// Sets the value of [update_time][crate::model::BatchProcessMetadata::update_time].
7807    pub fn set_update_time<T>(mut self, v: T) -> Self
7808    where
7809        T: std::convert::Into<wkt::Timestamp>,
7810    {
7811        self.update_time = std::option::Option::Some(v.into());
7812        self
7813    }
7814
7815    /// Sets or clears the value of [update_time][crate::model::BatchProcessMetadata::update_time].
7816    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7817    where
7818        T: std::convert::Into<wkt::Timestamp>,
7819    {
7820        self.update_time = v.map(|x| x.into());
7821        self
7822    }
7823
7824    /// Sets the value of [individual_process_statuses][crate::model::BatchProcessMetadata::individual_process_statuses].
7825    pub fn set_individual_process_statuses<T, V>(mut self, v: T) -> Self
7826    where
7827        T: std::iter::IntoIterator<Item = V>,
7828        V: std::convert::Into<crate::model::batch_process_metadata::IndividualProcessStatus>,
7829    {
7830        use std::iter::Iterator;
7831        self.individual_process_statuses = v.into_iter().map(|i| i.into()).collect();
7832        self
7833    }
7834}
7835
7836impl wkt::message::Message for BatchProcessMetadata {
7837    fn typename() -> &'static str {
7838        "type.googleapis.com/google.cloud.documentai.v1.BatchProcessMetadata"
7839    }
7840}
7841
7842/// Defines additional types related to [BatchProcessMetadata].
7843pub mod batch_process_metadata {
7844    #[allow(unused_imports)]
7845    use super::*;
7846
7847    /// The status of a each individual document in the batch process.
7848    #[derive(Clone, Default, PartialEq)]
7849    #[non_exhaustive]
7850    pub struct IndividualProcessStatus {
7851        /// The source of the document, same as the
7852        /// [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
7853        /// field in the request when the batch process started.
7854        ///
7855        /// [google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]: crate::model::batch_process_metadata::IndividualProcessStatus::input_gcs_source
7856        pub input_gcs_source: std::string::String,
7857
7858        /// The status processing the document.
7859        pub status: std::option::Option<rpc::model::Status>,
7860
7861        /// The Cloud Storage output destination (in the request as
7862        /// [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
7863        /// of the processed document if it was successful, otherwise empty.
7864        ///
7865        /// [google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]: crate::model::document_output_config::GcsOutputConfig::gcs_uri
7866        pub output_gcs_destination: std::string::String,
7867
7868        /// The status of human review on the processed document.
7869        pub human_review_status: std::option::Option<crate::model::HumanReviewStatus>,
7870
7871        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7872    }
7873
7874    impl IndividualProcessStatus {
7875        pub fn new() -> Self {
7876            std::default::Default::default()
7877        }
7878
7879        /// Sets the value of [input_gcs_source][crate::model::batch_process_metadata::IndividualProcessStatus::input_gcs_source].
7880        pub fn set_input_gcs_source<T: std::convert::Into<std::string::String>>(
7881            mut self,
7882            v: T,
7883        ) -> Self {
7884            self.input_gcs_source = v.into();
7885            self
7886        }
7887
7888        /// Sets the value of [status][crate::model::batch_process_metadata::IndividualProcessStatus::status].
7889        pub fn set_status<T>(mut self, v: T) -> Self
7890        where
7891            T: std::convert::Into<rpc::model::Status>,
7892        {
7893            self.status = std::option::Option::Some(v.into());
7894            self
7895        }
7896
7897        /// Sets or clears the value of [status][crate::model::batch_process_metadata::IndividualProcessStatus::status].
7898        pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
7899        where
7900            T: std::convert::Into<rpc::model::Status>,
7901        {
7902            self.status = v.map(|x| x.into());
7903            self
7904        }
7905
7906        /// Sets the value of [output_gcs_destination][crate::model::batch_process_metadata::IndividualProcessStatus::output_gcs_destination].
7907        pub fn set_output_gcs_destination<T: std::convert::Into<std::string::String>>(
7908            mut self,
7909            v: T,
7910        ) -> Self {
7911            self.output_gcs_destination = v.into();
7912            self
7913        }
7914
7915        /// Sets the value of [human_review_status][crate::model::batch_process_metadata::IndividualProcessStatus::human_review_status].
7916        pub fn set_human_review_status<T>(mut self, v: T) -> Self
7917        where
7918            T: std::convert::Into<crate::model::HumanReviewStatus>,
7919        {
7920            self.human_review_status = std::option::Option::Some(v.into());
7921            self
7922        }
7923
7924        /// Sets or clears the value of [human_review_status][crate::model::batch_process_metadata::IndividualProcessStatus::human_review_status].
7925        pub fn set_or_clear_human_review_status<T>(mut self, v: std::option::Option<T>) -> Self
7926        where
7927            T: std::convert::Into<crate::model::HumanReviewStatus>,
7928        {
7929            self.human_review_status = v.map(|x| x.into());
7930            self
7931        }
7932    }
7933
7934    impl wkt::message::Message for IndividualProcessStatus {
7935        fn typename() -> &'static str {
7936            "type.googleapis.com/google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus"
7937        }
7938    }
7939
7940    /// Possible states of the batch processing operation.
7941    ///
7942    /// # Working with unknown values
7943    ///
7944    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7945    /// additional enum variants at any time. Adding new variants is not considered
7946    /// a breaking change. Applications should write their code in anticipation of:
7947    ///
7948    /// - New values appearing in future releases of the client library, **and**
7949    /// - New values received dynamically, without application changes.
7950    ///
7951    /// Please consult the [Working with enums] section in the user guide for some
7952    /// guidelines.
7953    ///
7954    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7955    #[derive(Clone, Debug, PartialEq)]
7956    #[non_exhaustive]
7957    pub enum State {
7958        /// The default value. This value is used if the state is omitted.
7959        Unspecified,
7960        /// Request operation is waiting for scheduling.
7961        Waiting,
7962        /// Request is being processed.
7963        Running,
7964        /// The batch processing completed successfully.
7965        Succeeded,
7966        /// The batch processing was being cancelled.
7967        Cancelling,
7968        /// The batch processing was cancelled.
7969        Cancelled,
7970        /// The batch processing has failed.
7971        Failed,
7972        /// If set, the enum was initialized with an unknown value.
7973        ///
7974        /// Applications can examine the value using [State::value] or
7975        /// [State::name].
7976        UnknownValue(state::UnknownValue),
7977    }
7978
7979    #[doc(hidden)]
7980    pub mod state {
7981        #[allow(unused_imports)]
7982        use super::*;
7983        #[derive(Clone, Debug, PartialEq)]
7984        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7985    }
7986
7987    impl State {
7988        /// Gets the enum value.
7989        ///
7990        /// Returns `None` if the enum contains an unknown value deserialized from
7991        /// the string representation of enums.
7992        pub fn value(&self) -> std::option::Option<i32> {
7993            match self {
7994                Self::Unspecified => std::option::Option::Some(0),
7995                Self::Waiting => std::option::Option::Some(1),
7996                Self::Running => std::option::Option::Some(2),
7997                Self::Succeeded => std::option::Option::Some(3),
7998                Self::Cancelling => std::option::Option::Some(4),
7999                Self::Cancelled => std::option::Option::Some(5),
8000                Self::Failed => std::option::Option::Some(6),
8001                Self::UnknownValue(u) => u.0.value(),
8002            }
8003        }
8004
8005        /// Gets the enum value as a string.
8006        ///
8007        /// Returns `None` if the enum contains an unknown value deserialized from
8008        /// the integer representation of enums.
8009        pub fn name(&self) -> std::option::Option<&str> {
8010            match self {
8011                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8012                Self::Waiting => std::option::Option::Some("WAITING"),
8013                Self::Running => std::option::Option::Some("RUNNING"),
8014                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
8015                Self::Cancelling => std::option::Option::Some("CANCELLING"),
8016                Self::Cancelled => std::option::Option::Some("CANCELLED"),
8017                Self::Failed => std::option::Option::Some("FAILED"),
8018                Self::UnknownValue(u) => u.0.name(),
8019            }
8020        }
8021    }
8022
8023    impl std::default::Default for State {
8024        fn default() -> Self {
8025            use std::convert::From;
8026            Self::from(0)
8027        }
8028    }
8029
8030    impl std::fmt::Display for State {
8031        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8032            wkt::internal::display_enum(f, self.name(), self.value())
8033        }
8034    }
8035
8036    impl std::convert::From<i32> for State {
8037        fn from(value: i32) -> Self {
8038            match value {
8039                0 => Self::Unspecified,
8040                1 => Self::Waiting,
8041                2 => Self::Running,
8042                3 => Self::Succeeded,
8043                4 => Self::Cancelling,
8044                5 => Self::Cancelled,
8045                6 => Self::Failed,
8046                _ => Self::UnknownValue(state::UnknownValue(
8047                    wkt::internal::UnknownEnumValue::Integer(value),
8048                )),
8049            }
8050        }
8051    }
8052
8053    impl std::convert::From<&str> for State {
8054        fn from(value: &str) -> Self {
8055            use std::string::ToString;
8056            match value {
8057                "STATE_UNSPECIFIED" => Self::Unspecified,
8058                "WAITING" => Self::Waiting,
8059                "RUNNING" => Self::Running,
8060                "SUCCEEDED" => Self::Succeeded,
8061                "CANCELLING" => Self::Cancelling,
8062                "CANCELLED" => Self::Cancelled,
8063                "FAILED" => Self::Failed,
8064                _ => Self::UnknownValue(state::UnknownValue(
8065                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8066                )),
8067            }
8068        }
8069    }
8070
8071    impl serde::ser::Serialize for State {
8072        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8073        where
8074            S: serde::Serializer,
8075        {
8076            match self {
8077                Self::Unspecified => serializer.serialize_i32(0),
8078                Self::Waiting => serializer.serialize_i32(1),
8079                Self::Running => serializer.serialize_i32(2),
8080                Self::Succeeded => serializer.serialize_i32(3),
8081                Self::Cancelling => serializer.serialize_i32(4),
8082                Self::Cancelled => serializer.serialize_i32(5),
8083                Self::Failed => serializer.serialize_i32(6),
8084                Self::UnknownValue(u) => u.0.serialize(serializer),
8085            }
8086        }
8087    }
8088
8089    impl<'de> serde::de::Deserialize<'de> for State {
8090        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8091        where
8092            D: serde::Deserializer<'de>,
8093        {
8094            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8095                ".google.cloud.documentai.v1.BatchProcessMetadata.State",
8096            ))
8097        }
8098    }
8099}
8100
8101/// Request message for the
8102/// [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]
8103/// method. Some processor types may require the project be added to an
8104/// allowlist.
8105///
8106/// [google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]: crate::client::DocumentProcessorService::fetch_processor_types
8107#[derive(Clone, Default, PartialEq)]
8108#[non_exhaustive]
8109pub struct FetchProcessorTypesRequest {
8110    /// Required. The location of processor types to list.
8111    /// Format: `projects/{project}/locations/{location}`.
8112    pub parent: std::string::String,
8113
8114    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8115}
8116
8117impl FetchProcessorTypesRequest {
8118    pub fn new() -> Self {
8119        std::default::Default::default()
8120    }
8121
8122    /// Sets the value of [parent][crate::model::FetchProcessorTypesRequest::parent].
8123    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8124        self.parent = v.into();
8125        self
8126    }
8127}
8128
8129impl wkt::message::Message for FetchProcessorTypesRequest {
8130    fn typename() -> &'static str {
8131        "type.googleapis.com/google.cloud.documentai.v1.FetchProcessorTypesRequest"
8132    }
8133}
8134
8135/// Response message for the
8136/// [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]
8137/// method.
8138///
8139/// [google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]: crate::client::DocumentProcessorService::fetch_processor_types
8140#[derive(Clone, Default, PartialEq)]
8141#[non_exhaustive]
8142pub struct FetchProcessorTypesResponse {
8143    /// The list of processor types.
8144    pub processor_types: std::vec::Vec<crate::model::ProcessorType>,
8145
8146    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8147}
8148
8149impl FetchProcessorTypesResponse {
8150    pub fn new() -> Self {
8151        std::default::Default::default()
8152    }
8153
8154    /// Sets the value of [processor_types][crate::model::FetchProcessorTypesResponse::processor_types].
8155    pub fn set_processor_types<T, V>(mut self, v: T) -> Self
8156    where
8157        T: std::iter::IntoIterator<Item = V>,
8158        V: std::convert::Into<crate::model::ProcessorType>,
8159    {
8160        use std::iter::Iterator;
8161        self.processor_types = v.into_iter().map(|i| i.into()).collect();
8162        self
8163    }
8164}
8165
8166impl wkt::message::Message for FetchProcessorTypesResponse {
8167    fn typename() -> &'static str {
8168        "type.googleapis.com/google.cloud.documentai.v1.FetchProcessorTypesResponse"
8169    }
8170}
8171
8172/// Request message for the
8173/// [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
8174/// method. Some processor types may require the project be added to an
8175/// allowlist.
8176///
8177/// [google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]: crate::client::DocumentProcessorService::list_processor_types
8178#[derive(Clone, Default, PartialEq)]
8179#[non_exhaustive]
8180pub struct ListProcessorTypesRequest {
8181    /// Required. The location of processor types to list.
8182    /// Format: `projects/{project}/locations/{location}`.
8183    pub parent: std::string::String,
8184
8185    /// The maximum number of processor types to return.
8186    /// If unspecified, at most `100` processor types will be returned.
8187    /// The maximum value is `500`. Values above `500` will be coerced to `500`.
8188    pub page_size: i32,
8189
8190    /// Used to retrieve the next page of results, empty if at the end of the list.
8191    pub page_token: std::string::String,
8192
8193    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8194}
8195
8196impl ListProcessorTypesRequest {
8197    pub fn new() -> Self {
8198        std::default::Default::default()
8199    }
8200
8201    /// Sets the value of [parent][crate::model::ListProcessorTypesRequest::parent].
8202    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8203        self.parent = v.into();
8204        self
8205    }
8206
8207    /// Sets the value of [page_size][crate::model::ListProcessorTypesRequest::page_size].
8208    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8209        self.page_size = v.into();
8210        self
8211    }
8212
8213    /// Sets the value of [page_token][crate::model::ListProcessorTypesRequest::page_token].
8214    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8215        self.page_token = v.into();
8216        self
8217    }
8218}
8219
8220impl wkt::message::Message for ListProcessorTypesRequest {
8221    fn typename() -> &'static str {
8222        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorTypesRequest"
8223    }
8224}
8225
8226/// Response message for the
8227/// [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
8228/// method.
8229///
8230/// [google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]: crate::client::DocumentProcessorService::list_processor_types
8231#[derive(Clone, Default, PartialEq)]
8232#[non_exhaustive]
8233pub struct ListProcessorTypesResponse {
8234    /// The processor types.
8235    pub processor_types: std::vec::Vec<crate::model::ProcessorType>,
8236
8237    /// Points to the next page, otherwise empty.
8238    pub next_page_token: std::string::String,
8239
8240    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8241}
8242
8243impl ListProcessorTypesResponse {
8244    pub fn new() -> Self {
8245        std::default::Default::default()
8246    }
8247
8248    /// Sets the value of [processor_types][crate::model::ListProcessorTypesResponse::processor_types].
8249    pub fn set_processor_types<T, V>(mut self, v: T) -> Self
8250    where
8251        T: std::iter::IntoIterator<Item = V>,
8252        V: std::convert::Into<crate::model::ProcessorType>,
8253    {
8254        use std::iter::Iterator;
8255        self.processor_types = v.into_iter().map(|i| i.into()).collect();
8256        self
8257    }
8258
8259    /// Sets the value of [next_page_token][crate::model::ListProcessorTypesResponse::next_page_token].
8260    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8261        self.next_page_token = v.into();
8262        self
8263    }
8264}
8265
8266impl wkt::message::Message for ListProcessorTypesResponse {
8267    fn typename() -> &'static str {
8268        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorTypesResponse"
8269    }
8270}
8271
8272#[doc(hidden)]
8273impl gax::paginator::internal::PageableResponse for ListProcessorTypesResponse {
8274    type PageItem = crate::model::ProcessorType;
8275
8276    fn items(self) -> std::vec::Vec<Self::PageItem> {
8277        self.processor_types
8278    }
8279
8280    fn next_page_token(&self) -> std::string::String {
8281        use std::clone::Clone;
8282        self.next_page_token.clone()
8283    }
8284}
8285
8286/// Request message for list all processors belongs to a project.
8287#[derive(Clone, Default, PartialEq)]
8288#[non_exhaustive]
8289pub struct ListProcessorsRequest {
8290    /// Required. The parent (project and location) which owns this collection of
8291    /// Processors. Format: `projects/{project}/locations/{location}`
8292    pub parent: std::string::String,
8293
8294    /// The maximum number of processors to return.
8295    /// If unspecified, at most `50` processors will be returned.
8296    /// The maximum value is `100`. Values above `100` will be coerced to `100`.
8297    pub page_size: i32,
8298
8299    /// We will return the processors sorted by creation time. The page token
8300    /// will point to the next processor.
8301    pub page_token: std::string::String,
8302
8303    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8304}
8305
8306impl ListProcessorsRequest {
8307    pub fn new() -> Self {
8308        std::default::Default::default()
8309    }
8310
8311    /// Sets the value of [parent][crate::model::ListProcessorsRequest::parent].
8312    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8313        self.parent = v.into();
8314        self
8315    }
8316
8317    /// Sets the value of [page_size][crate::model::ListProcessorsRequest::page_size].
8318    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8319        self.page_size = v.into();
8320        self
8321    }
8322
8323    /// Sets the value of [page_token][crate::model::ListProcessorsRequest::page_token].
8324    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8325        self.page_token = v.into();
8326        self
8327    }
8328}
8329
8330impl wkt::message::Message for ListProcessorsRequest {
8331    fn typename() -> &'static str {
8332        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorsRequest"
8333    }
8334}
8335
8336/// Response message for the
8337/// [ListProcessors][google.cloud.documentai.v1.DocumentProcessorService.ListProcessors]
8338/// method.
8339///
8340/// [google.cloud.documentai.v1.DocumentProcessorService.ListProcessors]: crate::client::DocumentProcessorService::list_processors
8341#[derive(Clone, Default, PartialEq)]
8342#[non_exhaustive]
8343pub struct ListProcessorsResponse {
8344    /// The list of processors.
8345    pub processors: std::vec::Vec<crate::model::Processor>,
8346
8347    /// Points to the next processor, otherwise empty.
8348    pub next_page_token: std::string::String,
8349
8350    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8351}
8352
8353impl ListProcessorsResponse {
8354    pub fn new() -> Self {
8355        std::default::Default::default()
8356    }
8357
8358    /// Sets the value of [processors][crate::model::ListProcessorsResponse::processors].
8359    pub fn set_processors<T, V>(mut self, v: T) -> Self
8360    where
8361        T: std::iter::IntoIterator<Item = V>,
8362        V: std::convert::Into<crate::model::Processor>,
8363    {
8364        use std::iter::Iterator;
8365        self.processors = v.into_iter().map(|i| i.into()).collect();
8366        self
8367    }
8368
8369    /// Sets the value of [next_page_token][crate::model::ListProcessorsResponse::next_page_token].
8370    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8371        self.next_page_token = v.into();
8372        self
8373    }
8374}
8375
8376impl wkt::message::Message for ListProcessorsResponse {
8377    fn typename() -> &'static str {
8378        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorsResponse"
8379    }
8380}
8381
8382#[doc(hidden)]
8383impl gax::paginator::internal::PageableResponse for ListProcessorsResponse {
8384    type PageItem = crate::model::Processor;
8385
8386    fn items(self) -> std::vec::Vec<Self::PageItem> {
8387        self.processors
8388    }
8389
8390    fn next_page_token(&self) -> std::string::String {
8391        use std::clone::Clone;
8392        self.next_page_token.clone()
8393    }
8394}
8395
8396/// Request message for the
8397/// [GetProcessorType][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType]
8398/// method.
8399///
8400/// [google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType]: crate::client::DocumentProcessorService::get_processor_type
8401#[derive(Clone, Default, PartialEq)]
8402#[non_exhaustive]
8403pub struct GetProcessorTypeRequest {
8404    /// Required. The processor type resource name.
8405    pub name: std::string::String,
8406
8407    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8408}
8409
8410impl GetProcessorTypeRequest {
8411    pub fn new() -> Self {
8412        std::default::Default::default()
8413    }
8414
8415    /// Sets the value of [name][crate::model::GetProcessorTypeRequest::name].
8416    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8417        self.name = v.into();
8418        self
8419    }
8420}
8421
8422impl wkt::message::Message for GetProcessorTypeRequest {
8423    fn typename() -> &'static str {
8424        "type.googleapis.com/google.cloud.documentai.v1.GetProcessorTypeRequest"
8425    }
8426}
8427
8428/// Request message for the
8429/// [GetProcessor][google.cloud.documentai.v1.DocumentProcessorService.GetProcessor]
8430/// method.
8431///
8432/// [google.cloud.documentai.v1.DocumentProcessorService.GetProcessor]: crate::client::DocumentProcessorService::get_processor
8433#[derive(Clone, Default, PartialEq)]
8434#[non_exhaustive]
8435pub struct GetProcessorRequest {
8436    /// Required. The processor resource name.
8437    pub name: std::string::String,
8438
8439    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8440}
8441
8442impl GetProcessorRequest {
8443    pub fn new() -> Self {
8444        std::default::Default::default()
8445    }
8446
8447    /// Sets the value of [name][crate::model::GetProcessorRequest::name].
8448    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8449        self.name = v.into();
8450        self
8451    }
8452}
8453
8454impl wkt::message::Message for GetProcessorRequest {
8455    fn typename() -> &'static str {
8456        "type.googleapis.com/google.cloud.documentai.v1.GetProcessorRequest"
8457    }
8458}
8459
8460/// Request message for the
8461/// [GetProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion]
8462/// method.
8463///
8464/// [google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion]: crate::client::DocumentProcessorService::get_processor_version
8465#[derive(Clone, Default, PartialEq)]
8466#[non_exhaustive]
8467pub struct GetProcessorVersionRequest {
8468    /// Required. The processor resource name.
8469    pub name: std::string::String,
8470
8471    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8472}
8473
8474impl GetProcessorVersionRequest {
8475    pub fn new() -> Self {
8476        std::default::Default::default()
8477    }
8478
8479    /// Sets the value of [name][crate::model::GetProcessorVersionRequest::name].
8480    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8481        self.name = v.into();
8482        self
8483    }
8484}
8485
8486impl wkt::message::Message for GetProcessorVersionRequest {
8487    fn typename() -> &'static str {
8488        "type.googleapis.com/google.cloud.documentai.v1.GetProcessorVersionRequest"
8489    }
8490}
8491
8492/// Request message for list all processor versions belongs to a processor.
8493#[derive(Clone, Default, PartialEq)]
8494#[non_exhaustive]
8495pub struct ListProcessorVersionsRequest {
8496    /// Required. The parent (project, location and processor) to list all
8497    /// versions. Format:
8498    /// `projects/{project}/locations/{location}/processors/{processor}`
8499    pub parent: std::string::String,
8500
8501    /// The maximum number of processor versions to return.
8502    /// If unspecified, at most `10` processor versions will be returned.
8503    /// The maximum value is `20`. Values above `20` will be coerced to `20`.
8504    pub page_size: i32,
8505
8506    /// We will return the processor versions sorted by creation time. The page
8507    /// token will point to the next processor version.
8508    pub page_token: std::string::String,
8509
8510    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8511}
8512
8513impl ListProcessorVersionsRequest {
8514    pub fn new() -> Self {
8515        std::default::Default::default()
8516    }
8517
8518    /// Sets the value of [parent][crate::model::ListProcessorVersionsRequest::parent].
8519    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8520        self.parent = v.into();
8521        self
8522    }
8523
8524    /// Sets the value of [page_size][crate::model::ListProcessorVersionsRequest::page_size].
8525    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8526        self.page_size = v.into();
8527        self
8528    }
8529
8530    /// Sets the value of [page_token][crate::model::ListProcessorVersionsRequest::page_token].
8531    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8532        self.page_token = v.into();
8533        self
8534    }
8535}
8536
8537impl wkt::message::Message for ListProcessorVersionsRequest {
8538    fn typename() -> &'static str {
8539        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorVersionsRequest"
8540    }
8541}
8542
8543/// Response message for the
8544/// [ListProcessorVersions][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions]
8545/// method.
8546///
8547/// [google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions]: crate::client::DocumentProcessorService::list_processor_versions
8548#[derive(Clone, Default, PartialEq)]
8549#[non_exhaustive]
8550pub struct ListProcessorVersionsResponse {
8551    /// The list of processors.
8552    pub processor_versions: std::vec::Vec<crate::model::ProcessorVersion>,
8553
8554    /// Points to the next processor, otherwise empty.
8555    pub next_page_token: std::string::String,
8556
8557    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8558}
8559
8560impl ListProcessorVersionsResponse {
8561    pub fn new() -> Self {
8562        std::default::Default::default()
8563    }
8564
8565    /// Sets the value of [processor_versions][crate::model::ListProcessorVersionsResponse::processor_versions].
8566    pub fn set_processor_versions<T, V>(mut self, v: T) -> Self
8567    where
8568        T: std::iter::IntoIterator<Item = V>,
8569        V: std::convert::Into<crate::model::ProcessorVersion>,
8570    {
8571        use std::iter::Iterator;
8572        self.processor_versions = v.into_iter().map(|i| i.into()).collect();
8573        self
8574    }
8575
8576    /// Sets the value of [next_page_token][crate::model::ListProcessorVersionsResponse::next_page_token].
8577    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8578        self.next_page_token = v.into();
8579        self
8580    }
8581}
8582
8583impl wkt::message::Message for ListProcessorVersionsResponse {
8584    fn typename() -> &'static str {
8585        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorVersionsResponse"
8586    }
8587}
8588
8589#[doc(hidden)]
8590impl gax::paginator::internal::PageableResponse for ListProcessorVersionsResponse {
8591    type PageItem = crate::model::ProcessorVersion;
8592
8593    fn items(self) -> std::vec::Vec<Self::PageItem> {
8594        self.processor_versions
8595    }
8596
8597    fn next_page_token(&self) -> std::string::String {
8598        use std::clone::Clone;
8599        self.next_page_token.clone()
8600    }
8601}
8602
8603/// Request message for the
8604/// [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]
8605/// method.
8606///
8607/// [google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]: crate::client::DocumentProcessorService::delete_processor_version
8608#[derive(Clone, Default, PartialEq)]
8609#[non_exhaustive]
8610pub struct DeleteProcessorVersionRequest {
8611    /// Required. The processor version resource name to be deleted.
8612    pub name: std::string::String,
8613
8614    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8615}
8616
8617impl DeleteProcessorVersionRequest {
8618    pub fn new() -> Self {
8619        std::default::Default::default()
8620    }
8621
8622    /// Sets the value of [name][crate::model::DeleteProcessorVersionRequest::name].
8623    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8624        self.name = v.into();
8625        self
8626    }
8627}
8628
8629impl wkt::message::Message for DeleteProcessorVersionRequest {
8630    fn typename() -> &'static str {
8631        "type.googleapis.com/google.cloud.documentai.v1.DeleteProcessorVersionRequest"
8632    }
8633}
8634
8635/// The long-running operation metadata for the
8636/// [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]
8637/// method.
8638///
8639/// [google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]: crate::client::DocumentProcessorService::delete_processor_version
8640#[derive(Clone, Default, PartialEq)]
8641#[non_exhaustive]
8642pub struct DeleteProcessorVersionMetadata {
8643    /// The basic metadata of the long-running operation.
8644    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
8645
8646    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8647}
8648
8649impl DeleteProcessorVersionMetadata {
8650    pub fn new() -> Self {
8651        std::default::Default::default()
8652    }
8653
8654    /// Sets the value of [common_metadata][crate::model::DeleteProcessorVersionMetadata::common_metadata].
8655    pub fn set_common_metadata<T>(mut self, v: T) -> Self
8656    where
8657        T: std::convert::Into<crate::model::CommonOperationMetadata>,
8658    {
8659        self.common_metadata = std::option::Option::Some(v.into());
8660        self
8661    }
8662
8663    /// Sets or clears the value of [common_metadata][crate::model::DeleteProcessorVersionMetadata::common_metadata].
8664    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
8665    where
8666        T: std::convert::Into<crate::model::CommonOperationMetadata>,
8667    {
8668        self.common_metadata = v.map(|x| x.into());
8669        self
8670    }
8671}
8672
8673impl wkt::message::Message for DeleteProcessorVersionMetadata {
8674    fn typename() -> &'static str {
8675        "type.googleapis.com/google.cloud.documentai.v1.DeleteProcessorVersionMetadata"
8676    }
8677}
8678
8679/// Request message for the
8680/// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
8681/// method.
8682///
8683/// [google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]: crate::client::DocumentProcessorService::deploy_processor_version
8684#[derive(Clone, Default, PartialEq)]
8685#[non_exhaustive]
8686pub struct DeployProcessorVersionRequest {
8687    /// Required. The processor version resource name to be deployed.
8688    pub name: std::string::String,
8689
8690    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8691}
8692
8693impl DeployProcessorVersionRequest {
8694    pub fn new() -> Self {
8695        std::default::Default::default()
8696    }
8697
8698    /// Sets the value of [name][crate::model::DeployProcessorVersionRequest::name].
8699    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8700        self.name = v.into();
8701        self
8702    }
8703}
8704
8705impl wkt::message::Message for DeployProcessorVersionRequest {
8706    fn typename() -> &'static str {
8707        "type.googleapis.com/google.cloud.documentai.v1.DeployProcessorVersionRequest"
8708    }
8709}
8710
8711/// Response message for the
8712/// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
8713/// method.
8714///
8715/// [google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]: crate::client::DocumentProcessorService::deploy_processor_version
8716#[derive(Clone, Default, PartialEq)]
8717#[non_exhaustive]
8718pub struct DeployProcessorVersionResponse {
8719    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8720}
8721
8722impl DeployProcessorVersionResponse {
8723    pub fn new() -> Self {
8724        std::default::Default::default()
8725    }
8726}
8727
8728impl wkt::message::Message for DeployProcessorVersionResponse {
8729    fn typename() -> &'static str {
8730        "type.googleapis.com/google.cloud.documentai.v1.DeployProcessorVersionResponse"
8731    }
8732}
8733
8734/// The long-running operation metadata for the
8735/// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
8736/// method.
8737///
8738/// [google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]: crate::client::DocumentProcessorService::deploy_processor_version
8739#[derive(Clone, Default, PartialEq)]
8740#[non_exhaustive]
8741pub struct DeployProcessorVersionMetadata {
8742    /// The basic metadata of the long-running operation.
8743    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
8744
8745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8746}
8747
8748impl DeployProcessorVersionMetadata {
8749    pub fn new() -> Self {
8750        std::default::Default::default()
8751    }
8752
8753    /// Sets the value of [common_metadata][crate::model::DeployProcessorVersionMetadata::common_metadata].
8754    pub fn set_common_metadata<T>(mut self, v: T) -> Self
8755    where
8756        T: std::convert::Into<crate::model::CommonOperationMetadata>,
8757    {
8758        self.common_metadata = std::option::Option::Some(v.into());
8759        self
8760    }
8761
8762    /// Sets or clears the value of [common_metadata][crate::model::DeployProcessorVersionMetadata::common_metadata].
8763    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
8764    where
8765        T: std::convert::Into<crate::model::CommonOperationMetadata>,
8766    {
8767        self.common_metadata = v.map(|x| x.into());
8768        self
8769    }
8770}
8771
8772impl wkt::message::Message for DeployProcessorVersionMetadata {
8773    fn typename() -> &'static str {
8774        "type.googleapis.com/google.cloud.documentai.v1.DeployProcessorVersionMetadata"
8775    }
8776}
8777
8778/// Request message for the
8779/// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]
8780/// method.
8781///
8782/// [google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]: crate::client::DocumentProcessorService::undeploy_processor_version
8783#[derive(Clone, Default, PartialEq)]
8784#[non_exhaustive]
8785pub struct UndeployProcessorVersionRequest {
8786    /// Required. The processor version resource name to be undeployed.
8787    pub name: std::string::String,
8788
8789    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8790}
8791
8792impl UndeployProcessorVersionRequest {
8793    pub fn new() -> Self {
8794        std::default::Default::default()
8795    }
8796
8797    /// Sets the value of [name][crate::model::UndeployProcessorVersionRequest::name].
8798    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8799        self.name = v.into();
8800        self
8801    }
8802}
8803
8804impl wkt::message::Message for UndeployProcessorVersionRequest {
8805    fn typename() -> &'static str {
8806        "type.googleapis.com/google.cloud.documentai.v1.UndeployProcessorVersionRequest"
8807    }
8808}
8809
8810/// Response message for the
8811/// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]
8812/// method.
8813///
8814/// [google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]: crate::client::DocumentProcessorService::undeploy_processor_version
8815#[derive(Clone, Default, PartialEq)]
8816#[non_exhaustive]
8817pub struct UndeployProcessorVersionResponse {
8818    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8819}
8820
8821impl UndeployProcessorVersionResponse {
8822    pub fn new() -> Self {
8823        std::default::Default::default()
8824    }
8825}
8826
8827impl wkt::message::Message for UndeployProcessorVersionResponse {
8828    fn typename() -> &'static str {
8829        "type.googleapis.com/google.cloud.documentai.v1.UndeployProcessorVersionResponse"
8830    }
8831}
8832
8833/// The long-running operation metadata for the
8834/// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]
8835/// method.
8836///
8837/// [google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]: crate::client::DocumentProcessorService::undeploy_processor_version
8838#[derive(Clone, Default, PartialEq)]
8839#[non_exhaustive]
8840pub struct UndeployProcessorVersionMetadata {
8841    /// The basic metadata of the long-running operation.
8842    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
8843
8844    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8845}
8846
8847impl UndeployProcessorVersionMetadata {
8848    pub fn new() -> Self {
8849        std::default::Default::default()
8850    }
8851
8852    /// Sets the value of [common_metadata][crate::model::UndeployProcessorVersionMetadata::common_metadata].
8853    pub fn set_common_metadata<T>(mut self, v: T) -> Self
8854    where
8855        T: std::convert::Into<crate::model::CommonOperationMetadata>,
8856    {
8857        self.common_metadata = std::option::Option::Some(v.into());
8858        self
8859    }
8860
8861    /// Sets or clears the value of [common_metadata][crate::model::UndeployProcessorVersionMetadata::common_metadata].
8862    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
8863    where
8864        T: std::convert::Into<crate::model::CommonOperationMetadata>,
8865    {
8866        self.common_metadata = v.map(|x| x.into());
8867        self
8868    }
8869}
8870
8871impl wkt::message::Message for UndeployProcessorVersionMetadata {
8872    fn typename() -> &'static str {
8873        "type.googleapis.com/google.cloud.documentai.v1.UndeployProcessorVersionMetadata"
8874    }
8875}
8876
8877/// Request message for the
8878/// [CreateProcessor][google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor]
8879/// method. Notice this request is sent to a regionalized backend service. If the
8880/// [ProcessorType][google.cloud.documentai.v1.ProcessorType] isn't available in
8881/// that region, the creation fails.
8882///
8883/// [google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor]: crate::client::DocumentProcessorService::create_processor
8884/// [google.cloud.documentai.v1.ProcessorType]: crate::model::ProcessorType
8885#[derive(Clone, Default, PartialEq)]
8886#[non_exhaustive]
8887pub struct CreateProcessorRequest {
8888    /// Required. The parent (project and location) under which to create the
8889    /// processor. Format: `projects/{project}/locations/{location}`
8890    pub parent: std::string::String,
8891
8892    /// Required. The processor to be created, requires
8893    /// [Processor.type][google.cloud.documentai.v1.Processor.type] and
8894    /// [Processor.display_name][google.cloud.documentai.v1.Processor.display_name]
8895    /// to be set. Also, the
8896    /// [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
8897    /// field must be set if the processor is under CMEK.
8898    ///
8899    /// [google.cloud.documentai.v1.Processor.display_name]: crate::model::Processor::display_name
8900    /// [google.cloud.documentai.v1.Processor.kms_key_name]: crate::model::Processor::kms_key_name
8901    /// [google.cloud.documentai.v1.Processor.type]: crate::model::Processor::type
8902    pub processor: std::option::Option<crate::model::Processor>,
8903
8904    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8905}
8906
8907impl CreateProcessorRequest {
8908    pub fn new() -> Self {
8909        std::default::Default::default()
8910    }
8911
8912    /// Sets the value of [parent][crate::model::CreateProcessorRequest::parent].
8913    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8914        self.parent = v.into();
8915        self
8916    }
8917
8918    /// Sets the value of [processor][crate::model::CreateProcessorRequest::processor].
8919    pub fn set_processor<T>(mut self, v: T) -> Self
8920    where
8921        T: std::convert::Into<crate::model::Processor>,
8922    {
8923        self.processor = std::option::Option::Some(v.into());
8924        self
8925    }
8926
8927    /// Sets or clears the value of [processor][crate::model::CreateProcessorRequest::processor].
8928    pub fn set_or_clear_processor<T>(mut self, v: std::option::Option<T>) -> Self
8929    where
8930        T: std::convert::Into<crate::model::Processor>,
8931    {
8932        self.processor = v.map(|x| x.into());
8933        self
8934    }
8935}
8936
8937impl wkt::message::Message for CreateProcessorRequest {
8938    fn typename() -> &'static str {
8939        "type.googleapis.com/google.cloud.documentai.v1.CreateProcessorRequest"
8940    }
8941}
8942
8943/// Request message for the
8944/// [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]
8945/// method.
8946///
8947/// [google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]: crate::client::DocumentProcessorService::delete_processor
8948#[derive(Clone, Default, PartialEq)]
8949#[non_exhaustive]
8950pub struct DeleteProcessorRequest {
8951    /// Required. The processor resource name to be deleted.
8952    pub name: std::string::String,
8953
8954    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8955}
8956
8957impl DeleteProcessorRequest {
8958    pub fn new() -> Self {
8959        std::default::Default::default()
8960    }
8961
8962    /// Sets the value of [name][crate::model::DeleteProcessorRequest::name].
8963    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8964        self.name = v.into();
8965        self
8966    }
8967}
8968
8969impl wkt::message::Message for DeleteProcessorRequest {
8970    fn typename() -> &'static str {
8971        "type.googleapis.com/google.cloud.documentai.v1.DeleteProcessorRequest"
8972    }
8973}
8974
8975/// The long-running operation metadata for the
8976/// [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]
8977/// method.
8978///
8979/// [google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]: crate::client::DocumentProcessorService::delete_processor
8980#[derive(Clone, Default, PartialEq)]
8981#[non_exhaustive]
8982pub struct DeleteProcessorMetadata {
8983    /// The basic metadata of the long-running operation.
8984    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
8985
8986    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8987}
8988
8989impl DeleteProcessorMetadata {
8990    pub fn new() -> Self {
8991        std::default::Default::default()
8992    }
8993
8994    /// Sets the value of [common_metadata][crate::model::DeleteProcessorMetadata::common_metadata].
8995    pub fn set_common_metadata<T>(mut self, v: T) -> Self
8996    where
8997        T: std::convert::Into<crate::model::CommonOperationMetadata>,
8998    {
8999        self.common_metadata = std::option::Option::Some(v.into());
9000        self
9001    }
9002
9003    /// Sets or clears the value of [common_metadata][crate::model::DeleteProcessorMetadata::common_metadata].
9004    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9005    where
9006        T: std::convert::Into<crate::model::CommonOperationMetadata>,
9007    {
9008        self.common_metadata = v.map(|x| x.into());
9009        self
9010    }
9011}
9012
9013impl wkt::message::Message for DeleteProcessorMetadata {
9014    fn typename() -> &'static str {
9015        "type.googleapis.com/google.cloud.documentai.v1.DeleteProcessorMetadata"
9016    }
9017}
9018
9019/// Request message for the
9020/// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]
9021/// method.
9022///
9023/// [google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]: crate::client::DocumentProcessorService::enable_processor
9024#[derive(Clone, Default, PartialEq)]
9025#[non_exhaustive]
9026pub struct EnableProcessorRequest {
9027    /// Required. The processor resource name to be enabled.
9028    pub name: std::string::String,
9029
9030    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9031}
9032
9033impl EnableProcessorRequest {
9034    pub fn new() -> Self {
9035        std::default::Default::default()
9036    }
9037
9038    /// Sets the value of [name][crate::model::EnableProcessorRequest::name].
9039    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9040        self.name = v.into();
9041        self
9042    }
9043}
9044
9045impl wkt::message::Message for EnableProcessorRequest {
9046    fn typename() -> &'static str {
9047        "type.googleapis.com/google.cloud.documentai.v1.EnableProcessorRequest"
9048    }
9049}
9050
9051/// Response message for the
9052/// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]
9053/// method. Intentionally empty proto for adding fields in future.
9054///
9055/// [google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]: crate::client::DocumentProcessorService::enable_processor
9056#[derive(Clone, Default, PartialEq)]
9057#[non_exhaustive]
9058pub struct EnableProcessorResponse {
9059    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9060}
9061
9062impl EnableProcessorResponse {
9063    pub fn new() -> Self {
9064        std::default::Default::default()
9065    }
9066}
9067
9068impl wkt::message::Message for EnableProcessorResponse {
9069    fn typename() -> &'static str {
9070        "type.googleapis.com/google.cloud.documentai.v1.EnableProcessorResponse"
9071    }
9072}
9073
9074/// The long-running operation metadata for the
9075/// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]
9076/// method.
9077///
9078/// [google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]: crate::client::DocumentProcessorService::enable_processor
9079#[derive(Clone, Default, PartialEq)]
9080#[non_exhaustive]
9081pub struct EnableProcessorMetadata {
9082    /// The basic metadata of the long-running operation.
9083    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
9084
9085    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9086}
9087
9088impl EnableProcessorMetadata {
9089    pub fn new() -> Self {
9090        std::default::Default::default()
9091    }
9092
9093    /// Sets the value of [common_metadata][crate::model::EnableProcessorMetadata::common_metadata].
9094    pub fn set_common_metadata<T>(mut self, v: T) -> Self
9095    where
9096        T: std::convert::Into<crate::model::CommonOperationMetadata>,
9097    {
9098        self.common_metadata = std::option::Option::Some(v.into());
9099        self
9100    }
9101
9102    /// Sets or clears the value of [common_metadata][crate::model::EnableProcessorMetadata::common_metadata].
9103    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9104    where
9105        T: std::convert::Into<crate::model::CommonOperationMetadata>,
9106    {
9107        self.common_metadata = v.map(|x| x.into());
9108        self
9109    }
9110}
9111
9112impl wkt::message::Message for EnableProcessorMetadata {
9113    fn typename() -> &'static str {
9114        "type.googleapis.com/google.cloud.documentai.v1.EnableProcessorMetadata"
9115    }
9116}
9117
9118/// Request message for the
9119/// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
9120/// method.
9121///
9122/// [google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]: crate::client::DocumentProcessorService::disable_processor
9123#[derive(Clone, Default, PartialEq)]
9124#[non_exhaustive]
9125pub struct DisableProcessorRequest {
9126    /// Required. The processor resource name to be disabled.
9127    pub name: std::string::String,
9128
9129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9130}
9131
9132impl DisableProcessorRequest {
9133    pub fn new() -> Self {
9134        std::default::Default::default()
9135    }
9136
9137    /// Sets the value of [name][crate::model::DisableProcessorRequest::name].
9138    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9139        self.name = v.into();
9140        self
9141    }
9142}
9143
9144impl wkt::message::Message for DisableProcessorRequest {
9145    fn typename() -> &'static str {
9146        "type.googleapis.com/google.cloud.documentai.v1.DisableProcessorRequest"
9147    }
9148}
9149
9150/// Response message for the
9151/// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
9152/// method. Intentionally empty proto for adding fields in future.
9153///
9154/// [google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]: crate::client::DocumentProcessorService::disable_processor
9155#[derive(Clone, Default, PartialEq)]
9156#[non_exhaustive]
9157pub struct DisableProcessorResponse {
9158    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9159}
9160
9161impl DisableProcessorResponse {
9162    pub fn new() -> Self {
9163        std::default::Default::default()
9164    }
9165}
9166
9167impl wkt::message::Message for DisableProcessorResponse {
9168    fn typename() -> &'static str {
9169        "type.googleapis.com/google.cloud.documentai.v1.DisableProcessorResponse"
9170    }
9171}
9172
9173/// The long-running operation metadata for the
9174/// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
9175/// method.
9176///
9177/// [google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]: crate::client::DocumentProcessorService::disable_processor
9178#[derive(Clone, Default, PartialEq)]
9179#[non_exhaustive]
9180pub struct DisableProcessorMetadata {
9181    /// The basic metadata of the long-running operation.
9182    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
9183
9184    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9185}
9186
9187impl DisableProcessorMetadata {
9188    pub fn new() -> Self {
9189        std::default::Default::default()
9190    }
9191
9192    /// Sets the value of [common_metadata][crate::model::DisableProcessorMetadata::common_metadata].
9193    pub fn set_common_metadata<T>(mut self, v: T) -> Self
9194    where
9195        T: std::convert::Into<crate::model::CommonOperationMetadata>,
9196    {
9197        self.common_metadata = std::option::Option::Some(v.into());
9198        self
9199    }
9200
9201    /// Sets or clears the value of [common_metadata][crate::model::DisableProcessorMetadata::common_metadata].
9202    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9203    where
9204        T: std::convert::Into<crate::model::CommonOperationMetadata>,
9205    {
9206        self.common_metadata = v.map(|x| x.into());
9207        self
9208    }
9209}
9210
9211impl wkt::message::Message for DisableProcessorMetadata {
9212    fn typename() -> &'static str {
9213        "type.googleapis.com/google.cloud.documentai.v1.DisableProcessorMetadata"
9214    }
9215}
9216
9217/// Request message for the
9218/// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]
9219/// method.
9220///
9221/// [google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]: crate::client::DocumentProcessorService::set_default_processor_version
9222#[derive(Clone, Default, PartialEq)]
9223#[non_exhaustive]
9224pub struct SetDefaultProcessorVersionRequest {
9225    /// Required. The resource name of the
9226    /// [Processor][google.cloud.documentai.v1.Processor] to change default
9227    /// version.
9228    ///
9229    /// [google.cloud.documentai.v1.Processor]: crate::model::Processor
9230    pub processor: std::string::String,
9231
9232    /// Required. The resource name of child
9233    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as
9234    /// default. Format:
9235    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
9236    ///
9237    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
9238    pub default_processor_version: std::string::String,
9239
9240    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9241}
9242
9243impl SetDefaultProcessorVersionRequest {
9244    pub fn new() -> Self {
9245        std::default::Default::default()
9246    }
9247
9248    /// Sets the value of [processor][crate::model::SetDefaultProcessorVersionRequest::processor].
9249    pub fn set_processor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9250        self.processor = v.into();
9251        self
9252    }
9253
9254    /// Sets the value of [default_processor_version][crate::model::SetDefaultProcessorVersionRequest::default_processor_version].
9255    pub fn set_default_processor_version<T: std::convert::Into<std::string::String>>(
9256        mut self,
9257        v: T,
9258    ) -> Self {
9259        self.default_processor_version = v.into();
9260        self
9261    }
9262}
9263
9264impl wkt::message::Message for SetDefaultProcessorVersionRequest {
9265    fn typename() -> &'static str {
9266        "type.googleapis.com/google.cloud.documentai.v1.SetDefaultProcessorVersionRequest"
9267    }
9268}
9269
9270/// Response message for the
9271/// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]
9272/// method.
9273///
9274/// [google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]: crate::client::DocumentProcessorService::set_default_processor_version
9275#[derive(Clone, Default, PartialEq)]
9276#[non_exhaustive]
9277pub struct SetDefaultProcessorVersionResponse {
9278    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9279}
9280
9281impl SetDefaultProcessorVersionResponse {
9282    pub fn new() -> Self {
9283        std::default::Default::default()
9284    }
9285}
9286
9287impl wkt::message::Message for SetDefaultProcessorVersionResponse {
9288    fn typename() -> &'static str {
9289        "type.googleapis.com/google.cloud.documentai.v1.SetDefaultProcessorVersionResponse"
9290    }
9291}
9292
9293/// The long-running operation metadata for the
9294/// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]
9295/// method.
9296///
9297/// [google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]: crate::client::DocumentProcessorService::set_default_processor_version
9298#[derive(Clone, Default, PartialEq)]
9299#[non_exhaustive]
9300pub struct SetDefaultProcessorVersionMetadata {
9301    /// The basic metadata of the long-running operation.
9302    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
9303
9304    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9305}
9306
9307impl SetDefaultProcessorVersionMetadata {
9308    pub fn new() -> Self {
9309        std::default::Default::default()
9310    }
9311
9312    /// Sets the value of [common_metadata][crate::model::SetDefaultProcessorVersionMetadata::common_metadata].
9313    pub fn set_common_metadata<T>(mut self, v: T) -> Self
9314    where
9315        T: std::convert::Into<crate::model::CommonOperationMetadata>,
9316    {
9317        self.common_metadata = std::option::Option::Some(v.into());
9318        self
9319    }
9320
9321    /// Sets or clears the value of [common_metadata][crate::model::SetDefaultProcessorVersionMetadata::common_metadata].
9322    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9323    where
9324        T: std::convert::Into<crate::model::CommonOperationMetadata>,
9325    {
9326        self.common_metadata = v.map(|x| x.into());
9327        self
9328    }
9329}
9330
9331impl wkt::message::Message for SetDefaultProcessorVersionMetadata {
9332    fn typename() -> &'static str {
9333        "type.googleapis.com/google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata"
9334    }
9335}
9336
9337/// Request message for the
9338/// [TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion]
9339/// method.
9340///
9341/// [google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion]: crate::client::DocumentProcessorService::train_processor_version
9342#[derive(Clone, Default, PartialEq)]
9343#[non_exhaustive]
9344pub struct TrainProcessorVersionRequest {
9345    /// Required. The parent (project, location and processor) to create the new
9346    /// version for. Format:
9347    /// `projects/{project}/locations/{location}/processors/{processor}`.
9348    pub parent: std::string::String,
9349
9350    /// Required. The processor version to be created.
9351    pub processor_version: std::option::Option<crate::model::ProcessorVersion>,
9352
9353    /// Optional. The schema the processor version will be trained with.
9354    pub document_schema: std::option::Option<crate::model::DocumentSchema>,
9355
9356    /// Optional. The input data used to train the
9357    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
9358    ///
9359    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
9360    pub input_data: std::option::Option<crate::model::train_processor_version_request::InputData>,
9361
9362    /// Optional. The processor version to use as a base for training. This
9363    /// processor version must be a child of `parent`. Format:
9364    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
9365    pub base_processor_version: std::string::String,
9366
9367    pub processor_flags:
9368        std::option::Option<crate::model::train_processor_version_request::ProcessorFlags>,
9369
9370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9371}
9372
9373impl TrainProcessorVersionRequest {
9374    pub fn new() -> Self {
9375        std::default::Default::default()
9376    }
9377
9378    /// Sets the value of [parent][crate::model::TrainProcessorVersionRequest::parent].
9379    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9380        self.parent = v.into();
9381        self
9382    }
9383
9384    /// Sets the value of [processor_version][crate::model::TrainProcessorVersionRequest::processor_version].
9385    pub fn set_processor_version<T>(mut self, v: T) -> Self
9386    where
9387        T: std::convert::Into<crate::model::ProcessorVersion>,
9388    {
9389        self.processor_version = std::option::Option::Some(v.into());
9390        self
9391    }
9392
9393    /// Sets or clears the value of [processor_version][crate::model::TrainProcessorVersionRequest::processor_version].
9394    pub fn set_or_clear_processor_version<T>(mut self, v: std::option::Option<T>) -> Self
9395    where
9396        T: std::convert::Into<crate::model::ProcessorVersion>,
9397    {
9398        self.processor_version = v.map(|x| x.into());
9399        self
9400    }
9401
9402    /// Sets the value of [document_schema][crate::model::TrainProcessorVersionRequest::document_schema].
9403    pub fn set_document_schema<T>(mut self, v: T) -> Self
9404    where
9405        T: std::convert::Into<crate::model::DocumentSchema>,
9406    {
9407        self.document_schema = std::option::Option::Some(v.into());
9408        self
9409    }
9410
9411    /// Sets or clears the value of [document_schema][crate::model::TrainProcessorVersionRequest::document_schema].
9412    pub fn set_or_clear_document_schema<T>(mut self, v: std::option::Option<T>) -> Self
9413    where
9414        T: std::convert::Into<crate::model::DocumentSchema>,
9415    {
9416        self.document_schema = v.map(|x| x.into());
9417        self
9418    }
9419
9420    /// Sets the value of [input_data][crate::model::TrainProcessorVersionRequest::input_data].
9421    pub fn set_input_data<T>(mut self, v: T) -> Self
9422    where
9423        T: std::convert::Into<crate::model::train_processor_version_request::InputData>,
9424    {
9425        self.input_data = std::option::Option::Some(v.into());
9426        self
9427    }
9428
9429    /// Sets or clears the value of [input_data][crate::model::TrainProcessorVersionRequest::input_data].
9430    pub fn set_or_clear_input_data<T>(mut self, v: std::option::Option<T>) -> Self
9431    where
9432        T: std::convert::Into<crate::model::train_processor_version_request::InputData>,
9433    {
9434        self.input_data = v.map(|x| x.into());
9435        self
9436    }
9437
9438    /// Sets the value of [base_processor_version][crate::model::TrainProcessorVersionRequest::base_processor_version].
9439    pub fn set_base_processor_version<T: std::convert::Into<std::string::String>>(
9440        mut self,
9441        v: T,
9442    ) -> Self {
9443        self.base_processor_version = v.into();
9444        self
9445    }
9446
9447    /// Sets the value of [processor_flags][crate::model::TrainProcessorVersionRequest::processor_flags].
9448    ///
9449    /// Note that all the setters affecting `processor_flags` are mutually
9450    /// exclusive.
9451    pub fn set_processor_flags<
9452        T: std::convert::Into<
9453                std::option::Option<crate::model::train_processor_version_request::ProcessorFlags>,
9454            >,
9455    >(
9456        mut self,
9457        v: T,
9458    ) -> Self {
9459        self.processor_flags = v.into();
9460        self
9461    }
9462
9463    /// The value of [processor_flags][crate::model::TrainProcessorVersionRequest::processor_flags]
9464    /// if it holds a `CustomDocumentExtractionOptions`, `None` if the field is not set or
9465    /// holds a different branch.
9466    pub fn custom_document_extraction_options(
9467        &self,
9468    ) -> std::option::Option<
9469        &std::boxed::Box<
9470            crate::model::train_processor_version_request::CustomDocumentExtractionOptions,
9471        >,
9472    > {
9473        #[allow(unreachable_patterns)]
9474        self.processor_flags.as_ref().and_then(|v| match v {
9475            crate::model::train_processor_version_request::ProcessorFlags::CustomDocumentExtractionOptions(v) => std::option::Option::Some(v),
9476            _ => std::option::Option::None,
9477        })
9478    }
9479
9480    /// Sets the value of [processor_flags][crate::model::TrainProcessorVersionRequest::processor_flags]
9481    /// to hold a `CustomDocumentExtractionOptions`.
9482    ///
9483    /// Note that all the setters affecting `processor_flags` are
9484    /// mutually exclusive.
9485    pub fn set_custom_document_extraction_options<
9486        T: std::convert::Into<
9487                std::boxed::Box<
9488                    crate::model::train_processor_version_request::CustomDocumentExtractionOptions,
9489                >,
9490            >,
9491    >(
9492        mut self,
9493        v: T,
9494    ) -> Self {
9495        self.processor_flags = std::option::Option::Some(
9496            crate::model::train_processor_version_request::ProcessorFlags::CustomDocumentExtractionOptions(
9497                v.into()
9498            )
9499        );
9500        self
9501    }
9502
9503    /// The value of [processor_flags][crate::model::TrainProcessorVersionRequest::processor_flags]
9504    /// if it holds a `FoundationModelTuningOptions`, `None` if the field is not set or
9505    /// holds a different branch.
9506    pub fn foundation_model_tuning_options(
9507        &self,
9508    ) -> std::option::Option<
9509        &std::boxed::Box<
9510            crate::model::train_processor_version_request::FoundationModelTuningOptions,
9511        >,
9512    > {
9513        #[allow(unreachable_patterns)]
9514        self.processor_flags.as_ref().and_then(|v| match v {
9515            crate::model::train_processor_version_request::ProcessorFlags::FoundationModelTuningOptions(v) => std::option::Option::Some(v),
9516            _ => std::option::Option::None,
9517        })
9518    }
9519
9520    /// Sets the value of [processor_flags][crate::model::TrainProcessorVersionRequest::processor_flags]
9521    /// to hold a `FoundationModelTuningOptions`.
9522    ///
9523    /// Note that all the setters affecting `processor_flags` are
9524    /// mutually exclusive.
9525    pub fn set_foundation_model_tuning_options<
9526        T: std::convert::Into<
9527                std::boxed::Box<
9528                    crate::model::train_processor_version_request::FoundationModelTuningOptions,
9529                >,
9530            >,
9531    >(
9532        mut self,
9533        v: T,
9534    ) -> Self {
9535        self.processor_flags = std::option::Option::Some(
9536            crate::model::train_processor_version_request::ProcessorFlags::FoundationModelTuningOptions(
9537                v.into()
9538            )
9539        );
9540        self
9541    }
9542}
9543
9544impl wkt::message::Message for TrainProcessorVersionRequest {
9545    fn typename() -> &'static str {
9546        "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionRequest"
9547    }
9548}
9549
9550/// Defines additional types related to [TrainProcessorVersionRequest].
9551pub mod train_processor_version_request {
9552    #[allow(unused_imports)]
9553    use super::*;
9554
9555    /// The input data used to train a new
9556    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
9557    ///
9558    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
9559    #[derive(Clone, Default, PartialEq)]
9560    #[non_exhaustive]
9561    pub struct InputData {
9562        /// The documents used for training the new version.
9563        pub training_documents: std::option::Option<crate::model::BatchDocumentsInputConfig>,
9564
9565        /// The documents used for testing the trained version.
9566        pub test_documents: std::option::Option<crate::model::BatchDocumentsInputConfig>,
9567
9568        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9569    }
9570
9571    impl InputData {
9572        pub fn new() -> Self {
9573            std::default::Default::default()
9574        }
9575
9576        /// Sets the value of [training_documents][crate::model::train_processor_version_request::InputData::training_documents].
9577        pub fn set_training_documents<T>(mut self, v: T) -> Self
9578        where
9579            T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
9580        {
9581            self.training_documents = std::option::Option::Some(v.into());
9582            self
9583        }
9584
9585        /// Sets or clears the value of [training_documents][crate::model::train_processor_version_request::InputData::training_documents].
9586        pub fn set_or_clear_training_documents<T>(mut self, v: std::option::Option<T>) -> Self
9587        where
9588            T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
9589        {
9590            self.training_documents = v.map(|x| x.into());
9591            self
9592        }
9593
9594        /// Sets the value of [test_documents][crate::model::train_processor_version_request::InputData::test_documents].
9595        pub fn set_test_documents<T>(mut self, v: T) -> Self
9596        where
9597            T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
9598        {
9599            self.test_documents = std::option::Option::Some(v.into());
9600            self
9601        }
9602
9603        /// Sets or clears the value of [test_documents][crate::model::train_processor_version_request::InputData::test_documents].
9604        pub fn set_or_clear_test_documents<T>(mut self, v: std::option::Option<T>) -> Self
9605        where
9606            T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
9607        {
9608            self.test_documents = v.map(|x| x.into());
9609            self
9610        }
9611    }
9612
9613    impl wkt::message::Message for InputData {
9614        fn typename() -> &'static str {
9615            "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData"
9616        }
9617    }
9618
9619    /// Options to control the training of the Custom Document Extraction (CDE)
9620    /// Processor.
9621    #[derive(Clone, Default, PartialEq)]
9622    #[non_exhaustive]
9623    pub struct CustomDocumentExtractionOptions {
9624
9625        /// Optional. Training method to use for CDE training.
9626        pub training_method: crate::model::train_processor_version_request::custom_document_extraction_options::TrainingMethod,
9627
9628        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9629    }
9630
9631    impl CustomDocumentExtractionOptions {
9632        pub fn new() -> Self {
9633            std::default::Default::default()
9634        }
9635
9636        /// Sets the value of [training_method][crate::model::train_processor_version_request::CustomDocumentExtractionOptions::training_method].
9637        pub fn set_training_method<T: std::convert::Into<crate::model::train_processor_version_request::custom_document_extraction_options::TrainingMethod>>(mut self, v: T) -> Self{
9638            self.training_method = v.into();
9639            self
9640        }
9641    }
9642
9643    impl wkt::message::Message for CustomDocumentExtractionOptions {
9644        fn typename() -> &'static str {
9645            "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions"
9646        }
9647    }
9648
9649    /// Defines additional types related to [CustomDocumentExtractionOptions].
9650    pub mod custom_document_extraction_options {
9651        #[allow(unused_imports)]
9652        use super::*;
9653
9654        /// Training Method for CDE. `TRAINING_METHOD_UNSPECIFIED` will fall back to
9655        /// `MODEL_BASED`.
9656        ///
9657        /// # Working with unknown values
9658        ///
9659        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9660        /// additional enum variants at any time. Adding new variants is not considered
9661        /// a breaking change. Applications should write their code in anticipation of:
9662        ///
9663        /// - New values appearing in future releases of the client library, **and**
9664        /// - New values received dynamically, without application changes.
9665        ///
9666        /// Please consult the [Working with enums] section in the user guide for some
9667        /// guidelines.
9668        ///
9669        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9670        #[derive(Clone, Debug, PartialEq)]
9671        #[non_exhaustive]
9672        pub enum TrainingMethod {
9673            Unspecified,
9674            ModelBased,
9675            TemplateBased,
9676            /// If set, the enum was initialized with an unknown value.
9677            ///
9678            /// Applications can examine the value using [TrainingMethod::value] or
9679            /// [TrainingMethod::name].
9680            UnknownValue(training_method::UnknownValue),
9681        }
9682
9683        #[doc(hidden)]
9684        pub mod training_method {
9685            #[allow(unused_imports)]
9686            use super::*;
9687            #[derive(Clone, Debug, PartialEq)]
9688            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9689        }
9690
9691        impl TrainingMethod {
9692            /// Gets the enum value.
9693            ///
9694            /// Returns `None` if the enum contains an unknown value deserialized from
9695            /// the string representation of enums.
9696            pub fn value(&self) -> std::option::Option<i32> {
9697                match self {
9698                    Self::Unspecified => std::option::Option::Some(0),
9699                    Self::ModelBased => std::option::Option::Some(1),
9700                    Self::TemplateBased => std::option::Option::Some(2),
9701                    Self::UnknownValue(u) => u.0.value(),
9702                }
9703            }
9704
9705            /// Gets the enum value as a string.
9706            ///
9707            /// Returns `None` if the enum contains an unknown value deserialized from
9708            /// the integer representation of enums.
9709            pub fn name(&self) -> std::option::Option<&str> {
9710                match self {
9711                    Self::Unspecified => std::option::Option::Some("TRAINING_METHOD_UNSPECIFIED"),
9712                    Self::ModelBased => std::option::Option::Some("MODEL_BASED"),
9713                    Self::TemplateBased => std::option::Option::Some("TEMPLATE_BASED"),
9714                    Self::UnknownValue(u) => u.0.name(),
9715                }
9716            }
9717        }
9718
9719        impl std::default::Default for TrainingMethod {
9720            fn default() -> Self {
9721                use std::convert::From;
9722                Self::from(0)
9723            }
9724        }
9725
9726        impl std::fmt::Display for TrainingMethod {
9727            fn fmt(
9728                &self,
9729                f: &mut std::fmt::Formatter<'_>,
9730            ) -> std::result::Result<(), std::fmt::Error> {
9731                wkt::internal::display_enum(f, self.name(), self.value())
9732            }
9733        }
9734
9735        impl std::convert::From<i32> for TrainingMethod {
9736            fn from(value: i32) -> Self {
9737                match value {
9738                    0 => Self::Unspecified,
9739                    1 => Self::ModelBased,
9740                    2 => Self::TemplateBased,
9741                    _ => Self::UnknownValue(training_method::UnknownValue(
9742                        wkt::internal::UnknownEnumValue::Integer(value),
9743                    )),
9744                }
9745            }
9746        }
9747
9748        impl std::convert::From<&str> for TrainingMethod {
9749            fn from(value: &str) -> Self {
9750                use std::string::ToString;
9751                match value {
9752                    "TRAINING_METHOD_UNSPECIFIED" => Self::Unspecified,
9753                    "MODEL_BASED" => Self::ModelBased,
9754                    "TEMPLATE_BASED" => Self::TemplateBased,
9755                    _ => Self::UnknownValue(training_method::UnknownValue(
9756                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9757                    )),
9758                }
9759            }
9760        }
9761
9762        impl serde::ser::Serialize for TrainingMethod {
9763            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9764            where
9765                S: serde::Serializer,
9766            {
9767                match self {
9768                    Self::Unspecified => serializer.serialize_i32(0),
9769                    Self::ModelBased => serializer.serialize_i32(1),
9770                    Self::TemplateBased => serializer.serialize_i32(2),
9771                    Self::UnknownValue(u) => u.0.serialize(serializer),
9772                }
9773            }
9774        }
9775
9776        impl<'de> serde::de::Deserialize<'de> for TrainingMethod {
9777            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9778            where
9779                D: serde::Deserializer<'de>,
9780            {
9781                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TrainingMethod>::new(
9782                    ".google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod"))
9783            }
9784        }
9785    }
9786
9787    /// Options to control foundation model tuning of the processor.
9788    #[derive(Clone, Default, PartialEq)]
9789    #[non_exhaustive]
9790    pub struct FoundationModelTuningOptions {
9791        /// Optional. The number of steps to run for model tuning. Valid values are
9792        /// between 1 and 400. If not provided, recommended steps will be used.
9793        pub train_steps: i32,
9794
9795        /// Optional. The multiplier to apply to the recommended learning rate. Valid
9796        /// values are between 0.1 and 10. If not provided, recommended learning rate
9797        /// will be used.
9798        pub learning_rate_multiplier: f32,
9799
9800        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9801    }
9802
9803    impl FoundationModelTuningOptions {
9804        pub fn new() -> Self {
9805            std::default::Default::default()
9806        }
9807
9808        /// Sets the value of [train_steps][crate::model::train_processor_version_request::FoundationModelTuningOptions::train_steps].
9809        pub fn set_train_steps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9810            self.train_steps = v.into();
9811            self
9812        }
9813
9814        /// Sets the value of [learning_rate_multiplier][crate::model::train_processor_version_request::FoundationModelTuningOptions::learning_rate_multiplier].
9815        pub fn set_learning_rate_multiplier<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
9816            self.learning_rate_multiplier = v.into();
9817            self
9818        }
9819    }
9820
9821    impl wkt::message::Message for FoundationModelTuningOptions {
9822        fn typename() -> &'static str {
9823            "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions"
9824        }
9825    }
9826
9827    #[derive(Clone, Debug, PartialEq)]
9828    #[non_exhaustive]
9829    pub enum ProcessorFlags {
9830        /// Options to control Custom Document Extraction (CDE) Processor.
9831        CustomDocumentExtractionOptions(
9832            std::boxed::Box<
9833                crate::model::train_processor_version_request::CustomDocumentExtractionOptions,
9834            >,
9835        ),
9836        /// Options to control foundation model tuning of a processor.
9837        FoundationModelTuningOptions(
9838            std::boxed::Box<
9839                crate::model::train_processor_version_request::FoundationModelTuningOptions,
9840            >,
9841        ),
9842    }
9843}
9844
9845/// The response for
9846/// [TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion].
9847///
9848/// [google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion]: crate::client::DocumentProcessorService::train_processor_version
9849#[derive(Clone, Default, PartialEq)]
9850#[non_exhaustive]
9851pub struct TrainProcessorVersionResponse {
9852    /// The resource name of the processor version produced by training.
9853    pub processor_version: std::string::String,
9854
9855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9856}
9857
9858impl TrainProcessorVersionResponse {
9859    pub fn new() -> Self {
9860        std::default::Default::default()
9861    }
9862
9863    /// Sets the value of [processor_version][crate::model::TrainProcessorVersionResponse::processor_version].
9864    pub fn set_processor_version<T: std::convert::Into<std::string::String>>(
9865        mut self,
9866        v: T,
9867    ) -> Self {
9868        self.processor_version = v.into();
9869        self
9870    }
9871}
9872
9873impl wkt::message::Message for TrainProcessorVersionResponse {
9874    fn typename() -> &'static str {
9875        "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionResponse"
9876    }
9877}
9878
9879/// The metadata that represents a processor version being created.
9880#[derive(Clone, Default, PartialEq)]
9881#[non_exhaustive]
9882pub struct TrainProcessorVersionMetadata {
9883    /// The basic metadata of the long-running operation.
9884    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
9885
9886    /// The training dataset validation information.
9887    pub training_dataset_validation:
9888        std::option::Option<crate::model::train_processor_version_metadata::DatasetValidation>,
9889
9890    /// The test dataset validation information.
9891    pub test_dataset_validation:
9892        std::option::Option<crate::model::train_processor_version_metadata::DatasetValidation>,
9893
9894    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9895}
9896
9897impl TrainProcessorVersionMetadata {
9898    pub fn new() -> Self {
9899        std::default::Default::default()
9900    }
9901
9902    /// Sets the value of [common_metadata][crate::model::TrainProcessorVersionMetadata::common_metadata].
9903    pub fn set_common_metadata<T>(mut self, v: T) -> Self
9904    where
9905        T: std::convert::Into<crate::model::CommonOperationMetadata>,
9906    {
9907        self.common_metadata = std::option::Option::Some(v.into());
9908        self
9909    }
9910
9911    /// Sets or clears the value of [common_metadata][crate::model::TrainProcessorVersionMetadata::common_metadata].
9912    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9913    where
9914        T: std::convert::Into<crate::model::CommonOperationMetadata>,
9915    {
9916        self.common_metadata = v.map(|x| x.into());
9917        self
9918    }
9919
9920    /// Sets the value of [training_dataset_validation][crate::model::TrainProcessorVersionMetadata::training_dataset_validation].
9921    pub fn set_training_dataset_validation<T>(mut self, v: T) -> Self
9922    where
9923        T: std::convert::Into<crate::model::train_processor_version_metadata::DatasetValidation>,
9924    {
9925        self.training_dataset_validation = std::option::Option::Some(v.into());
9926        self
9927    }
9928
9929    /// Sets or clears the value of [training_dataset_validation][crate::model::TrainProcessorVersionMetadata::training_dataset_validation].
9930    pub fn set_or_clear_training_dataset_validation<T>(mut self, v: std::option::Option<T>) -> Self
9931    where
9932        T: std::convert::Into<crate::model::train_processor_version_metadata::DatasetValidation>,
9933    {
9934        self.training_dataset_validation = v.map(|x| x.into());
9935        self
9936    }
9937
9938    /// Sets the value of [test_dataset_validation][crate::model::TrainProcessorVersionMetadata::test_dataset_validation].
9939    pub fn set_test_dataset_validation<T>(mut self, v: T) -> Self
9940    where
9941        T: std::convert::Into<crate::model::train_processor_version_metadata::DatasetValidation>,
9942    {
9943        self.test_dataset_validation = std::option::Option::Some(v.into());
9944        self
9945    }
9946
9947    /// Sets or clears the value of [test_dataset_validation][crate::model::TrainProcessorVersionMetadata::test_dataset_validation].
9948    pub fn set_or_clear_test_dataset_validation<T>(mut self, v: std::option::Option<T>) -> Self
9949    where
9950        T: std::convert::Into<crate::model::train_processor_version_metadata::DatasetValidation>,
9951    {
9952        self.test_dataset_validation = v.map(|x| x.into());
9953        self
9954    }
9955}
9956
9957impl wkt::message::Message for TrainProcessorVersionMetadata {
9958    fn typename() -> &'static str {
9959        "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionMetadata"
9960    }
9961}
9962
9963/// Defines additional types related to [TrainProcessorVersionMetadata].
9964pub mod train_processor_version_metadata {
9965    #[allow(unused_imports)]
9966    use super::*;
9967
9968    /// The dataset validation information.
9969    /// This includes any and all errors with documents and the dataset.
9970    #[derive(Clone, Default, PartialEq)]
9971    #[non_exhaustive]
9972    pub struct DatasetValidation {
9973        /// The total number of document errors.
9974        pub document_error_count: i32,
9975
9976        /// The total number of dataset errors.
9977        pub dataset_error_count: i32,
9978
9979        /// Error information pertaining to specific documents. A maximum of 10
9980        /// document errors will be returned.
9981        /// Any document with errors will not be used throughout training.
9982        pub document_errors: std::vec::Vec<rpc::model::Status>,
9983
9984        /// Error information for the dataset as a whole. A maximum of 10 dataset
9985        /// errors will be returned.
9986        /// A single dataset error is terminal for training.
9987        pub dataset_errors: std::vec::Vec<rpc::model::Status>,
9988
9989        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9990    }
9991
9992    impl DatasetValidation {
9993        pub fn new() -> Self {
9994            std::default::Default::default()
9995        }
9996
9997        /// Sets the value of [document_error_count][crate::model::train_processor_version_metadata::DatasetValidation::document_error_count].
9998        pub fn set_document_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9999            self.document_error_count = v.into();
10000            self
10001        }
10002
10003        /// Sets the value of [dataset_error_count][crate::model::train_processor_version_metadata::DatasetValidation::dataset_error_count].
10004        pub fn set_dataset_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10005            self.dataset_error_count = v.into();
10006            self
10007        }
10008
10009        /// Sets the value of [document_errors][crate::model::train_processor_version_metadata::DatasetValidation::document_errors].
10010        pub fn set_document_errors<T, V>(mut self, v: T) -> Self
10011        where
10012            T: std::iter::IntoIterator<Item = V>,
10013            V: std::convert::Into<rpc::model::Status>,
10014        {
10015            use std::iter::Iterator;
10016            self.document_errors = v.into_iter().map(|i| i.into()).collect();
10017            self
10018        }
10019
10020        /// Sets the value of [dataset_errors][crate::model::train_processor_version_metadata::DatasetValidation::dataset_errors].
10021        pub fn set_dataset_errors<T, V>(mut self, v: T) -> Self
10022        where
10023            T: std::iter::IntoIterator<Item = V>,
10024            V: std::convert::Into<rpc::model::Status>,
10025        {
10026            use std::iter::Iterator;
10027            self.dataset_errors = v.into_iter().map(|i| i.into()).collect();
10028            self
10029        }
10030    }
10031
10032    impl wkt::message::Message for DatasetValidation {
10033        fn typename() -> &'static str {
10034            "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation"
10035        }
10036    }
10037}
10038
10039/// Request message for the
10040/// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]
10041/// method.
10042///
10043/// [google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]: crate::client::DocumentProcessorService::review_document
10044#[derive(Clone, Default, PartialEq)]
10045#[non_exhaustive]
10046pub struct ReviewDocumentRequest {
10047    /// Required. The resource name of the
10048    /// [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the
10049    /// document will be reviewed with.
10050    pub human_review_config: std::string::String,
10051
10052    /// Whether the validation should be performed on the ad-hoc review request.
10053    pub enable_schema_validation: bool,
10054
10055    /// The priority of the human review task.
10056    pub priority: crate::model::review_document_request::Priority,
10057
10058    /// The document schema of the human review task.
10059    pub document_schema: std::option::Option<crate::model::DocumentSchema>,
10060
10061    /// The document payload.
10062    pub source: std::option::Option<crate::model::review_document_request::Source>,
10063
10064    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10065}
10066
10067impl ReviewDocumentRequest {
10068    pub fn new() -> Self {
10069        std::default::Default::default()
10070    }
10071
10072    /// Sets the value of [human_review_config][crate::model::ReviewDocumentRequest::human_review_config].
10073    pub fn set_human_review_config<T: std::convert::Into<std::string::String>>(
10074        mut self,
10075        v: T,
10076    ) -> Self {
10077        self.human_review_config = v.into();
10078        self
10079    }
10080
10081    /// Sets the value of [enable_schema_validation][crate::model::ReviewDocumentRequest::enable_schema_validation].
10082    pub fn set_enable_schema_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10083        self.enable_schema_validation = v.into();
10084        self
10085    }
10086
10087    /// Sets the value of [priority][crate::model::ReviewDocumentRequest::priority].
10088    pub fn set_priority<T: std::convert::Into<crate::model::review_document_request::Priority>>(
10089        mut self,
10090        v: T,
10091    ) -> Self {
10092        self.priority = v.into();
10093        self
10094    }
10095
10096    /// Sets the value of [document_schema][crate::model::ReviewDocumentRequest::document_schema].
10097    pub fn set_document_schema<T>(mut self, v: T) -> Self
10098    where
10099        T: std::convert::Into<crate::model::DocumentSchema>,
10100    {
10101        self.document_schema = std::option::Option::Some(v.into());
10102        self
10103    }
10104
10105    /// Sets or clears the value of [document_schema][crate::model::ReviewDocumentRequest::document_schema].
10106    pub fn set_or_clear_document_schema<T>(mut self, v: std::option::Option<T>) -> Self
10107    where
10108        T: std::convert::Into<crate::model::DocumentSchema>,
10109    {
10110        self.document_schema = v.map(|x| x.into());
10111        self
10112    }
10113
10114    /// Sets the value of [source][crate::model::ReviewDocumentRequest::source].
10115    ///
10116    /// Note that all the setters affecting `source` are mutually
10117    /// exclusive.
10118    pub fn set_source<
10119        T: std::convert::Into<std::option::Option<crate::model::review_document_request::Source>>,
10120    >(
10121        mut self,
10122        v: T,
10123    ) -> Self {
10124        self.source = v.into();
10125        self
10126    }
10127
10128    /// The value of [source][crate::model::ReviewDocumentRequest::source]
10129    /// if it holds a `InlineDocument`, `None` if the field is not set or
10130    /// holds a different branch.
10131    pub fn inline_document(&self) -> std::option::Option<&std::boxed::Box<crate::model::Document>> {
10132        #[allow(unreachable_patterns)]
10133        self.source.as_ref().and_then(|v| match v {
10134            crate::model::review_document_request::Source::InlineDocument(v) => {
10135                std::option::Option::Some(v)
10136            }
10137            _ => std::option::Option::None,
10138        })
10139    }
10140
10141    /// Sets the value of [source][crate::model::ReviewDocumentRequest::source]
10142    /// to hold a `InlineDocument`.
10143    ///
10144    /// Note that all the setters affecting `source` are
10145    /// mutually exclusive.
10146    pub fn set_inline_document<T: std::convert::Into<std::boxed::Box<crate::model::Document>>>(
10147        mut self,
10148        v: T,
10149    ) -> Self {
10150        self.source = std::option::Option::Some(
10151            crate::model::review_document_request::Source::InlineDocument(v.into()),
10152        );
10153        self
10154    }
10155}
10156
10157impl wkt::message::Message for ReviewDocumentRequest {
10158    fn typename() -> &'static str {
10159        "type.googleapis.com/google.cloud.documentai.v1.ReviewDocumentRequest"
10160    }
10161}
10162
10163/// Defines additional types related to [ReviewDocumentRequest].
10164pub mod review_document_request {
10165    #[allow(unused_imports)]
10166    use super::*;
10167
10168    /// The priority level of the human review task.
10169    ///
10170    /// # Working with unknown values
10171    ///
10172    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10173    /// additional enum variants at any time. Adding new variants is not considered
10174    /// a breaking change. Applications should write their code in anticipation of:
10175    ///
10176    /// - New values appearing in future releases of the client library, **and**
10177    /// - New values received dynamically, without application changes.
10178    ///
10179    /// Please consult the [Working with enums] section in the user guide for some
10180    /// guidelines.
10181    ///
10182    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10183    #[derive(Clone, Debug, PartialEq)]
10184    #[non_exhaustive]
10185    pub enum Priority {
10186        /// The default priority level.
10187        Default,
10188        /// The urgent priority level. The labeling manager should allocate labeler
10189        /// resource to the urgent task queue to respect this priority level.
10190        Urgent,
10191        /// If set, the enum was initialized with an unknown value.
10192        ///
10193        /// Applications can examine the value using [Priority::value] or
10194        /// [Priority::name].
10195        UnknownValue(priority::UnknownValue),
10196    }
10197
10198    #[doc(hidden)]
10199    pub mod priority {
10200        #[allow(unused_imports)]
10201        use super::*;
10202        #[derive(Clone, Debug, PartialEq)]
10203        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10204    }
10205
10206    impl Priority {
10207        /// Gets the enum value.
10208        ///
10209        /// Returns `None` if the enum contains an unknown value deserialized from
10210        /// the string representation of enums.
10211        pub fn value(&self) -> std::option::Option<i32> {
10212            match self {
10213                Self::Default => std::option::Option::Some(0),
10214                Self::Urgent => std::option::Option::Some(1),
10215                Self::UnknownValue(u) => u.0.value(),
10216            }
10217        }
10218
10219        /// Gets the enum value as a string.
10220        ///
10221        /// Returns `None` if the enum contains an unknown value deserialized from
10222        /// the integer representation of enums.
10223        pub fn name(&self) -> std::option::Option<&str> {
10224            match self {
10225                Self::Default => std::option::Option::Some("DEFAULT"),
10226                Self::Urgent => std::option::Option::Some("URGENT"),
10227                Self::UnknownValue(u) => u.0.name(),
10228            }
10229        }
10230    }
10231
10232    impl std::default::Default for Priority {
10233        fn default() -> Self {
10234            use std::convert::From;
10235            Self::from(0)
10236        }
10237    }
10238
10239    impl std::fmt::Display for Priority {
10240        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10241            wkt::internal::display_enum(f, self.name(), self.value())
10242        }
10243    }
10244
10245    impl std::convert::From<i32> for Priority {
10246        fn from(value: i32) -> Self {
10247            match value {
10248                0 => Self::Default,
10249                1 => Self::Urgent,
10250                _ => Self::UnknownValue(priority::UnknownValue(
10251                    wkt::internal::UnknownEnumValue::Integer(value),
10252                )),
10253            }
10254        }
10255    }
10256
10257    impl std::convert::From<&str> for Priority {
10258        fn from(value: &str) -> Self {
10259            use std::string::ToString;
10260            match value {
10261                "DEFAULT" => Self::Default,
10262                "URGENT" => Self::Urgent,
10263                _ => Self::UnknownValue(priority::UnknownValue(
10264                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10265                )),
10266            }
10267        }
10268    }
10269
10270    impl serde::ser::Serialize for Priority {
10271        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10272        where
10273            S: serde::Serializer,
10274        {
10275            match self {
10276                Self::Default => serializer.serialize_i32(0),
10277                Self::Urgent => serializer.serialize_i32(1),
10278                Self::UnknownValue(u) => u.0.serialize(serializer),
10279            }
10280        }
10281    }
10282
10283    impl<'de> serde::de::Deserialize<'de> for Priority {
10284        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10285        where
10286            D: serde::Deserializer<'de>,
10287        {
10288            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Priority>::new(
10289                ".google.cloud.documentai.v1.ReviewDocumentRequest.Priority",
10290            ))
10291        }
10292    }
10293
10294    /// The document payload.
10295    #[derive(Clone, Debug, PartialEq)]
10296    #[non_exhaustive]
10297    pub enum Source {
10298        /// An inline document proto.
10299        InlineDocument(std::boxed::Box<crate::model::Document>),
10300    }
10301}
10302
10303/// Response message for the
10304/// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]
10305/// method.
10306///
10307/// [google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]: crate::client::DocumentProcessorService::review_document
10308#[derive(Clone, Default, PartialEq)]
10309#[non_exhaustive]
10310pub struct ReviewDocumentResponse {
10311    /// The Cloud Storage uri for the human reviewed document if the review is
10312    /// succeeded.
10313    pub gcs_destination: std::string::String,
10314
10315    /// The state of the review operation.
10316    pub state: crate::model::review_document_response::State,
10317
10318    /// The reason why the review is rejected by reviewer.
10319    pub rejection_reason: std::string::String,
10320
10321    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10322}
10323
10324impl ReviewDocumentResponse {
10325    pub fn new() -> Self {
10326        std::default::Default::default()
10327    }
10328
10329    /// Sets the value of [gcs_destination][crate::model::ReviewDocumentResponse::gcs_destination].
10330    pub fn set_gcs_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10331        self.gcs_destination = v.into();
10332        self
10333    }
10334
10335    /// Sets the value of [state][crate::model::ReviewDocumentResponse::state].
10336    pub fn set_state<T: std::convert::Into<crate::model::review_document_response::State>>(
10337        mut self,
10338        v: T,
10339    ) -> Self {
10340        self.state = v.into();
10341        self
10342    }
10343
10344    /// Sets the value of [rejection_reason][crate::model::ReviewDocumentResponse::rejection_reason].
10345    pub fn set_rejection_reason<T: std::convert::Into<std::string::String>>(
10346        mut self,
10347        v: T,
10348    ) -> Self {
10349        self.rejection_reason = v.into();
10350        self
10351    }
10352}
10353
10354impl wkt::message::Message for ReviewDocumentResponse {
10355    fn typename() -> &'static str {
10356        "type.googleapis.com/google.cloud.documentai.v1.ReviewDocumentResponse"
10357    }
10358}
10359
10360/// Defines additional types related to [ReviewDocumentResponse].
10361pub mod review_document_response {
10362    #[allow(unused_imports)]
10363    use super::*;
10364
10365    /// Possible states of the review operation.
10366    ///
10367    /// # Working with unknown values
10368    ///
10369    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10370    /// additional enum variants at any time. Adding new variants is not considered
10371    /// a breaking change. Applications should write their code in anticipation of:
10372    ///
10373    /// - New values appearing in future releases of the client library, **and**
10374    /// - New values received dynamically, without application changes.
10375    ///
10376    /// Please consult the [Working with enums] section in the user guide for some
10377    /// guidelines.
10378    ///
10379    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10380    #[derive(Clone, Debug, PartialEq)]
10381    #[non_exhaustive]
10382    pub enum State {
10383        /// The default value. This value is used if the state is omitted.
10384        Unspecified,
10385        /// The review operation is rejected by the reviewer.
10386        Rejected,
10387        /// The review operation is succeeded.
10388        Succeeded,
10389        /// If set, the enum was initialized with an unknown value.
10390        ///
10391        /// Applications can examine the value using [State::value] or
10392        /// [State::name].
10393        UnknownValue(state::UnknownValue),
10394    }
10395
10396    #[doc(hidden)]
10397    pub mod state {
10398        #[allow(unused_imports)]
10399        use super::*;
10400        #[derive(Clone, Debug, PartialEq)]
10401        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10402    }
10403
10404    impl State {
10405        /// Gets the enum value.
10406        ///
10407        /// Returns `None` if the enum contains an unknown value deserialized from
10408        /// the string representation of enums.
10409        pub fn value(&self) -> std::option::Option<i32> {
10410            match self {
10411                Self::Unspecified => std::option::Option::Some(0),
10412                Self::Rejected => std::option::Option::Some(1),
10413                Self::Succeeded => std::option::Option::Some(2),
10414                Self::UnknownValue(u) => u.0.value(),
10415            }
10416        }
10417
10418        /// Gets the enum value as a string.
10419        ///
10420        /// Returns `None` if the enum contains an unknown value deserialized from
10421        /// the integer representation of enums.
10422        pub fn name(&self) -> std::option::Option<&str> {
10423            match self {
10424                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10425                Self::Rejected => std::option::Option::Some("REJECTED"),
10426                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10427                Self::UnknownValue(u) => u.0.name(),
10428            }
10429        }
10430    }
10431
10432    impl std::default::Default for State {
10433        fn default() -> Self {
10434            use std::convert::From;
10435            Self::from(0)
10436        }
10437    }
10438
10439    impl std::fmt::Display for State {
10440        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10441            wkt::internal::display_enum(f, self.name(), self.value())
10442        }
10443    }
10444
10445    impl std::convert::From<i32> for State {
10446        fn from(value: i32) -> Self {
10447            match value {
10448                0 => Self::Unspecified,
10449                1 => Self::Rejected,
10450                2 => Self::Succeeded,
10451                _ => Self::UnknownValue(state::UnknownValue(
10452                    wkt::internal::UnknownEnumValue::Integer(value),
10453                )),
10454            }
10455        }
10456    }
10457
10458    impl std::convert::From<&str> for State {
10459        fn from(value: &str) -> Self {
10460            use std::string::ToString;
10461            match value {
10462                "STATE_UNSPECIFIED" => Self::Unspecified,
10463                "REJECTED" => Self::Rejected,
10464                "SUCCEEDED" => Self::Succeeded,
10465                _ => Self::UnknownValue(state::UnknownValue(
10466                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10467                )),
10468            }
10469        }
10470    }
10471
10472    impl serde::ser::Serialize for State {
10473        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10474        where
10475            S: serde::Serializer,
10476        {
10477            match self {
10478                Self::Unspecified => serializer.serialize_i32(0),
10479                Self::Rejected => serializer.serialize_i32(1),
10480                Self::Succeeded => serializer.serialize_i32(2),
10481                Self::UnknownValue(u) => u.0.serialize(serializer),
10482            }
10483        }
10484    }
10485
10486    impl<'de> serde::de::Deserialize<'de> for State {
10487        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10488        where
10489            D: serde::Deserializer<'de>,
10490        {
10491            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10492                ".google.cloud.documentai.v1.ReviewDocumentResponse.State",
10493            ))
10494        }
10495    }
10496}
10497
10498/// The long-running operation metadata for the
10499/// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]
10500/// method.
10501///
10502/// [google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]: crate::client::DocumentProcessorService::review_document
10503#[derive(Clone, Default, PartialEq)]
10504#[non_exhaustive]
10505pub struct ReviewDocumentOperationMetadata {
10506    /// The basic metadata of the long-running operation.
10507    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
10508
10509    /// The Crowd Compute question ID.
10510    pub question_id: std::string::String,
10511
10512    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10513}
10514
10515impl ReviewDocumentOperationMetadata {
10516    pub fn new() -> Self {
10517        std::default::Default::default()
10518    }
10519
10520    /// Sets the value of [common_metadata][crate::model::ReviewDocumentOperationMetadata::common_metadata].
10521    pub fn set_common_metadata<T>(mut self, v: T) -> Self
10522    where
10523        T: std::convert::Into<crate::model::CommonOperationMetadata>,
10524    {
10525        self.common_metadata = std::option::Option::Some(v.into());
10526        self
10527    }
10528
10529    /// Sets or clears the value of [common_metadata][crate::model::ReviewDocumentOperationMetadata::common_metadata].
10530    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
10531    where
10532        T: std::convert::Into<crate::model::CommonOperationMetadata>,
10533    {
10534        self.common_metadata = v.map(|x| x.into());
10535        self
10536    }
10537
10538    /// Sets the value of [question_id][crate::model::ReviewDocumentOperationMetadata::question_id].
10539    pub fn set_question_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10540        self.question_id = v.into();
10541        self
10542    }
10543}
10544
10545impl wkt::message::Message for ReviewDocumentOperationMetadata {
10546    fn typename() -> &'static str {
10547        "type.googleapis.com/google.cloud.documentai.v1.ReviewDocumentOperationMetadata"
10548    }
10549}
10550
10551/// Evaluates the given
10552/// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] against the
10553/// supplied documents.
10554///
10555/// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
10556#[derive(Clone, Default, PartialEq)]
10557#[non_exhaustive]
10558pub struct EvaluateProcessorVersionRequest {
10559    /// Required. The resource name of the
10560    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
10561    /// evaluate.
10562    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
10563    ///
10564    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
10565    pub processor_version: std::string::String,
10566
10567    /// Optional. The documents used in the evaluation. If unspecified, use the
10568    /// processor's dataset as evaluation input.
10569    pub evaluation_documents: std::option::Option<crate::model::BatchDocumentsInputConfig>,
10570
10571    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10572}
10573
10574impl EvaluateProcessorVersionRequest {
10575    pub fn new() -> Self {
10576        std::default::Default::default()
10577    }
10578
10579    /// Sets the value of [processor_version][crate::model::EvaluateProcessorVersionRequest::processor_version].
10580    pub fn set_processor_version<T: std::convert::Into<std::string::String>>(
10581        mut self,
10582        v: T,
10583    ) -> Self {
10584        self.processor_version = v.into();
10585        self
10586    }
10587
10588    /// Sets the value of [evaluation_documents][crate::model::EvaluateProcessorVersionRequest::evaluation_documents].
10589    pub fn set_evaluation_documents<T>(mut self, v: T) -> Self
10590    where
10591        T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
10592    {
10593        self.evaluation_documents = std::option::Option::Some(v.into());
10594        self
10595    }
10596
10597    /// Sets or clears the value of [evaluation_documents][crate::model::EvaluateProcessorVersionRequest::evaluation_documents].
10598    pub fn set_or_clear_evaluation_documents<T>(mut self, v: std::option::Option<T>) -> Self
10599    where
10600        T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
10601    {
10602        self.evaluation_documents = v.map(|x| x.into());
10603        self
10604    }
10605}
10606
10607impl wkt::message::Message for EvaluateProcessorVersionRequest {
10608    fn typename() -> &'static str {
10609        "type.googleapis.com/google.cloud.documentai.v1.EvaluateProcessorVersionRequest"
10610    }
10611}
10612
10613/// Metadata of the
10614/// [EvaluateProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion]
10615/// method.
10616///
10617/// [google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion]: crate::client::DocumentProcessorService::evaluate_processor_version
10618#[derive(Clone, Default, PartialEq)]
10619#[non_exhaustive]
10620pub struct EvaluateProcessorVersionMetadata {
10621    /// The basic metadata of the long-running operation.
10622    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
10623
10624    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10625}
10626
10627impl EvaluateProcessorVersionMetadata {
10628    pub fn new() -> Self {
10629        std::default::Default::default()
10630    }
10631
10632    /// Sets the value of [common_metadata][crate::model::EvaluateProcessorVersionMetadata::common_metadata].
10633    pub fn set_common_metadata<T>(mut self, v: T) -> Self
10634    where
10635        T: std::convert::Into<crate::model::CommonOperationMetadata>,
10636    {
10637        self.common_metadata = std::option::Option::Some(v.into());
10638        self
10639    }
10640
10641    /// Sets or clears the value of [common_metadata][crate::model::EvaluateProcessorVersionMetadata::common_metadata].
10642    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
10643    where
10644        T: std::convert::Into<crate::model::CommonOperationMetadata>,
10645    {
10646        self.common_metadata = v.map(|x| x.into());
10647        self
10648    }
10649}
10650
10651impl wkt::message::Message for EvaluateProcessorVersionMetadata {
10652    fn typename() -> &'static str {
10653        "type.googleapis.com/google.cloud.documentai.v1.EvaluateProcessorVersionMetadata"
10654    }
10655}
10656
10657/// Response of the
10658/// [EvaluateProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion]
10659/// method.
10660///
10661/// [google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion]: crate::client::DocumentProcessorService::evaluate_processor_version
10662#[derive(Clone, Default, PartialEq)]
10663#[non_exhaustive]
10664pub struct EvaluateProcessorVersionResponse {
10665    /// The resource name of the created evaluation.
10666    pub evaluation: std::string::String,
10667
10668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10669}
10670
10671impl EvaluateProcessorVersionResponse {
10672    pub fn new() -> Self {
10673        std::default::Default::default()
10674    }
10675
10676    /// Sets the value of [evaluation][crate::model::EvaluateProcessorVersionResponse::evaluation].
10677    pub fn set_evaluation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10678        self.evaluation = v.into();
10679        self
10680    }
10681}
10682
10683impl wkt::message::Message for EvaluateProcessorVersionResponse {
10684    fn typename() -> &'static str {
10685        "type.googleapis.com/google.cloud.documentai.v1.EvaluateProcessorVersionResponse"
10686    }
10687}
10688
10689/// Retrieves a specific Evaluation.
10690#[derive(Clone, Default, PartialEq)]
10691#[non_exhaustive]
10692pub struct GetEvaluationRequest {
10693    /// Required. The resource name of the
10694    /// [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
10695    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
10696    ///
10697    /// [google.cloud.documentai.v1.Evaluation]: crate::model::Evaluation
10698    pub name: std::string::String,
10699
10700    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10701}
10702
10703impl GetEvaluationRequest {
10704    pub fn new() -> Self {
10705        std::default::Default::default()
10706    }
10707
10708    /// Sets the value of [name][crate::model::GetEvaluationRequest::name].
10709    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10710        self.name = v.into();
10711        self
10712    }
10713}
10714
10715impl wkt::message::Message for GetEvaluationRequest {
10716    fn typename() -> &'static str {
10717        "type.googleapis.com/google.cloud.documentai.v1.GetEvaluationRequest"
10718    }
10719}
10720
10721/// Retrieves a list of evaluations for a given
10722/// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
10723///
10724/// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
10725#[derive(Clone, Default, PartialEq)]
10726#[non_exhaustive]
10727pub struct ListEvaluationsRequest {
10728    /// Required. The resource name of the
10729    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
10730    /// evaluations for.
10731    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
10732    ///
10733    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
10734    pub parent: std::string::String,
10735
10736    /// The standard list page size.
10737    /// If unspecified, at most `5` evaluations are returned.
10738    /// The maximum value is `100`. Values above `100` are coerced to `100`.
10739    pub page_size: i32,
10740
10741    /// A page token, received from a previous `ListEvaluations` call.
10742    /// Provide this to retrieve the subsequent page.
10743    pub page_token: std::string::String,
10744
10745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10746}
10747
10748impl ListEvaluationsRequest {
10749    pub fn new() -> Self {
10750        std::default::Default::default()
10751    }
10752
10753    /// Sets the value of [parent][crate::model::ListEvaluationsRequest::parent].
10754    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10755        self.parent = v.into();
10756        self
10757    }
10758
10759    /// Sets the value of [page_size][crate::model::ListEvaluationsRequest::page_size].
10760    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10761        self.page_size = v.into();
10762        self
10763    }
10764
10765    /// Sets the value of [page_token][crate::model::ListEvaluationsRequest::page_token].
10766    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10767        self.page_token = v.into();
10768        self
10769    }
10770}
10771
10772impl wkt::message::Message for ListEvaluationsRequest {
10773    fn typename() -> &'static str {
10774        "type.googleapis.com/google.cloud.documentai.v1.ListEvaluationsRequest"
10775    }
10776}
10777
10778/// The response from `ListEvaluations`.
10779#[derive(Clone, Default, PartialEq)]
10780#[non_exhaustive]
10781pub struct ListEvaluationsResponse {
10782    /// The evaluations requested.
10783    pub evaluations: std::vec::Vec<crate::model::Evaluation>,
10784
10785    /// A token, which can be sent as `page_token` to retrieve the next page.
10786    /// If this field is omitted, there are no subsequent pages.
10787    pub next_page_token: std::string::String,
10788
10789    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10790}
10791
10792impl ListEvaluationsResponse {
10793    pub fn new() -> Self {
10794        std::default::Default::default()
10795    }
10796
10797    /// Sets the value of [evaluations][crate::model::ListEvaluationsResponse::evaluations].
10798    pub fn set_evaluations<T, V>(mut self, v: T) -> Self
10799    where
10800        T: std::iter::IntoIterator<Item = V>,
10801        V: std::convert::Into<crate::model::Evaluation>,
10802    {
10803        use std::iter::Iterator;
10804        self.evaluations = v.into_iter().map(|i| i.into()).collect();
10805        self
10806    }
10807
10808    /// Sets the value of [next_page_token][crate::model::ListEvaluationsResponse::next_page_token].
10809    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10810        self.next_page_token = v.into();
10811        self
10812    }
10813}
10814
10815impl wkt::message::Message for ListEvaluationsResponse {
10816    fn typename() -> &'static str {
10817        "type.googleapis.com/google.cloud.documentai.v1.ListEvaluationsResponse"
10818    }
10819}
10820
10821#[doc(hidden)]
10822impl gax::paginator::internal::PageableResponse for ListEvaluationsResponse {
10823    type PageItem = crate::model::Evaluation;
10824
10825    fn items(self) -> std::vec::Vec<Self::PageItem> {
10826        self.evaluations
10827    }
10828
10829    fn next_page_token(&self) -> std::string::String {
10830        use std::clone::Clone;
10831        self.next_page_token.clone()
10832    }
10833}
10834
10835/// The schema defines the output of the processed document by a processor.
10836#[derive(Clone, Default, PartialEq)]
10837#[non_exhaustive]
10838pub struct DocumentSchema {
10839    /// Display name to show to users.
10840    pub display_name: std::string::String,
10841
10842    /// Description of the schema.
10843    pub description: std::string::String,
10844
10845    /// Entity types of the schema.
10846    pub entity_types: std::vec::Vec<crate::model::document_schema::EntityType>,
10847
10848    /// Metadata of the schema.
10849    pub metadata: std::option::Option<crate::model::document_schema::Metadata>,
10850
10851    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10852}
10853
10854impl DocumentSchema {
10855    pub fn new() -> Self {
10856        std::default::Default::default()
10857    }
10858
10859    /// Sets the value of [display_name][crate::model::DocumentSchema::display_name].
10860    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10861        self.display_name = v.into();
10862        self
10863    }
10864
10865    /// Sets the value of [description][crate::model::DocumentSchema::description].
10866    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10867        self.description = v.into();
10868        self
10869    }
10870
10871    /// Sets the value of [entity_types][crate::model::DocumentSchema::entity_types].
10872    pub fn set_entity_types<T, V>(mut self, v: T) -> Self
10873    where
10874        T: std::iter::IntoIterator<Item = V>,
10875        V: std::convert::Into<crate::model::document_schema::EntityType>,
10876    {
10877        use std::iter::Iterator;
10878        self.entity_types = v.into_iter().map(|i| i.into()).collect();
10879        self
10880    }
10881
10882    /// Sets the value of [metadata][crate::model::DocumentSchema::metadata].
10883    pub fn set_metadata<T>(mut self, v: T) -> Self
10884    where
10885        T: std::convert::Into<crate::model::document_schema::Metadata>,
10886    {
10887        self.metadata = std::option::Option::Some(v.into());
10888        self
10889    }
10890
10891    /// Sets or clears the value of [metadata][crate::model::DocumentSchema::metadata].
10892    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
10893    where
10894        T: std::convert::Into<crate::model::document_schema::Metadata>,
10895    {
10896        self.metadata = v.map(|x| x.into());
10897        self
10898    }
10899}
10900
10901impl wkt::message::Message for DocumentSchema {
10902    fn typename() -> &'static str {
10903        "type.googleapis.com/google.cloud.documentai.v1.DocumentSchema"
10904    }
10905}
10906
10907/// Defines additional types related to [DocumentSchema].
10908pub mod document_schema {
10909    #[allow(unused_imports)]
10910    use super::*;
10911
10912    /// EntityType is the wrapper of a label of the corresponding model with
10913    /// detailed attributes and limitations for entity-based processors. Multiple
10914    /// types can also compose a dependency tree to represent nested types.
10915    #[derive(Clone, Default, PartialEq)]
10916    #[non_exhaustive]
10917    pub struct EntityType {
10918        /// User defined name for the type.
10919        pub display_name: std::string::String,
10920
10921        /// Name of the type. It must be unique within the schema file and
10922        /// cannot be a "Common Type".  The following naming conventions are used:
10923        ///
10924        /// - Use `snake_casing`.
10925        /// - Name matching is case-sensitive.
10926        /// - Maximum 64 characters.
10927        /// - Must start with a letter.
10928        /// - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
10929        ///   compatibility internal infrastructure and tooling can handle any ascii
10930        ///   character.)
10931        /// - The `/` is sometimes used to denote a property of a type.  For example
10932        ///   `line_item/amount`.  This convention is deprecated, but will still be
10933        ///   honored for backward compatibility.
10934        pub name: std::string::String,
10935
10936        /// The entity type that this type is derived from.  For now, one and only
10937        /// one should be set.
10938        pub base_types: std::vec::Vec<std::string::String>,
10939
10940        /// Description the nested structure, or composition of an entity.
10941        pub properties: std::vec::Vec<crate::model::document_schema::entity_type::Property>,
10942
10943        pub value_source:
10944            std::option::Option<crate::model::document_schema::entity_type::ValueSource>,
10945
10946        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10947    }
10948
10949    impl EntityType {
10950        pub fn new() -> Self {
10951            std::default::Default::default()
10952        }
10953
10954        /// Sets the value of [display_name][crate::model::document_schema::EntityType::display_name].
10955        pub fn set_display_name<T: std::convert::Into<std::string::String>>(
10956            mut self,
10957            v: T,
10958        ) -> Self {
10959            self.display_name = v.into();
10960            self
10961        }
10962
10963        /// Sets the value of [name][crate::model::document_schema::EntityType::name].
10964        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10965            self.name = v.into();
10966            self
10967        }
10968
10969        /// Sets the value of [base_types][crate::model::document_schema::EntityType::base_types].
10970        pub fn set_base_types<T, V>(mut self, v: T) -> Self
10971        where
10972            T: std::iter::IntoIterator<Item = V>,
10973            V: std::convert::Into<std::string::String>,
10974        {
10975            use std::iter::Iterator;
10976            self.base_types = v.into_iter().map(|i| i.into()).collect();
10977            self
10978        }
10979
10980        /// Sets the value of [properties][crate::model::document_schema::EntityType::properties].
10981        pub fn set_properties<T, V>(mut self, v: T) -> Self
10982        where
10983            T: std::iter::IntoIterator<Item = V>,
10984            V: std::convert::Into<crate::model::document_schema::entity_type::Property>,
10985        {
10986            use std::iter::Iterator;
10987            self.properties = v.into_iter().map(|i| i.into()).collect();
10988            self
10989        }
10990
10991        /// Sets the value of [value_source][crate::model::document_schema::EntityType::value_source].
10992        ///
10993        /// Note that all the setters affecting `value_source` are mutually
10994        /// exclusive.
10995        pub fn set_value_source<
10996            T: std::convert::Into<
10997                    std::option::Option<crate::model::document_schema::entity_type::ValueSource>,
10998                >,
10999        >(
11000            mut self,
11001            v: T,
11002        ) -> Self {
11003            self.value_source = v.into();
11004            self
11005        }
11006
11007        /// The value of [value_source][crate::model::document_schema::EntityType::value_source]
11008        /// if it holds a `EnumValues`, `None` if the field is not set or
11009        /// holds a different branch.
11010        pub fn enum_values(
11011            &self,
11012        ) -> std::option::Option<
11013            &std::boxed::Box<crate::model::document_schema::entity_type::EnumValues>,
11014        > {
11015            #[allow(unreachable_patterns)]
11016            self.value_source.as_ref().and_then(|v| match v {
11017                crate::model::document_schema::entity_type::ValueSource::EnumValues(v) => {
11018                    std::option::Option::Some(v)
11019                }
11020                _ => std::option::Option::None,
11021            })
11022        }
11023
11024        /// Sets the value of [value_source][crate::model::document_schema::EntityType::value_source]
11025        /// to hold a `EnumValues`.
11026        ///
11027        /// Note that all the setters affecting `value_source` are
11028        /// mutually exclusive.
11029        pub fn set_enum_values<
11030            T: std::convert::Into<
11031                    std::boxed::Box<crate::model::document_schema::entity_type::EnumValues>,
11032                >,
11033        >(
11034            mut self,
11035            v: T,
11036        ) -> Self {
11037            self.value_source = std::option::Option::Some(
11038                crate::model::document_schema::entity_type::ValueSource::EnumValues(v.into()),
11039            );
11040            self
11041        }
11042    }
11043
11044    impl wkt::message::Message for EntityType {
11045        fn typename() -> &'static str {
11046            "type.googleapis.com/google.cloud.documentai.v1.DocumentSchema.EntityType"
11047        }
11048    }
11049
11050    /// Defines additional types related to [EntityType].
11051    pub mod entity_type {
11052        #[allow(unused_imports)]
11053        use super::*;
11054
11055        /// Defines the a list of enum values.
11056        #[derive(Clone, Default, PartialEq)]
11057        #[non_exhaustive]
11058        pub struct EnumValues {
11059            /// The individual values that this enum values type can include.
11060            pub values: std::vec::Vec<std::string::String>,
11061
11062            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11063        }
11064
11065        impl EnumValues {
11066            pub fn new() -> Self {
11067                std::default::Default::default()
11068            }
11069
11070            /// Sets the value of [values][crate::model::document_schema::entity_type::EnumValues::values].
11071            pub fn set_values<T, V>(mut self, v: T) -> Self
11072            where
11073                T: std::iter::IntoIterator<Item = V>,
11074                V: std::convert::Into<std::string::String>,
11075            {
11076                use std::iter::Iterator;
11077                self.values = v.into_iter().map(|i| i.into()).collect();
11078                self
11079            }
11080        }
11081
11082        impl wkt::message::Message for EnumValues {
11083            fn typename() -> &'static str {
11084                "type.googleapis.com/google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues"
11085            }
11086        }
11087
11088        /// Defines properties that can be part of the entity type.
11089        #[derive(Clone, Default, PartialEq)]
11090        #[non_exhaustive]
11091        pub struct Property {
11092            /// The name of the property.  Follows the same guidelines as the
11093            /// EntityType name.
11094            pub name: std::string::String,
11095
11096            /// User defined name for the property.
11097            pub display_name: std::string::String,
11098
11099            /// A reference to the value type of the property.  This type is subject
11100            /// to the same conventions as the `Entity.base_types` field.
11101            pub value_type: std::string::String,
11102
11103            /// Occurrence type limits the number of instances an entity type appears
11104            /// in the document.
11105            pub occurrence_type:
11106                crate::model::document_schema::entity_type::property::OccurrenceType,
11107
11108            /// Specifies how the entity's value is obtained.
11109            pub method: crate::model::document_schema::entity_type::property::Method,
11110
11111            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11112        }
11113
11114        impl Property {
11115            pub fn new() -> Self {
11116                std::default::Default::default()
11117            }
11118
11119            /// Sets the value of [name][crate::model::document_schema::entity_type::Property::name].
11120            pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11121                self.name = v.into();
11122                self
11123            }
11124
11125            /// Sets the value of [display_name][crate::model::document_schema::entity_type::Property::display_name].
11126            pub fn set_display_name<T: std::convert::Into<std::string::String>>(
11127                mut self,
11128                v: T,
11129            ) -> Self {
11130                self.display_name = v.into();
11131                self
11132            }
11133
11134            /// Sets the value of [value_type][crate::model::document_schema::entity_type::Property::value_type].
11135            pub fn set_value_type<T: std::convert::Into<std::string::String>>(
11136                mut self,
11137                v: T,
11138            ) -> Self {
11139                self.value_type = v.into();
11140                self
11141            }
11142
11143            /// Sets the value of [occurrence_type][crate::model::document_schema::entity_type::Property::occurrence_type].
11144            pub fn set_occurrence_type<
11145                T: std::convert::Into<
11146                        crate::model::document_schema::entity_type::property::OccurrenceType,
11147                    >,
11148            >(
11149                mut self,
11150                v: T,
11151            ) -> Self {
11152                self.occurrence_type = v.into();
11153                self
11154            }
11155
11156            /// Sets the value of [method][crate::model::document_schema::entity_type::Property::method].
11157            pub fn set_method<
11158                T: std::convert::Into<crate::model::document_schema::entity_type::property::Method>,
11159            >(
11160                mut self,
11161                v: T,
11162            ) -> Self {
11163                self.method = v.into();
11164                self
11165            }
11166        }
11167
11168        impl wkt::message::Message for Property {
11169            fn typename() -> &'static str {
11170                "type.googleapis.com/google.cloud.documentai.v1.DocumentSchema.EntityType.Property"
11171            }
11172        }
11173
11174        /// Defines additional types related to [Property].
11175        pub mod property {
11176            #[allow(unused_imports)]
11177            use super::*;
11178
11179            /// Types of occurrences of the entity type in the document.  This
11180            /// represents the number of instances, not mentions, of an entity.
11181            /// For example, a bank statement might only have one
11182            /// `account_number`, but this account number can be mentioned in several
11183            /// places on the document.  In this case, the `account_number` is
11184            /// considered a `REQUIRED_ONCE` entity type. If, on the other hand, we
11185            /// expect a bank statement to contain the status of multiple different
11186            /// accounts for the customers, the occurrence type is set to
11187            /// `REQUIRED_MULTIPLE`.
11188            ///
11189            /// # Working with unknown values
11190            ///
11191            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11192            /// additional enum variants at any time. Adding new variants is not considered
11193            /// a breaking change. Applications should write their code in anticipation of:
11194            ///
11195            /// - New values appearing in future releases of the client library, **and**
11196            /// - New values received dynamically, without application changes.
11197            ///
11198            /// Please consult the [Working with enums] section in the user guide for some
11199            /// guidelines.
11200            ///
11201            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11202            #[derive(Clone, Debug, PartialEq)]
11203            #[non_exhaustive]
11204            pub enum OccurrenceType {
11205                /// Unspecified occurrence type.
11206                Unspecified,
11207                /// There will be zero or one instance of this entity type.  The same
11208                /// entity instance may be mentioned multiple times.
11209                OptionalOnce,
11210                /// The entity type will appear zero or multiple times.
11211                OptionalMultiple,
11212                /// The entity type will only appear exactly once.  The same
11213                /// entity instance may be mentioned multiple times.
11214                RequiredOnce,
11215                /// The entity type will appear once or more times.
11216                RequiredMultiple,
11217                /// If set, the enum was initialized with an unknown value.
11218                ///
11219                /// Applications can examine the value using [OccurrenceType::value] or
11220                /// [OccurrenceType::name].
11221                UnknownValue(occurrence_type::UnknownValue),
11222            }
11223
11224            #[doc(hidden)]
11225            pub mod occurrence_type {
11226                #[allow(unused_imports)]
11227                use super::*;
11228                #[derive(Clone, Debug, PartialEq)]
11229                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11230            }
11231
11232            impl OccurrenceType {
11233                /// Gets the enum value.
11234                ///
11235                /// Returns `None` if the enum contains an unknown value deserialized from
11236                /// the string representation of enums.
11237                pub fn value(&self) -> std::option::Option<i32> {
11238                    match self {
11239                        Self::Unspecified => std::option::Option::Some(0),
11240                        Self::OptionalOnce => std::option::Option::Some(1),
11241                        Self::OptionalMultiple => std::option::Option::Some(2),
11242                        Self::RequiredOnce => std::option::Option::Some(3),
11243                        Self::RequiredMultiple => std::option::Option::Some(4),
11244                        Self::UnknownValue(u) => u.0.value(),
11245                    }
11246                }
11247
11248                /// Gets the enum value as a string.
11249                ///
11250                /// Returns `None` if the enum contains an unknown value deserialized from
11251                /// the integer representation of enums.
11252                pub fn name(&self) -> std::option::Option<&str> {
11253                    match self {
11254                        Self::Unspecified => {
11255                            std::option::Option::Some("OCCURRENCE_TYPE_UNSPECIFIED")
11256                        }
11257                        Self::OptionalOnce => std::option::Option::Some("OPTIONAL_ONCE"),
11258                        Self::OptionalMultiple => std::option::Option::Some("OPTIONAL_MULTIPLE"),
11259                        Self::RequiredOnce => std::option::Option::Some("REQUIRED_ONCE"),
11260                        Self::RequiredMultiple => std::option::Option::Some("REQUIRED_MULTIPLE"),
11261                        Self::UnknownValue(u) => u.0.name(),
11262                    }
11263                }
11264            }
11265
11266            impl std::default::Default for OccurrenceType {
11267                fn default() -> Self {
11268                    use std::convert::From;
11269                    Self::from(0)
11270                }
11271            }
11272
11273            impl std::fmt::Display for OccurrenceType {
11274                fn fmt(
11275                    &self,
11276                    f: &mut std::fmt::Formatter<'_>,
11277                ) -> std::result::Result<(), std::fmt::Error> {
11278                    wkt::internal::display_enum(f, self.name(), self.value())
11279                }
11280            }
11281
11282            impl std::convert::From<i32> for OccurrenceType {
11283                fn from(value: i32) -> Self {
11284                    match value {
11285                        0 => Self::Unspecified,
11286                        1 => Self::OptionalOnce,
11287                        2 => Self::OptionalMultiple,
11288                        3 => Self::RequiredOnce,
11289                        4 => Self::RequiredMultiple,
11290                        _ => Self::UnknownValue(occurrence_type::UnknownValue(
11291                            wkt::internal::UnknownEnumValue::Integer(value),
11292                        )),
11293                    }
11294                }
11295            }
11296
11297            impl std::convert::From<&str> for OccurrenceType {
11298                fn from(value: &str) -> Self {
11299                    use std::string::ToString;
11300                    match value {
11301                        "OCCURRENCE_TYPE_UNSPECIFIED" => Self::Unspecified,
11302                        "OPTIONAL_ONCE" => Self::OptionalOnce,
11303                        "OPTIONAL_MULTIPLE" => Self::OptionalMultiple,
11304                        "REQUIRED_ONCE" => Self::RequiredOnce,
11305                        "REQUIRED_MULTIPLE" => Self::RequiredMultiple,
11306                        _ => Self::UnknownValue(occurrence_type::UnknownValue(
11307                            wkt::internal::UnknownEnumValue::String(value.to_string()),
11308                        )),
11309                    }
11310                }
11311            }
11312
11313            impl serde::ser::Serialize for OccurrenceType {
11314                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11315                where
11316                    S: serde::Serializer,
11317                {
11318                    match self {
11319                        Self::Unspecified => serializer.serialize_i32(0),
11320                        Self::OptionalOnce => serializer.serialize_i32(1),
11321                        Self::OptionalMultiple => serializer.serialize_i32(2),
11322                        Self::RequiredOnce => serializer.serialize_i32(3),
11323                        Self::RequiredMultiple => serializer.serialize_i32(4),
11324                        Self::UnknownValue(u) => u.0.serialize(serializer),
11325                    }
11326                }
11327            }
11328
11329            impl<'de> serde::de::Deserialize<'de> for OccurrenceType {
11330                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11331                where
11332                    D: serde::Deserializer<'de>,
11333                {
11334                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<OccurrenceType>::new(
11335                        ".google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType"))
11336                }
11337            }
11338
11339            /// Specifies how the entity's value is obtained from the document.
11340            ///
11341            /// # Working with unknown values
11342            ///
11343            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11344            /// additional enum variants at any time. Adding new variants is not considered
11345            /// a breaking change. Applications should write their code in anticipation of:
11346            ///
11347            /// - New values appearing in future releases of the client library, **and**
11348            /// - New values received dynamically, without application changes.
11349            ///
11350            /// Please consult the [Working with enums] section in the user guide for some
11351            /// guidelines.
11352            ///
11353            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11354            #[derive(Clone, Debug, PartialEq)]
11355            #[non_exhaustive]
11356            pub enum Method {
11357                /// Unspecified method. It defaults to `EXTRACT`.
11358                Unspecified,
11359                /// The entity's value is directly extracted as-is from the document
11360                /// text.
11361                Extract,
11362                /// The entity's value is derived through inference and is not
11363                /// necessarily an exact text extraction from the document.
11364                Derive,
11365                /// If set, the enum was initialized with an unknown value.
11366                ///
11367                /// Applications can examine the value using [Method::value] or
11368                /// [Method::name].
11369                UnknownValue(method::UnknownValue),
11370            }
11371
11372            #[doc(hidden)]
11373            pub mod method {
11374                #[allow(unused_imports)]
11375                use super::*;
11376                #[derive(Clone, Debug, PartialEq)]
11377                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11378            }
11379
11380            impl Method {
11381                /// Gets the enum value.
11382                ///
11383                /// Returns `None` if the enum contains an unknown value deserialized from
11384                /// the string representation of enums.
11385                pub fn value(&self) -> std::option::Option<i32> {
11386                    match self {
11387                        Self::Unspecified => std::option::Option::Some(0),
11388                        Self::Extract => std::option::Option::Some(1),
11389                        Self::Derive => std::option::Option::Some(2),
11390                        Self::UnknownValue(u) => u.0.value(),
11391                    }
11392                }
11393
11394                /// Gets the enum value as a string.
11395                ///
11396                /// Returns `None` if the enum contains an unknown value deserialized from
11397                /// the integer representation of enums.
11398                pub fn name(&self) -> std::option::Option<&str> {
11399                    match self {
11400                        Self::Unspecified => std::option::Option::Some("METHOD_UNSPECIFIED"),
11401                        Self::Extract => std::option::Option::Some("EXTRACT"),
11402                        Self::Derive => std::option::Option::Some("DERIVE"),
11403                        Self::UnknownValue(u) => u.0.name(),
11404                    }
11405                }
11406            }
11407
11408            impl std::default::Default for Method {
11409                fn default() -> Self {
11410                    use std::convert::From;
11411                    Self::from(0)
11412                }
11413            }
11414
11415            impl std::fmt::Display for Method {
11416                fn fmt(
11417                    &self,
11418                    f: &mut std::fmt::Formatter<'_>,
11419                ) -> std::result::Result<(), std::fmt::Error> {
11420                    wkt::internal::display_enum(f, self.name(), self.value())
11421                }
11422            }
11423
11424            impl std::convert::From<i32> for Method {
11425                fn from(value: i32) -> Self {
11426                    match value {
11427                        0 => Self::Unspecified,
11428                        1 => Self::Extract,
11429                        2 => Self::Derive,
11430                        _ => Self::UnknownValue(method::UnknownValue(
11431                            wkt::internal::UnknownEnumValue::Integer(value),
11432                        )),
11433                    }
11434                }
11435            }
11436
11437            impl std::convert::From<&str> for Method {
11438                fn from(value: &str) -> Self {
11439                    use std::string::ToString;
11440                    match value {
11441                        "METHOD_UNSPECIFIED" => Self::Unspecified,
11442                        "EXTRACT" => Self::Extract,
11443                        "DERIVE" => Self::Derive,
11444                        _ => Self::UnknownValue(method::UnknownValue(
11445                            wkt::internal::UnknownEnumValue::String(value.to_string()),
11446                        )),
11447                    }
11448                }
11449            }
11450
11451            impl serde::ser::Serialize for Method {
11452                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11453                where
11454                    S: serde::Serializer,
11455                {
11456                    match self {
11457                        Self::Unspecified => serializer.serialize_i32(0),
11458                        Self::Extract => serializer.serialize_i32(1),
11459                        Self::Derive => serializer.serialize_i32(2),
11460                        Self::UnknownValue(u) => u.0.serialize(serializer),
11461                    }
11462                }
11463            }
11464
11465            impl<'de> serde::de::Deserialize<'de> for Method {
11466                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11467                where
11468                    D: serde::Deserializer<'de>,
11469                {
11470                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<Method>::new(
11471                        ".google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method",
11472                    ))
11473                }
11474            }
11475        }
11476
11477        #[derive(Clone, Debug, PartialEq)]
11478        #[non_exhaustive]
11479        pub enum ValueSource {
11480            /// If specified, lists all the possible values for this entity.  This
11481            /// should not be more than a handful of values.  If the number of values
11482            /// is >10 or could change frequently use the `EntityType.value_ontology`
11483            /// field and specify a list of all possible values in a value ontology
11484            /// file.
11485            EnumValues(std::boxed::Box<crate::model::document_schema::entity_type::EnumValues>),
11486        }
11487    }
11488
11489    /// Metadata for global schema behavior.
11490    #[derive(Clone, Default, PartialEq)]
11491    #[non_exhaustive]
11492    pub struct Metadata {
11493        /// If true, a `document` entity type can be applied to subdocument
11494        /// (splitting). Otherwise, it can only be applied to the entire document
11495        /// (classification).
11496        pub document_splitter: bool,
11497
11498        /// If true, on a given page, there can be multiple `document` annotations
11499        /// covering it.
11500        pub document_allow_multiple_labels: bool,
11501
11502        /// If set, all the nested entities must be prefixed with the parents.
11503        pub prefixed_naming_on_properties: bool,
11504
11505        /// If set, we will skip the naming format validation in the schema. So the
11506        /// string values in `DocumentSchema.EntityType.name` and
11507        /// `DocumentSchema.EntityType.Property.name` will not be checked.
11508        pub skip_naming_validation: bool,
11509
11510        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11511    }
11512
11513    impl Metadata {
11514        pub fn new() -> Self {
11515            std::default::Default::default()
11516        }
11517
11518        /// Sets the value of [document_splitter][crate::model::document_schema::Metadata::document_splitter].
11519        pub fn set_document_splitter<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11520            self.document_splitter = v.into();
11521            self
11522        }
11523
11524        /// Sets the value of [document_allow_multiple_labels][crate::model::document_schema::Metadata::document_allow_multiple_labels].
11525        pub fn set_document_allow_multiple_labels<T: std::convert::Into<bool>>(
11526            mut self,
11527            v: T,
11528        ) -> Self {
11529            self.document_allow_multiple_labels = v.into();
11530            self
11531        }
11532
11533        /// Sets the value of [prefixed_naming_on_properties][crate::model::document_schema::Metadata::prefixed_naming_on_properties].
11534        pub fn set_prefixed_naming_on_properties<T: std::convert::Into<bool>>(
11535            mut self,
11536            v: T,
11537        ) -> Self {
11538            self.prefixed_naming_on_properties = v.into();
11539            self
11540        }
11541
11542        /// Sets the value of [skip_naming_validation][crate::model::document_schema::Metadata::skip_naming_validation].
11543        pub fn set_skip_naming_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11544            self.skip_naming_validation = v.into();
11545            self
11546        }
11547    }
11548
11549    impl wkt::message::Message for Metadata {
11550        fn typename() -> &'static str {
11551            "type.googleapis.com/google.cloud.documentai.v1.DocumentSchema.Metadata"
11552        }
11553    }
11554}
11555
11556/// Gives a short summary of an evaluation, and links to the evaluation itself.
11557#[derive(Clone, Default, PartialEq)]
11558#[non_exhaustive]
11559pub struct EvaluationReference {
11560    /// The resource name of the Long Running Operation for the evaluation.
11561    pub operation: std::string::String,
11562
11563    /// The resource name of the evaluation.
11564    pub evaluation: std::string::String,
11565
11566    /// An aggregate of the statistics for the evaluation with fuzzy matching on.
11567    pub aggregate_metrics: std::option::Option<crate::model::evaluation::Metrics>,
11568
11569    /// An aggregate of the statistics for the evaluation with fuzzy matching off.
11570    pub aggregate_metrics_exact: std::option::Option<crate::model::evaluation::Metrics>,
11571
11572    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11573}
11574
11575impl EvaluationReference {
11576    pub fn new() -> Self {
11577        std::default::Default::default()
11578    }
11579
11580    /// Sets the value of [operation][crate::model::EvaluationReference::operation].
11581    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11582        self.operation = v.into();
11583        self
11584    }
11585
11586    /// Sets the value of [evaluation][crate::model::EvaluationReference::evaluation].
11587    pub fn set_evaluation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11588        self.evaluation = v.into();
11589        self
11590    }
11591
11592    /// Sets the value of [aggregate_metrics][crate::model::EvaluationReference::aggregate_metrics].
11593    pub fn set_aggregate_metrics<T>(mut self, v: T) -> Self
11594    where
11595        T: std::convert::Into<crate::model::evaluation::Metrics>,
11596    {
11597        self.aggregate_metrics = std::option::Option::Some(v.into());
11598        self
11599    }
11600
11601    /// Sets or clears the value of [aggregate_metrics][crate::model::EvaluationReference::aggregate_metrics].
11602    pub fn set_or_clear_aggregate_metrics<T>(mut self, v: std::option::Option<T>) -> Self
11603    where
11604        T: std::convert::Into<crate::model::evaluation::Metrics>,
11605    {
11606        self.aggregate_metrics = v.map(|x| x.into());
11607        self
11608    }
11609
11610    /// Sets the value of [aggregate_metrics_exact][crate::model::EvaluationReference::aggregate_metrics_exact].
11611    pub fn set_aggregate_metrics_exact<T>(mut self, v: T) -> Self
11612    where
11613        T: std::convert::Into<crate::model::evaluation::Metrics>,
11614    {
11615        self.aggregate_metrics_exact = std::option::Option::Some(v.into());
11616        self
11617    }
11618
11619    /// Sets or clears the value of [aggregate_metrics_exact][crate::model::EvaluationReference::aggregate_metrics_exact].
11620    pub fn set_or_clear_aggregate_metrics_exact<T>(mut self, v: std::option::Option<T>) -> Self
11621    where
11622        T: std::convert::Into<crate::model::evaluation::Metrics>,
11623    {
11624        self.aggregate_metrics_exact = v.map(|x| x.into());
11625        self
11626    }
11627}
11628
11629impl wkt::message::Message for EvaluationReference {
11630    fn typename() -> &'static str {
11631        "type.googleapis.com/google.cloud.documentai.v1.EvaluationReference"
11632    }
11633}
11634
11635/// An evaluation of a ProcessorVersion's performance.
11636#[derive(Clone, Default, PartialEq)]
11637#[non_exhaustive]
11638pub struct Evaluation {
11639    /// The resource name of the evaluation.
11640    /// Format:
11641    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
11642    pub name: std::string::String,
11643
11644    /// The time that the evaluation was created.
11645    pub create_time: std::option::Option<wkt::Timestamp>,
11646
11647    /// Counters for the documents used in the evaluation.
11648    pub document_counters: std::option::Option<crate::model::evaluation::Counters>,
11649
11650    /// Metrics for all the entities in aggregate.
11651    pub all_entities_metrics: std::option::Option<crate::model::evaluation::MultiConfidenceMetrics>,
11652
11653    /// Metrics across confidence levels, for different entities.
11654    pub entity_metrics: std::collections::HashMap<
11655        std::string::String,
11656        crate::model::evaluation::MultiConfidenceMetrics,
11657    >,
11658
11659    /// The KMS key name used for encryption.
11660    pub kms_key_name: std::string::String,
11661
11662    /// The KMS key version with which data is encrypted.
11663    pub kms_key_version_name: std::string::String,
11664
11665    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11666}
11667
11668impl Evaluation {
11669    pub fn new() -> Self {
11670        std::default::Default::default()
11671    }
11672
11673    /// Sets the value of [name][crate::model::Evaluation::name].
11674    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11675        self.name = v.into();
11676        self
11677    }
11678
11679    /// Sets the value of [create_time][crate::model::Evaluation::create_time].
11680    pub fn set_create_time<T>(mut self, v: T) -> Self
11681    where
11682        T: std::convert::Into<wkt::Timestamp>,
11683    {
11684        self.create_time = std::option::Option::Some(v.into());
11685        self
11686    }
11687
11688    /// Sets or clears the value of [create_time][crate::model::Evaluation::create_time].
11689    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11690    where
11691        T: std::convert::Into<wkt::Timestamp>,
11692    {
11693        self.create_time = v.map(|x| x.into());
11694        self
11695    }
11696
11697    /// Sets the value of [document_counters][crate::model::Evaluation::document_counters].
11698    pub fn set_document_counters<T>(mut self, v: T) -> Self
11699    where
11700        T: std::convert::Into<crate::model::evaluation::Counters>,
11701    {
11702        self.document_counters = std::option::Option::Some(v.into());
11703        self
11704    }
11705
11706    /// Sets or clears the value of [document_counters][crate::model::Evaluation::document_counters].
11707    pub fn set_or_clear_document_counters<T>(mut self, v: std::option::Option<T>) -> Self
11708    where
11709        T: std::convert::Into<crate::model::evaluation::Counters>,
11710    {
11711        self.document_counters = v.map(|x| x.into());
11712        self
11713    }
11714
11715    /// Sets the value of [all_entities_metrics][crate::model::Evaluation::all_entities_metrics].
11716    pub fn set_all_entities_metrics<T>(mut self, v: T) -> Self
11717    where
11718        T: std::convert::Into<crate::model::evaluation::MultiConfidenceMetrics>,
11719    {
11720        self.all_entities_metrics = std::option::Option::Some(v.into());
11721        self
11722    }
11723
11724    /// Sets or clears the value of [all_entities_metrics][crate::model::Evaluation::all_entities_metrics].
11725    pub fn set_or_clear_all_entities_metrics<T>(mut self, v: std::option::Option<T>) -> Self
11726    where
11727        T: std::convert::Into<crate::model::evaluation::MultiConfidenceMetrics>,
11728    {
11729        self.all_entities_metrics = v.map(|x| x.into());
11730        self
11731    }
11732
11733    /// Sets the value of [entity_metrics][crate::model::Evaluation::entity_metrics].
11734    pub fn set_entity_metrics<T, K, V>(mut self, v: T) -> Self
11735    where
11736        T: std::iter::IntoIterator<Item = (K, V)>,
11737        K: std::convert::Into<std::string::String>,
11738        V: std::convert::Into<crate::model::evaluation::MultiConfidenceMetrics>,
11739    {
11740        use std::iter::Iterator;
11741        self.entity_metrics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11742        self
11743    }
11744
11745    /// Sets the value of [kms_key_name][crate::model::Evaluation::kms_key_name].
11746    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11747        self.kms_key_name = v.into();
11748        self
11749    }
11750
11751    /// Sets the value of [kms_key_version_name][crate::model::Evaluation::kms_key_version_name].
11752    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
11753        mut self,
11754        v: T,
11755    ) -> Self {
11756        self.kms_key_version_name = v.into();
11757        self
11758    }
11759}
11760
11761impl wkt::message::Message for Evaluation {
11762    fn typename() -> &'static str {
11763        "type.googleapis.com/google.cloud.documentai.v1.Evaluation"
11764    }
11765}
11766
11767/// Defines additional types related to [Evaluation].
11768pub mod evaluation {
11769    #[allow(unused_imports)]
11770    use super::*;
11771
11772    /// Evaluation counters for the documents that were used.
11773    #[derive(Clone, Default, PartialEq)]
11774    #[non_exhaustive]
11775    pub struct Counters {
11776        /// How many documents were sent for evaluation.
11777        pub input_documents_count: i32,
11778
11779        /// How many documents were not included in the evaluation as they didn't
11780        /// pass validation.
11781        pub invalid_documents_count: i32,
11782
11783        /// How many documents were not included in the evaluation as Document AI
11784        /// failed to process them.
11785        pub failed_documents_count: i32,
11786
11787        /// How many documents were used in the evaluation.
11788        pub evaluated_documents_count: i32,
11789
11790        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11791    }
11792
11793    impl Counters {
11794        pub fn new() -> Self {
11795            std::default::Default::default()
11796        }
11797
11798        /// Sets the value of [input_documents_count][crate::model::evaluation::Counters::input_documents_count].
11799        pub fn set_input_documents_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11800            self.input_documents_count = v.into();
11801            self
11802        }
11803
11804        /// Sets the value of [invalid_documents_count][crate::model::evaluation::Counters::invalid_documents_count].
11805        pub fn set_invalid_documents_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11806            self.invalid_documents_count = v.into();
11807            self
11808        }
11809
11810        /// Sets the value of [failed_documents_count][crate::model::evaluation::Counters::failed_documents_count].
11811        pub fn set_failed_documents_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11812            self.failed_documents_count = v.into();
11813            self
11814        }
11815
11816        /// Sets the value of [evaluated_documents_count][crate::model::evaluation::Counters::evaluated_documents_count].
11817        pub fn set_evaluated_documents_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11818            self.evaluated_documents_count = v.into();
11819            self
11820        }
11821    }
11822
11823    impl wkt::message::Message for Counters {
11824        fn typename() -> &'static str {
11825            "type.googleapis.com/google.cloud.documentai.v1.Evaluation.Counters"
11826        }
11827    }
11828
11829    /// Evaluation metrics, either in aggregate or about a specific entity.
11830    #[derive(Clone, Default, PartialEq)]
11831    #[non_exhaustive]
11832    pub struct Metrics {
11833        /// The calculated precision.
11834        pub precision: f32,
11835
11836        /// The calculated recall.
11837        pub recall: f32,
11838
11839        /// The calculated f1 score.
11840        pub f1_score: f32,
11841
11842        /// The amount of occurrences in predicted documents.
11843        pub predicted_occurrences_count: i32,
11844
11845        /// The amount of occurrences in ground truth documents.
11846        pub ground_truth_occurrences_count: i32,
11847
11848        /// The amount of documents with a predicted occurrence.
11849        pub predicted_document_count: i32,
11850
11851        /// The amount of documents with a ground truth occurrence.
11852        pub ground_truth_document_count: i32,
11853
11854        /// The amount of true positives.
11855        pub true_positives_count: i32,
11856
11857        /// The amount of false positives.
11858        pub false_positives_count: i32,
11859
11860        /// The amount of false negatives.
11861        pub false_negatives_count: i32,
11862
11863        /// The amount of documents that had an occurrence of this label.
11864        pub total_documents_count: i32,
11865
11866        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11867    }
11868
11869    impl Metrics {
11870        pub fn new() -> Self {
11871            std::default::Default::default()
11872        }
11873
11874        /// Sets the value of [precision][crate::model::evaluation::Metrics::precision].
11875        pub fn set_precision<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
11876            self.precision = v.into();
11877            self
11878        }
11879
11880        /// Sets the value of [recall][crate::model::evaluation::Metrics::recall].
11881        pub fn set_recall<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
11882            self.recall = v.into();
11883            self
11884        }
11885
11886        /// Sets the value of [f1_score][crate::model::evaluation::Metrics::f1_score].
11887        pub fn set_f1_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
11888            self.f1_score = v.into();
11889            self
11890        }
11891
11892        /// Sets the value of [predicted_occurrences_count][crate::model::evaluation::Metrics::predicted_occurrences_count].
11893        pub fn set_predicted_occurrences_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11894            self.predicted_occurrences_count = v.into();
11895            self
11896        }
11897
11898        /// Sets the value of [ground_truth_occurrences_count][crate::model::evaluation::Metrics::ground_truth_occurrences_count].
11899        pub fn set_ground_truth_occurrences_count<T: std::convert::Into<i32>>(
11900            mut self,
11901            v: T,
11902        ) -> Self {
11903            self.ground_truth_occurrences_count = v.into();
11904            self
11905        }
11906
11907        /// Sets the value of [predicted_document_count][crate::model::evaluation::Metrics::predicted_document_count].
11908        pub fn set_predicted_document_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11909            self.predicted_document_count = v.into();
11910            self
11911        }
11912
11913        /// Sets the value of [ground_truth_document_count][crate::model::evaluation::Metrics::ground_truth_document_count].
11914        pub fn set_ground_truth_document_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11915            self.ground_truth_document_count = v.into();
11916            self
11917        }
11918
11919        /// Sets the value of [true_positives_count][crate::model::evaluation::Metrics::true_positives_count].
11920        pub fn set_true_positives_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11921            self.true_positives_count = v.into();
11922            self
11923        }
11924
11925        /// Sets the value of [false_positives_count][crate::model::evaluation::Metrics::false_positives_count].
11926        pub fn set_false_positives_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11927            self.false_positives_count = v.into();
11928            self
11929        }
11930
11931        /// Sets the value of [false_negatives_count][crate::model::evaluation::Metrics::false_negatives_count].
11932        pub fn set_false_negatives_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11933            self.false_negatives_count = v.into();
11934            self
11935        }
11936
11937        /// Sets the value of [total_documents_count][crate::model::evaluation::Metrics::total_documents_count].
11938        pub fn set_total_documents_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11939            self.total_documents_count = v.into();
11940            self
11941        }
11942    }
11943
11944    impl wkt::message::Message for Metrics {
11945        fn typename() -> &'static str {
11946            "type.googleapis.com/google.cloud.documentai.v1.Evaluation.Metrics"
11947        }
11948    }
11949
11950    /// Evaluations metrics, at a specific confidence level.
11951    #[derive(Clone, Default, PartialEq)]
11952    #[non_exhaustive]
11953    pub struct ConfidenceLevelMetrics {
11954        /// The confidence level.
11955        pub confidence_level: f32,
11956
11957        /// The metrics at the specific confidence level.
11958        pub metrics: std::option::Option<crate::model::evaluation::Metrics>,
11959
11960        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11961    }
11962
11963    impl ConfidenceLevelMetrics {
11964        pub fn new() -> Self {
11965            std::default::Default::default()
11966        }
11967
11968        /// Sets the value of [confidence_level][crate::model::evaluation::ConfidenceLevelMetrics::confidence_level].
11969        pub fn set_confidence_level<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
11970            self.confidence_level = v.into();
11971            self
11972        }
11973
11974        /// Sets the value of [metrics][crate::model::evaluation::ConfidenceLevelMetrics::metrics].
11975        pub fn set_metrics<T>(mut self, v: T) -> Self
11976        where
11977            T: std::convert::Into<crate::model::evaluation::Metrics>,
11978        {
11979            self.metrics = std::option::Option::Some(v.into());
11980            self
11981        }
11982
11983        /// Sets or clears the value of [metrics][crate::model::evaluation::ConfidenceLevelMetrics::metrics].
11984        pub fn set_or_clear_metrics<T>(mut self, v: std::option::Option<T>) -> Self
11985        where
11986            T: std::convert::Into<crate::model::evaluation::Metrics>,
11987        {
11988            self.metrics = v.map(|x| x.into());
11989            self
11990        }
11991    }
11992
11993    impl wkt::message::Message for ConfidenceLevelMetrics {
11994        fn typename() -> &'static str {
11995            "type.googleapis.com/google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics"
11996        }
11997    }
11998
11999    /// Metrics across multiple confidence levels.
12000    #[derive(Clone, Default, PartialEq)]
12001    #[non_exhaustive]
12002    pub struct MultiConfidenceMetrics {
12003        /// Metrics across confidence levels with fuzzy matching enabled.
12004        pub confidence_level_metrics:
12005            std::vec::Vec<crate::model::evaluation::ConfidenceLevelMetrics>,
12006
12007        /// Metrics across confidence levels with only exact matching.
12008        pub confidence_level_metrics_exact:
12009            std::vec::Vec<crate::model::evaluation::ConfidenceLevelMetrics>,
12010
12011        /// The calculated area under the precision recall curve (AUPRC), computed by
12012        /// integrating over all confidence thresholds.
12013        pub auprc: f32,
12014
12015        /// The Estimated Calibration Error (ECE) of the confidence of the predicted
12016        /// entities.
12017        pub estimated_calibration_error: f32,
12018
12019        /// The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching
12020        /// only.
12021        pub auprc_exact: f32,
12022
12023        /// The ECE for the predicted entities with fuzzy matching disabled, i.e.,
12024        /// exact matching only.
12025        pub estimated_calibration_error_exact: f32,
12026
12027        /// The metrics type for the label.
12028        pub metrics_type: crate::model::evaluation::multi_confidence_metrics::MetricsType,
12029
12030        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12031    }
12032
12033    impl MultiConfidenceMetrics {
12034        pub fn new() -> Self {
12035            std::default::Default::default()
12036        }
12037
12038        /// Sets the value of [confidence_level_metrics][crate::model::evaluation::MultiConfidenceMetrics::confidence_level_metrics].
12039        pub fn set_confidence_level_metrics<T, V>(mut self, v: T) -> Self
12040        where
12041            T: std::iter::IntoIterator<Item = V>,
12042            V: std::convert::Into<crate::model::evaluation::ConfidenceLevelMetrics>,
12043        {
12044            use std::iter::Iterator;
12045            self.confidence_level_metrics = v.into_iter().map(|i| i.into()).collect();
12046            self
12047        }
12048
12049        /// Sets the value of [confidence_level_metrics_exact][crate::model::evaluation::MultiConfidenceMetrics::confidence_level_metrics_exact].
12050        pub fn set_confidence_level_metrics_exact<T, V>(mut self, v: T) -> Self
12051        where
12052            T: std::iter::IntoIterator<Item = V>,
12053            V: std::convert::Into<crate::model::evaluation::ConfidenceLevelMetrics>,
12054        {
12055            use std::iter::Iterator;
12056            self.confidence_level_metrics_exact = v.into_iter().map(|i| i.into()).collect();
12057            self
12058        }
12059
12060        /// Sets the value of [auprc][crate::model::evaluation::MultiConfidenceMetrics::auprc].
12061        pub fn set_auprc<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
12062            self.auprc = v.into();
12063            self
12064        }
12065
12066        /// Sets the value of [estimated_calibration_error][crate::model::evaluation::MultiConfidenceMetrics::estimated_calibration_error].
12067        pub fn set_estimated_calibration_error<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
12068            self.estimated_calibration_error = v.into();
12069            self
12070        }
12071
12072        /// Sets the value of [auprc_exact][crate::model::evaluation::MultiConfidenceMetrics::auprc_exact].
12073        pub fn set_auprc_exact<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
12074            self.auprc_exact = v.into();
12075            self
12076        }
12077
12078        /// Sets the value of [estimated_calibration_error_exact][crate::model::evaluation::MultiConfidenceMetrics::estimated_calibration_error_exact].
12079        pub fn set_estimated_calibration_error_exact<T: std::convert::Into<f32>>(
12080            mut self,
12081            v: T,
12082        ) -> Self {
12083            self.estimated_calibration_error_exact = v.into();
12084            self
12085        }
12086
12087        /// Sets the value of [metrics_type][crate::model::evaluation::MultiConfidenceMetrics::metrics_type].
12088        pub fn set_metrics_type<
12089            T: std::convert::Into<crate::model::evaluation::multi_confidence_metrics::MetricsType>,
12090        >(
12091            mut self,
12092            v: T,
12093        ) -> Self {
12094            self.metrics_type = v.into();
12095            self
12096        }
12097    }
12098
12099    impl wkt::message::Message for MultiConfidenceMetrics {
12100        fn typename() -> &'static str {
12101            "type.googleapis.com/google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics"
12102        }
12103    }
12104
12105    /// Defines additional types related to [MultiConfidenceMetrics].
12106    pub mod multi_confidence_metrics {
12107        #[allow(unused_imports)]
12108        use super::*;
12109
12110        /// A type that determines how metrics should be interpreted.
12111        ///
12112        /// # Working with unknown values
12113        ///
12114        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12115        /// additional enum variants at any time. Adding new variants is not considered
12116        /// a breaking change. Applications should write their code in anticipation of:
12117        ///
12118        /// - New values appearing in future releases of the client library, **and**
12119        /// - New values received dynamically, without application changes.
12120        ///
12121        /// Please consult the [Working with enums] section in the user guide for some
12122        /// guidelines.
12123        ///
12124        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12125        #[derive(Clone, Debug, PartialEq)]
12126        #[non_exhaustive]
12127        pub enum MetricsType {
12128            /// The metrics type is unspecified. By default, metrics without a
12129            /// particular specification are for leaf entity types (i.e., top-level
12130            /// entity types without child types, or child types which are not
12131            /// parent types themselves).
12132            Unspecified,
12133            /// Indicates whether metrics for this particular label type represent an
12134            /// aggregate of metrics for other types instead of being based on actual
12135            /// TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf)
12136            /// entity types are an aggregate of metrics for their children.
12137            Aggregate,
12138            /// If set, the enum was initialized with an unknown value.
12139            ///
12140            /// Applications can examine the value using [MetricsType::value] or
12141            /// [MetricsType::name].
12142            UnknownValue(metrics_type::UnknownValue),
12143        }
12144
12145        #[doc(hidden)]
12146        pub mod metrics_type {
12147            #[allow(unused_imports)]
12148            use super::*;
12149            #[derive(Clone, Debug, PartialEq)]
12150            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12151        }
12152
12153        impl MetricsType {
12154            /// Gets the enum value.
12155            ///
12156            /// Returns `None` if the enum contains an unknown value deserialized from
12157            /// the string representation of enums.
12158            pub fn value(&self) -> std::option::Option<i32> {
12159                match self {
12160                    Self::Unspecified => std::option::Option::Some(0),
12161                    Self::Aggregate => std::option::Option::Some(1),
12162                    Self::UnknownValue(u) => u.0.value(),
12163                }
12164            }
12165
12166            /// Gets the enum value as a string.
12167            ///
12168            /// Returns `None` if the enum contains an unknown value deserialized from
12169            /// the integer representation of enums.
12170            pub fn name(&self) -> std::option::Option<&str> {
12171                match self {
12172                    Self::Unspecified => std::option::Option::Some("METRICS_TYPE_UNSPECIFIED"),
12173                    Self::Aggregate => std::option::Option::Some("AGGREGATE"),
12174                    Self::UnknownValue(u) => u.0.name(),
12175                }
12176            }
12177        }
12178
12179        impl std::default::Default for MetricsType {
12180            fn default() -> Self {
12181                use std::convert::From;
12182                Self::from(0)
12183            }
12184        }
12185
12186        impl std::fmt::Display for MetricsType {
12187            fn fmt(
12188                &self,
12189                f: &mut std::fmt::Formatter<'_>,
12190            ) -> std::result::Result<(), std::fmt::Error> {
12191                wkt::internal::display_enum(f, self.name(), self.value())
12192            }
12193        }
12194
12195        impl std::convert::From<i32> for MetricsType {
12196            fn from(value: i32) -> Self {
12197                match value {
12198                    0 => Self::Unspecified,
12199                    1 => Self::Aggregate,
12200                    _ => Self::UnknownValue(metrics_type::UnknownValue(
12201                        wkt::internal::UnknownEnumValue::Integer(value),
12202                    )),
12203                }
12204            }
12205        }
12206
12207        impl std::convert::From<&str> for MetricsType {
12208            fn from(value: &str) -> Self {
12209                use std::string::ToString;
12210                match value {
12211                    "METRICS_TYPE_UNSPECIFIED" => Self::Unspecified,
12212                    "AGGREGATE" => Self::Aggregate,
12213                    _ => Self::UnknownValue(metrics_type::UnknownValue(
12214                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12215                    )),
12216                }
12217            }
12218        }
12219
12220        impl serde::ser::Serialize for MetricsType {
12221            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12222            where
12223                S: serde::Serializer,
12224            {
12225                match self {
12226                    Self::Unspecified => serializer.serialize_i32(0),
12227                    Self::Aggregate => serializer.serialize_i32(1),
12228                    Self::UnknownValue(u) => u.0.serialize(serializer),
12229                }
12230            }
12231        }
12232
12233        impl<'de> serde::de::Deserialize<'de> for MetricsType {
12234            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12235            where
12236                D: serde::Deserializer<'de>,
12237            {
12238                deserializer.deserialize_any(wkt::internal::EnumVisitor::<MetricsType>::new(
12239                    ".google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType",
12240                ))
12241            }
12242        }
12243    }
12244}
12245
12246/// A vertex represents a 2D point in the image.
12247/// NOTE: the vertex coordinates are in the same scale as the original image.
12248#[derive(Clone, Default, PartialEq)]
12249#[non_exhaustive]
12250pub struct Vertex {
12251    /// X coordinate.
12252    pub x: i32,
12253
12254    /// Y coordinate (starts from the top of the image).
12255    pub y: i32,
12256
12257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12258}
12259
12260impl Vertex {
12261    pub fn new() -> Self {
12262        std::default::Default::default()
12263    }
12264
12265    /// Sets the value of [x][crate::model::Vertex::x].
12266    pub fn set_x<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12267        self.x = v.into();
12268        self
12269    }
12270
12271    /// Sets the value of [y][crate::model::Vertex::y].
12272    pub fn set_y<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12273        self.y = v.into();
12274        self
12275    }
12276}
12277
12278impl wkt::message::Message for Vertex {
12279    fn typename() -> &'static str {
12280        "type.googleapis.com/google.cloud.documentai.v1.Vertex"
12281    }
12282}
12283
12284/// A vertex represents a 2D point in the image.
12285/// NOTE: the normalized vertex coordinates are relative to the original image
12286/// and range from 0 to 1.
12287#[derive(Clone, Default, PartialEq)]
12288#[non_exhaustive]
12289pub struct NormalizedVertex {
12290    /// X coordinate.
12291    pub x: f32,
12292
12293    /// Y coordinate (starts from the top of the image).
12294    pub y: f32,
12295
12296    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12297}
12298
12299impl NormalizedVertex {
12300    pub fn new() -> Self {
12301        std::default::Default::default()
12302    }
12303
12304    /// Sets the value of [x][crate::model::NormalizedVertex::x].
12305    pub fn set_x<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
12306        self.x = v.into();
12307        self
12308    }
12309
12310    /// Sets the value of [y][crate::model::NormalizedVertex::y].
12311    pub fn set_y<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
12312        self.y = v.into();
12313        self
12314    }
12315}
12316
12317impl wkt::message::Message for NormalizedVertex {
12318    fn typename() -> &'static str {
12319        "type.googleapis.com/google.cloud.documentai.v1.NormalizedVertex"
12320    }
12321}
12322
12323/// A bounding polygon for the detected image annotation.
12324#[derive(Clone, Default, PartialEq)]
12325#[non_exhaustive]
12326pub struct BoundingPoly {
12327    /// The bounding polygon vertices.
12328    pub vertices: std::vec::Vec<crate::model::Vertex>,
12329
12330    /// The bounding polygon normalized vertices.
12331    pub normalized_vertices: std::vec::Vec<crate::model::NormalizedVertex>,
12332
12333    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12334}
12335
12336impl BoundingPoly {
12337    pub fn new() -> Self {
12338        std::default::Default::default()
12339    }
12340
12341    /// Sets the value of [vertices][crate::model::BoundingPoly::vertices].
12342    pub fn set_vertices<T, V>(mut self, v: T) -> Self
12343    where
12344        T: std::iter::IntoIterator<Item = V>,
12345        V: std::convert::Into<crate::model::Vertex>,
12346    {
12347        use std::iter::Iterator;
12348        self.vertices = v.into_iter().map(|i| i.into()).collect();
12349        self
12350    }
12351
12352    /// Sets the value of [normalized_vertices][crate::model::BoundingPoly::normalized_vertices].
12353    pub fn set_normalized_vertices<T, V>(mut self, v: T) -> Self
12354    where
12355        T: std::iter::IntoIterator<Item = V>,
12356        V: std::convert::Into<crate::model::NormalizedVertex>,
12357    {
12358        use std::iter::Iterator;
12359        self.normalized_vertices = v.into_iter().map(|i| i.into()).collect();
12360        self
12361    }
12362}
12363
12364impl wkt::message::Message for BoundingPoly {
12365    fn typename() -> &'static str {
12366        "type.googleapis.com/google.cloud.documentai.v1.BoundingPoly"
12367    }
12368}
12369
12370/// The common metadata for long running operations.
12371#[derive(Clone, Default, PartialEq)]
12372#[non_exhaustive]
12373pub struct CommonOperationMetadata {
12374    /// The state of the operation.
12375    pub state: crate::model::common_operation_metadata::State,
12376
12377    /// A message providing more details about the current state of processing.
12378    pub state_message: std::string::String,
12379
12380    /// A related resource to this operation.
12381    pub resource: std::string::String,
12382
12383    /// The creation time of the operation.
12384    pub create_time: std::option::Option<wkt::Timestamp>,
12385
12386    /// The last update time of the operation.
12387    pub update_time: std::option::Option<wkt::Timestamp>,
12388
12389    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12390}
12391
12392impl CommonOperationMetadata {
12393    pub fn new() -> Self {
12394        std::default::Default::default()
12395    }
12396
12397    /// Sets the value of [state][crate::model::CommonOperationMetadata::state].
12398    pub fn set_state<T: std::convert::Into<crate::model::common_operation_metadata::State>>(
12399        mut self,
12400        v: T,
12401    ) -> Self {
12402        self.state = v.into();
12403        self
12404    }
12405
12406    /// Sets the value of [state_message][crate::model::CommonOperationMetadata::state_message].
12407    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12408        self.state_message = v.into();
12409        self
12410    }
12411
12412    /// Sets the value of [resource][crate::model::CommonOperationMetadata::resource].
12413    pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12414        self.resource = v.into();
12415        self
12416    }
12417
12418    /// Sets the value of [create_time][crate::model::CommonOperationMetadata::create_time].
12419    pub fn set_create_time<T>(mut self, v: T) -> Self
12420    where
12421        T: std::convert::Into<wkt::Timestamp>,
12422    {
12423        self.create_time = std::option::Option::Some(v.into());
12424        self
12425    }
12426
12427    /// Sets or clears the value of [create_time][crate::model::CommonOperationMetadata::create_time].
12428    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12429    where
12430        T: std::convert::Into<wkt::Timestamp>,
12431    {
12432        self.create_time = v.map(|x| x.into());
12433        self
12434    }
12435
12436    /// Sets the value of [update_time][crate::model::CommonOperationMetadata::update_time].
12437    pub fn set_update_time<T>(mut self, v: T) -> Self
12438    where
12439        T: std::convert::Into<wkt::Timestamp>,
12440    {
12441        self.update_time = std::option::Option::Some(v.into());
12442        self
12443    }
12444
12445    /// Sets or clears the value of [update_time][crate::model::CommonOperationMetadata::update_time].
12446    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12447    where
12448        T: std::convert::Into<wkt::Timestamp>,
12449    {
12450        self.update_time = v.map(|x| x.into());
12451        self
12452    }
12453}
12454
12455impl wkt::message::Message for CommonOperationMetadata {
12456    fn typename() -> &'static str {
12457        "type.googleapis.com/google.cloud.documentai.v1.CommonOperationMetadata"
12458    }
12459}
12460
12461/// Defines additional types related to [CommonOperationMetadata].
12462pub mod common_operation_metadata {
12463    #[allow(unused_imports)]
12464    use super::*;
12465
12466    /// State of the longrunning operation.
12467    ///
12468    /// # Working with unknown values
12469    ///
12470    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12471    /// additional enum variants at any time. Adding new variants is not considered
12472    /// a breaking change. Applications should write their code in anticipation of:
12473    ///
12474    /// - New values appearing in future releases of the client library, **and**
12475    /// - New values received dynamically, without application changes.
12476    ///
12477    /// Please consult the [Working with enums] section in the user guide for some
12478    /// guidelines.
12479    ///
12480    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12481    #[derive(Clone, Debug, PartialEq)]
12482    #[non_exhaustive]
12483    pub enum State {
12484        /// Unspecified state.
12485        Unspecified,
12486        /// Operation is still running.
12487        Running,
12488        /// Operation is being cancelled.
12489        Cancelling,
12490        /// Operation succeeded.
12491        Succeeded,
12492        /// Operation failed.
12493        Failed,
12494        /// Operation is cancelled.
12495        Cancelled,
12496        /// If set, the enum was initialized with an unknown value.
12497        ///
12498        /// Applications can examine the value using [State::value] or
12499        /// [State::name].
12500        UnknownValue(state::UnknownValue),
12501    }
12502
12503    #[doc(hidden)]
12504    pub mod state {
12505        #[allow(unused_imports)]
12506        use super::*;
12507        #[derive(Clone, Debug, PartialEq)]
12508        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12509    }
12510
12511    impl State {
12512        /// Gets the enum value.
12513        ///
12514        /// Returns `None` if the enum contains an unknown value deserialized from
12515        /// the string representation of enums.
12516        pub fn value(&self) -> std::option::Option<i32> {
12517            match self {
12518                Self::Unspecified => std::option::Option::Some(0),
12519                Self::Running => std::option::Option::Some(1),
12520                Self::Cancelling => std::option::Option::Some(2),
12521                Self::Succeeded => std::option::Option::Some(3),
12522                Self::Failed => std::option::Option::Some(4),
12523                Self::Cancelled => std::option::Option::Some(5),
12524                Self::UnknownValue(u) => u.0.value(),
12525            }
12526        }
12527
12528        /// Gets the enum value as a string.
12529        ///
12530        /// Returns `None` if the enum contains an unknown value deserialized from
12531        /// the integer representation of enums.
12532        pub fn name(&self) -> std::option::Option<&str> {
12533            match self {
12534                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12535                Self::Running => std::option::Option::Some("RUNNING"),
12536                Self::Cancelling => std::option::Option::Some("CANCELLING"),
12537                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12538                Self::Failed => std::option::Option::Some("FAILED"),
12539                Self::Cancelled => std::option::Option::Some("CANCELLED"),
12540                Self::UnknownValue(u) => u.0.name(),
12541            }
12542        }
12543    }
12544
12545    impl std::default::Default for State {
12546        fn default() -> Self {
12547            use std::convert::From;
12548            Self::from(0)
12549        }
12550    }
12551
12552    impl std::fmt::Display for State {
12553        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12554            wkt::internal::display_enum(f, self.name(), self.value())
12555        }
12556    }
12557
12558    impl std::convert::From<i32> for State {
12559        fn from(value: i32) -> Self {
12560            match value {
12561                0 => Self::Unspecified,
12562                1 => Self::Running,
12563                2 => Self::Cancelling,
12564                3 => Self::Succeeded,
12565                4 => Self::Failed,
12566                5 => Self::Cancelled,
12567                _ => Self::UnknownValue(state::UnknownValue(
12568                    wkt::internal::UnknownEnumValue::Integer(value),
12569                )),
12570            }
12571        }
12572    }
12573
12574    impl std::convert::From<&str> for State {
12575        fn from(value: &str) -> Self {
12576            use std::string::ToString;
12577            match value {
12578                "STATE_UNSPECIFIED" => Self::Unspecified,
12579                "RUNNING" => Self::Running,
12580                "CANCELLING" => Self::Cancelling,
12581                "SUCCEEDED" => Self::Succeeded,
12582                "FAILED" => Self::Failed,
12583                "CANCELLED" => Self::Cancelled,
12584                _ => Self::UnknownValue(state::UnknownValue(
12585                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12586                )),
12587            }
12588        }
12589    }
12590
12591    impl serde::ser::Serialize for State {
12592        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12593        where
12594            S: serde::Serializer,
12595        {
12596            match self {
12597                Self::Unspecified => serializer.serialize_i32(0),
12598                Self::Running => serializer.serialize_i32(1),
12599                Self::Cancelling => serializer.serialize_i32(2),
12600                Self::Succeeded => serializer.serialize_i32(3),
12601                Self::Failed => serializer.serialize_i32(4),
12602                Self::Cancelled => serializer.serialize_i32(5),
12603                Self::UnknownValue(u) => u.0.serialize(serializer),
12604            }
12605        }
12606    }
12607
12608    impl<'de> serde::de::Deserialize<'de> for State {
12609        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12610        where
12611            D: serde::Deserializer<'de>,
12612        {
12613            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12614                ".google.cloud.documentai.v1.CommonOperationMetadata.State",
12615            ))
12616        }
12617    }
12618}
12619
12620/// A processor version is an implementation of a processor. Each processor
12621/// can have multiple versions, pretrained by Google internally or uptrained
12622/// by the customer. A processor can only have one default version at a time.
12623/// Its document-processing behavior is defined by that version.
12624#[derive(Clone, Default, PartialEq)]
12625#[non_exhaustive]
12626pub struct ProcessorVersion {
12627    /// Identifier. The resource name of the processor version.
12628    /// Format:
12629    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
12630    pub name: std::string::String,
12631
12632    /// The display name of the processor version.
12633    pub display_name: std::string::String,
12634
12635    /// Output only. The schema of the processor version. Describes the output.
12636    pub document_schema: std::option::Option<crate::model::DocumentSchema>,
12637
12638    /// Output only. The state of the processor version.
12639    pub state: crate::model::processor_version::State,
12640
12641    /// Output only. The time the processor version was created.
12642    pub create_time: std::option::Option<wkt::Timestamp>,
12643
12644    /// Output only. The most recently invoked evaluation for the processor
12645    /// version.
12646    pub latest_evaluation: std::option::Option<crate::model::EvaluationReference>,
12647
12648    /// Output only. The KMS key name used for encryption.
12649    pub kms_key_name: std::string::String,
12650
12651    /// Output only. The KMS key version with which data is encrypted.
12652    pub kms_key_version_name: std::string::String,
12653
12654    /// Output only. Denotes that this `ProcessorVersion` is managed by Google.
12655    pub google_managed: bool,
12656
12657    /// Output only. If set, information about the eventual deprecation of this
12658    /// version.
12659    pub deprecation_info: std::option::Option<crate::model::processor_version::DeprecationInfo>,
12660
12661    /// Output only. The model type of this processor version.
12662    pub model_type: crate::model::processor_version::ModelType,
12663
12664    /// Output only. Reserved for future use.
12665    pub satisfies_pzs: bool,
12666
12667    /// Output only. Reserved for future use.
12668    pub satisfies_pzi: bool,
12669
12670    /// Output only. Information about Generative AI model-based processor
12671    /// versions.
12672    pub gen_ai_model_info: std::option::Option<crate::model::processor_version::GenAiModelInfo>,
12673
12674    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12675}
12676
12677impl ProcessorVersion {
12678    pub fn new() -> Self {
12679        std::default::Default::default()
12680    }
12681
12682    /// Sets the value of [name][crate::model::ProcessorVersion::name].
12683    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12684        self.name = v.into();
12685        self
12686    }
12687
12688    /// Sets the value of [display_name][crate::model::ProcessorVersion::display_name].
12689    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12690        self.display_name = v.into();
12691        self
12692    }
12693
12694    /// Sets the value of [document_schema][crate::model::ProcessorVersion::document_schema].
12695    pub fn set_document_schema<T>(mut self, v: T) -> Self
12696    where
12697        T: std::convert::Into<crate::model::DocumentSchema>,
12698    {
12699        self.document_schema = std::option::Option::Some(v.into());
12700        self
12701    }
12702
12703    /// Sets or clears the value of [document_schema][crate::model::ProcessorVersion::document_schema].
12704    pub fn set_or_clear_document_schema<T>(mut self, v: std::option::Option<T>) -> Self
12705    where
12706        T: std::convert::Into<crate::model::DocumentSchema>,
12707    {
12708        self.document_schema = v.map(|x| x.into());
12709        self
12710    }
12711
12712    /// Sets the value of [state][crate::model::ProcessorVersion::state].
12713    pub fn set_state<T: std::convert::Into<crate::model::processor_version::State>>(
12714        mut self,
12715        v: T,
12716    ) -> Self {
12717        self.state = v.into();
12718        self
12719    }
12720
12721    /// Sets the value of [create_time][crate::model::ProcessorVersion::create_time].
12722    pub fn set_create_time<T>(mut self, v: T) -> Self
12723    where
12724        T: std::convert::Into<wkt::Timestamp>,
12725    {
12726        self.create_time = std::option::Option::Some(v.into());
12727        self
12728    }
12729
12730    /// Sets or clears the value of [create_time][crate::model::ProcessorVersion::create_time].
12731    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12732    where
12733        T: std::convert::Into<wkt::Timestamp>,
12734    {
12735        self.create_time = v.map(|x| x.into());
12736        self
12737    }
12738
12739    /// Sets the value of [latest_evaluation][crate::model::ProcessorVersion::latest_evaluation].
12740    pub fn set_latest_evaluation<T>(mut self, v: T) -> Self
12741    where
12742        T: std::convert::Into<crate::model::EvaluationReference>,
12743    {
12744        self.latest_evaluation = std::option::Option::Some(v.into());
12745        self
12746    }
12747
12748    /// Sets or clears the value of [latest_evaluation][crate::model::ProcessorVersion::latest_evaluation].
12749    pub fn set_or_clear_latest_evaluation<T>(mut self, v: std::option::Option<T>) -> Self
12750    where
12751        T: std::convert::Into<crate::model::EvaluationReference>,
12752    {
12753        self.latest_evaluation = v.map(|x| x.into());
12754        self
12755    }
12756
12757    /// Sets the value of [kms_key_name][crate::model::ProcessorVersion::kms_key_name].
12758    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12759        self.kms_key_name = v.into();
12760        self
12761    }
12762
12763    /// Sets the value of [kms_key_version_name][crate::model::ProcessorVersion::kms_key_version_name].
12764    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
12765        mut self,
12766        v: T,
12767    ) -> Self {
12768        self.kms_key_version_name = v.into();
12769        self
12770    }
12771
12772    /// Sets the value of [google_managed][crate::model::ProcessorVersion::google_managed].
12773    pub fn set_google_managed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12774        self.google_managed = v.into();
12775        self
12776    }
12777
12778    /// Sets the value of [deprecation_info][crate::model::ProcessorVersion::deprecation_info].
12779    pub fn set_deprecation_info<T>(mut self, v: T) -> Self
12780    where
12781        T: std::convert::Into<crate::model::processor_version::DeprecationInfo>,
12782    {
12783        self.deprecation_info = std::option::Option::Some(v.into());
12784        self
12785    }
12786
12787    /// Sets or clears the value of [deprecation_info][crate::model::ProcessorVersion::deprecation_info].
12788    pub fn set_or_clear_deprecation_info<T>(mut self, v: std::option::Option<T>) -> Self
12789    where
12790        T: std::convert::Into<crate::model::processor_version::DeprecationInfo>,
12791    {
12792        self.deprecation_info = v.map(|x| x.into());
12793        self
12794    }
12795
12796    /// Sets the value of [model_type][crate::model::ProcessorVersion::model_type].
12797    pub fn set_model_type<T: std::convert::Into<crate::model::processor_version::ModelType>>(
12798        mut self,
12799        v: T,
12800    ) -> Self {
12801        self.model_type = v.into();
12802        self
12803    }
12804
12805    /// Sets the value of [satisfies_pzs][crate::model::ProcessorVersion::satisfies_pzs].
12806    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12807        self.satisfies_pzs = v.into();
12808        self
12809    }
12810
12811    /// Sets the value of [satisfies_pzi][crate::model::ProcessorVersion::satisfies_pzi].
12812    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12813        self.satisfies_pzi = v.into();
12814        self
12815    }
12816
12817    /// Sets the value of [gen_ai_model_info][crate::model::ProcessorVersion::gen_ai_model_info].
12818    pub fn set_gen_ai_model_info<T>(mut self, v: T) -> Self
12819    where
12820        T: std::convert::Into<crate::model::processor_version::GenAiModelInfo>,
12821    {
12822        self.gen_ai_model_info = std::option::Option::Some(v.into());
12823        self
12824    }
12825
12826    /// Sets or clears the value of [gen_ai_model_info][crate::model::ProcessorVersion::gen_ai_model_info].
12827    pub fn set_or_clear_gen_ai_model_info<T>(mut self, v: std::option::Option<T>) -> Self
12828    where
12829        T: std::convert::Into<crate::model::processor_version::GenAiModelInfo>,
12830    {
12831        self.gen_ai_model_info = v.map(|x| x.into());
12832        self
12833    }
12834}
12835
12836impl wkt::message::Message for ProcessorVersion {
12837    fn typename() -> &'static str {
12838        "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersion"
12839    }
12840}
12841
12842/// Defines additional types related to [ProcessorVersion].
12843pub mod processor_version {
12844    #[allow(unused_imports)]
12845    use super::*;
12846
12847    /// Information about the upcoming deprecation of this processor version.
12848    #[derive(Clone, Default, PartialEq)]
12849    #[non_exhaustive]
12850    pub struct DeprecationInfo {
12851        /// The time at which this processor version will be deprecated.
12852        pub deprecation_time: std::option::Option<wkt::Timestamp>,
12853
12854        /// If set, the processor version that will be used as a replacement.
12855        pub replacement_processor_version: std::string::String,
12856
12857        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12858    }
12859
12860    impl DeprecationInfo {
12861        pub fn new() -> Self {
12862            std::default::Default::default()
12863        }
12864
12865        /// Sets the value of [deprecation_time][crate::model::processor_version::DeprecationInfo::deprecation_time].
12866        pub fn set_deprecation_time<T>(mut self, v: T) -> Self
12867        where
12868            T: std::convert::Into<wkt::Timestamp>,
12869        {
12870            self.deprecation_time = std::option::Option::Some(v.into());
12871            self
12872        }
12873
12874        /// Sets or clears the value of [deprecation_time][crate::model::processor_version::DeprecationInfo::deprecation_time].
12875        pub fn set_or_clear_deprecation_time<T>(mut self, v: std::option::Option<T>) -> Self
12876        where
12877            T: std::convert::Into<wkt::Timestamp>,
12878        {
12879            self.deprecation_time = v.map(|x| x.into());
12880            self
12881        }
12882
12883        /// Sets the value of [replacement_processor_version][crate::model::processor_version::DeprecationInfo::replacement_processor_version].
12884        pub fn set_replacement_processor_version<T: std::convert::Into<std::string::String>>(
12885            mut self,
12886            v: T,
12887        ) -> Self {
12888            self.replacement_processor_version = v.into();
12889            self
12890        }
12891    }
12892
12893    impl wkt::message::Message for DeprecationInfo {
12894        fn typename() -> &'static str {
12895            "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo"
12896        }
12897    }
12898
12899    /// Information about Generative AI model-based processor versions.
12900    #[derive(Clone, Default, PartialEq)]
12901    #[non_exhaustive]
12902    pub struct GenAiModelInfo {
12903        /// The processor version is either a pretrained Google-managed foundation
12904        /// model or a custom Generative AI model created by the user.
12905        pub model_info:
12906            std::option::Option<crate::model::processor_version::gen_ai_model_info::ModelInfo>,
12907
12908        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12909    }
12910
12911    impl GenAiModelInfo {
12912        pub fn new() -> Self {
12913            std::default::Default::default()
12914        }
12915
12916        /// Sets the value of [model_info][crate::model::processor_version::GenAiModelInfo::model_info].
12917        ///
12918        /// Note that all the setters affecting `model_info` are mutually
12919        /// exclusive.
12920        pub fn set_model_info<
12921            T: std::convert::Into<
12922                    std::option::Option<
12923                        crate::model::processor_version::gen_ai_model_info::ModelInfo,
12924                    >,
12925                >,
12926        >(
12927            mut self,
12928            v: T,
12929        ) -> Self {
12930            self.model_info = v.into();
12931            self
12932        }
12933
12934        /// The value of [model_info][crate::model::processor_version::GenAiModelInfo::model_info]
12935        /// if it holds a `FoundationGenAiModelInfo`, `None` if the field is not set or
12936        /// holds a different branch.
12937        pub fn foundation_gen_ai_model_info(
12938            &self,
12939        ) -> std::option::Option<
12940            &std::boxed::Box<
12941                crate::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo,
12942            >,
12943        > {
12944            #[allow(unreachable_patterns)]
12945            self.model_info.as_ref().and_then(|v| match v {
12946                crate::model::processor_version::gen_ai_model_info::ModelInfo::FoundationGenAiModelInfo(v) => std::option::Option::Some(v),
12947                _ => std::option::Option::None,
12948            })
12949        }
12950
12951        /// Sets the value of [model_info][crate::model::processor_version::GenAiModelInfo::model_info]
12952        /// to hold a `FoundationGenAiModelInfo`.
12953        ///
12954        /// Note that all the setters affecting `model_info` are
12955        /// mutually exclusive.
12956        pub fn set_foundation_gen_ai_model_info<T: std::convert::Into<std::boxed::Box<crate::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo>>>(mut self, v: T) -> Self{
12957            self.model_info = std::option::Option::Some(
12958                crate::model::processor_version::gen_ai_model_info::ModelInfo::FoundationGenAiModelInfo(
12959                    v.into()
12960                )
12961            );
12962            self
12963        }
12964
12965        /// The value of [model_info][crate::model::processor_version::GenAiModelInfo::model_info]
12966        /// if it holds a `CustomGenAiModelInfo`, `None` if the field is not set or
12967        /// holds a different branch.
12968        pub fn custom_gen_ai_model_info(
12969            &self,
12970        ) -> std::option::Option<
12971            &std::boxed::Box<
12972                crate::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo,
12973            >,
12974        > {
12975            #[allow(unreachable_patterns)]
12976            self.model_info.as_ref().and_then(|v| match v {
12977                crate::model::processor_version::gen_ai_model_info::ModelInfo::CustomGenAiModelInfo(v) => std::option::Option::Some(v),
12978                _ => std::option::Option::None,
12979            })
12980        }
12981
12982        /// Sets the value of [model_info][crate::model::processor_version::GenAiModelInfo::model_info]
12983        /// to hold a `CustomGenAiModelInfo`.
12984        ///
12985        /// Note that all the setters affecting `model_info` are
12986        /// mutually exclusive.
12987        pub fn set_custom_gen_ai_model_info<
12988            T: std::convert::Into<
12989                    std::boxed::Box<
12990                        crate::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo,
12991                    >,
12992                >,
12993        >(
12994            mut self,
12995            v: T,
12996        ) -> Self {
12997            self.model_info = std::option::Option::Some(
12998                crate::model::processor_version::gen_ai_model_info::ModelInfo::CustomGenAiModelInfo(
12999                    v.into(),
13000                ),
13001            );
13002            self
13003        }
13004    }
13005
13006    impl wkt::message::Message for GenAiModelInfo {
13007        fn typename() -> &'static str {
13008            "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo"
13009        }
13010    }
13011
13012    /// Defines additional types related to [GenAiModelInfo].
13013    pub mod gen_ai_model_info {
13014        #[allow(unused_imports)]
13015        use super::*;
13016
13017        /// Information for a pretrained Google-managed foundation model.
13018        #[derive(Clone, Default, PartialEq)]
13019        #[non_exhaustive]
13020        pub struct FoundationGenAiModelInfo {
13021            /// Whether finetuning is allowed for this base processor version.
13022            pub finetuning_allowed: bool,
13023
13024            /// The minimum number of labeled documents in the training dataset
13025            /// required for finetuning.
13026            pub min_train_labeled_documents: i32,
13027
13028            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13029        }
13030
13031        impl FoundationGenAiModelInfo {
13032            pub fn new() -> Self {
13033                std::default::Default::default()
13034            }
13035
13036            /// Sets the value of [finetuning_allowed][crate::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo::finetuning_allowed].
13037            pub fn set_finetuning_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13038                self.finetuning_allowed = v.into();
13039                self
13040            }
13041
13042            /// Sets the value of [min_train_labeled_documents][crate::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo::min_train_labeled_documents].
13043            pub fn set_min_train_labeled_documents<T: std::convert::Into<i32>>(
13044                mut self,
13045                v: T,
13046            ) -> Self {
13047                self.min_train_labeled_documents = v.into();
13048                self
13049            }
13050        }
13051
13052        impl wkt::message::Message for FoundationGenAiModelInfo {
13053            fn typename() -> &'static str {
13054                "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo"
13055            }
13056        }
13057
13058        /// Information for a custom Generative AI model created by the user. These
13059        /// are created with `Create New Version` in either the `Call foundation
13060        /// model` or `Fine tuning` tabs.
13061        #[derive(Clone, Default, PartialEq)]
13062        #[non_exhaustive]
13063        pub struct CustomGenAiModelInfo {
13064
13065            /// The type of custom model created by the user.
13066            pub custom_model_type: crate::model::processor_version::gen_ai_model_info::custom_gen_ai_model_info::CustomModelType,
13067
13068            /// The base processor version ID for the custom model.
13069            pub base_processor_version_id: std::string::String,
13070
13071            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13072        }
13073
13074        impl CustomGenAiModelInfo {
13075            pub fn new() -> Self {
13076                std::default::Default::default()
13077            }
13078
13079            /// Sets the value of [custom_model_type][crate::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo::custom_model_type].
13080            pub fn set_custom_model_type<T: std::convert::Into<crate::model::processor_version::gen_ai_model_info::custom_gen_ai_model_info::CustomModelType>>(mut self, v: T) -> Self{
13081                self.custom_model_type = v.into();
13082                self
13083            }
13084
13085            /// Sets the value of [base_processor_version_id][crate::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo::base_processor_version_id].
13086            pub fn set_base_processor_version_id<T: std::convert::Into<std::string::String>>(
13087                mut self,
13088                v: T,
13089            ) -> Self {
13090                self.base_processor_version_id = v.into();
13091                self
13092            }
13093        }
13094
13095        impl wkt::message::Message for CustomGenAiModelInfo {
13096            fn typename() -> &'static str {
13097                "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo"
13098            }
13099        }
13100
13101        /// Defines additional types related to [CustomGenAiModelInfo].
13102        pub mod custom_gen_ai_model_info {
13103            #[allow(unused_imports)]
13104            use super::*;
13105
13106            /// The type of custom model created by the user.
13107            ///
13108            /// # Working with unknown values
13109            ///
13110            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13111            /// additional enum variants at any time. Adding new variants is not considered
13112            /// a breaking change. Applications should write their code in anticipation of:
13113            ///
13114            /// - New values appearing in future releases of the client library, **and**
13115            /// - New values received dynamically, without application changes.
13116            ///
13117            /// Please consult the [Working with enums] section in the user guide for some
13118            /// guidelines.
13119            ///
13120            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13121            #[derive(Clone, Debug, PartialEq)]
13122            #[non_exhaustive]
13123            pub enum CustomModelType {
13124                /// The model type is unspecified.
13125                Unspecified,
13126                /// The model is a versioned foundation model.
13127                VersionedFoundation,
13128                /// The model is a finetuned foundation model.
13129                FineTuned,
13130                /// If set, the enum was initialized with an unknown value.
13131                ///
13132                /// Applications can examine the value using [CustomModelType::value] or
13133                /// [CustomModelType::name].
13134                UnknownValue(custom_model_type::UnknownValue),
13135            }
13136
13137            #[doc(hidden)]
13138            pub mod custom_model_type {
13139                #[allow(unused_imports)]
13140                use super::*;
13141                #[derive(Clone, Debug, PartialEq)]
13142                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13143            }
13144
13145            impl CustomModelType {
13146                /// Gets the enum value.
13147                ///
13148                /// Returns `None` if the enum contains an unknown value deserialized from
13149                /// the string representation of enums.
13150                pub fn value(&self) -> std::option::Option<i32> {
13151                    match self {
13152                        Self::Unspecified => std::option::Option::Some(0),
13153                        Self::VersionedFoundation => std::option::Option::Some(1),
13154                        Self::FineTuned => std::option::Option::Some(2),
13155                        Self::UnknownValue(u) => u.0.value(),
13156                    }
13157                }
13158
13159                /// Gets the enum value as a string.
13160                ///
13161                /// Returns `None` if the enum contains an unknown value deserialized from
13162                /// the integer representation of enums.
13163                pub fn name(&self) -> std::option::Option<&str> {
13164                    match self {
13165                        Self::Unspecified => {
13166                            std::option::Option::Some("CUSTOM_MODEL_TYPE_UNSPECIFIED")
13167                        }
13168                        Self::VersionedFoundation => {
13169                            std::option::Option::Some("VERSIONED_FOUNDATION")
13170                        }
13171                        Self::FineTuned => std::option::Option::Some("FINE_TUNED"),
13172                        Self::UnknownValue(u) => u.0.name(),
13173                    }
13174                }
13175            }
13176
13177            impl std::default::Default for CustomModelType {
13178                fn default() -> Self {
13179                    use std::convert::From;
13180                    Self::from(0)
13181                }
13182            }
13183
13184            impl std::fmt::Display for CustomModelType {
13185                fn fmt(
13186                    &self,
13187                    f: &mut std::fmt::Formatter<'_>,
13188                ) -> std::result::Result<(), std::fmt::Error> {
13189                    wkt::internal::display_enum(f, self.name(), self.value())
13190                }
13191            }
13192
13193            impl std::convert::From<i32> for CustomModelType {
13194                fn from(value: i32) -> Self {
13195                    match value {
13196                        0 => Self::Unspecified,
13197                        1 => Self::VersionedFoundation,
13198                        2 => Self::FineTuned,
13199                        _ => Self::UnknownValue(custom_model_type::UnknownValue(
13200                            wkt::internal::UnknownEnumValue::Integer(value),
13201                        )),
13202                    }
13203                }
13204            }
13205
13206            impl std::convert::From<&str> for CustomModelType {
13207                fn from(value: &str) -> Self {
13208                    use std::string::ToString;
13209                    match value {
13210                        "CUSTOM_MODEL_TYPE_UNSPECIFIED" => Self::Unspecified,
13211                        "VERSIONED_FOUNDATION" => Self::VersionedFoundation,
13212                        "FINE_TUNED" => Self::FineTuned,
13213                        _ => Self::UnknownValue(custom_model_type::UnknownValue(
13214                            wkt::internal::UnknownEnumValue::String(value.to_string()),
13215                        )),
13216                    }
13217                }
13218            }
13219
13220            impl serde::ser::Serialize for CustomModelType {
13221                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13222                where
13223                    S: serde::Serializer,
13224                {
13225                    match self {
13226                        Self::Unspecified => serializer.serialize_i32(0),
13227                        Self::VersionedFoundation => serializer.serialize_i32(1),
13228                        Self::FineTuned => serializer.serialize_i32(2),
13229                        Self::UnknownValue(u) => u.0.serialize(serializer),
13230                    }
13231                }
13232            }
13233
13234            impl<'de> serde::de::Deserialize<'de> for CustomModelType {
13235                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13236                where
13237                    D: serde::Deserializer<'de>,
13238                {
13239                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<CustomModelType>::new(
13240                        ".google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType"))
13241                }
13242            }
13243        }
13244
13245        /// The processor version is either a pretrained Google-managed foundation
13246        /// model or a custom Generative AI model created by the user.
13247        #[derive(Clone, Debug, PartialEq)]
13248        #[non_exhaustive]
13249        pub enum ModelInfo {
13250            /// Information for a pretrained Google-managed foundation model.
13251            FoundationGenAiModelInfo(
13252                std::boxed::Box<
13253                    crate::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo,
13254                >,
13255            ),
13256            /// Information for a custom Generative AI model created by the user.
13257            CustomGenAiModelInfo(
13258                std::boxed::Box<
13259                    crate::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo,
13260                >,
13261            ),
13262        }
13263    }
13264
13265    /// The possible states of the processor version.
13266    ///
13267    /// # Working with unknown values
13268    ///
13269    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13270    /// additional enum variants at any time. Adding new variants is not considered
13271    /// a breaking change. Applications should write their code in anticipation of:
13272    ///
13273    /// - New values appearing in future releases of the client library, **and**
13274    /// - New values received dynamically, without application changes.
13275    ///
13276    /// Please consult the [Working with enums] section in the user guide for some
13277    /// guidelines.
13278    ///
13279    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13280    #[derive(Clone, Debug, PartialEq)]
13281    #[non_exhaustive]
13282    pub enum State {
13283        /// The processor version is in an unspecified state.
13284        Unspecified,
13285        /// The processor version is deployed and can be used for processing.
13286        Deployed,
13287        /// The processor version is being deployed.
13288        Deploying,
13289        /// The processor version is not deployed and cannot be used for processing.
13290        Undeployed,
13291        /// The processor version is being undeployed.
13292        Undeploying,
13293        /// The processor version is being created.
13294        Creating,
13295        /// The processor version is being deleted.
13296        Deleting,
13297        /// The processor version failed and is in an indeterminate state.
13298        Failed,
13299        /// The processor version is being imported.
13300        Importing,
13301        /// If set, the enum was initialized with an unknown value.
13302        ///
13303        /// Applications can examine the value using [State::value] or
13304        /// [State::name].
13305        UnknownValue(state::UnknownValue),
13306    }
13307
13308    #[doc(hidden)]
13309    pub mod state {
13310        #[allow(unused_imports)]
13311        use super::*;
13312        #[derive(Clone, Debug, PartialEq)]
13313        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13314    }
13315
13316    impl State {
13317        /// Gets the enum value.
13318        ///
13319        /// Returns `None` if the enum contains an unknown value deserialized from
13320        /// the string representation of enums.
13321        pub fn value(&self) -> std::option::Option<i32> {
13322            match self {
13323                Self::Unspecified => std::option::Option::Some(0),
13324                Self::Deployed => std::option::Option::Some(1),
13325                Self::Deploying => std::option::Option::Some(2),
13326                Self::Undeployed => std::option::Option::Some(3),
13327                Self::Undeploying => std::option::Option::Some(4),
13328                Self::Creating => std::option::Option::Some(5),
13329                Self::Deleting => std::option::Option::Some(6),
13330                Self::Failed => std::option::Option::Some(7),
13331                Self::Importing => std::option::Option::Some(8),
13332                Self::UnknownValue(u) => u.0.value(),
13333            }
13334        }
13335
13336        /// Gets the enum value as a string.
13337        ///
13338        /// Returns `None` if the enum contains an unknown value deserialized from
13339        /// the integer representation of enums.
13340        pub fn name(&self) -> std::option::Option<&str> {
13341            match self {
13342                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13343                Self::Deployed => std::option::Option::Some("DEPLOYED"),
13344                Self::Deploying => std::option::Option::Some("DEPLOYING"),
13345                Self::Undeployed => std::option::Option::Some("UNDEPLOYED"),
13346                Self::Undeploying => std::option::Option::Some("UNDEPLOYING"),
13347                Self::Creating => std::option::Option::Some("CREATING"),
13348                Self::Deleting => std::option::Option::Some("DELETING"),
13349                Self::Failed => std::option::Option::Some("FAILED"),
13350                Self::Importing => std::option::Option::Some("IMPORTING"),
13351                Self::UnknownValue(u) => u.0.name(),
13352            }
13353        }
13354    }
13355
13356    impl std::default::Default for State {
13357        fn default() -> Self {
13358            use std::convert::From;
13359            Self::from(0)
13360        }
13361    }
13362
13363    impl std::fmt::Display for State {
13364        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13365            wkt::internal::display_enum(f, self.name(), self.value())
13366        }
13367    }
13368
13369    impl std::convert::From<i32> for State {
13370        fn from(value: i32) -> Self {
13371            match value {
13372                0 => Self::Unspecified,
13373                1 => Self::Deployed,
13374                2 => Self::Deploying,
13375                3 => Self::Undeployed,
13376                4 => Self::Undeploying,
13377                5 => Self::Creating,
13378                6 => Self::Deleting,
13379                7 => Self::Failed,
13380                8 => Self::Importing,
13381                _ => Self::UnknownValue(state::UnknownValue(
13382                    wkt::internal::UnknownEnumValue::Integer(value),
13383                )),
13384            }
13385        }
13386    }
13387
13388    impl std::convert::From<&str> for State {
13389        fn from(value: &str) -> Self {
13390            use std::string::ToString;
13391            match value {
13392                "STATE_UNSPECIFIED" => Self::Unspecified,
13393                "DEPLOYED" => Self::Deployed,
13394                "DEPLOYING" => Self::Deploying,
13395                "UNDEPLOYED" => Self::Undeployed,
13396                "UNDEPLOYING" => Self::Undeploying,
13397                "CREATING" => Self::Creating,
13398                "DELETING" => Self::Deleting,
13399                "FAILED" => Self::Failed,
13400                "IMPORTING" => Self::Importing,
13401                _ => Self::UnknownValue(state::UnknownValue(
13402                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13403                )),
13404            }
13405        }
13406    }
13407
13408    impl serde::ser::Serialize for State {
13409        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13410        where
13411            S: serde::Serializer,
13412        {
13413            match self {
13414                Self::Unspecified => serializer.serialize_i32(0),
13415                Self::Deployed => serializer.serialize_i32(1),
13416                Self::Deploying => serializer.serialize_i32(2),
13417                Self::Undeployed => serializer.serialize_i32(3),
13418                Self::Undeploying => serializer.serialize_i32(4),
13419                Self::Creating => serializer.serialize_i32(5),
13420                Self::Deleting => serializer.serialize_i32(6),
13421                Self::Failed => serializer.serialize_i32(7),
13422                Self::Importing => serializer.serialize_i32(8),
13423                Self::UnknownValue(u) => u.0.serialize(serializer),
13424            }
13425        }
13426    }
13427
13428    impl<'de> serde::de::Deserialize<'de> for State {
13429        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13430        where
13431            D: serde::Deserializer<'de>,
13432        {
13433            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13434                ".google.cloud.documentai.v1.ProcessorVersion.State",
13435            ))
13436        }
13437    }
13438
13439    /// The possible model types of the processor version.
13440    ///
13441    /// # Working with unknown values
13442    ///
13443    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13444    /// additional enum variants at any time. Adding new variants is not considered
13445    /// a breaking change. Applications should write their code in anticipation of:
13446    ///
13447    /// - New values appearing in future releases of the client library, **and**
13448    /// - New values received dynamically, without application changes.
13449    ///
13450    /// Please consult the [Working with enums] section in the user guide for some
13451    /// guidelines.
13452    ///
13453    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13454    #[derive(Clone, Debug, PartialEq)]
13455    #[non_exhaustive]
13456    pub enum ModelType {
13457        /// The processor version has unspecified model type.
13458        Unspecified,
13459        /// The processor version has generative model type.
13460        Generative,
13461        /// The processor version has custom model type.
13462        Custom,
13463        /// If set, the enum was initialized with an unknown value.
13464        ///
13465        /// Applications can examine the value using [ModelType::value] or
13466        /// [ModelType::name].
13467        UnknownValue(model_type::UnknownValue),
13468    }
13469
13470    #[doc(hidden)]
13471    pub mod model_type {
13472        #[allow(unused_imports)]
13473        use super::*;
13474        #[derive(Clone, Debug, PartialEq)]
13475        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13476    }
13477
13478    impl ModelType {
13479        /// Gets the enum value.
13480        ///
13481        /// Returns `None` if the enum contains an unknown value deserialized from
13482        /// the string representation of enums.
13483        pub fn value(&self) -> std::option::Option<i32> {
13484            match self {
13485                Self::Unspecified => std::option::Option::Some(0),
13486                Self::Generative => std::option::Option::Some(1),
13487                Self::Custom => std::option::Option::Some(2),
13488                Self::UnknownValue(u) => u.0.value(),
13489            }
13490        }
13491
13492        /// Gets the enum value as a string.
13493        ///
13494        /// Returns `None` if the enum contains an unknown value deserialized from
13495        /// the integer representation of enums.
13496        pub fn name(&self) -> std::option::Option<&str> {
13497            match self {
13498                Self::Unspecified => std::option::Option::Some("MODEL_TYPE_UNSPECIFIED"),
13499                Self::Generative => std::option::Option::Some("MODEL_TYPE_GENERATIVE"),
13500                Self::Custom => std::option::Option::Some("MODEL_TYPE_CUSTOM"),
13501                Self::UnknownValue(u) => u.0.name(),
13502            }
13503        }
13504    }
13505
13506    impl std::default::Default for ModelType {
13507        fn default() -> Self {
13508            use std::convert::From;
13509            Self::from(0)
13510        }
13511    }
13512
13513    impl std::fmt::Display for ModelType {
13514        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13515            wkt::internal::display_enum(f, self.name(), self.value())
13516        }
13517    }
13518
13519    impl std::convert::From<i32> for ModelType {
13520        fn from(value: i32) -> Self {
13521            match value {
13522                0 => Self::Unspecified,
13523                1 => Self::Generative,
13524                2 => Self::Custom,
13525                _ => Self::UnknownValue(model_type::UnknownValue(
13526                    wkt::internal::UnknownEnumValue::Integer(value),
13527                )),
13528            }
13529        }
13530    }
13531
13532    impl std::convert::From<&str> for ModelType {
13533        fn from(value: &str) -> Self {
13534            use std::string::ToString;
13535            match value {
13536                "MODEL_TYPE_UNSPECIFIED" => Self::Unspecified,
13537                "MODEL_TYPE_GENERATIVE" => Self::Generative,
13538                "MODEL_TYPE_CUSTOM" => Self::Custom,
13539                _ => Self::UnknownValue(model_type::UnknownValue(
13540                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13541                )),
13542            }
13543        }
13544    }
13545
13546    impl serde::ser::Serialize for ModelType {
13547        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13548        where
13549            S: serde::Serializer,
13550        {
13551            match self {
13552                Self::Unspecified => serializer.serialize_i32(0),
13553                Self::Generative => serializer.serialize_i32(1),
13554                Self::Custom => serializer.serialize_i32(2),
13555                Self::UnknownValue(u) => u.0.serialize(serializer),
13556            }
13557        }
13558    }
13559
13560    impl<'de> serde::de::Deserialize<'de> for ModelType {
13561        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13562        where
13563            D: serde::Deserializer<'de>,
13564        {
13565            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ModelType>::new(
13566                ".google.cloud.documentai.v1.ProcessorVersion.ModelType",
13567            ))
13568        }
13569    }
13570}
13571
13572/// Contains the alias and the aliased resource name of processor version.
13573#[derive(Clone, Default, PartialEq)]
13574#[non_exhaustive]
13575pub struct ProcessorVersionAlias {
13576    /// The alias in the form of `processor_version` resource name.
13577    pub alias: std::string::String,
13578
13579    /// The resource name of aliased processor version.
13580    pub processor_version: std::string::String,
13581
13582    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13583}
13584
13585impl ProcessorVersionAlias {
13586    pub fn new() -> Self {
13587        std::default::Default::default()
13588    }
13589
13590    /// Sets the value of [alias][crate::model::ProcessorVersionAlias::alias].
13591    pub fn set_alias<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13592        self.alias = v.into();
13593        self
13594    }
13595
13596    /// Sets the value of [processor_version][crate::model::ProcessorVersionAlias::processor_version].
13597    pub fn set_processor_version<T: std::convert::Into<std::string::String>>(
13598        mut self,
13599        v: T,
13600    ) -> Self {
13601        self.processor_version = v.into();
13602        self
13603    }
13604}
13605
13606impl wkt::message::Message for ProcessorVersionAlias {
13607    fn typename() -> &'static str {
13608        "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersionAlias"
13609    }
13610}
13611
13612/// The first-class citizen for Document AI. Each processor defines how to
13613/// extract structural information from a document.
13614#[derive(Clone, Default, PartialEq)]
13615#[non_exhaustive]
13616pub struct Processor {
13617    /// Output only. Immutable. The resource name of the processor.
13618    /// Format: `projects/{project}/locations/{location}/processors/{processor}`
13619    pub name: std::string::String,
13620
13621    /// The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`.
13622    /// To get a list of processor types, see
13623    /// [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
13624    ///
13625    /// [google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]: crate::client::DocumentProcessorService::fetch_processor_types
13626    pub r#type: std::string::String,
13627
13628    /// The display name of the processor.
13629    pub display_name: std::string::String,
13630
13631    /// Output only. The state of the processor.
13632    pub state: crate::model::processor::State,
13633
13634    /// The default processor version.
13635    pub default_processor_version: std::string::String,
13636
13637    /// Output only. The processor version aliases.
13638    pub processor_version_aliases: std::vec::Vec<crate::model::ProcessorVersionAlias>,
13639
13640    /// Output only. Immutable. The http endpoint that can be called to invoke
13641    /// processing.
13642    pub process_endpoint: std::string::String,
13643
13644    /// Output only. The time the processor was created.
13645    pub create_time: std::option::Option<wkt::Timestamp>,
13646
13647    /// The [KMS key](https://cloud.google.com/security-key-management) used for
13648    /// encryption and decryption in CMEK scenarios.
13649    pub kms_key_name: std::string::String,
13650
13651    /// Output only. Reserved for future use.
13652    pub satisfies_pzs: bool,
13653
13654    /// Output only. Reserved for future use.
13655    pub satisfies_pzi: bool,
13656
13657    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13658}
13659
13660impl Processor {
13661    pub fn new() -> Self {
13662        std::default::Default::default()
13663    }
13664
13665    /// Sets the value of [name][crate::model::Processor::name].
13666    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13667        self.name = v.into();
13668        self
13669    }
13670
13671    /// Sets the value of [r#type][crate::model::Processor::type].
13672    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13673        self.r#type = v.into();
13674        self
13675    }
13676
13677    /// Sets the value of [display_name][crate::model::Processor::display_name].
13678    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13679        self.display_name = v.into();
13680        self
13681    }
13682
13683    /// Sets the value of [state][crate::model::Processor::state].
13684    pub fn set_state<T: std::convert::Into<crate::model::processor::State>>(
13685        mut self,
13686        v: T,
13687    ) -> Self {
13688        self.state = v.into();
13689        self
13690    }
13691
13692    /// Sets the value of [default_processor_version][crate::model::Processor::default_processor_version].
13693    pub fn set_default_processor_version<T: std::convert::Into<std::string::String>>(
13694        mut self,
13695        v: T,
13696    ) -> Self {
13697        self.default_processor_version = v.into();
13698        self
13699    }
13700
13701    /// Sets the value of [processor_version_aliases][crate::model::Processor::processor_version_aliases].
13702    pub fn set_processor_version_aliases<T, V>(mut self, v: T) -> Self
13703    where
13704        T: std::iter::IntoIterator<Item = V>,
13705        V: std::convert::Into<crate::model::ProcessorVersionAlias>,
13706    {
13707        use std::iter::Iterator;
13708        self.processor_version_aliases = v.into_iter().map(|i| i.into()).collect();
13709        self
13710    }
13711
13712    /// Sets the value of [process_endpoint][crate::model::Processor::process_endpoint].
13713    pub fn set_process_endpoint<T: std::convert::Into<std::string::String>>(
13714        mut self,
13715        v: T,
13716    ) -> Self {
13717        self.process_endpoint = v.into();
13718        self
13719    }
13720
13721    /// Sets the value of [create_time][crate::model::Processor::create_time].
13722    pub fn set_create_time<T>(mut self, v: T) -> Self
13723    where
13724        T: std::convert::Into<wkt::Timestamp>,
13725    {
13726        self.create_time = std::option::Option::Some(v.into());
13727        self
13728    }
13729
13730    /// Sets or clears the value of [create_time][crate::model::Processor::create_time].
13731    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13732    where
13733        T: std::convert::Into<wkt::Timestamp>,
13734    {
13735        self.create_time = v.map(|x| x.into());
13736        self
13737    }
13738
13739    /// Sets the value of [kms_key_name][crate::model::Processor::kms_key_name].
13740    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13741        self.kms_key_name = v.into();
13742        self
13743    }
13744
13745    /// Sets the value of [satisfies_pzs][crate::model::Processor::satisfies_pzs].
13746    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13747        self.satisfies_pzs = v.into();
13748        self
13749    }
13750
13751    /// Sets the value of [satisfies_pzi][crate::model::Processor::satisfies_pzi].
13752    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13753        self.satisfies_pzi = v.into();
13754        self
13755    }
13756}
13757
13758impl wkt::message::Message for Processor {
13759    fn typename() -> &'static str {
13760        "type.googleapis.com/google.cloud.documentai.v1.Processor"
13761    }
13762}
13763
13764/// Defines additional types related to [Processor].
13765pub mod processor {
13766    #[allow(unused_imports)]
13767    use super::*;
13768
13769    /// The possible states of the processor.
13770    ///
13771    /// # Working with unknown values
13772    ///
13773    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13774    /// additional enum variants at any time. Adding new variants is not considered
13775    /// a breaking change. Applications should write their code in anticipation of:
13776    ///
13777    /// - New values appearing in future releases of the client library, **and**
13778    /// - New values received dynamically, without application changes.
13779    ///
13780    /// Please consult the [Working with enums] section in the user guide for some
13781    /// guidelines.
13782    ///
13783    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13784    #[derive(Clone, Debug, PartialEq)]
13785    #[non_exhaustive]
13786    pub enum State {
13787        /// The processor is in an unspecified state.
13788        Unspecified,
13789        /// The processor is enabled, i.e., has an enabled version which can
13790        /// currently serve processing requests and all the feature dependencies have
13791        /// been successfully initialized.
13792        Enabled,
13793        /// The processor is disabled.
13794        Disabled,
13795        /// The processor is being enabled, will become `ENABLED` if successful.
13796        Enabling,
13797        /// The processor is being disabled, will become `DISABLED` if successful.
13798        Disabling,
13799        /// The processor is being created, will become either `ENABLED` (for
13800        /// successful creation) or `FAILED` (for failed ones).
13801        /// Once a processor is in this state, it can then be used for document
13802        /// processing, but the feature dependencies of the processor might not be
13803        /// fully created yet.
13804        Creating,
13805        /// The processor failed during creation or initialization of feature
13806        /// dependencies. The user should delete the processor and recreate one as
13807        /// all the functionalities of the processor are disabled.
13808        Failed,
13809        /// The processor is being deleted, will be removed if successful.
13810        Deleting,
13811        /// If set, the enum was initialized with an unknown value.
13812        ///
13813        /// Applications can examine the value using [State::value] or
13814        /// [State::name].
13815        UnknownValue(state::UnknownValue),
13816    }
13817
13818    #[doc(hidden)]
13819    pub mod state {
13820        #[allow(unused_imports)]
13821        use super::*;
13822        #[derive(Clone, Debug, PartialEq)]
13823        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13824    }
13825
13826    impl State {
13827        /// Gets the enum value.
13828        ///
13829        /// Returns `None` if the enum contains an unknown value deserialized from
13830        /// the string representation of enums.
13831        pub fn value(&self) -> std::option::Option<i32> {
13832            match self {
13833                Self::Unspecified => std::option::Option::Some(0),
13834                Self::Enabled => std::option::Option::Some(1),
13835                Self::Disabled => std::option::Option::Some(2),
13836                Self::Enabling => std::option::Option::Some(3),
13837                Self::Disabling => std::option::Option::Some(4),
13838                Self::Creating => std::option::Option::Some(5),
13839                Self::Failed => std::option::Option::Some(6),
13840                Self::Deleting => std::option::Option::Some(7),
13841                Self::UnknownValue(u) => u.0.value(),
13842            }
13843        }
13844
13845        /// Gets the enum value as a string.
13846        ///
13847        /// Returns `None` if the enum contains an unknown value deserialized from
13848        /// the integer representation of enums.
13849        pub fn name(&self) -> std::option::Option<&str> {
13850            match self {
13851                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13852                Self::Enabled => std::option::Option::Some("ENABLED"),
13853                Self::Disabled => std::option::Option::Some("DISABLED"),
13854                Self::Enabling => std::option::Option::Some("ENABLING"),
13855                Self::Disabling => std::option::Option::Some("DISABLING"),
13856                Self::Creating => std::option::Option::Some("CREATING"),
13857                Self::Failed => std::option::Option::Some("FAILED"),
13858                Self::Deleting => std::option::Option::Some("DELETING"),
13859                Self::UnknownValue(u) => u.0.name(),
13860            }
13861        }
13862    }
13863
13864    impl std::default::Default for State {
13865        fn default() -> Self {
13866            use std::convert::From;
13867            Self::from(0)
13868        }
13869    }
13870
13871    impl std::fmt::Display for State {
13872        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13873            wkt::internal::display_enum(f, self.name(), self.value())
13874        }
13875    }
13876
13877    impl std::convert::From<i32> for State {
13878        fn from(value: i32) -> Self {
13879            match value {
13880                0 => Self::Unspecified,
13881                1 => Self::Enabled,
13882                2 => Self::Disabled,
13883                3 => Self::Enabling,
13884                4 => Self::Disabling,
13885                5 => Self::Creating,
13886                6 => Self::Failed,
13887                7 => Self::Deleting,
13888                _ => Self::UnknownValue(state::UnknownValue(
13889                    wkt::internal::UnknownEnumValue::Integer(value),
13890                )),
13891            }
13892        }
13893    }
13894
13895    impl std::convert::From<&str> for State {
13896        fn from(value: &str) -> Self {
13897            use std::string::ToString;
13898            match value {
13899                "STATE_UNSPECIFIED" => Self::Unspecified,
13900                "ENABLED" => Self::Enabled,
13901                "DISABLED" => Self::Disabled,
13902                "ENABLING" => Self::Enabling,
13903                "DISABLING" => Self::Disabling,
13904                "CREATING" => Self::Creating,
13905                "FAILED" => Self::Failed,
13906                "DELETING" => Self::Deleting,
13907                _ => Self::UnknownValue(state::UnknownValue(
13908                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13909                )),
13910            }
13911        }
13912    }
13913
13914    impl serde::ser::Serialize for State {
13915        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13916        where
13917            S: serde::Serializer,
13918        {
13919            match self {
13920                Self::Unspecified => serializer.serialize_i32(0),
13921                Self::Enabled => serializer.serialize_i32(1),
13922                Self::Disabled => serializer.serialize_i32(2),
13923                Self::Enabling => serializer.serialize_i32(3),
13924                Self::Disabling => serializer.serialize_i32(4),
13925                Self::Creating => serializer.serialize_i32(5),
13926                Self::Failed => serializer.serialize_i32(6),
13927                Self::Deleting => serializer.serialize_i32(7),
13928                Self::UnknownValue(u) => u.0.serialize(serializer),
13929            }
13930        }
13931    }
13932
13933    impl<'de> serde::de::Deserialize<'de> for State {
13934        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13935        where
13936            D: serde::Deserializer<'de>,
13937        {
13938            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13939                ".google.cloud.documentai.v1.Processor.State",
13940            ))
13941        }
13942    }
13943}
13944
13945/// A processor type is responsible for performing a certain document
13946/// understanding task on a certain type of document.
13947#[derive(Clone, Default, PartialEq)]
13948#[non_exhaustive]
13949pub struct ProcessorType {
13950    /// The resource name of the processor type.
13951    /// Format: `projects/{project}/processorTypes/{processor_type}`
13952    pub name: std::string::String,
13953
13954    /// The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`.
13955    pub r#type: std::string::String,
13956
13957    /// The processor category, used by UI to group processor types.
13958    pub category: std::string::String,
13959
13960    /// The locations in which this processor is available.
13961    pub available_locations: std::vec::Vec<crate::model::processor_type::LocationInfo>,
13962
13963    /// Whether the processor type allows creation. If true, users can create a
13964    /// processor of this processor type. Otherwise, users need to request access.
13965    pub allow_creation: bool,
13966
13967    /// Launch stage of the processor type
13968    pub launch_stage: api::model::LaunchStage,
13969
13970    /// A set of Cloud Storage URIs of sample documents for this processor.
13971    pub sample_document_uris: std::vec::Vec<std::string::String>,
13972
13973    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13974}
13975
13976impl ProcessorType {
13977    pub fn new() -> Self {
13978        std::default::Default::default()
13979    }
13980
13981    /// Sets the value of [name][crate::model::ProcessorType::name].
13982    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13983        self.name = v.into();
13984        self
13985    }
13986
13987    /// Sets the value of [r#type][crate::model::ProcessorType::type].
13988    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13989        self.r#type = v.into();
13990        self
13991    }
13992
13993    /// Sets the value of [category][crate::model::ProcessorType::category].
13994    pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13995        self.category = v.into();
13996        self
13997    }
13998
13999    /// Sets the value of [available_locations][crate::model::ProcessorType::available_locations].
14000    pub fn set_available_locations<T, V>(mut self, v: T) -> Self
14001    where
14002        T: std::iter::IntoIterator<Item = V>,
14003        V: std::convert::Into<crate::model::processor_type::LocationInfo>,
14004    {
14005        use std::iter::Iterator;
14006        self.available_locations = v.into_iter().map(|i| i.into()).collect();
14007        self
14008    }
14009
14010    /// Sets the value of [allow_creation][crate::model::ProcessorType::allow_creation].
14011    pub fn set_allow_creation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14012        self.allow_creation = v.into();
14013        self
14014    }
14015
14016    /// Sets the value of [launch_stage][crate::model::ProcessorType::launch_stage].
14017    pub fn set_launch_stage<T: std::convert::Into<api::model::LaunchStage>>(
14018        mut self,
14019        v: T,
14020    ) -> Self {
14021        self.launch_stage = v.into();
14022        self
14023    }
14024
14025    /// Sets the value of [sample_document_uris][crate::model::ProcessorType::sample_document_uris].
14026    pub fn set_sample_document_uris<T, V>(mut self, v: T) -> Self
14027    where
14028        T: std::iter::IntoIterator<Item = V>,
14029        V: std::convert::Into<std::string::String>,
14030    {
14031        use std::iter::Iterator;
14032        self.sample_document_uris = v.into_iter().map(|i| i.into()).collect();
14033        self
14034    }
14035}
14036
14037impl wkt::message::Message for ProcessorType {
14038    fn typename() -> &'static str {
14039        "type.googleapis.com/google.cloud.documentai.v1.ProcessorType"
14040    }
14041}
14042
14043/// Defines additional types related to [ProcessorType].
14044pub mod processor_type {
14045    #[allow(unused_imports)]
14046    use super::*;
14047
14048    /// The location information about where the processor is available.
14049    #[derive(Clone, Default, PartialEq)]
14050    #[non_exhaustive]
14051    pub struct LocationInfo {
14052        /// The location ID. For supported locations, refer to [regional and
14053        /// multi-regional support](/document-ai/docs/regions).
14054        pub location_id: std::string::String,
14055
14056        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14057    }
14058
14059    impl LocationInfo {
14060        pub fn new() -> Self {
14061            std::default::Default::default()
14062        }
14063
14064        /// Sets the value of [location_id][crate::model::processor_type::LocationInfo::location_id].
14065        pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14066            self.location_id = v.into();
14067            self
14068        }
14069    }
14070
14071    impl wkt::message::Message for LocationInfo {
14072        fn typename() -> &'static str {
14073            "type.googleapis.com/google.cloud.documentai.v1.ProcessorType.LocationInfo"
14074        }
14075    }
14076}