Skip to main content

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 async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_api;
24extern crate google_cloud_gax;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate google_cloud_type;
30extern crate lazy_static;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// Encodes the detailed information of a barcode.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct Barcode {
46    /// Format of a barcode.
47    /// The supported formats are:
48    ///
49    /// - `CODE_128`: Code 128 type.
50    /// - `CODE_39`: Code 39 type.
51    /// - `CODE_93`: Code 93 type.
52    /// - `CODABAR`: Codabar type.
53    /// - `DATA_MATRIX`: 2D Data Matrix type.
54    /// - `ITF`: ITF type.
55    /// - `EAN_13`: EAN-13 type.
56    /// - `EAN_8`: EAN-8 type.
57    /// - `QR_CODE`: 2D QR code type.
58    /// - `UPC_A`: UPC-A type.
59    /// - `UPC_E`: UPC-E type.
60    /// - `PDF417`: PDF417 type.
61    /// - `AZTEC`: 2D Aztec code type.
62    /// - `DATABAR`: GS1 DataBar code type.
63    pub format: std::string::String,
64
65    /// Value format describes the format of the value that a barcode
66    /// encodes.
67    /// The supported formats are:
68    ///
69    /// - `CONTACT_INFO`: Contact information.
70    /// - `EMAIL`: Email address.
71    /// - `ISBN`: ISBN identifier.
72    /// - `PHONE`: Phone number.
73    /// - `PRODUCT`: Product.
74    /// - `SMS`: SMS message.
75    /// - `TEXT`: Text string.
76    /// - `URL`: URL address.
77    /// - `WIFI`: Wifi information.
78    /// - `GEO`: Geo-localization.
79    /// - `CALENDAR_EVENT`: Calendar event.
80    /// - `DRIVER_LICENSE`: Driver's license.
81    pub value_format: std::string::String,
82
83    /// Raw value encoded in the barcode.
84    /// For example: `'MEBKM:TITLE:Google;URL:<https://www.google.com>;;'`.
85    pub raw_value: std::string::String,
86
87    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
88}
89
90impl Barcode {
91    pub fn new() -> Self {
92        std::default::Default::default()
93    }
94
95    /// Sets the value of [format][crate::model::Barcode::format].
96    ///
97    /// # Example
98    /// ```ignore,no_run
99    /// # use google_cloud_documentai_v1::model::Barcode;
100    /// let x = Barcode::new().set_format("example");
101    /// ```
102    pub fn set_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
103        self.format = v.into();
104        self
105    }
106
107    /// Sets the value of [value_format][crate::model::Barcode::value_format].
108    ///
109    /// # Example
110    /// ```ignore,no_run
111    /// # use google_cloud_documentai_v1::model::Barcode;
112    /// let x = Barcode::new().set_value_format("example");
113    /// ```
114    pub fn set_value_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
115        self.value_format = v.into();
116        self
117    }
118
119    /// Sets the value of [raw_value][crate::model::Barcode::raw_value].
120    ///
121    /// # Example
122    /// ```ignore,no_run
123    /// # use google_cloud_documentai_v1::model::Barcode;
124    /// let x = Barcode::new().set_raw_value("example");
125    /// ```
126    pub fn set_raw_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
127        self.raw_value = v.into();
128        self
129    }
130}
131
132impl wkt::message::Message for Barcode {
133    fn typename() -> &'static str {
134        "type.googleapis.com/google.cloud.documentai.v1.Barcode"
135    }
136}
137
138/// Document represents the canonical document resource in Document AI. It is an
139/// interchange format that provides insights into documents and allows for
140/// collaboration between users and Document AI to iterate and optimize for
141/// quality.
142#[derive(Clone, Default, PartialEq)]
143#[non_exhaustive]
144pub struct Document {
145    /// Optional. An internal identifier for document. Should be loggable (no PII).
146    pub docid: std::string::String,
147
148    /// An IANA published [media type (MIME
149    /// type)](https://www.iana.org/assignments/media-types/media-types.xhtml).
150    pub mime_type: std::string::String,
151
152    /// Optional. UTF-8 encoded text in reading order from the document.
153    pub text: std::string::String,
154
155    /// Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
156    ///
157    /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
158    #[deprecated]
159    pub text_styles: std::vec::Vec<crate::model::document::Style>,
160
161    /// Visual page layout for the [Document][google.cloud.documentai.v1.Document].
162    ///
163    /// [google.cloud.documentai.v1.Document]: crate::model::Document
164    pub pages: std::vec::Vec<crate::model::document::Page>,
165
166    /// A list of entities detected on
167    /// [Document.text][google.cloud.documentai.v1.Document.text]. For document
168    /// shards, entities in this list may cross shard boundaries.
169    ///
170    /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
171    pub entities: std::vec::Vec<crate::model::document::Entity>,
172
173    /// Placeholder.  Relationship among
174    /// [Document.entities][google.cloud.documentai.v1.Document.entities].
175    ///
176    /// [google.cloud.documentai.v1.Document.entities]: crate::model::Document::entities
177    pub entity_relations: std::vec::Vec<crate::model::document::EntityRelation>,
178
179    /// Placeholder.  A list of text corrections made to
180    /// [Document.text][google.cloud.documentai.v1.Document.text].  This is usually
181    /// used for annotating corrections to OCR mistakes.  Text changes for a given
182    /// revision may not overlap with each other.
183    ///
184    /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
185    pub text_changes: std::vec::Vec<crate::model::document::TextChange>,
186
187    /// Information about the sharding if this document is sharded part of a larger
188    /// document. If the document is not sharded, this message is not specified.
189    pub shard_info: std::option::Option<crate::model::document::ShardInfo>,
190
191    /// Any error that occurred while processing this document.
192    pub error: std::option::Option<google_cloud_rpc::model::Status>,
193
194    /// Placeholder. Revision history of this document.
195    pub revisions: std::vec::Vec<crate::model::document::Revision>,
196
197    /// Parsed layout of the document.
198    pub document_layout: std::option::Option<crate::model::document::DocumentLayout>,
199
200    /// Document chunked based on chunking config.
201    pub chunked_document: std::option::Option<crate::model::document::ChunkedDocument>,
202
203    /// The entity validation output for the document. This is the validation
204    /// output for `document.entities` field.
205    pub entity_validation_output:
206        std::option::Option<crate::model::document::EntityValidationOutput>,
207
208    /// A list of entity revisions. The entity revisions are appended to the
209    /// document in the processing order. This field can be used for comparing the
210    /// entity extraction results at different stages of the processing.
211    pub entities_revisions: std::vec::Vec<crate::model::document::EntitiesRevision>,
212
213    /// The entity revision ID that `document.entities` field is based on.
214    /// If this field is set and `entities_revisions` is not empty, the entities in
215    /// `document.entities` field are the entities in the entity revision with this
216    /// ID and `document.entity_validation_output` field is the
217    /// `entity_validation_output` field in this entity revision.
218    pub entities_revision_id: std::string::String,
219
220    /// Original source document from the user.
221    pub source: std::option::Option<crate::model::document::Source>,
222
223    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
224}
225
226impl Document {
227    pub fn new() -> Self {
228        std::default::Default::default()
229    }
230
231    /// Sets the value of [docid][crate::model::Document::docid].
232    ///
233    /// # Example
234    /// ```ignore,no_run
235    /// # use google_cloud_documentai_v1::model::Document;
236    /// let x = Document::new().set_docid("example");
237    /// ```
238    pub fn set_docid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
239        self.docid = v.into();
240        self
241    }
242
243    /// Sets the value of [mime_type][crate::model::Document::mime_type].
244    ///
245    /// # Example
246    /// ```ignore,no_run
247    /// # use google_cloud_documentai_v1::model::Document;
248    /// let x = Document::new().set_mime_type("example");
249    /// ```
250    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
251        self.mime_type = v.into();
252        self
253    }
254
255    /// Sets the value of [text][crate::model::Document::text].
256    ///
257    /// # Example
258    /// ```ignore,no_run
259    /// # use google_cloud_documentai_v1::model::Document;
260    /// let x = Document::new().set_text("example");
261    /// ```
262    pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
263        self.text = v.into();
264        self
265    }
266
267    /// Sets the value of [text_styles][crate::model::Document::text_styles].
268    ///
269    /// # Example
270    /// ```ignore,no_run
271    /// # use google_cloud_documentai_v1::model::Document;
272    /// use google_cloud_documentai_v1::model::document::Style;
273    /// let x = Document::new()
274    ///     .set_text_styles([
275    ///         Style::default()/* use setters */,
276    ///         Style::default()/* use (different) setters */,
277    ///     ]);
278    /// ```
279    #[deprecated]
280    pub fn set_text_styles<T, V>(mut self, v: T) -> Self
281    where
282        T: std::iter::IntoIterator<Item = V>,
283        V: std::convert::Into<crate::model::document::Style>,
284    {
285        use std::iter::Iterator;
286        self.text_styles = v.into_iter().map(|i| i.into()).collect();
287        self
288    }
289
290    /// Sets the value of [pages][crate::model::Document::pages].
291    ///
292    /// # Example
293    /// ```ignore,no_run
294    /// # use google_cloud_documentai_v1::model::Document;
295    /// use google_cloud_documentai_v1::model::document::Page;
296    /// let x = Document::new()
297    ///     .set_pages([
298    ///         Page::default()/* use setters */,
299    ///         Page::default()/* use (different) setters */,
300    ///     ]);
301    /// ```
302    pub fn set_pages<T, V>(mut self, v: T) -> Self
303    where
304        T: std::iter::IntoIterator<Item = V>,
305        V: std::convert::Into<crate::model::document::Page>,
306    {
307        use std::iter::Iterator;
308        self.pages = v.into_iter().map(|i| i.into()).collect();
309        self
310    }
311
312    /// Sets the value of [entities][crate::model::Document::entities].
313    ///
314    /// # Example
315    /// ```ignore,no_run
316    /// # use google_cloud_documentai_v1::model::Document;
317    /// use google_cloud_documentai_v1::model::document::Entity;
318    /// let x = Document::new()
319    ///     .set_entities([
320    ///         Entity::default()/* use setters */,
321    ///         Entity::default()/* use (different) setters */,
322    ///     ]);
323    /// ```
324    pub fn set_entities<T, V>(mut self, v: T) -> Self
325    where
326        T: std::iter::IntoIterator<Item = V>,
327        V: std::convert::Into<crate::model::document::Entity>,
328    {
329        use std::iter::Iterator;
330        self.entities = v.into_iter().map(|i| i.into()).collect();
331        self
332    }
333
334    /// Sets the value of [entity_relations][crate::model::Document::entity_relations].
335    ///
336    /// # Example
337    /// ```ignore,no_run
338    /// # use google_cloud_documentai_v1::model::Document;
339    /// use google_cloud_documentai_v1::model::document::EntityRelation;
340    /// let x = Document::new()
341    ///     .set_entity_relations([
342    ///         EntityRelation::default()/* use setters */,
343    ///         EntityRelation::default()/* use (different) setters */,
344    ///     ]);
345    /// ```
346    pub fn set_entity_relations<T, V>(mut self, v: T) -> Self
347    where
348        T: std::iter::IntoIterator<Item = V>,
349        V: std::convert::Into<crate::model::document::EntityRelation>,
350    {
351        use std::iter::Iterator;
352        self.entity_relations = v.into_iter().map(|i| i.into()).collect();
353        self
354    }
355
356    /// Sets the value of [text_changes][crate::model::Document::text_changes].
357    ///
358    /// # Example
359    /// ```ignore,no_run
360    /// # use google_cloud_documentai_v1::model::Document;
361    /// use google_cloud_documentai_v1::model::document::TextChange;
362    /// let x = Document::new()
363    ///     .set_text_changes([
364    ///         TextChange::default()/* use setters */,
365    ///         TextChange::default()/* use (different) setters */,
366    ///     ]);
367    /// ```
368    pub fn set_text_changes<T, V>(mut self, v: T) -> Self
369    where
370        T: std::iter::IntoIterator<Item = V>,
371        V: std::convert::Into<crate::model::document::TextChange>,
372    {
373        use std::iter::Iterator;
374        self.text_changes = v.into_iter().map(|i| i.into()).collect();
375        self
376    }
377
378    /// Sets the value of [shard_info][crate::model::Document::shard_info].
379    ///
380    /// # Example
381    /// ```ignore,no_run
382    /// # use google_cloud_documentai_v1::model::Document;
383    /// use google_cloud_documentai_v1::model::document::ShardInfo;
384    /// let x = Document::new().set_shard_info(ShardInfo::default()/* use setters */);
385    /// ```
386    pub fn set_shard_info<T>(mut self, v: T) -> Self
387    where
388        T: std::convert::Into<crate::model::document::ShardInfo>,
389    {
390        self.shard_info = std::option::Option::Some(v.into());
391        self
392    }
393
394    /// Sets or clears the value of [shard_info][crate::model::Document::shard_info].
395    ///
396    /// # Example
397    /// ```ignore,no_run
398    /// # use google_cloud_documentai_v1::model::Document;
399    /// use google_cloud_documentai_v1::model::document::ShardInfo;
400    /// let x = Document::new().set_or_clear_shard_info(Some(ShardInfo::default()/* use setters */));
401    /// let x = Document::new().set_or_clear_shard_info(None::<ShardInfo>);
402    /// ```
403    pub fn set_or_clear_shard_info<T>(mut self, v: std::option::Option<T>) -> Self
404    where
405        T: std::convert::Into<crate::model::document::ShardInfo>,
406    {
407        self.shard_info = v.map(|x| x.into());
408        self
409    }
410
411    /// Sets the value of [error][crate::model::Document::error].
412    ///
413    /// # Example
414    /// ```ignore,no_run
415    /// # use google_cloud_documentai_v1::model::Document;
416    /// use google_cloud_rpc::model::Status;
417    /// let x = Document::new().set_error(Status::default()/* use setters */);
418    /// ```
419    pub fn set_error<T>(mut self, v: T) -> Self
420    where
421        T: std::convert::Into<google_cloud_rpc::model::Status>,
422    {
423        self.error = std::option::Option::Some(v.into());
424        self
425    }
426
427    /// Sets or clears the value of [error][crate::model::Document::error].
428    ///
429    /// # Example
430    /// ```ignore,no_run
431    /// # use google_cloud_documentai_v1::model::Document;
432    /// use google_cloud_rpc::model::Status;
433    /// let x = Document::new().set_or_clear_error(Some(Status::default()/* use setters */));
434    /// let x = Document::new().set_or_clear_error(None::<Status>);
435    /// ```
436    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
437    where
438        T: std::convert::Into<google_cloud_rpc::model::Status>,
439    {
440        self.error = v.map(|x| x.into());
441        self
442    }
443
444    /// Sets the value of [revisions][crate::model::Document::revisions].
445    ///
446    /// # Example
447    /// ```ignore,no_run
448    /// # use google_cloud_documentai_v1::model::Document;
449    /// use google_cloud_documentai_v1::model::document::Revision;
450    /// let x = Document::new()
451    ///     .set_revisions([
452    ///         Revision::default()/* use setters */,
453    ///         Revision::default()/* use (different) setters */,
454    ///     ]);
455    /// ```
456    pub fn set_revisions<T, V>(mut self, v: T) -> Self
457    where
458        T: std::iter::IntoIterator<Item = V>,
459        V: std::convert::Into<crate::model::document::Revision>,
460    {
461        use std::iter::Iterator;
462        self.revisions = v.into_iter().map(|i| i.into()).collect();
463        self
464    }
465
466    /// Sets the value of [document_layout][crate::model::Document::document_layout].
467    ///
468    /// # Example
469    /// ```ignore,no_run
470    /// # use google_cloud_documentai_v1::model::Document;
471    /// use google_cloud_documentai_v1::model::document::DocumentLayout;
472    /// let x = Document::new().set_document_layout(DocumentLayout::default()/* use setters */);
473    /// ```
474    pub fn set_document_layout<T>(mut self, v: T) -> Self
475    where
476        T: std::convert::Into<crate::model::document::DocumentLayout>,
477    {
478        self.document_layout = std::option::Option::Some(v.into());
479        self
480    }
481
482    /// Sets or clears the value of [document_layout][crate::model::Document::document_layout].
483    ///
484    /// # Example
485    /// ```ignore,no_run
486    /// # use google_cloud_documentai_v1::model::Document;
487    /// use google_cloud_documentai_v1::model::document::DocumentLayout;
488    /// let x = Document::new().set_or_clear_document_layout(Some(DocumentLayout::default()/* use setters */));
489    /// let x = Document::new().set_or_clear_document_layout(None::<DocumentLayout>);
490    /// ```
491    pub fn set_or_clear_document_layout<T>(mut self, v: std::option::Option<T>) -> Self
492    where
493        T: std::convert::Into<crate::model::document::DocumentLayout>,
494    {
495        self.document_layout = v.map(|x| x.into());
496        self
497    }
498
499    /// Sets the value of [chunked_document][crate::model::Document::chunked_document].
500    ///
501    /// # Example
502    /// ```ignore,no_run
503    /// # use google_cloud_documentai_v1::model::Document;
504    /// use google_cloud_documentai_v1::model::document::ChunkedDocument;
505    /// let x = Document::new().set_chunked_document(ChunkedDocument::default()/* use setters */);
506    /// ```
507    pub fn set_chunked_document<T>(mut self, v: T) -> Self
508    where
509        T: std::convert::Into<crate::model::document::ChunkedDocument>,
510    {
511        self.chunked_document = std::option::Option::Some(v.into());
512        self
513    }
514
515    /// Sets or clears the value of [chunked_document][crate::model::Document::chunked_document].
516    ///
517    /// # Example
518    /// ```ignore,no_run
519    /// # use google_cloud_documentai_v1::model::Document;
520    /// use google_cloud_documentai_v1::model::document::ChunkedDocument;
521    /// let x = Document::new().set_or_clear_chunked_document(Some(ChunkedDocument::default()/* use setters */));
522    /// let x = Document::new().set_or_clear_chunked_document(None::<ChunkedDocument>);
523    /// ```
524    pub fn set_or_clear_chunked_document<T>(mut self, v: std::option::Option<T>) -> Self
525    where
526        T: std::convert::Into<crate::model::document::ChunkedDocument>,
527    {
528        self.chunked_document = v.map(|x| x.into());
529        self
530    }
531
532    /// Sets the value of [entity_validation_output][crate::model::Document::entity_validation_output].
533    ///
534    /// # Example
535    /// ```ignore,no_run
536    /// # use google_cloud_documentai_v1::model::Document;
537    /// use google_cloud_documentai_v1::model::document::EntityValidationOutput;
538    /// let x = Document::new().set_entity_validation_output(EntityValidationOutput::default()/* use setters */);
539    /// ```
540    pub fn set_entity_validation_output<T>(mut self, v: T) -> Self
541    where
542        T: std::convert::Into<crate::model::document::EntityValidationOutput>,
543    {
544        self.entity_validation_output = std::option::Option::Some(v.into());
545        self
546    }
547
548    /// Sets or clears the value of [entity_validation_output][crate::model::Document::entity_validation_output].
549    ///
550    /// # Example
551    /// ```ignore,no_run
552    /// # use google_cloud_documentai_v1::model::Document;
553    /// use google_cloud_documentai_v1::model::document::EntityValidationOutput;
554    /// let x = Document::new().set_or_clear_entity_validation_output(Some(EntityValidationOutput::default()/* use setters */));
555    /// let x = Document::new().set_or_clear_entity_validation_output(None::<EntityValidationOutput>);
556    /// ```
557    pub fn set_or_clear_entity_validation_output<T>(mut self, v: std::option::Option<T>) -> Self
558    where
559        T: std::convert::Into<crate::model::document::EntityValidationOutput>,
560    {
561        self.entity_validation_output = v.map(|x| x.into());
562        self
563    }
564
565    /// Sets the value of [entities_revisions][crate::model::Document::entities_revisions].
566    ///
567    /// # Example
568    /// ```ignore,no_run
569    /// # use google_cloud_documentai_v1::model::Document;
570    /// use google_cloud_documentai_v1::model::document::EntitiesRevision;
571    /// let x = Document::new()
572    ///     .set_entities_revisions([
573    ///         EntitiesRevision::default()/* use setters */,
574    ///         EntitiesRevision::default()/* use (different) setters */,
575    ///     ]);
576    /// ```
577    pub fn set_entities_revisions<T, V>(mut self, v: T) -> Self
578    where
579        T: std::iter::IntoIterator<Item = V>,
580        V: std::convert::Into<crate::model::document::EntitiesRevision>,
581    {
582        use std::iter::Iterator;
583        self.entities_revisions = v.into_iter().map(|i| i.into()).collect();
584        self
585    }
586
587    /// Sets the value of [entities_revision_id][crate::model::Document::entities_revision_id].
588    ///
589    /// # Example
590    /// ```ignore,no_run
591    /// # use google_cloud_documentai_v1::model::Document;
592    /// let x = Document::new().set_entities_revision_id("example");
593    /// ```
594    pub fn set_entities_revision_id<T: std::convert::Into<std::string::String>>(
595        mut self,
596        v: T,
597    ) -> Self {
598        self.entities_revision_id = v.into();
599        self
600    }
601
602    /// Sets the value of [source][crate::model::Document::source].
603    ///
604    /// Note that all the setters affecting `source` are mutually
605    /// exclusive.
606    ///
607    /// # Example
608    /// ```ignore,no_run
609    /// # use google_cloud_documentai_v1::model::Document;
610    /// use google_cloud_documentai_v1::model::document::Source;
611    /// let x = Document::new().set_source(Some(Source::Uri("example".to_string())));
612    /// ```
613    pub fn set_source<
614        T: std::convert::Into<std::option::Option<crate::model::document::Source>>,
615    >(
616        mut self,
617        v: T,
618    ) -> Self {
619        self.source = v.into();
620        self
621    }
622
623    /// The value of [source][crate::model::Document::source]
624    /// if it holds a `Uri`, `None` if the field is not set or
625    /// holds a different branch.
626    pub fn uri(&self) -> std::option::Option<&std::string::String> {
627        #[allow(unreachable_patterns)]
628        self.source.as_ref().and_then(|v| match v {
629            crate::model::document::Source::Uri(v) => std::option::Option::Some(v),
630            _ => std::option::Option::None,
631        })
632    }
633
634    /// Sets the value of [source][crate::model::Document::source]
635    /// to hold a `Uri`.
636    ///
637    /// Note that all the setters affecting `source` are
638    /// mutually exclusive.
639    ///
640    /// # Example
641    /// ```ignore,no_run
642    /// # use google_cloud_documentai_v1::model::Document;
643    /// let x = Document::new().set_uri("example");
644    /// assert!(x.uri().is_some());
645    /// assert!(x.content().is_none());
646    /// ```
647    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
648        self.source = std::option::Option::Some(crate::model::document::Source::Uri(v.into()));
649        self
650    }
651
652    /// The value of [source][crate::model::Document::source]
653    /// if it holds a `Content`, `None` if the field is not set or
654    /// holds a different branch.
655    pub fn content(&self) -> std::option::Option<&::bytes::Bytes> {
656        #[allow(unreachable_patterns)]
657        self.source.as_ref().and_then(|v| match v {
658            crate::model::document::Source::Content(v) => std::option::Option::Some(v),
659            _ => std::option::Option::None,
660        })
661    }
662
663    /// Sets the value of [source][crate::model::Document::source]
664    /// to hold a `Content`.
665    ///
666    /// Note that all the setters affecting `source` are
667    /// mutually exclusive.
668    ///
669    /// # Example
670    /// ```ignore,no_run
671    /// # use google_cloud_documentai_v1::model::Document;
672    /// let x = Document::new().set_content(bytes::Bytes::from_static(b"example"));
673    /// assert!(x.content().is_some());
674    /// assert!(x.uri().is_none());
675    /// ```
676    pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
677        self.source = std::option::Option::Some(crate::model::document::Source::Content(v.into()));
678        self
679    }
680}
681
682impl wkt::message::Message for Document {
683    fn typename() -> &'static str {
684        "type.googleapis.com/google.cloud.documentai.v1.Document"
685    }
686}
687
688/// Defines additional types related to [Document].
689pub mod document {
690    #[allow(unused_imports)]
691    use super::*;
692
693    /// For a large document, sharding may be performed to produce several
694    /// document shards. Each document shard contains this field to detail which
695    /// shard it is.
696    #[derive(Clone, Default, PartialEq)]
697    #[non_exhaustive]
698    pub struct ShardInfo {
699        /// The 0-based index of this shard.
700        pub shard_index: i64,
701
702        /// Total number of shards.
703        pub shard_count: i64,
704
705        /// The index of the first character in
706        /// [Document.text][google.cloud.documentai.v1.Document.text] in the overall
707        /// document global text.
708        ///
709        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
710        pub text_offset: i64,
711
712        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
713    }
714
715    impl ShardInfo {
716        pub fn new() -> Self {
717            std::default::Default::default()
718        }
719
720        /// Sets the value of [shard_index][crate::model::document::ShardInfo::shard_index].
721        ///
722        /// # Example
723        /// ```ignore,no_run
724        /// # use google_cloud_documentai_v1::model::document::ShardInfo;
725        /// let x = ShardInfo::new().set_shard_index(42);
726        /// ```
727        pub fn set_shard_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
728            self.shard_index = v.into();
729            self
730        }
731
732        /// Sets the value of [shard_count][crate::model::document::ShardInfo::shard_count].
733        ///
734        /// # Example
735        /// ```ignore,no_run
736        /// # use google_cloud_documentai_v1::model::document::ShardInfo;
737        /// let x = ShardInfo::new().set_shard_count(42);
738        /// ```
739        pub fn set_shard_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
740            self.shard_count = v.into();
741            self
742        }
743
744        /// Sets the value of [text_offset][crate::model::document::ShardInfo::text_offset].
745        ///
746        /// # Example
747        /// ```ignore,no_run
748        /// # use google_cloud_documentai_v1::model::document::ShardInfo;
749        /// let x = ShardInfo::new().set_text_offset(42);
750        /// ```
751        pub fn set_text_offset<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
752            self.text_offset = v.into();
753            self
754        }
755    }
756
757    impl wkt::message::Message for ShardInfo {
758        fn typename() -> &'static str {
759            "type.googleapis.com/google.cloud.documentai.v1.Document.ShardInfo"
760        }
761    }
762
763    /// Annotation for common text style attributes. This adheres to CSS
764    /// conventions as much as possible.
765    #[derive(Clone, Default, PartialEq)]
766    #[non_exhaustive]
767    pub struct Style {
768        /// Text anchor indexing into the
769        /// [Document.text][google.cloud.documentai.v1.Document.text].
770        ///
771        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
772        pub text_anchor: std::option::Option<crate::model::document::TextAnchor>,
773
774        /// Text color.
775        pub color: std::option::Option<google_cloud_type::model::Color>,
776
777        /// Text background color.
778        pub background_color: std::option::Option<google_cloud_type::model::Color>,
779
780        /// [Font weight](https://www.w3schools.com/cssref/pr_font_weight.asp).
781        /// Possible values are `normal`, `bold`, `bolder`, and `lighter`.
782        pub font_weight: std::string::String,
783
784        /// [Text style](https://www.w3schools.com/cssref/pr_font_font-style.asp).
785        /// Possible values are `normal`, `italic`, and `oblique`.
786        pub text_style: std::string::String,
787
788        /// [Text
789        /// decoration](https://www.w3schools.com/cssref/pr_text_text-decoration.asp).
790        /// Follows CSS standard. \<text-decoration-line\> \<text-decoration-color\>
791        /// \<text-decoration-style\>
792        pub text_decoration: std::string::String,
793
794        /// Font size.
795        pub font_size: std::option::Option<crate::model::document::style::FontSize>,
796
797        /// Font family such as `Arial`, `Times New Roman`.
798        /// <https://www.w3schools.com/cssref/pr_font_font-family.asp>
799        pub font_family: std::string::String,
800
801        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
802    }
803
804    impl Style {
805        pub fn new() -> Self {
806            std::default::Default::default()
807        }
808
809        /// Sets the value of [text_anchor][crate::model::document::Style::text_anchor].
810        ///
811        /// # Example
812        /// ```ignore,no_run
813        /// # use google_cloud_documentai_v1::model::document::Style;
814        /// use google_cloud_documentai_v1::model::document::TextAnchor;
815        /// let x = Style::new().set_text_anchor(TextAnchor::default()/* use setters */);
816        /// ```
817        pub fn set_text_anchor<T>(mut self, v: T) -> Self
818        where
819            T: std::convert::Into<crate::model::document::TextAnchor>,
820        {
821            self.text_anchor = std::option::Option::Some(v.into());
822            self
823        }
824
825        /// Sets or clears the value of [text_anchor][crate::model::document::Style::text_anchor].
826        ///
827        /// # Example
828        /// ```ignore,no_run
829        /// # use google_cloud_documentai_v1::model::document::Style;
830        /// use google_cloud_documentai_v1::model::document::TextAnchor;
831        /// let x = Style::new().set_or_clear_text_anchor(Some(TextAnchor::default()/* use setters */));
832        /// let x = Style::new().set_or_clear_text_anchor(None::<TextAnchor>);
833        /// ```
834        pub fn set_or_clear_text_anchor<T>(mut self, v: std::option::Option<T>) -> Self
835        where
836            T: std::convert::Into<crate::model::document::TextAnchor>,
837        {
838            self.text_anchor = v.map(|x| x.into());
839            self
840        }
841
842        /// Sets the value of [color][crate::model::document::Style::color].
843        ///
844        /// # Example
845        /// ```ignore,no_run
846        /// # use google_cloud_documentai_v1::model::document::Style;
847        /// use google_cloud_type::model::Color;
848        /// let x = Style::new().set_color(Color::default()/* use setters */);
849        /// ```
850        pub fn set_color<T>(mut self, v: T) -> Self
851        where
852            T: std::convert::Into<google_cloud_type::model::Color>,
853        {
854            self.color = std::option::Option::Some(v.into());
855            self
856        }
857
858        /// Sets or clears the value of [color][crate::model::document::Style::color].
859        ///
860        /// # Example
861        /// ```ignore,no_run
862        /// # use google_cloud_documentai_v1::model::document::Style;
863        /// use google_cloud_type::model::Color;
864        /// let x = Style::new().set_or_clear_color(Some(Color::default()/* use setters */));
865        /// let x = Style::new().set_or_clear_color(None::<Color>);
866        /// ```
867        pub fn set_or_clear_color<T>(mut self, v: std::option::Option<T>) -> Self
868        where
869            T: std::convert::Into<google_cloud_type::model::Color>,
870        {
871            self.color = v.map(|x| x.into());
872            self
873        }
874
875        /// Sets the value of [background_color][crate::model::document::Style::background_color].
876        ///
877        /// # Example
878        /// ```ignore,no_run
879        /// # use google_cloud_documentai_v1::model::document::Style;
880        /// use google_cloud_type::model::Color;
881        /// let x = Style::new().set_background_color(Color::default()/* use setters */);
882        /// ```
883        pub fn set_background_color<T>(mut self, v: T) -> Self
884        where
885            T: std::convert::Into<google_cloud_type::model::Color>,
886        {
887            self.background_color = std::option::Option::Some(v.into());
888            self
889        }
890
891        /// Sets or clears the value of [background_color][crate::model::document::Style::background_color].
892        ///
893        /// # Example
894        /// ```ignore,no_run
895        /// # use google_cloud_documentai_v1::model::document::Style;
896        /// use google_cloud_type::model::Color;
897        /// let x = Style::new().set_or_clear_background_color(Some(Color::default()/* use setters */));
898        /// let x = Style::new().set_or_clear_background_color(None::<Color>);
899        /// ```
900        pub fn set_or_clear_background_color<T>(mut self, v: std::option::Option<T>) -> Self
901        where
902            T: std::convert::Into<google_cloud_type::model::Color>,
903        {
904            self.background_color = v.map(|x| x.into());
905            self
906        }
907
908        /// Sets the value of [font_weight][crate::model::document::Style::font_weight].
909        ///
910        /// # Example
911        /// ```ignore,no_run
912        /// # use google_cloud_documentai_v1::model::document::Style;
913        /// let x = Style::new().set_font_weight("example");
914        /// ```
915        pub fn set_font_weight<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
916            self.font_weight = v.into();
917            self
918        }
919
920        /// Sets the value of [text_style][crate::model::document::Style::text_style].
921        ///
922        /// # Example
923        /// ```ignore,no_run
924        /// # use google_cloud_documentai_v1::model::document::Style;
925        /// let x = Style::new().set_text_style("example");
926        /// ```
927        pub fn set_text_style<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
928            self.text_style = v.into();
929            self
930        }
931
932        /// Sets the value of [text_decoration][crate::model::document::Style::text_decoration].
933        ///
934        /// # Example
935        /// ```ignore,no_run
936        /// # use google_cloud_documentai_v1::model::document::Style;
937        /// let x = Style::new().set_text_decoration("example");
938        /// ```
939        pub fn set_text_decoration<T: std::convert::Into<std::string::String>>(
940            mut self,
941            v: T,
942        ) -> Self {
943            self.text_decoration = v.into();
944            self
945        }
946
947        /// Sets the value of [font_size][crate::model::document::Style::font_size].
948        ///
949        /// # Example
950        /// ```ignore,no_run
951        /// # use google_cloud_documentai_v1::model::document::Style;
952        /// use google_cloud_documentai_v1::model::document::style::FontSize;
953        /// let x = Style::new().set_font_size(FontSize::default()/* use setters */);
954        /// ```
955        pub fn set_font_size<T>(mut self, v: T) -> Self
956        where
957            T: std::convert::Into<crate::model::document::style::FontSize>,
958        {
959            self.font_size = std::option::Option::Some(v.into());
960            self
961        }
962
963        /// Sets or clears the value of [font_size][crate::model::document::Style::font_size].
964        ///
965        /// # Example
966        /// ```ignore,no_run
967        /// # use google_cloud_documentai_v1::model::document::Style;
968        /// use google_cloud_documentai_v1::model::document::style::FontSize;
969        /// let x = Style::new().set_or_clear_font_size(Some(FontSize::default()/* use setters */));
970        /// let x = Style::new().set_or_clear_font_size(None::<FontSize>);
971        /// ```
972        pub fn set_or_clear_font_size<T>(mut self, v: std::option::Option<T>) -> Self
973        where
974            T: std::convert::Into<crate::model::document::style::FontSize>,
975        {
976            self.font_size = v.map(|x| x.into());
977            self
978        }
979
980        /// Sets the value of [font_family][crate::model::document::Style::font_family].
981        ///
982        /// # Example
983        /// ```ignore,no_run
984        /// # use google_cloud_documentai_v1::model::document::Style;
985        /// let x = Style::new().set_font_family("example");
986        /// ```
987        pub fn set_font_family<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
988            self.font_family = v.into();
989            self
990        }
991    }
992
993    impl wkt::message::Message for Style {
994        fn typename() -> &'static str {
995            "type.googleapis.com/google.cloud.documentai.v1.Document.Style"
996        }
997    }
998
999    /// Defines additional types related to [Style].
1000    pub mod style {
1001        #[allow(unused_imports)]
1002        use super::*;
1003
1004        /// Font size with unit.
1005        #[derive(Clone, Default, PartialEq)]
1006        #[non_exhaustive]
1007        pub struct FontSize {
1008            /// Font size for the text.
1009            pub size: f32,
1010
1011            /// Unit for the font size. Follows CSS naming (such as `in`, `px`, and
1012            /// `pt`).
1013            pub unit: std::string::String,
1014
1015            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1016        }
1017
1018        impl FontSize {
1019            pub fn new() -> Self {
1020                std::default::Default::default()
1021            }
1022
1023            /// Sets the value of [size][crate::model::document::style::FontSize::size].
1024            ///
1025            /// # Example
1026            /// ```ignore,no_run
1027            /// # use google_cloud_documentai_v1::model::document::style::FontSize;
1028            /// let x = FontSize::new().set_size(42.0);
1029            /// ```
1030            pub fn set_size<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1031                self.size = v.into();
1032                self
1033            }
1034
1035            /// Sets the value of [unit][crate::model::document::style::FontSize::unit].
1036            ///
1037            /// # Example
1038            /// ```ignore,no_run
1039            /// # use google_cloud_documentai_v1::model::document::style::FontSize;
1040            /// let x = FontSize::new().set_unit("example");
1041            /// ```
1042            pub fn set_unit<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1043                self.unit = v.into();
1044                self
1045            }
1046        }
1047
1048        impl wkt::message::Message for FontSize {
1049            fn typename() -> &'static str {
1050                "type.googleapis.com/google.cloud.documentai.v1.Document.Style.FontSize"
1051            }
1052        }
1053    }
1054
1055    /// A page in a [Document][google.cloud.documentai.v1.Document].
1056    ///
1057    /// [google.cloud.documentai.v1.Document]: crate::model::Document
1058    #[derive(Clone, Default, PartialEq)]
1059    #[non_exhaustive]
1060    pub struct Page {
1061        /// 1-based index for current
1062        /// [Page][google.cloud.documentai.v1.Document.Page] in a parent
1063        /// [Document][google.cloud.documentai.v1.Document]. Useful when a page is
1064        /// taken out of a [Document][google.cloud.documentai.v1.Document] for
1065        /// individual processing.
1066        ///
1067        /// [google.cloud.documentai.v1.Document]: crate::model::Document
1068        /// [google.cloud.documentai.v1.Document.Page]: crate::model::document::Page
1069        pub page_number: i32,
1070
1071        /// Rendered image for this page. This image is preprocessed to remove any
1072        /// skew, rotation, and distortions such that the annotation bounding boxes
1073        /// can be upright and axis-aligned.
1074        pub image: std::option::Option<crate::model::document::page::Image>,
1075
1076        /// Transformation matrices that were applied to the original document image
1077        /// to produce [Page.image][google.cloud.documentai.v1.Document.Page.image].
1078        ///
1079        /// [google.cloud.documentai.v1.Document.Page.image]: crate::model::document::Page::image
1080        pub transforms: std::vec::Vec<crate::model::document::page::Matrix>,
1081
1082        /// Physical dimension of the page.
1083        pub dimension: std::option::Option<crate::model::document::page::Dimension>,
1084
1085        /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the page.
1086        ///
1087        /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1088        pub layout: std::option::Option<crate::model::document::page::Layout>,
1089
1090        /// A list of detected languages together with confidence.
1091        pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
1092
1093        /// A list of visually detected text blocks on the page.
1094        /// A block has a set of lines (collected into paragraphs) that have a common
1095        /// line-spacing and orientation.
1096        pub blocks: std::vec::Vec<crate::model::document::page::Block>,
1097
1098        /// A list of visually detected text paragraphs on the page.
1099        /// A collection of lines that a human would perceive as a paragraph.
1100        pub paragraphs: std::vec::Vec<crate::model::document::page::Paragraph>,
1101
1102        /// A list of visually detected text lines on the page.
1103        /// A collection of tokens that a human would perceive as a line.
1104        pub lines: std::vec::Vec<crate::model::document::page::Line>,
1105
1106        /// A list of visually detected tokens on the page.
1107        pub tokens: std::vec::Vec<crate::model::document::page::Token>,
1108
1109        /// A list of detected non-text visual elements e.g. checkbox,
1110        /// signature etc. on the page.
1111        pub visual_elements: std::vec::Vec<crate::model::document::page::VisualElement>,
1112
1113        /// A list of visually detected tables on the page.
1114        pub tables: std::vec::Vec<crate::model::document::page::Table>,
1115
1116        /// A list of visually detected form fields on the page.
1117        pub form_fields: std::vec::Vec<crate::model::document::page::FormField>,
1118
1119        /// A list of visually detected symbols on the page.
1120        pub symbols: std::vec::Vec<crate::model::document::page::Symbol>,
1121
1122        /// A list of detected barcodes.
1123        pub detected_barcodes: std::vec::Vec<crate::model::document::page::DetectedBarcode>,
1124
1125        /// Image quality scores.
1126        pub image_quality_scores:
1127            std::option::Option<crate::model::document::page::ImageQualityScores>,
1128
1129        /// The history of this page.
1130        #[deprecated]
1131        pub provenance: std::option::Option<crate::model::document::Provenance>,
1132
1133        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1134    }
1135
1136    impl Page {
1137        pub fn new() -> Self {
1138            std::default::Default::default()
1139        }
1140
1141        /// Sets the value of [page_number][crate::model::document::Page::page_number].
1142        ///
1143        /// # Example
1144        /// ```ignore,no_run
1145        /// # use google_cloud_documentai_v1::model::document::Page;
1146        /// let x = Page::new().set_page_number(42);
1147        /// ```
1148        pub fn set_page_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1149            self.page_number = v.into();
1150            self
1151        }
1152
1153        /// Sets the value of [image][crate::model::document::Page::image].
1154        ///
1155        /// # Example
1156        /// ```ignore,no_run
1157        /// # use google_cloud_documentai_v1::model::document::Page;
1158        /// use google_cloud_documentai_v1::model::document::page::Image;
1159        /// let x = Page::new().set_image(Image::default()/* use setters */);
1160        /// ```
1161        pub fn set_image<T>(mut self, v: T) -> Self
1162        where
1163            T: std::convert::Into<crate::model::document::page::Image>,
1164        {
1165            self.image = std::option::Option::Some(v.into());
1166            self
1167        }
1168
1169        /// Sets or clears the value of [image][crate::model::document::Page::image].
1170        ///
1171        /// # Example
1172        /// ```ignore,no_run
1173        /// # use google_cloud_documentai_v1::model::document::Page;
1174        /// use google_cloud_documentai_v1::model::document::page::Image;
1175        /// let x = Page::new().set_or_clear_image(Some(Image::default()/* use setters */));
1176        /// let x = Page::new().set_or_clear_image(None::<Image>);
1177        /// ```
1178        pub fn set_or_clear_image<T>(mut self, v: std::option::Option<T>) -> Self
1179        where
1180            T: std::convert::Into<crate::model::document::page::Image>,
1181        {
1182            self.image = v.map(|x| x.into());
1183            self
1184        }
1185
1186        /// Sets the value of [transforms][crate::model::document::Page::transforms].
1187        ///
1188        /// # Example
1189        /// ```ignore,no_run
1190        /// # use google_cloud_documentai_v1::model::document::Page;
1191        /// use google_cloud_documentai_v1::model::document::page::Matrix;
1192        /// let x = Page::new()
1193        ///     .set_transforms([
1194        ///         Matrix::default()/* use setters */,
1195        ///         Matrix::default()/* use (different) setters */,
1196        ///     ]);
1197        /// ```
1198        pub fn set_transforms<T, V>(mut self, v: T) -> Self
1199        where
1200            T: std::iter::IntoIterator<Item = V>,
1201            V: std::convert::Into<crate::model::document::page::Matrix>,
1202        {
1203            use std::iter::Iterator;
1204            self.transforms = v.into_iter().map(|i| i.into()).collect();
1205            self
1206        }
1207
1208        /// Sets the value of [dimension][crate::model::document::Page::dimension].
1209        ///
1210        /// # Example
1211        /// ```ignore,no_run
1212        /// # use google_cloud_documentai_v1::model::document::Page;
1213        /// use google_cloud_documentai_v1::model::document::page::Dimension;
1214        /// let x = Page::new().set_dimension(Dimension::default()/* use setters */);
1215        /// ```
1216        pub fn set_dimension<T>(mut self, v: T) -> Self
1217        where
1218            T: std::convert::Into<crate::model::document::page::Dimension>,
1219        {
1220            self.dimension = std::option::Option::Some(v.into());
1221            self
1222        }
1223
1224        /// Sets or clears the value of [dimension][crate::model::document::Page::dimension].
1225        ///
1226        /// # Example
1227        /// ```ignore,no_run
1228        /// # use google_cloud_documentai_v1::model::document::Page;
1229        /// use google_cloud_documentai_v1::model::document::page::Dimension;
1230        /// let x = Page::new().set_or_clear_dimension(Some(Dimension::default()/* use setters */));
1231        /// let x = Page::new().set_or_clear_dimension(None::<Dimension>);
1232        /// ```
1233        pub fn set_or_clear_dimension<T>(mut self, v: std::option::Option<T>) -> Self
1234        where
1235            T: std::convert::Into<crate::model::document::page::Dimension>,
1236        {
1237            self.dimension = v.map(|x| x.into());
1238            self
1239        }
1240
1241        /// Sets the value of [layout][crate::model::document::Page::layout].
1242        ///
1243        /// # Example
1244        /// ```ignore,no_run
1245        /// # use google_cloud_documentai_v1::model::document::Page;
1246        /// use google_cloud_documentai_v1::model::document::page::Layout;
1247        /// let x = Page::new().set_layout(Layout::default()/* use setters */);
1248        /// ```
1249        pub fn set_layout<T>(mut self, v: T) -> Self
1250        where
1251            T: std::convert::Into<crate::model::document::page::Layout>,
1252        {
1253            self.layout = std::option::Option::Some(v.into());
1254            self
1255        }
1256
1257        /// Sets or clears the value of [layout][crate::model::document::Page::layout].
1258        ///
1259        /// # Example
1260        /// ```ignore,no_run
1261        /// # use google_cloud_documentai_v1::model::document::Page;
1262        /// use google_cloud_documentai_v1::model::document::page::Layout;
1263        /// let x = Page::new().set_or_clear_layout(Some(Layout::default()/* use setters */));
1264        /// let x = Page::new().set_or_clear_layout(None::<Layout>);
1265        /// ```
1266        pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
1267        where
1268            T: std::convert::Into<crate::model::document::page::Layout>,
1269        {
1270            self.layout = v.map(|x| x.into());
1271            self
1272        }
1273
1274        /// Sets the value of [detected_languages][crate::model::document::Page::detected_languages].
1275        ///
1276        /// # Example
1277        /// ```ignore,no_run
1278        /// # use google_cloud_documentai_v1::model::document::Page;
1279        /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
1280        /// let x = Page::new()
1281        ///     .set_detected_languages([
1282        ///         DetectedLanguage::default()/* use setters */,
1283        ///         DetectedLanguage::default()/* use (different) setters */,
1284        ///     ]);
1285        /// ```
1286        pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
1287        where
1288            T: std::iter::IntoIterator<Item = V>,
1289            V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
1290        {
1291            use std::iter::Iterator;
1292            self.detected_languages = v.into_iter().map(|i| i.into()).collect();
1293            self
1294        }
1295
1296        /// Sets the value of [blocks][crate::model::document::Page::blocks].
1297        ///
1298        /// # Example
1299        /// ```ignore,no_run
1300        /// # use google_cloud_documentai_v1::model::document::Page;
1301        /// use google_cloud_documentai_v1::model::document::page::Block;
1302        /// let x = Page::new()
1303        ///     .set_blocks([
1304        ///         Block::default()/* use setters */,
1305        ///         Block::default()/* use (different) setters */,
1306        ///     ]);
1307        /// ```
1308        pub fn set_blocks<T, V>(mut self, v: T) -> Self
1309        where
1310            T: std::iter::IntoIterator<Item = V>,
1311            V: std::convert::Into<crate::model::document::page::Block>,
1312        {
1313            use std::iter::Iterator;
1314            self.blocks = v.into_iter().map(|i| i.into()).collect();
1315            self
1316        }
1317
1318        /// Sets the value of [paragraphs][crate::model::document::Page::paragraphs].
1319        ///
1320        /// # Example
1321        /// ```ignore,no_run
1322        /// # use google_cloud_documentai_v1::model::document::Page;
1323        /// use google_cloud_documentai_v1::model::document::page::Paragraph;
1324        /// let x = Page::new()
1325        ///     .set_paragraphs([
1326        ///         Paragraph::default()/* use setters */,
1327        ///         Paragraph::default()/* use (different) setters */,
1328        ///     ]);
1329        /// ```
1330        pub fn set_paragraphs<T, V>(mut self, v: T) -> Self
1331        where
1332            T: std::iter::IntoIterator<Item = V>,
1333            V: std::convert::Into<crate::model::document::page::Paragraph>,
1334        {
1335            use std::iter::Iterator;
1336            self.paragraphs = v.into_iter().map(|i| i.into()).collect();
1337            self
1338        }
1339
1340        /// Sets the value of [lines][crate::model::document::Page::lines].
1341        ///
1342        /// # Example
1343        /// ```ignore,no_run
1344        /// # use google_cloud_documentai_v1::model::document::Page;
1345        /// use google_cloud_documentai_v1::model::document::page::Line;
1346        /// let x = Page::new()
1347        ///     .set_lines([
1348        ///         Line::default()/* use setters */,
1349        ///         Line::default()/* use (different) setters */,
1350        ///     ]);
1351        /// ```
1352        pub fn set_lines<T, V>(mut self, v: T) -> Self
1353        where
1354            T: std::iter::IntoIterator<Item = V>,
1355            V: std::convert::Into<crate::model::document::page::Line>,
1356        {
1357            use std::iter::Iterator;
1358            self.lines = v.into_iter().map(|i| i.into()).collect();
1359            self
1360        }
1361
1362        /// Sets the value of [tokens][crate::model::document::Page::tokens].
1363        ///
1364        /// # Example
1365        /// ```ignore,no_run
1366        /// # use google_cloud_documentai_v1::model::document::Page;
1367        /// use google_cloud_documentai_v1::model::document::page::Token;
1368        /// let x = Page::new()
1369        ///     .set_tokens([
1370        ///         Token::default()/* use setters */,
1371        ///         Token::default()/* use (different) setters */,
1372        ///     ]);
1373        /// ```
1374        pub fn set_tokens<T, V>(mut self, v: T) -> Self
1375        where
1376            T: std::iter::IntoIterator<Item = V>,
1377            V: std::convert::Into<crate::model::document::page::Token>,
1378        {
1379            use std::iter::Iterator;
1380            self.tokens = v.into_iter().map(|i| i.into()).collect();
1381            self
1382        }
1383
1384        /// Sets the value of [visual_elements][crate::model::document::Page::visual_elements].
1385        ///
1386        /// # Example
1387        /// ```ignore,no_run
1388        /// # use google_cloud_documentai_v1::model::document::Page;
1389        /// use google_cloud_documentai_v1::model::document::page::VisualElement;
1390        /// let x = Page::new()
1391        ///     .set_visual_elements([
1392        ///         VisualElement::default()/* use setters */,
1393        ///         VisualElement::default()/* use (different) setters */,
1394        ///     ]);
1395        /// ```
1396        pub fn set_visual_elements<T, V>(mut self, v: T) -> Self
1397        where
1398            T: std::iter::IntoIterator<Item = V>,
1399            V: std::convert::Into<crate::model::document::page::VisualElement>,
1400        {
1401            use std::iter::Iterator;
1402            self.visual_elements = v.into_iter().map(|i| i.into()).collect();
1403            self
1404        }
1405
1406        /// Sets the value of [tables][crate::model::document::Page::tables].
1407        ///
1408        /// # Example
1409        /// ```ignore,no_run
1410        /// # use google_cloud_documentai_v1::model::document::Page;
1411        /// use google_cloud_documentai_v1::model::document::page::Table;
1412        /// let x = Page::new()
1413        ///     .set_tables([
1414        ///         Table::default()/* use setters */,
1415        ///         Table::default()/* use (different) setters */,
1416        ///     ]);
1417        /// ```
1418        pub fn set_tables<T, V>(mut self, v: T) -> Self
1419        where
1420            T: std::iter::IntoIterator<Item = V>,
1421            V: std::convert::Into<crate::model::document::page::Table>,
1422        {
1423            use std::iter::Iterator;
1424            self.tables = v.into_iter().map(|i| i.into()).collect();
1425            self
1426        }
1427
1428        /// Sets the value of [form_fields][crate::model::document::Page::form_fields].
1429        ///
1430        /// # Example
1431        /// ```ignore,no_run
1432        /// # use google_cloud_documentai_v1::model::document::Page;
1433        /// use google_cloud_documentai_v1::model::document::page::FormField;
1434        /// let x = Page::new()
1435        ///     .set_form_fields([
1436        ///         FormField::default()/* use setters */,
1437        ///         FormField::default()/* use (different) setters */,
1438        ///     ]);
1439        /// ```
1440        pub fn set_form_fields<T, V>(mut self, v: T) -> Self
1441        where
1442            T: std::iter::IntoIterator<Item = V>,
1443            V: std::convert::Into<crate::model::document::page::FormField>,
1444        {
1445            use std::iter::Iterator;
1446            self.form_fields = v.into_iter().map(|i| i.into()).collect();
1447            self
1448        }
1449
1450        /// Sets the value of [symbols][crate::model::document::Page::symbols].
1451        ///
1452        /// # Example
1453        /// ```ignore,no_run
1454        /// # use google_cloud_documentai_v1::model::document::Page;
1455        /// use google_cloud_documentai_v1::model::document::page::Symbol;
1456        /// let x = Page::new()
1457        ///     .set_symbols([
1458        ///         Symbol::default()/* use setters */,
1459        ///         Symbol::default()/* use (different) setters */,
1460        ///     ]);
1461        /// ```
1462        pub fn set_symbols<T, V>(mut self, v: T) -> Self
1463        where
1464            T: std::iter::IntoIterator<Item = V>,
1465            V: std::convert::Into<crate::model::document::page::Symbol>,
1466        {
1467            use std::iter::Iterator;
1468            self.symbols = v.into_iter().map(|i| i.into()).collect();
1469            self
1470        }
1471
1472        /// Sets the value of [detected_barcodes][crate::model::document::Page::detected_barcodes].
1473        ///
1474        /// # Example
1475        /// ```ignore,no_run
1476        /// # use google_cloud_documentai_v1::model::document::Page;
1477        /// use google_cloud_documentai_v1::model::document::page::DetectedBarcode;
1478        /// let x = Page::new()
1479        ///     .set_detected_barcodes([
1480        ///         DetectedBarcode::default()/* use setters */,
1481        ///         DetectedBarcode::default()/* use (different) setters */,
1482        ///     ]);
1483        /// ```
1484        pub fn set_detected_barcodes<T, V>(mut self, v: T) -> Self
1485        where
1486            T: std::iter::IntoIterator<Item = V>,
1487            V: std::convert::Into<crate::model::document::page::DetectedBarcode>,
1488        {
1489            use std::iter::Iterator;
1490            self.detected_barcodes = v.into_iter().map(|i| i.into()).collect();
1491            self
1492        }
1493
1494        /// Sets the value of [image_quality_scores][crate::model::document::Page::image_quality_scores].
1495        ///
1496        /// # Example
1497        /// ```ignore,no_run
1498        /// # use google_cloud_documentai_v1::model::document::Page;
1499        /// use google_cloud_documentai_v1::model::document::page::ImageQualityScores;
1500        /// let x = Page::new().set_image_quality_scores(ImageQualityScores::default()/* use setters */);
1501        /// ```
1502        pub fn set_image_quality_scores<T>(mut self, v: T) -> Self
1503        where
1504            T: std::convert::Into<crate::model::document::page::ImageQualityScores>,
1505        {
1506            self.image_quality_scores = std::option::Option::Some(v.into());
1507            self
1508        }
1509
1510        /// Sets or clears the value of [image_quality_scores][crate::model::document::Page::image_quality_scores].
1511        ///
1512        /// # Example
1513        /// ```ignore,no_run
1514        /// # use google_cloud_documentai_v1::model::document::Page;
1515        /// use google_cloud_documentai_v1::model::document::page::ImageQualityScores;
1516        /// let x = Page::new().set_or_clear_image_quality_scores(Some(ImageQualityScores::default()/* use setters */));
1517        /// let x = Page::new().set_or_clear_image_quality_scores(None::<ImageQualityScores>);
1518        /// ```
1519        pub fn set_or_clear_image_quality_scores<T>(mut self, v: std::option::Option<T>) -> Self
1520        where
1521            T: std::convert::Into<crate::model::document::page::ImageQualityScores>,
1522        {
1523            self.image_quality_scores = v.map(|x| x.into());
1524            self
1525        }
1526
1527        /// Sets the value of [provenance][crate::model::document::Page::provenance].
1528        ///
1529        /// # Example
1530        /// ```ignore,no_run
1531        /// # use google_cloud_documentai_v1::model::document::Page;
1532        /// use google_cloud_documentai_v1::model::document::Provenance;
1533        /// let x = Page::new().set_provenance(Provenance::default()/* use setters */);
1534        /// ```
1535        #[deprecated]
1536        pub fn set_provenance<T>(mut self, v: T) -> Self
1537        where
1538            T: std::convert::Into<crate::model::document::Provenance>,
1539        {
1540            self.provenance = std::option::Option::Some(v.into());
1541            self
1542        }
1543
1544        /// Sets or clears the value of [provenance][crate::model::document::Page::provenance].
1545        ///
1546        /// # Example
1547        /// ```ignore,no_run
1548        /// # use google_cloud_documentai_v1::model::document::Page;
1549        /// use google_cloud_documentai_v1::model::document::Provenance;
1550        /// let x = Page::new().set_or_clear_provenance(Some(Provenance::default()/* use setters */));
1551        /// let x = Page::new().set_or_clear_provenance(None::<Provenance>);
1552        /// ```
1553        #[deprecated]
1554        pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
1555        where
1556            T: std::convert::Into<crate::model::document::Provenance>,
1557        {
1558            self.provenance = v.map(|x| x.into());
1559            self
1560        }
1561    }
1562
1563    impl wkt::message::Message for Page {
1564        fn typename() -> &'static str {
1565            "type.googleapis.com/google.cloud.documentai.v1.Document.Page"
1566        }
1567    }
1568
1569    /// Defines additional types related to [Page].
1570    pub mod page {
1571        #[allow(unused_imports)]
1572        use super::*;
1573
1574        /// Dimension for the page.
1575        #[derive(Clone, Default, PartialEq)]
1576        #[non_exhaustive]
1577        pub struct Dimension {
1578            /// Page width.
1579            pub width: f32,
1580
1581            /// Page height.
1582            pub height: f32,
1583
1584            /// Dimension unit.
1585            pub unit: std::string::String,
1586
1587            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1588        }
1589
1590        impl Dimension {
1591            pub fn new() -> Self {
1592                std::default::Default::default()
1593            }
1594
1595            /// Sets the value of [width][crate::model::document::page::Dimension::width].
1596            ///
1597            /// # Example
1598            /// ```ignore,no_run
1599            /// # use google_cloud_documentai_v1::model::document::page::Dimension;
1600            /// let x = Dimension::new().set_width(42.0);
1601            /// ```
1602            pub fn set_width<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1603                self.width = v.into();
1604                self
1605            }
1606
1607            /// Sets the value of [height][crate::model::document::page::Dimension::height].
1608            ///
1609            /// # Example
1610            /// ```ignore,no_run
1611            /// # use google_cloud_documentai_v1::model::document::page::Dimension;
1612            /// let x = Dimension::new().set_height(42.0);
1613            /// ```
1614            pub fn set_height<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1615                self.height = v.into();
1616                self
1617            }
1618
1619            /// Sets the value of [unit][crate::model::document::page::Dimension::unit].
1620            ///
1621            /// # Example
1622            /// ```ignore,no_run
1623            /// # use google_cloud_documentai_v1::model::document::page::Dimension;
1624            /// let x = Dimension::new().set_unit("example");
1625            /// ```
1626            pub fn set_unit<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1627                self.unit = v.into();
1628                self
1629            }
1630        }
1631
1632        impl wkt::message::Message for Dimension {
1633            fn typename() -> &'static str {
1634                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Dimension"
1635            }
1636        }
1637
1638        /// Rendered image contents for this page.
1639        #[derive(Clone, Default, PartialEq)]
1640        #[non_exhaustive]
1641        pub struct Image {
1642            /// Raw byte content of the image.
1643            pub content: ::bytes::Bytes,
1644
1645            /// Encoding [media type (MIME
1646            /// type)](https://www.iana.org/assignments/media-types/media-types.xhtml)
1647            /// for the image.
1648            pub mime_type: std::string::String,
1649
1650            /// Width of the image in pixels.
1651            pub width: i32,
1652
1653            /// Height of the image in pixels.
1654            pub height: i32,
1655
1656            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1657        }
1658
1659        impl Image {
1660            pub fn new() -> Self {
1661                std::default::Default::default()
1662            }
1663
1664            /// Sets the value of [content][crate::model::document::page::Image::content].
1665            ///
1666            /// # Example
1667            /// ```ignore,no_run
1668            /// # use google_cloud_documentai_v1::model::document::page::Image;
1669            /// let x = Image::new().set_content(bytes::Bytes::from_static(b"example"));
1670            /// ```
1671            pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1672                self.content = v.into();
1673                self
1674            }
1675
1676            /// Sets the value of [mime_type][crate::model::document::page::Image::mime_type].
1677            ///
1678            /// # Example
1679            /// ```ignore,no_run
1680            /// # use google_cloud_documentai_v1::model::document::page::Image;
1681            /// let x = Image::new().set_mime_type("example");
1682            /// ```
1683            pub fn set_mime_type<T: std::convert::Into<std::string::String>>(
1684                mut self,
1685                v: T,
1686            ) -> Self {
1687                self.mime_type = v.into();
1688                self
1689            }
1690
1691            /// Sets the value of [width][crate::model::document::page::Image::width].
1692            ///
1693            /// # Example
1694            /// ```ignore,no_run
1695            /// # use google_cloud_documentai_v1::model::document::page::Image;
1696            /// let x = Image::new().set_width(42);
1697            /// ```
1698            pub fn set_width<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1699                self.width = v.into();
1700                self
1701            }
1702
1703            /// Sets the value of [height][crate::model::document::page::Image::height].
1704            ///
1705            /// # Example
1706            /// ```ignore,no_run
1707            /// # use google_cloud_documentai_v1::model::document::page::Image;
1708            /// let x = Image::new().set_height(42);
1709            /// ```
1710            pub fn set_height<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1711                self.height = v.into();
1712                self
1713            }
1714        }
1715
1716        impl wkt::message::Message for Image {
1717            fn typename() -> &'static str {
1718                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Image"
1719            }
1720        }
1721
1722        /// Representation for transformation matrix, intended to be compatible and
1723        /// used with OpenCV format for image manipulation.
1724        #[derive(Clone, Default, PartialEq)]
1725        #[non_exhaustive]
1726        pub struct Matrix {
1727            /// Number of rows in the matrix.
1728            pub rows: i32,
1729
1730            /// Number of columns in the matrix.
1731            pub cols: i32,
1732
1733            /// This encodes information about what data type the matrix uses.
1734            /// For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list
1735            /// of OpenCV primitive data types, please refer to
1736            /// <https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html>
1737            pub r#type: i32,
1738
1739            /// The matrix data.
1740            pub data: ::bytes::Bytes,
1741
1742            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1743        }
1744
1745        impl Matrix {
1746            pub fn new() -> Self {
1747                std::default::Default::default()
1748            }
1749
1750            /// Sets the value of [rows][crate::model::document::page::Matrix::rows].
1751            ///
1752            /// # Example
1753            /// ```ignore,no_run
1754            /// # use google_cloud_documentai_v1::model::document::page::Matrix;
1755            /// let x = Matrix::new().set_rows(42);
1756            /// ```
1757            pub fn set_rows<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1758                self.rows = v.into();
1759                self
1760            }
1761
1762            /// Sets the value of [cols][crate::model::document::page::Matrix::cols].
1763            ///
1764            /// # Example
1765            /// ```ignore,no_run
1766            /// # use google_cloud_documentai_v1::model::document::page::Matrix;
1767            /// let x = Matrix::new().set_cols(42);
1768            /// ```
1769            pub fn set_cols<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1770                self.cols = v.into();
1771                self
1772            }
1773
1774            /// Sets the value of [r#type][crate::model::document::page::Matrix::type].
1775            ///
1776            /// # Example
1777            /// ```ignore,no_run
1778            /// # use google_cloud_documentai_v1::model::document::page::Matrix;
1779            /// let x = Matrix::new().set_type(42);
1780            /// ```
1781            pub fn set_type<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1782                self.r#type = v.into();
1783                self
1784            }
1785
1786            /// Sets the value of [data][crate::model::document::page::Matrix::data].
1787            ///
1788            /// # Example
1789            /// ```ignore,no_run
1790            /// # use google_cloud_documentai_v1::model::document::page::Matrix;
1791            /// let x = Matrix::new().set_data(bytes::Bytes::from_static(b"example"));
1792            /// ```
1793            pub fn set_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1794                self.data = v.into();
1795                self
1796            }
1797        }
1798
1799        impl wkt::message::Message for Matrix {
1800            fn typename() -> &'static str {
1801                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Matrix"
1802            }
1803        }
1804
1805        /// Visual element describing a layout unit on a page.
1806        #[derive(Clone, Default, PartialEq)]
1807        #[non_exhaustive]
1808        pub struct Layout {
1809            /// Text anchor indexing into the
1810            /// [Document.text][google.cloud.documentai.v1.Document.text].
1811            ///
1812            /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
1813            pub text_anchor: std::option::Option<crate::model::document::TextAnchor>,
1814
1815            /// Confidence of the current
1816            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] within
1817            /// context of the object this layout is for. e.g. confidence can be for a
1818            /// single token, a table, a visual element, etc. depending on context.
1819            /// Range `[0, 1]`.
1820            ///
1821            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1822            pub confidence: f32,
1823
1824            /// The bounding polygon for the
1825            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout].
1826            ///
1827            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1828            pub bounding_poly: std::option::Option<crate::model::BoundingPoly>,
1829
1830            /// Detected orientation for the
1831            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout].
1832            ///
1833            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
1834            pub orientation: crate::model::document::page::layout::Orientation,
1835
1836            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1837        }
1838
1839        impl Layout {
1840            pub fn new() -> Self {
1841                std::default::Default::default()
1842            }
1843
1844            /// Sets the value of [text_anchor][crate::model::document::page::Layout::text_anchor].
1845            ///
1846            /// # Example
1847            /// ```ignore,no_run
1848            /// # use google_cloud_documentai_v1::model::document::page::Layout;
1849            /// use google_cloud_documentai_v1::model::document::TextAnchor;
1850            /// let x = Layout::new().set_text_anchor(TextAnchor::default()/* use setters */);
1851            /// ```
1852            pub fn set_text_anchor<T>(mut self, v: T) -> Self
1853            where
1854                T: std::convert::Into<crate::model::document::TextAnchor>,
1855            {
1856                self.text_anchor = std::option::Option::Some(v.into());
1857                self
1858            }
1859
1860            /// Sets or clears the value of [text_anchor][crate::model::document::page::Layout::text_anchor].
1861            ///
1862            /// # Example
1863            /// ```ignore,no_run
1864            /// # use google_cloud_documentai_v1::model::document::page::Layout;
1865            /// use google_cloud_documentai_v1::model::document::TextAnchor;
1866            /// let x = Layout::new().set_or_clear_text_anchor(Some(TextAnchor::default()/* use setters */));
1867            /// let x = Layout::new().set_or_clear_text_anchor(None::<TextAnchor>);
1868            /// ```
1869            pub fn set_or_clear_text_anchor<T>(mut self, v: std::option::Option<T>) -> Self
1870            where
1871                T: std::convert::Into<crate::model::document::TextAnchor>,
1872            {
1873                self.text_anchor = v.map(|x| x.into());
1874                self
1875            }
1876
1877            /// Sets the value of [confidence][crate::model::document::page::Layout::confidence].
1878            ///
1879            /// # Example
1880            /// ```ignore,no_run
1881            /// # use google_cloud_documentai_v1::model::document::page::Layout;
1882            /// let x = Layout::new().set_confidence(42.0);
1883            /// ```
1884            pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1885                self.confidence = v.into();
1886                self
1887            }
1888
1889            /// Sets the value of [bounding_poly][crate::model::document::page::Layout::bounding_poly].
1890            ///
1891            /// # Example
1892            /// ```ignore,no_run
1893            /// # use google_cloud_documentai_v1::model::document::page::Layout;
1894            /// use google_cloud_documentai_v1::model::BoundingPoly;
1895            /// let x = Layout::new().set_bounding_poly(BoundingPoly::default()/* use setters */);
1896            /// ```
1897            pub fn set_bounding_poly<T>(mut self, v: T) -> Self
1898            where
1899                T: std::convert::Into<crate::model::BoundingPoly>,
1900            {
1901                self.bounding_poly = std::option::Option::Some(v.into());
1902                self
1903            }
1904
1905            /// Sets or clears the value of [bounding_poly][crate::model::document::page::Layout::bounding_poly].
1906            ///
1907            /// # Example
1908            /// ```ignore,no_run
1909            /// # use google_cloud_documentai_v1::model::document::page::Layout;
1910            /// use google_cloud_documentai_v1::model::BoundingPoly;
1911            /// let x = Layout::new().set_or_clear_bounding_poly(Some(BoundingPoly::default()/* use setters */));
1912            /// let x = Layout::new().set_or_clear_bounding_poly(None::<BoundingPoly>);
1913            /// ```
1914            pub fn set_or_clear_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
1915            where
1916                T: std::convert::Into<crate::model::BoundingPoly>,
1917            {
1918                self.bounding_poly = v.map(|x| x.into());
1919                self
1920            }
1921
1922            /// Sets the value of [orientation][crate::model::document::page::Layout::orientation].
1923            ///
1924            /// # Example
1925            /// ```ignore,no_run
1926            /// # use google_cloud_documentai_v1::model::document::page::Layout;
1927            /// use google_cloud_documentai_v1::model::document::page::layout::Orientation;
1928            /// let x0 = Layout::new().set_orientation(Orientation::PageUp);
1929            /// let x1 = Layout::new().set_orientation(Orientation::PageRight);
1930            /// let x2 = Layout::new().set_orientation(Orientation::PageDown);
1931            /// ```
1932            pub fn set_orientation<
1933                T: std::convert::Into<crate::model::document::page::layout::Orientation>,
1934            >(
1935                mut self,
1936                v: T,
1937            ) -> Self {
1938                self.orientation = v.into();
1939                self
1940            }
1941        }
1942
1943        impl wkt::message::Message for Layout {
1944            fn typename() -> &'static str {
1945                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Layout"
1946            }
1947        }
1948
1949        /// Defines additional types related to [Layout].
1950        pub mod layout {
1951            #[allow(unused_imports)]
1952            use super::*;
1953
1954            /// Detected human reading orientation.
1955            ///
1956            /// # Working with unknown values
1957            ///
1958            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1959            /// additional enum variants at any time. Adding new variants is not considered
1960            /// a breaking change. Applications should write their code in anticipation of:
1961            ///
1962            /// - New values appearing in future releases of the client library, **and**
1963            /// - New values received dynamically, without application changes.
1964            ///
1965            /// Please consult the [Working with enums] section in the user guide for some
1966            /// guidelines.
1967            ///
1968            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1969            #[derive(Clone, Debug, PartialEq)]
1970            #[non_exhaustive]
1971            pub enum Orientation {
1972                /// Unspecified orientation.
1973                Unspecified,
1974                /// Orientation is aligned with page up.
1975                PageUp,
1976                /// Orientation is aligned with page right.
1977                /// Turn the head 90 degrees clockwise from upright to read.
1978                PageRight,
1979                /// Orientation is aligned with page down.
1980                /// Turn the head 180 degrees from upright to read.
1981                PageDown,
1982                /// Orientation is aligned with page left.
1983                /// Turn the head 90 degrees counterclockwise from upright to read.
1984                PageLeft,
1985                /// If set, the enum was initialized with an unknown value.
1986                ///
1987                /// Applications can examine the value using [Orientation::value] or
1988                /// [Orientation::name].
1989                UnknownValue(orientation::UnknownValue),
1990            }
1991
1992            #[doc(hidden)]
1993            pub mod orientation {
1994                #[allow(unused_imports)]
1995                use super::*;
1996                #[derive(Clone, Debug, PartialEq)]
1997                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1998            }
1999
2000            impl Orientation {
2001                /// Gets the enum value.
2002                ///
2003                /// Returns `None` if the enum contains an unknown value deserialized from
2004                /// the string representation of enums.
2005                pub fn value(&self) -> std::option::Option<i32> {
2006                    match self {
2007                        Self::Unspecified => std::option::Option::Some(0),
2008                        Self::PageUp => std::option::Option::Some(1),
2009                        Self::PageRight => std::option::Option::Some(2),
2010                        Self::PageDown => std::option::Option::Some(3),
2011                        Self::PageLeft => std::option::Option::Some(4),
2012                        Self::UnknownValue(u) => u.0.value(),
2013                    }
2014                }
2015
2016                /// Gets the enum value as a string.
2017                ///
2018                /// Returns `None` if the enum contains an unknown value deserialized from
2019                /// the integer representation of enums.
2020                pub fn name(&self) -> std::option::Option<&str> {
2021                    match self {
2022                        Self::Unspecified => std::option::Option::Some("ORIENTATION_UNSPECIFIED"),
2023                        Self::PageUp => std::option::Option::Some("PAGE_UP"),
2024                        Self::PageRight => std::option::Option::Some("PAGE_RIGHT"),
2025                        Self::PageDown => std::option::Option::Some("PAGE_DOWN"),
2026                        Self::PageLeft => std::option::Option::Some("PAGE_LEFT"),
2027                        Self::UnknownValue(u) => u.0.name(),
2028                    }
2029                }
2030            }
2031
2032            impl std::default::Default for Orientation {
2033                fn default() -> Self {
2034                    use std::convert::From;
2035                    Self::from(0)
2036                }
2037            }
2038
2039            impl std::fmt::Display for Orientation {
2040                fn fmt(
2041                    &self,
2042                    f: &mut std::fmt::Formatter<'_>,
2043                ) -> std::result::Result<(), std::fmt::Error> {
2044                    wkt::internal::display_enum(f, self.name(), self.value())
2045                }
2046            }
2047
2048            impl std::convert::From<i32> for Orientation {
2049                fn from(value: i32) -> Self {
2050                    match value {
2051                        0 => Self::Unspecified,
2052                        1 => Self::PageUp,
2053                        2 => Self::PageRight,
2054                        3 => Self::PageDown,
2055                        4 => Self::PageLeft,
2056                        _ => Self::UnknownValue(orientation::UnknownValue(
2057                            wkt::internal::UnknownEnumValue::Integer(value),
2058                        )),
2059                    }
2060                }
2061            }
2062
2063            impl std::convert::From<&str> for Orientation {
2064                fn from(value: &str) -> Self {
2065                    use std::string::ToString;
2066                    match value {
2067                        "ORIENTATION_UNSPECIFIED" => Self::Unspecified,
2068                        "PAGE_UP" => Self::PageUp,
2069                        "PAGE_RIGHT" => Self::PageRight,
2070                        "PAGE_DOWN" => Self::PageDown,
2071                        "PAGE_LEFT" => Self::PageLeft,
2072                        _ => Self::UnknownValue(orientation::UnknownValue(
2073                            wkt::internal::UnknownEnumValue::String(value.to_string()),
2074                        )),
2075                    }
2076                }
2077            }
2078
2079            impl serde::ser::Serialize for Orientation {
2080                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2081                where
2082                    S: serde::Serializer,
2083                {
2084                    match self {
2085                        Self::Unspecified => serializer.serialize_i32(0),
2086                        Self::PageUp => serializer.serialize_i32(1),
2087                        Self::PageRight => serializer.serialize_i32(2),
2088                        Self::PageDown => serializer.serialize_i32(3),
2089                        Self::PageLeft => serializer.serialize_i32(4),
2090                        Self::UnknownValue(u) => u.0.serialize(serializer),
2091                    }
2092                }
2093            }
2094
2095            impl<'de> serde::de::Deserialize<'de> for Orientation {
2096                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2097                where
2098                    D: serde::Deserializer<'de>,
2099                {
2100                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<Orientation>::new(
2101                        ".google.cloud.documentai.v1.Document.Page.Layout.Orientation",
2102                    ))
2103                }
2104            }
2105        }
2106
2107        /// A block has a set of lines (collected into paragraphs) that have a
2108        /// common line-spacing and orientation.
2109        #[derive(Clone, Default, PartialEq)]
2110        #[non_exhaustive]
2111        pub struct Block {
2112            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
2113            /// [Block][google.cloud.documentai.v1.Document.Page.Block].
2114            ///
2115            /// [google.cloud.documentai.v1.Document.Page.Block]: crate::model::document::page::Block
2116            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2117            pub layout: std::option::Option<crate::model::document::page::Layout>,
2118
2119            /// A list of detected languages together with confidence.
2120            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
2121
2122            /// The history of this annotation.
2123            #[deprecated]
2124            pub provenance: std::option::Option<crate::model::document::Provenance>,
2125
2126            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2127        }
2128
2129        impl Block {
2130            pub fn new() -> Self {
2131                std::default::Default::default()
2132            }
2133
2134            /// Sets the value of [layout][crate::model::document::page::Block::layout].
2135            ///
2136            /// # Example
2137            /// ```ignore,no_run
2138            /// # use google_cloud_documentai_v1::model::document::page::Block;
2139            /// use google_cloud_documentai_v1::model::document::page::Layout;
2140            /// let x = Block::new().set_layout(Layout::default()/* use setters */);
2141            /// ```
2142            pub fn set_layout<T>(mut self, v: T) -> Self
2143            where
2144                T: std::convert::Into<crate::model::document::page::Layout>,
2145            {
2146                self.layout = std::option::Option::Some(v.into());
2147                self
2148            }
2149
2150            /// Sets or clears the value of [layout][crate::model::document::page::Block::layout].
2151            ///
2152            /// # Example
2153            /// ```ignore,no_run
2154            /// # use google_cloud_documentai_v1::model::document::page::Block;
2155            /// use google_cloud_documentai_v1::model::document::page::Layout;
2156            /// let x = Block::new().set_or_clear_layout(Some(Layout::default()/* use setters */));
2157            /// let x = Block::new().set_or_clear_layout(None::<Layout>);
2158            /// ```
2159            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
2160            where
2161                T: std::convert::Into<crate::model::document::page::Layout>,
2162            {
2163                self.layout = v.map(|x| x.into());
2164                self
2165            }
2166
2167            /// Sets the value of [detected_languages][crate::model::document::page::Block::detected_languages].
2168            ///
2169            /// # Example
2170            /// ```ignore,no_run
2171            /// # use google_cloud_documentai_v1::model::document::page::Block;
2172            /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
2173            /// let x = Block::new()
2174            ///     .set_detected_languages([
2175            ///         DetectedLanguage::default()/* use setters */,
2176            ///         DetectedLanguage::default()/* use (different) setters */,
2177            ///     ]);
2178            /// ```
2179            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
2180            where
2181                T: std::iter::IntoIterator<Item = V>,
2182                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
2183            {
2184                use std::iter::Iterator;
2185                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
2186                self
2187            }
2188
2189            /// Sets the value of [provenance][crate::model::document::page::Block::provenance].
2190            ///
2191            /// # Example
2192            /// ```ignore,no_run
2193            /// # use google_cloud_documentai_v1::model::document::page::Block;
2194            /// use google_cloud_documentai_v1::model::document::Provenance;
2195            /// let x = Block::new().set_provenance(Provenance::default()/* use setters */);
2196            /// ```
2197            #[deprecated]
2198            pub fn set_provenance<T>(mut self, v: T) -> Self
2199            where
2200                T: std::convert::Into<crate::model::document::Provenance>,
2201            {
2202                self.provenance = std::option::Option::Some(v.into());
2203                self
2204            }
2205
2206            /// Sets or clears the value of [provenance][crate::model::document::page::Block::provenance].
2207            ///
2208            /// # Example
2209            /// ```ignore,no_run
2210            /// # use google_cloud_documentai_v1::model::document::page::Block;
2211            /// use google_cloud_documentai_v1::model::document::Provenance;
2212            /// let x = Block::new().set_or_clear_provenance(Some(Provenance::default()/* use setters */));
2213            /// let x = Block::new().set_or_clear_provenance(None::<Provenance>);
2214            /// ```
2215            #[deprecated]
2216            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
2217            where
2218                T: std::convert::Into<crate::model::document::Provenance>,
2219            {
2220                self.provenance = v.map(|x| x.into());
2221                self
2222            }
2223        }
2224
2225        impl wkt::message::Message for Block {
2226            fn typename() -> &'static str {
2227                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Block"
2228            }
2229        }
2230
2231        /// A collection of lines that a human would perceive as a paragraph.
2232        #[derive(Clone, Default, PartialEq)]
2233        #[non_exhaustive]
2234        pub struct Paragraph {
2235            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
2236            /// [Paragraph][google.cloud.documentai.v1.Document.Page.Paragraph].
2237            ///
2238            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2239            /// [google.cloud.documentai.v1.Document.Page.Paragraph]: crate::model::document::page::Paragraph
2240            pub layout: std::option::Option<crate::model::document::page::Layout>,
2241
2242            /// A list of detected languages together with confidence.
2243            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
2244
2245            /// The  history of this annotation.
2246            #[deprecated]
2247            pub provenance: std::option::Option<crate::model::document::Provenance>,
2248
2249            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2250        }
2251
2252        impl Paragraph {
2253            pub fn new() -> Self {
2254                std::default::Default::default()
2255            }
2256
2257            /// Sets the value of [layout][crate::model::document::page::Paragraph::layout].
2258            ///
2259            /// # Example
2260            /// ```ignore,no_run
2261            /// # use google_cloud_documentai_v1::model::document::page::Paragraph;
2262            /// use google_cloud_documentai_v1::model::document::page::Layout;
2263            /// let x = Paragraph::new().set_layout(Layout::default()/* use setters */);
2264            /// ```
2265            pub fn set_layout<T>(mut self, v: T) -> Self
2266            where
2267                T: std::convert::Into<crate::model::document::page::Layout>,
2268            {
2269                self.layout = std::option::Option::Some(v.into());
2270                self
2271            }
2272
2273            /// Sets or clears the value of [layout][crate::model::document::page::Paragraph::layout].
2274            ///
2275            /// # Example
2276            /// ```ignore,no_run
2277            /// # use google_cloud_documentai_v1::model::document::page::Paragraph;
2278            /// use google_cloud_documentai_v1::model::document::page::Layout;
2279            /// let x = Paragraph::new().set_or_clear_layout(Some(Layout::default()/* use setters */));
2280            /// let x = Paragraph::new().set_or_clear_layout(None::<Layout>);
2281            /// ```
2282            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
2283            where
2284                T: std::convert::Into<crate::model::document::page::Layout>,
2285            {
2286                self.layout = v.map(|x| x.into());
2287                self
2288            }
2289
2290            /// Sets the value of [detected_languages][crate::model::document::page::Paragraph::detected_languages].
2291            ///
2292            /// # Example
2293            /// ```ignore,no_run
2294            /// # use google_cloud_documentai_v1::model::document::page::Paragraph;
2295            /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
2296            /// let x = Paragraph::new()
2297            ///     .set_detected_languages([
2298            ///         DetectedLanguage::default()/* use setters */,
2299            ///         DetectedLanguage::default()/* use (different) setters */,
2300            ///     ]);
2301            /// ```
2302            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
2303            where
2304                T: std::iter::IntoIterator<Item = V>,
2305                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
2306            {
2307                use std::iter::Iterator;
2308                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
2309                self
2310            }
2311
2312            /// Sets the value of [provenance][crate::model::document::page::Paragraph::provenance].
2313            ///
2314            /// # Example
2315            /// ```ignore,no_run
2316            /// # use google_cloud_documentai_v1::model::document::page::Paragraph;
2317            /// use google_cloud_documentai_v1::model::document::Provenance;
2318            /// let x = Paragraph::new().set_provenance(Provenance::default()/* use setters */);
2319            /// ```
2320            #[deprecated]
2321            pub fn set_provenance<T>(mut self, v: T) -> Self
2322            where
2323                T: std::convert::Into<crate::model::document::Provenance>,
2324            {
2325                self.provenance = std::option::Option::Some(v.into());
2326                self
2327            }
2328
2329            /// Sets or clears the value of [provenance][crate::model::document::page::Paragraph::provenance].
2330            ///
2331            /// # Example
2332            /// ```ignore,no_run
2333            /// # use google_cloud_documentai_v1::model::document::page::Paragraph;
2334            /// use google_cloud_documentai_v1::model::document::Provenance;
2335            /// let x = Paragraph::new().set_or_clear_provenance(Some(Provenance::default()/* use setters */));
2336            /// let x = Paragraph::new().set_or_clear_provenance(None::<Provenance>);
2337            /// ```
2338            #[deprecated]
2339            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
2340            where
2341                T: std::convert::Into<crate::model::document::Provenance>,
2342            {
2343                self.provenance = v.map(|x| x.into());
2344                self
2345            }
2346        }
2347
2348        impl wkt::message::Message for Paragraph {
2349            fn typename() -> &'static str {
2350                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Paragraph"
2351            }
2352        }
2353
2354        /// A collection of tokens that a human would perceive as a line.
2355        /// Does not cross column boundaries, can be horizontal, vertical, etc.
2356        #[derive(Clone, Default, PartialEq)]
2357        #[non_exhaustive]
2358        pub struct Line {
2359            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
2360            /// [Line][google.cloud.documentai.v1.Document.Page.Line].
2361            ///
2362            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2363            /// [google.cloud.documentai.v1.Document.Page.Line]: crate::model::document::page::Line
2364            pub layout: std::option::Option<crate::model::document::page::Layout>,
2365
2366            /// A list of detected languages together with confidence.
2367            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
2368
2369            /// The  history of this annotation.
2370            #[deprecated]
2371            pub provenance: std::option::Option<crate::model::document::Provenance>,
2372
2373            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2374        }
2375
2376        impl Line {
2377            pub fn new() -> Self {
2378                std::default::Default::default()
2379            }
2380
2381            /// Sets the value of [layout][crate::model::document::page::Line::layout].
2382            ///
2383            /// # Example
2384            /// ```ignore,no_run
2385            /// # use google_cloud_documentai_v1::model::document::page::Line;
2386            /// use google_cloud_documentai_v1::model::document::page::Layout;
2387            /// let x = Line::new().set_layout(Layout::default()/* use setters */);
2388            /// ```
2389            pub fn set_layout<T>(mut self, v: T) -> Self
2390            where
2391                T: std::convert::Into<crate::model::document::page::Layout>,
2392            {
2393                self.layout = std::option::Option::Some(v.into());
2394                self
2395            }
2396
2397            /// Sets or clears the value of [layout][crate::model::document::page::Line::layout].
2398            ///
2399            /// # Example
2400            /// ```ignore,no_run
2401            /// # use google_cloud_documentai_v1::model::document::page::Line;
2402            /// use google_cloud_documentai_v1::model::document::page::Layout;
2403            /// let x = Line::new().set_or_clear_layout(Some(Layout::default()/* use setters */));
2404            /// let x = Line::new().set_or_clear_layout(None::<Layout>);
2405            /// ```
2406            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
2407            where
2408                T: std::convert::Into<crate::model::document::page::Layout>,
2409            {
2410                self.layout = v.map(|x| x.into());
2411                self
2412            }
2413
2414            /// Sets the value of [detected_languages][crate::model::document::page::Line::detected_languages].
2415            ///
2416            /// # Example
2417            /// ```ignore,no_run
2418            /// # use google_cloud_documentai_v1::model::document::page::Line;
2419            /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
2420            /// let x = Line::new()
2421            ///     .set_detected_languages([
2422            ///         DetectedLanguage::default()/* use setters */,
2423            ///         DetectedLanguage::default()/* use (different) setters */,
2424            ///     ]);
2425            /// ```
2426            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
2427            where
2428                T: std::iter::IntoIterator<Item = V>,
2429                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
2430            {
2431                use std::iter::Iterator;
2432                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
2433                self
2434            }
2435
2436            /// Sets the value of [provenance][crate::model::document::page::Line::provenance].
2437            ///
2438            /// # Example
2439            /// ```ignore,no_run
2440            /// # use google_cloud_documentai_v1::model::document::page::Line;
2441            /// use google_cloud_documentai_v1::model::document::Provenance;
2442            /// let x = Line::new().set_provenance(Provenance::default()/* use setters */);
2443            /// ```
2444            #[deprecated]
2445            pub fn set_provenance<T>(mut self, v: T) -> Self
2446            where
2447                T: std::convert::Into<crate::model::document::Provenance>,
2448            {
2449                self.provenance = std::option::Option::Some(v.into());
2450                self
2451            }
2452
2453            /// Sets or clears the value of [provenance][crate::model::document::page::Line::provenance].
2454            ///
2455            /// # Example
2456            /// ```ignore,no_run
2457            /// # use google_cloud_documentai_v1::model::document::page::Line;
2458            /// use google_cloud_documentai_v1::model::document::Provenance;
2459            /// let x = Line::new().set_or_clear_provenance(Some(Provenance::default()/* use setters */));
2460            /// let x = Line::new().set_or_clear_provenance(None::<Provenance>);
2461            /// ```
2462            #[deprecated]
2463            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
2464            where
2465                T: std::convert::Into<crate::model::document::Provenance>,
2466            {
2467                self.provenance = v.map(|x| x.into());
2468                self
2469            }
2470        }
2471
2472        impl wkt::message::Message for Line {
2473            fn typename() -> &'static str {
2474                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Line"
2475            }
2476        }
2477
2478        /// A detected token.
2479        #[derive(Clone, Default, PartialEq)]
2480        #[non_exhaustive]
2481        pub struct Token {
2482            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
2483            /// [Token][google.cloud.documentai.v1.Document.Page.Token].
2484            ///
2485            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
2486            /// [google.cloud.documentai.v1.Document.Page.Token]: crate::model::document::page::Token
2487            pub layout: std::option::Option<crate::model::document::page::Layout>,
2488
2489            /// Detected break at the end of a
2490            /// [Token][google.cloud.documentai.v1.Document.Page.Token].
2491            ///
2492            /// [google.cloud.documentai.v1.Document.Page.Token]: crate::model::document::page::Token
2493            pub detected_break:
2494                std::option::Option<crate::model::document::page::token::DetectedBreak>,
2495
2496            /// A list of detected languages together with confidence.
2497            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
2498
2499            /// The history of this annotation.
2500            #[deprecated]
2501            pub provenance: std::option::Option<crate::model::document::Provenance>,
2502
2503            /// Text style attributes.
2504            pub style_info: std::option::Option<crate::model::document::page::token::StyleInfo>,
2505
2506            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2507        }
2508
2509        impl Token {
2510            pub fn new() -> Self {
2511                std::default::Default::default()
2512            }
2513
2514            /// Sets the value of [layout][crate::model::document::page::Token::layout].
2515            ///
2516            /// # Example
2517            /// ```ignore,no_run
2518            /// # use google_cloud_documentai_v1::model::document::page::Token;
2519            /// use google_cloud_documentai_v1::model::document::page::Layout;
2520            /// let x = Token::new().set_layout(Layout::default()/* use setters */);
2521            /// ```
2522            pub fn set_layout<T>(mut self, v: T) -> Self
2523            where
2524                T: std::convert::Into<crate::model::document::page::Layout>,
2525            {
2526                self.layout = std::option::Option::Some(v.into());
2527                self
2528            }
2529
2530            /// Sets or clears the value of [layout][crate::model::document::page::Token::layout].
2531            ///
2532            /// # Example
2533            /// ```ignore,no_run
2534            /// # use google_cloud_documentai_v1::model::document::page::Token;
2535            /// use google_cloud_documentai_v1::model::document::page::Layout;
2536            /// let x = Token::new().set_or_clear_layout(Some(Layout::default()/* use setters */));
2537            /// let x = Token::new().set_or_clear_layout(None::<Layout>);
2538            /// ```
2539            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
2540            where
2541                T: std::convert::Into<crate::model::document::page::Layout>,
2542            {
2543                self.layout = v.map(|x| x.into());
2544                self
2545            }
2546
2547            /// Sets the value of [detected_break][crate::model::document::page::Token::detected_break].
2548            ///
2549            /// # Example
2550            /// ```ignore,no_run
2551            /// # use google_cloud_documentai_v1::model::document::page::Token;
2552            /// use google_cloud_documentai_v1::model::document::page::token::DetectedBreak;
2553            /// let x = Token::new().set_detected_break(DetectedBreak::default()/* use setters */);
2554            /// ```
2555            pub fn set_detected_break<T>(mut self, v: T) -> Self
2556            where
2557                T: std::convert::Into<crate::model::document::page::token::DetectedBreak>,
2558            {
2559                self.detected_break = std::option::Option::Some(v.into());
2560                self
2561            }
2562
2563            /// Sets or clears the value of [detected_break][crate::model::document::page::Token::detected_break].
2564            ///
2565            /// # Example
2566            /// ```ignore,no_run
2567            /// # use google_cloud_documentai_v1::model::document::page::Token;
2568            /// use google_cloud_documentai_v1::model::document::page::token::DetectedBreak;
2569            /// let x = Token::new().set_or_clear_detected_break(Some(DetectedBreak::default()/* use setters */));
2570            /// let x = Token::new().set_or_clear_detected_break(None::<DetectedBreak>);
2571            /// ```
2572            pub fn set_or_clear_detected_break<T>(mut self, v: std::option::Option<T>) -> Self
2573            where
2574                T: std::convert::Into<crate::model::document::page::token::DetectedBreak>,
2575            {
2576                self.detected_break = v.map(|x| x.into());
2577                self
2578            }
2579
2580            /// Sets the value of [detected_languages][crate::model::document::page::Token::detected_languages].
2581            ///
2582            /// # Example
2583            /// ```ignore,no_run
2584            /// # use google_cloud_documentai_v1::model::document::page::Token;
2585            /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
2586            /// let x = Token::new()
2587            ///     .set_detected_languages([
2588            ///         DetectedLanguage::default()/* use setters */,
2589            ///         DetectedLanguage::default()/* use (different) setters */,
2590            ///     ]);
2591            /// ```
2592            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
2593            where
2594                T: std::iter::IntoIterator<Item = V>,
2595                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
2596            {
2597                use std::iter::Iterator;
2598                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
2599                self
2600            }
2601
2602            /// Sets the value of [provenance][crate::model::document::page::Token::provenance].
2603            ///
2604            /// # Example
2605            /// ```ignore,no_run
2606            /// # use google_cloud_documentai_v1::model::document::page::Token;
2607            /// use google_cloud_documentai_v1::model::document::Provenance;
2608            /// let x = Token::new().set_provenance(Provenance::default()/* use setters */);
2609            /// ```
2610            #[deprecated]
2611            pub fn set_provenance<T>(mut self, v: T) -> Self
2612            where
2613                T: std::convert::Into<crate::model::document::Provenance>,
2614            {
2615                self.provenance = std::option::Option::Some(v.into());
2616                self
2617            }
2618
2619            /// Sets or clears the value of [provenance][crate::model::document::page::Token::provenance].
2620            ///
2621            /// # Example
2622            /// ```ignore,no_run
2623            /// # use google_cloud_documentai_v1::model::document::page::Token;
2624            /// use google_cloud_documentai_v1::model::document::Provenance;
2625            /// let x = Token::new().set_or_clear_provenance(Some(Provenance::default()/* use setters */));
2626            /// let x = Token::new().set_or_clear_provenance(None::<Provenance>);
2627            /// ```
2628            #[deprecated]
2629            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
2630            where
2631                T: std::convert::Into<crate::model::document::Provenance>,
2632            {
2633                self.provenance = v.map(|x| x.into());
2634                self
2635            }
2636
2637            /// Sets the value of [style_info][crate::model::document::page::Token::style_info].
2638            ///
2639            /// # Example
2640            /// ```ignore,no_run
2641            /// # use google_cloud_documentai_v1::model::document::page::Token;
2642            /// use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
2643            /// let x = Token::new().set_style_info(StyleInfo::default()/* use setters */);
2644            /// ```
2645            pub fn set_style_info<T>(mut self, v: T) -> Self
2646            where
2647                T: std::convert::Into<crate::model::document::page::token::StyleInfo>,
2648            {
2649                self.style_info = std::option::Option::Some(v.into());
2650                self
2651            }
2652
2653            /// Sets or clears the value of [style_info][crate::model::document::page::Token::style_info].
2654            ///
2655            /// # Example
2656            /// ```ignore,no_run
2657            /// # use google_cloud_documentai_v1::model::document::page::Token;
2658            /// use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
2659            /// let x = Token::new().set_or_clear_style_info(Some(StyleInfo::default()/* use setters */));
2660            /// let x = Token::new().set_or_clear_style_info(None::<StyleInfo>);
2661            /// ```
2662            pub fn set_or_clear_style_info<T>(mut self, v: std::option::Option<T>) -> Self
2663            where
2664                T: std::convert::Into<crate::model::document::page::token::StyleInfo>,
2665            {
2666                self.style_info = v.map(|x| x.into());
2667                self
2668            }
2669        }
2670
2671        impl wkt::message::Message for Token {
2672            fn typename() -> &'static str {
2673                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Token"
2674            }
2675        }
2676
2677        /// Defines additional types related to [Token].
2678        pub mod token {
2679            #[allow(unused_imports)]
2680            use super::*;
2681
2682            /// Detected break at the end of a
2683            /// [Token][google.cloud.documentai.v1.Document.Page.Token].
2684            ///
2685            /// [google.cloud.documentai.v1.Document.Page.Token]: crate::model::document::page::Token
2686            #[derive(Clone, Default, PartialEq)]
2687            #[non_exhaustive]
2688            pub struct DetectedBreak {
2689                /// Detected break type.
2690                pub r#type: crate::model::document::page::token::detected_break::Type,
2691
2692                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2693            }
2694
2695            impl DetectedBreak {
2696                pub fn new() -> Self {
2697                    std::default::Default::default()
2698                }
2699
2700                /// Sets the value of [r#type][crate::model::document::page::token::DetectedBreak::type].
2701                ///
2702                /// # Example
2703                /// ```ignore,no_run
2704                /// # use google_cloud_documentai_v1::model::document::page::token::DetectedBreak;
2705                /// use google_cloud_documentai_v1::model::document::page::token::detected_break::Type;
2706                /// let x0 = DetectedBreak::new().set_type(Type::Space);
2707                /// let x1 = DetectedBreak::new().set_type(Type::WideSpace);
2708                /// let x2 = DetectedBreak::new().set_type(Type::Hyphen);
2709                /// ```
2710                pub fn set_type<
2711                    T: std::convert::Into<crate::model::document::page::token::detected_break::Type>,
2712                >(
2713                    mut self,
2714                    v: T,
2715                ) -> Self {
2716                    self.r#type = v.into();
2717                    self
2718                }
2719            }
2720
2721            impl wkt::message::Message for DetectedBreak {
2722                fn typename() -> &'static str {
2723                    "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Token.DetectedBreak"
2724                }
2725            }
2726
2727            /// Defines additional types related to [DetectedBreak].
2728            pub mod detected_break {
2729                #[allow(unused_imports)]
2730                use super::*;
2731
2732                /// Enum to denote the type of break found.
2733                ///
2734                /// # Working with unknown values
2735                ///
2736                /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2737                /// additional enum variants at any time. Adding new variants is not considered
2738                /// a breaking change. Applications should write their code in anticipation of:
2739                ///
2740                /// - New values appearing in future releases of the client library, **and**
2741                /// - New values received dynamically, without application changes.
2742                ///
2743                /// Please consult the [Working with enums] section in the user guide for some
2744                /// guidelines.
2745                ///
2746                /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2747                #[derive(Clone, Debug, PartialEq)]
2748                #[non_exhaustive]
2749                pub enum Type {
2750                    /// Unspecified break type.
2751                    Unspecified,
2752                    /// A single whitespace.
2753                    Space,
2754                    /// A wider whitespace.
2755                    WideSpace,
2756                    /// A hyphen that indicates that a token has been split across lines.
2757                    Hyphen,
2758                    /// If set, the enum was initialized with an unknown value.
2759                    ///
2760                    /// Applications can examine the value using [Type::value] or
2761                    /// [Type::name].
2762                    UnknownValue(r#type::UnknownValue),
2763                }
2764
2765                #[doc(hidden)]
2766                pub mod r#type {
2767                    #[allow(unused_imports)]
2768                    use super::*;
2769                    #[derive(Clone, Debug, PartialEq)]
2770                    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2771                }
2772
2773                impl Type {
2774                    /// Gets the enum value.
2775                    ///
2776                    /// Returns `None` if the enum contains an unknown value deserialized from
2777                    /// the string representation of enums.
2778                    pub fn value(&self) -> std::option::Option<i32> {
2779                        match self {
2780                            Self::Unspecified => std::option::Option::Some(0),
2781                            Self::Space => std::option::Option::Some(1),
2782                            Self::WideSpace => std::option::Option::Some(2),
2783                            Self::Hyphen => std::option::Option::Some(3),
2784                            Self::UnknownValue(u) => u.0.value(),
2785                        }
2786                    }
2787
2788                    /// Gets the enum value as a string.
2789                    ///
2790                    /// Returns `None` if the enum contains an unknown value deserialized from
2791                    /// the integer representation of enums.
2792                    pub fn name(&self) -> std::option::Option<&str> {
2793                        match self {
2794                            Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
2795                            Self::Space => std::option::Option::Some("SPACE"),
2796                            Self::WideSpace => std::option::Option::Some("WIDE_SPACE"),
2797                            Self::Hyphen => std::option::Option::Some("HYPHEN"),
2798                            Self::UnknownValue(u) => u.0.name(),
2799                        }
2800                    }
2801                }
2802
2803                impl std::default::Default for Type {
2804                    fn default() -> Self {
2805                        use std::convert::From;
2806                        Self::from(0)
2807                    }
2808                }
2809
2810                impl std::fmt::Display for Type {
2811                    fn fmt(
2812                        &self,
2813                        f: &mut std::fmt::Formatter<'_>,
2814                    ) -> std::result::Result<(), std::fmt::Error> {
2815                        wkt::internal::display_enum(f, self.name(), self.value())
2816                    }
2817                }
2818
2819                impl std::convert::From<i32> for Type {
2820                    fn from(value: i32) -> Self {
2821                        match value {
2822                            0 => Self::Unspecified,
2823                            1 => Self::Space,
2824                            2 => Self::WideSpace,
2825                            3 => Self::Hyphen,
2826                            _ => Self::UnknownValue(r#type::UnknownValue(
2827                                wkt::internal::UnknownEnumValue::Integer(value),
2828                            )),
2829                        }
2830                    }
2831                }
2832
2833                impl std::convert::From<&str> for Type {
2834                    fn from(value: &str) -> Self {
2835                        use std::string::ToString;
2836                        match value {
2837                            "TYPE_UNSPECIFIED" => Self::Unspecified,
2838                            "SPACE" => Self::Space,
2839                            "WIDE_SPACE" => Self::WideSpace,
2840                            "HYPHEN" => Self::Hyphen,
2841                            _ => Self::UnknownValue(r#type::UnknownValue(
2842                                wkt::internal::UnknownEnumValue::String(value.to_string()),
2843                            )),
2844                        }
2845                    }
2846                }
2847
2848                impl serde::ser::Serialize for Type {
2849                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2850                    where
2851                        S: serde::Serializer,
2852                    {
2853                        match self {
2854                            Self::Unspecified => serializer.serialize_i32(0),
2855                            Self::Space => serializer.serialize_i32(1),
2856                            Self::WideSpace => serializer.serialize_i32(2),
2857                            Self::Hyphen => serializer.serialize_i32(3),
2858                            Self::UnknownValue(u) => u.0.serialize(serializer),
2859                        }
2860                    }
2861                }
2862
2863                impl<'de> serde::de::Deserialize<'de> for Type {
2864                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2865                    where
2866                        D: serde::Deserializer<'de>,
2867                    {
2868                        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
2869                            ".google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type",
2870                        ))
2871                    }
2872                }
2873            }
2874
2875            /// Font and other text style attributes.
2876            #[derive(Clone, Default, PartialEq)]
2877            #[non_exhaustive]
2878            pub struct StyleInfo {
2879                /// Font size in points (`1` point is `¹⁄₇₂` inches).
2880                pub font_size: i32,
2881
2882                /// Font size in pixels, equal to _unrounded
2883                /// [font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]_
2884                ///
2885                /// * _resolution_ ÷ `72.0`.
2886                ///
2887                /// [google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]: crate::model::document::page::token::StyleInfo::font_size
2888                pub pixel_font_size: f64,
2889
2890                /// Letter spacing in points.
2891                pub letter_spacing: f64,
2892
2893                /// Name or style of the font.
2894                pub font_type: std::string::String,
2895
2896                /// Whether the text is bold (equivalent to
2897                /// [font_weight][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight]
2898                /// is at least `700`).
2899                ///
2900                /// [google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_weight]: crate::model::document::page::token::StyleInfo::font_weight
2901                pub bold: bool,
2902
2903                /// Whether the text is italic.
2904                pub italic: bool,
2905
2906                /// Whether the text is underlined.
2907                pub underlined: bool,
2908
2909                /// Whether the text is strikethrough. This feature is not supported yet.
2910                pub strikeout: bool,
2911
2912                /// Whether the text is a subscript. This feature is not supported yet.
2913                pub subscript: bool,
2914
2915                /// Whether the text is a superscript. This feature is not supported yet.
2916                pub superscript: bool,
2917
2918                /// Whether the text is in small caps. This feature is not supported yet.
2919                pub smallcaps: bool,
2920
2921                /// TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy).
2922                /// Normal is `400`, bold is `700`.
2923                pub font_weight: i32,
2924
2925                /// Whether the text is handwritten.
2926                pub handwritten: bool,
2927
2928                /// Color of the text.
2929                pub text_color: std::option::Option<google_cloud_type::model::Color>,
2930
2931                /// Color of the background.
2932                pub background_color: std::option::Option<google_cloud_type::model::Color>,
2933
2934                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2935            }
2936
2937            impl StyleInfo {
2938                pub fn new() -> Self {
2939                    std::default::Default::default()
2940                }
2941
2942                /// Sets the value of [font_size][crate::model::document::page::token::StyleInfo::font_size].
2943                ///
2944                /// # Example
2945                /// ```ignore,no_run
2946                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
2947                /// let x = StyleInfo::new().set_font_size(42);
2948                /// ```
2949                pub fn set_font_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2950                    self.font_size = v.into();
2951                    self
2952                }
2953
2954                /// Sets the value of [pixel_font_size][crate::model::document::page::token::StyleInfo::pixel_font_size].
2955                ///
2956                /// # Example
2957                /// ```ignore,no_run
2958                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
2959                /// let x = StyleInfo::new().set_pixel_font_size(42.0);
2960                /// ```
2961                pub fn set_pixel_font_size<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2962                    self.pixel_font_size = v.into();
2963                    self
2964                }
2965
2966                /// Sets the value of [letter_spacing][crate::model::document::page::token::StyleInfo::letter_spacing].
2967                ///
2968                /// # Example
2969                /// ```ignore,no_run
2970                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
2971                /// let x = StyleInfo::new().set_letter_spacing(42.0);
2972                /// ```
2973                pub fn set_letter_spacing<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2974                    self.letter_spacing = v.into();
2975                    self
2976                }
2977
2978                /// Sets the value of [font_type][crate::model::document::page::token::StyleInfo::font_type].
2979                ///
2980                /// # Example
2981                /// ```ignore,no_run
2982                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
2983                /// let x = StyleInfo::new().set_font_type("example");
2984                /// ```
2985                pub fn set_font_type<T: std::convert::Into<std::string::String>>(
2986                    mut self,
2987                    v: T,
2988                ) -> Self {
2989                    self.font_type = v.into();
2990                    self
2991                }
2992
2993                /// Sets the value of [bold][crate::model::document::page::token::StyleInfo::bold].
2994                ///
2995                /// # Example
2996                /// ```ignore,no_run
2997                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
2998                /// let x = StyleInfo::new().set_bold(true);
2999                /// ```
3000                pub fn set_bold<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3001                    self.bold = v.into();
3002                    self
3003                }
3004
3005                /// Sets the value of [italic][crate::model::document::page::token::StyleInfo::italic].
3006                ///
3007                /// # Example
3008                /// ```ignore,no_run
3009                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3010                /// let x = StyleInfo::new().set_italic(true);
3011                /// ```
3012                pub fn set_italic<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3013                    self.italic = v.into();
3014                    self
3015                }
3016
3017                /// Sets the value of [underlined][crate::model::document::page::token::StyleInfo::underlined].
3018                ///
3019                /// # Example
3020                /// ```ignore,no_run
3021                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3022                /// let x = StyleInfo::new().set_underlined(true);
3023                /// ```
3024                pub fn set_underlined<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3025                    self.underlined = v.into();
3026                    self
3027                }
3028
3029                /// Sets the value of [strikeout][crate::model::document::page::token::StyleInfo::strikeout].
3030                ///
3031                /// # Example
3032                /// ```ignore,no_run
3033                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3034                /// let x = StyleInfo::new().set_strikeout(true);
3035                /// ```
3036                pub fn set_strikeout<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3037                    self.strikeout = v.into();
3038                    self
3039                }
3040
3041                /// Sets the value of [subscript][crate::model::document::page::token::StyleInfo::subscript].
3042                ///
3043                /// # Example
3044                /// ```ignore,no_run
3045                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3046                /// let x = StyleInfo::new().set_subscript(true);
3047                /// ```
3048                pub fn set_subscript<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3049                    self.subscript = v.into();
3050                    self
3051                }
3052
3053                /// Sets the value of [superscript][crate::model::document::page::token::StyleInfo::superscript].
3054                ///
3055                /// # Example
3056                /// ```ignore,no_run
3057                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3058                /// let x = StyleInfo::new().set_superscript(true);
3059                /// ```
3060                pub fn set_superscript<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3061                    self.superscript = v.into();
3062                    self
3063                }
3064
3065                /// Sets the value of [smallcaps][crate::model::document::page::token::StyleInfo::smallcaps].
3066                ///
3067                /// # Example
3068                /// ```ignore,no_run
3069                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3070                /// let x = StyleInfo::new().set_smallcaps(true);
3071                /// ```
3072                pub fn set_smallcaps<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3073                    self.smallcaps = v.into();
3074                    self
3075                }
3076
3077                /// Sets the value of [font_weight][crate::model::document::page::token::StyleInfo::font_weight].
3078                ///
3079                /// # Example
3080                /// ```ignore,no_run
3081                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3082                /// let x = StyleInfo::new().set_font_weight(42);
3083                /// ```
3084                pub fn set_font_weight<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3085                    self.font_weight = v.into();
3086                    self
3087                }
3088
3089                /// Sets the value of [handwritten][crate::model::document::page::token::StyleInfo::handwritten].
3090                ///
3091                /// # Example
3092                /// ```ignore,no_run
3093                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3094                /// let x = StyleInfo::new().set_handwritten(true);
3095                /// ```
3096                pub fn set_handwritten<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3097                    self.handwritten = v.into();
3098                    self
3099                }
3100
3101                /// Sets the value of [text_color][crate::model::document::page::token::StyleInfo::text_color].
3102                ///
3103                /// # Example
3104                /// ```ignore,no_run
3105                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3106                /// use google_cloud_type::model::Color;
3107                /// let x = StyleInfo::new().set_text_color(Color::default()/* use setters */);
3108                /// ```
3109                pub fn set_text_color<T>(mut self, v: T) -> Self
3110                where
3111                    T: std::convert::Into<google_cloud_type::model::Color>,
3112                {
3113                    self.text_color = std::option::Option::Some(v.into());
3114                    self
3115                }
3116
3117                /// Sets or clears the value of [text_color][crate::model::document::page::token::StyleInfo::text_color].
3118                ///
3119                /// # Example
3120                /// ```ignore,no_run
3121                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3122                /// use google_cloud_type::model::Color;
3123                /// let x = StyleInfo::new().set_or_clear_text_color(Some(Color::default()/* use setters */));
3124                /// let x = StyleInfo::new().set_or_clear_text_color(None::<Color>);
3125                /// ```
3126                pub fn set_or_clear_text_color<T>(mut self, v: std::option::Option<T>) -> Self
3127                where
3128                    T: std::convert::Into<google_cloud_type::model::Color>,
3129                {
3130                    self.text_color = v.map(|x| x.into());
3131                    self
3132                }
3133
3134                /// Sets the value of [background_color][crate::model::document::page::token::StyleInfo::background_color].
3135                ///
3136                /// # Example
3137                /// ```ignore,no_run
3138                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3139                /// use google_cloud_type::model::Color;
3140                /// let x = StyleInfo::new().set_background_color(Color::default()/* use setters */);
3141                /// ```
3142                pub fn set_background_color<T>(mut self, v: T) -> Self
3143                where
3144                    T: std::convert::Into<google_cloud_type::model::Color>,
3145                {
3146                    self.background_color = std::option::Option::Some(v.into());
3147                    self
3148                }
3149
3150                /// Sets or clears the value of [background_color][crate::model::document::page::token::StyleInfo::background_color].
3151                ///
3152                /// # Example
3153                /// ```ignore,no_run
3154                /// # use google_cloud_documentai_v1::model::document::page::token::StyleInfo;
3155                /// use google_cloud_type::model::Color;
3156                /// let x = StyleInfo::new().set_or_clear_background_color(Some(Color::default()/* use setters */));
3157                /// let x = StyleInfo::new().set_or_clear_background_color(None::<Color>);
3158                /// ```
3159                pub fn set_or_clear_background_color<T>(mut self, v: std::option::Option<T>) -> Self
3160                where
3161                    T: std::convert::Into<google_cloud_type::model::Color>,
3162                {
3163                    self.background_color = v.map(|x| x.into());
3164                    self
3165                }
3166            }
3167
3168            impl wkt::message::Message for StyleInfo {
3169                fn typename() -> &'static str {
3170                    "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Token.StyleInfo"
3171                }
3172            }
3173        }
3174
3175        /// A detected symbol.
3176        #[derive(Clone, Default, PartialEq)]
3177        #[non_exhaustive]
3178        pub struct Symbol {
3179            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
3180            /// [Symbol][google.cloud.documentai.v1.Document.Page.Symbol].
3181            ///
3182            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
3183            /// [google.cloud.documentai.v1.Document.Page.Symbol]: crate::model::document::page::Symbol
3184            pub layout: std::option::Option<crate::model::document::page::Layout>,
3185
3186            /// A list of detected languages together with confidence.
3187            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
3188
3189            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3190        }
3191
3192        impl Symbol {
3193            pub fn new() -> Self {
3194                std::default::Default::default()
3195            }
3196
3197            /// Sets the value of [layout][crate::model::document::page::Symbol::layout].
3198            ///
3199            /// # Example
3200            /// ```ignore,no_run
3201            /// # use google_cloud_documentai_v1::model::document::page::Symbol;
3202            /// use google_cloud_documentai_v1::model::document::page::Layout;
3203            /// let x = Symbol::new().set_layout(Layout::default()/* use setters */);
3204            /// ```
3205            pub fn set_layout<T>(mut self, v: T) -> Self
3206            where
3207                T: std::convert::Into<crate::model::document::page::Layout>,
3208            {
3209                self.layout = std::option::Option::Some(v.into());
3210                self
3211            }
3212
3213            /// Sets or clears the value of [layout][crate::model::document::page::Symbol::layout].
3214            ///
3215            /// # Example
3216            /// ```ignore,no_run
3217            /// # use google_cloud_documentai_v1::model::document::page::Symbol;
3218            /// use google_cloud_documentai_v1::model::document::page::Layout;
3219            /// let x = Symbol::new().set_or_clear_layout(Some(Layout::default()/* use setters */));
3220            /// let x = Symbol::new().set_or_clear_layout(None::<Layout>);
3221            /// ```
3222            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
3223            where
3224                T: std::convert::Into<crate::model::document::page::Layout>,
3225            {
3226                self.layout = v.map(|x| x.into());
3227                self
3228            }
3229
3230            /// Sets the value of [detected_languages][crate::model::document::page::Symbol::detected_languages].
3231            ///
3232            /// # Example
3233            /// ```ignore,no_run
3234            /// # use google_cloud_documentai_v1::model::document::page::Symbol;
3235            /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
3236            /// let x = Symbol::new()
3237            ///     .set_detected_languages([
3238            ///         DetectedLanguage::default()/* use setters */,
3239            ///         DetectedLanguage::default()/* use (different) setters */,
3240            ///     ]);
3241            /// ```
3242            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
3243            where
3244                T: std::iter::IntoIterator<Item = V>,
3245                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
3246            {
3247                use std::iter::Iterator;
3248                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
3249                self
3250            }
3251        }
3252
3253        impl wkt::message::Message for Symbol {
3254            fn typename() -> &'static str {
3255                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Symbol"
3256            }
3257        }
3258
3259        /// Detected non-text visual elements e.g. checkbox, signature etc. on the
3260        /// page.
3261        #[derive(Clone, Default, PartialEq)]
3262        #[non_exhaustive]
3263        pub struct VisualElement {
3264            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
3265            /// [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
3266            ///
3267            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
3268            /// [google.cloud.documentai.v1.Document.Page.VisualElement]: crate::model::document::page::VisualElement
3269            pub layout: std::option::Option<crate::model::document::page::Layout>,
3270
3271            /// Type of the
3272            /// [VisualElement][google.cloud.documentai.v1.Document.Page.VisualElement].
3273            ///
3274            /// [google.cloud.documentai.v1.Document.Page.VisualElement]: crate::model::document::page::VisualElement
3275            pub r#type: std::string::String,
3276
3277            /// A list of detected languages together with confidence.
3278            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
3279
3280            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3281        }
3282
3283        impl VisualElement {
3284            pub fn new() -> Self {
3285                std::default::Default::default()
3286            }
3287
3288            /// Sets the value of [layout][crate::model::document::page::VisualElement::layout].
3289            ///
3290            /// # Example
3291            /// ```ignore,no_run
3292            /// # use google_cloud_documentai_v1::model::document::page::VisualElement;
3293            /// use google_cloud_documentai_v1::model::document::page::Layout;
3294            /// let x = VisualElement::new().set_layout(Layout::default()/* use setters */);
3295            /// ```
3296            pub fn set_layout<T>(mut self, v: T) -> Self
3297            where
3298                T: std::convert::Into<crate::model::document::page::Layout>,
3299            {
3300                self.layout = std::option::Option::Some(v.into());
3301                self
3302            }
3303
3304            /// Sets or clears the value of [layout][crate::model::document::page::VisualElement::layout].
3305            ///
3306            /// # Example
3307            /// ```ignore,no_run
3308            /// # use google_cloud_documentai_v1::model::document::page::VisualElement;
3309            /// use google_cloud_documentai_v1::model::document::page::Layout;
3310            /// let x = VisualElement::new().set_or_clear_layout(Some(Layout::default()/* use setters */));
3311            /// let x = VisualElement::new().set_or_clear_layout(None::<Layout>);
3312            /// ```
3313            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
3314            where
3315                T: std::convert::Into<crate::model::document::page::Layout>,
3316            {
3317                self.layout = v.map(|x| x.into());
3318                self
3319            }
3320
3321            /// Sets the value of [r#type][crate::model::document::page::VisualElement::type].
3322            ///
3323            /// # Example
3324            /// ```ignore,no_run
3325            /// # use google_cloud_documentai_v1::model::document::page::VisualElement;
3326            /// let x = VisualElement::new().set_type("example");
3327            /// ```
3328            pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3329                self.r#type = v.into();
3330                self
3331            }
3332
3333            /// Sets the value of [detected_languages][crate::model::document::page::VisualElement::detected_languages].
3334            ///
3335            /// # Example
3336            /// ```ignore,no_run
3337            /// # use google_cloud_documentai_v1::model::document::page::VisualElement;
3338            /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
3339            /// let x = VisualElement::new()
3340            ///     .set_detected_languages([
3341            ///         DetectedLanguage::default()/* use setters */,
3342            ///         DetectedLanguage::default()/* use (different) setters */,
3343            ///     ]);
3344            /// ```
3345            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
3346            where
3347                T: std::iter::IntoIterator<Item = V>,
3348                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
3349            {
3350                use std::iter::Iterator;
3351                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
3352                self
3353            }
3354        }
3355
3356        impl wkt::message::Message for VisualElement {
3357            fn typename() -> &'static str {
3358                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.VisualElement"
3359            }
3360        }
3361
3362        /// A table representation similar to HTML table structure.
3363        #[derive(Clone, Default, PartialEq)]
3364        #[non_exhaustive]
3365        pub struct Table {
3366            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
3367            /// [Table][google.cloud.documentai.v1.Document.Page.Table].
3368            ///
3369            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
3370            /// [google.cloud.documentai.v1.Document.Page.Table]: crate::model::document::page::Table
3371            pub layout: std::option::Option<crate::model::document::page::Layout>,
3372
3373            /// Header rows of the table.
3374            pub header_rows: std::vec::Vec<crate::model::document::page::table::TableRow>,
3375
3376            /// Body rows of the table.
3377            pub body_rows: std::vec::Vec<crate::model::document::page::table::TableRow>,
3378
3379            /// A list of detected languages together with confidence.
3380            pub detected_languages: std::vec::Vec<crate::model::document::page::DetectedLanguage>,
3381
3382            /// The history of this table.
3383            #[deprecated]
3384            pub provenance: std::option::Option<crate::model::document::Provenance>,
3385
3386            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3387        }
3388
3389        impl Table {
3390            pub fn new() -> Self {
3391                std::default::Default::default()
3392            }
3393
3394            /// Sets the value of [layout][crate::model::document::page::Table::layout].
3395            ///
3396            /// # Example
3397            /// ```ignore,no_run
3398            /// # use google_cloud_documentai_v1::model::document::page::Table;
3399            /// use google_cloud_documentai_v1::model::document::page::Layout;
3400            /// let x = Table::new().set_layout(Layout::default()/* use setters */);
3401            /// ```
3402            pub fn set_layout<T>(mut self, v: T) -> Self
3403            where
3404                T: std::convert::Into<crate::model::document::page::Layout>,
3405            {
3406                self.layout = std::option::Option::Some(v.into());
3407                self
3408            }
3409
3410            /// Sets or clears the value of [layout][crate::model::document::page::Table::layout].
3411            ///
3412            /// # Example
3413            /// ```ignore,no_run
3414            /// # use google_cloud_documentai_v1::model::document::page::Table;
3415            /// use google_cloud_documentai_v1::model::document::page::Layout;
3416            /// let x = Table::new().set_or_clear_layout(Some(Layout::default()/* use setters */));
3417            /// let x = Table::new().set_or_clear_layout(None::<Layout>);
3418            /// ```
3419            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
3420            where
3421                T: std::convert::Into<crate::model::document::page::Layout>,
3422            {
3423                self.layout = v.map(|x| x.into());
3424                self
3425            }
3426
3427            /// Sets the value of [header_rows][crate::model::document::page::Table::header_rows].
3428            ///
3429            /// # Example
3430            /// ```ignore,no_run
3431            /// # use google_cloud_documentai_v1::model::document::page::Table;
3432            /// use google_cloud_documentai_v1::model::document::page::table::TableRow;
3433            /// let x = Table::new()
3434            ///     .set_header_rows([
3435            ///         TableRow::default()/* use setters */,
3436            ///         TableRow::default()/* use (different) setters */,
3437            ///     ]);
3438            /// ```
3439            pub fn set_header_rows<T, V>(mut self, v: T) -> Self
3440            where
3441                T: std::iter::IntoIterator<Item = V>,
3442                V: std::convert::Into<crate::model::document::page::table::TableRow>,
3443            {
3444                use std::iter::Iterator;
3445                self.header_rows = v.into_iter().map(|i| i.into()).collect();
3446                self
3447            }
3448
3449            /// Sets the value of [body_rows][crate::model::document::page::Table::body_rows].
3450            ///
3451            /// # Example
3452            /// ```ignore,no_run
3453            /// # use google_cloud_documentai_v1::model::document::page::Table;
3454            /// use google_cloud_documentai_v1::model::document::page::table::TableRow;
3455            /// let x = Table::new()
3456            ///     .set_body_rows([
3457            ///         TableRow::default()/* use setters */,
3458            ///         TableRow::default()/* use (different) setters */,
3459            ///     ]);
3460            /// ```
3461            pub fn set_body_rows<T, V>(mut self, v: T) -> Self
3462            where
3463                T: std::iter::IntoIterator<Item = V>,
3464                V: std::convert::Into<crate::model::document::page::table::TableRow>,
3465            {
3466                use std::iter::Iterator;
3467                self.body_rows = v.into_iter().map(|i| i.into()).collect();
3468                self
3469            }
3470
3471            /// Sets the value of [detected_languages][crate::model::document::page::Table::detected_languages].
3472            ///
3473            /// # Example
3474            /// ```ignore,no_run
3475            /// # use google_cloud_documentai_v1::model::document::page::Table;
3476            /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
3477            /// let x = Table::new()
3478            ///     .set_detected_languages([
3479            ///         DetectedLanguage::default()/* use setters */,
3480            ///         DetectedLanguage::default()/* use (different) setters */,
3481            ///     ]);
3482            /// ```
3483            pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
3484            where
3485                T: std::iter::IntoIterator<Item = V>,
3486                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
3487            {
3488                use std::iter::Iterator;
3489                self.detected_languages = v.into_iter().map(|i| i.into()).collect();
3490                self
3491            }
3492
3493            /// Sets the value of [provenance][crate::model::document::page::Table::provenance].
3494            ///
3495            /// # Example
3496            /// ```ignore,no_run
3497            /// # use google_cloud_documentai_v1::model::document::page::Table;
3498            /// use google_cloud_documentai_v1::model::document::Provenance;
3499            /// let x = Table::new().set_provenance(Provenance::default()/* use setters */);
3500            /// ```
3501            #[deprecated]
3502            pub fn set_provenance<T>(mut self, v: T) -> Self
3503            where
3504                T: std::convert::Into<crate::model::document::Provenance>,
3505            {
3506                self.provenance = std::option::Option::Some(v.into());
3507                self
3508            }
3509
3510            /// Sets or clears the value of [provenance][crate::model::document::page::Table::provenance].
3511            ///
3512            /// # Example
3513            /// ```ignore,no_run
3514            /// # use google_cloud_documentai_v1::model::document::page::Table;
3515            /// use google_cloud_documentai_v1::model::document::Provenance;
3516            /// let x = Table::new().set_or_clear_provenance(Some(Provenance::default()/* use setters */));
3517            /// let x = Table::new().set_or_clear_provenance(None::<Provenance>);
3518            /// ```
3519            #[deprecated]
3520            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
3521            where
3522                T: std::convert::Into<crate::model::document::Provenance>,
3523            {
3524                self.provenance = v.map(|x| x.into());
3525                self
3526            }
3527        }
3528
3529        impl wkt::message::Message for Table {
3530            fn typename() -> &'static str {
3531                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Table"
3532            }
3533        }
3534
3535        /// Defines additional types related to [Table].
3536        pub mod table {
3537            #[allow(unused_imports)]
3538            use super::*;
3539
3540            /// A row of table cells.
3541            #[derive(Clone, Default, PartialEq)]
3542            #[non_exhaustive]
3543            pub struct TableRow {
3544                /// Cells that make up this row.
3545                pub cells: std::vec::Vec<crate::model::document::page::table::TableCell>,
3546
3547                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3548            }
3549
3550            impl TableRow {
3551                pub fn new() -> Self {
3552                    std::default::Default::default()
3553                }
3554
3555                /// Sets the value of [cells][crate::model::document::page::table::TableRow::cells].
3556                ///
3557                /// # Example
3558                /// ```ignore,no_run
3559                /// # use google_cloud_documentai_v1::model::document::page::table::TableRow;
3560                /// use google_cloud_documentai_v1::model::document::page::table::TableCell;
3561                /// let x = TableRow::new()
3562                ///     .set_cells([
3563                ///         TableCell::default()/* use setters */,
3564                ///         TableCell::default()/* use (different) setters */,
3565                ///     ]);
3566                /// ```
3567                pub fn set_cells<T, V>(mut self, v: T) -> Self
3568                where
3569                    T: std::iter::IntoIterator<Item = V>,
3570                    V: std::convert::Into<crate::model::document::page::table::TableCell>,
3571                {
3572                    use std::iter::Iterator;
3573                    self.cells = v.into_iter().map(|i| i.into()).collect();
3574                    self
3575                }
3576            }
3577
3578            impl wkt::message::Message for TableRow {
3579                fn typename() -> &'static str {
3580                    "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Table.TableRow"
3581                }
3582            }
3583
3584            /// A cell representation inside the table.
3585            #[derive(Clone, Default, PartialEq)]
3586            #[non_exhaustive]
3587            pub struct TableCell {
3588                /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
3589                /// [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
3590                ///
3591                /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
3592                /// [google.cloud.documentai.v1.Document.Page.Table.TableCell]: crate::model::document::page::table::TableCell
3593                pub layout: std::option::Option<crate::model::document::page::Layout>,
3594
3595                /// How many rows this cell spans.
3596                pub row_span: i32,
3597
3598                /// How many columns this cell spans.
3599                pub col_span: i32,
3600
3601                /// A list of detected languages together with confidence.
3602                pub detected_languages:
3603                    std::vec::Vec<crate::model::document::page::DetectedLanguage>,
3604
3605                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3606            }
3607
3608            impl TableCell {
3609                pub fn new() -> Self {
3610                    std::default::Default::default()
3611                }
3612
3613                /// Sets the value of [layout][crate::model::document::page::table::TableCell::layout].
3614                ///
3615                /// # Example
3616                /// ```ignore,no_run
3617                /// # use google_cloud_documentai_v1::model::document::page::table::TableCell;
3618                /// use google_cloud_documentai_v1::model::document::page::Layout;
3619                /// let x = TableCell::new().set_layout(Layout::default()/* use setters */);
3620                /// ```
3621                pub fn set_layout<T>(mut self, v: T) -> Self
3622                where
3623                    T: std::convert::Into<crate::model::document::page::Layout>,
3624                {
3625                    self.layout = std::option::Option::Some(v.into());
3626                    self
3627                }
3628
3629                /// Sets or clears the value of [layout][crate::model::document::page::table::TableCell::layout].
3630                ///
3631                /// # Example
3632                /// ```ignore,no_run
3633                /// # use google_cloud_documentai_v1::model::document::page::table::TableCell;
3634                /// use google_cloud_documentai_v1::model::document::page::Layout;
3635                /// let x = TableCell::new().set_or_clear_layout(Some(Layout::default()/* use setters */));
3636                /// let x = TableCell::new().set_or_clear_layout(None::<Layout>);
3637                /// ```
3638                pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
3639                where
3640                    T: std::convert::Into<crate::model::document::page::Layout>,
3641                {
3642                    self.layout = v.map(|x| x.into());
3643                    self
3644                }
3645
3646                /// Sets the value of [row_span][crate::model::document::page::table::TableCell::row_span].
3647                ///
3648                /// # Example
3649                /// ```ignore,no_run
3650                /// # use google_cloud_documentai_v1::model::document::page::table::TableCell;
3651                /// let x = TableCell::new().set_row_span(42);
3652                /// ```
3653                pub fn set_row_span<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3654                    self.row_span = v.into();
3655                    self
3656                }
3657
3658                /// Sets the value of [col_span][crate::model::document::page::table::TableCell::col_span].
3659                ///
3660                /// # Example
3661                /// ```ignore,no_run
3662                /// # use google_cloud_documentai_v1::model::document::page::table::TableCell;
3663                /// let x = TableCell::new().set_col_span(42);
3664                /// ```
3665                pub fn set_col_span<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3666                    self.col_span = v.into();
3667                    self
3668                }
3669
3670                /// Sets the value of [detected_languages][crate::model::document::page::table::TableCell::detected_languages].
3671                ///
3672                /// # Example
3673                /// ```ignore,no_run
3674                /// # use google_cloud_documentai_v1::model::document::page::table::TableCell;
3675                /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
3676                /// let x = TableCell::new()
3677                ///     .set_detected_languages([
3678                ///         DetectedLanguage::default()/* use setters */,
3679                ///         DetectedLanguage::default()/* use (different) setters */,
3680                ///     ]);
3681                /// ```
3682                pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
3683                where
3684                    T: std::iter::IntoIterator<Item = V>,
3685                    V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
3686                {
3687                    use std::iter::Iterator;
3688                    self.detected_languages = v.into_iter().map(|i| i.into()).collect();
3689                    self
3690                }
3691            }
3692
3693            impl wkt::message::Message for TableCell {
3694                fn typename() -> &'static str {
3695                    "type.googleapis.com/google.cloud.documentai.v1.Document.Page.Table.TableCell"
3696                }
3697            }
3698        }
3699
3700        /// A form field detected on the page.
3701        #[derive(Clone, Default, PartialEq)]
3702        #[non_exhaustive]
3703        pub struct FormField {
3704            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
3705            /// [FormField][google.cloud.documentai.v1.Document.Page.FormField] name.
3706            /// e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
3707            ///
3708            /// [google.cloud.documentai.v1.Document.Page.FormField]: crate::model::document::page::FormField
3709            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
3710            pub field_name: std::option::Option<crate::model::document::page::Layout>,
3711
3712            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for the
3713            /// [FormField][google.cloud.documentai.v1.Document.Page.FormField] value.
3714            ///
3715            /// [google.cloud.documentai.v1.Document.Page.FormField]: crate::model::document::page::FormField
3716            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
3717            pub field_value: std::option::Option<crate::model::document::page::Layout>,
3718
3719            /// A list of detected languages for name together with confidence.
3720            pub name_detected_languages:
3721                std::vec::Vec<crate::model::document::page::DetectedLanguage>,
3722
3723            /// A list of detected languages for value together with confidence.
3724            pub value_detected_languages:
3725                std::vec::Vec<crate::model::document::page::DetectedLanguage>,
3726
3727            /// If the value is non-textual, this field represents the type. Current
3728            /// valid values are:
3729            ///
3730            /// - blank (this indicates the `field_value` is normal text)
3731            /// - `unfilled_checkbox`
3732            /// - `filled_checkbox`
3733            pub value_type: std::string::String,
3734
3735            /// Created for Labeling UI to export key text.
3736            /// If corrections were made to the text identified by the
3737            /// `field_name.text_anchor`, this field will contain the correction.
3738            pub corrected_key_text: std::string::String,
3739
3740            /// Created for Labeling UI to export value text.
3741            /// If corrections were made to the text identified by the
3742            /// `field_value.text_anchor`, this field will contain the correction.
3743            pub corrected_value_text: std::string::String,
3744
3745            /// The history of this annotation.
3746            pub provenance: std::option::Option<crate::model::document::Provenance>,
3747
3748            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3749        }
3750
3751        impl FormField {
3752            pub fn new() -> Self {
3753                std::default::Default::default()
3754            }
3755
3756            /// Sets the value of [field_name][crate::model::document::page::FormField::field_name].
3757            ///
3758            /// # Example
3759            /// ```ignore,no_run
3760            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3761            /// use google_cloud_documentai_v1::model::document::page::Layout;
3762            /// let x = FormField::new().set_field_name(Layout::default()/* use setters */);
3763            /// ```
3764            pub fn set_field_name<T>(mut self, v: T) -> Self
3765            where
3766                T: std::convert::Into<crate::model::document::page::Layout>,
3767            {
3768                self.field_name = std::option::Option::Some(v.into());
3769                self
3770            }
3771
3772            /// Sets or clears the value of [field_name][crate::model::document::page::FormField::field_name].
3773            ///
3774            /// # Example
3775            /// ```ignore,no_run
3776            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3777            /// use google_cloud_documentai_v1::model::document::page::Layout;
3778            /// let x = FormField::new().set_or_clear_field_name(Some(Layout::default()/* use setters */));
3779            /// let x = FormField::new().set_or_clear_field_name(None::<Layout>);
3780            /// ```
3781            pub fn set_or_clear_field_name<T>(mut self, v: std::option::Option<T>) -> Self
3782            where
3783                T: std::convert::Into<crate::model::document::page::Layout>,
3784            {
3785                self.field_name = v.map(|x| x.into());
3786                self
3787            }
3788
3789            /// Sets the value of [field_value][crate::model::document::page::FormField::field_value].
3790            ///
3791            /// # Example
3792            /// ```ignore,no_run
3793            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3794            /// use google_cloud_documentai_v1::model::document::page::Layout;
3795            /// let x = FormField::new().set_field_value(Layout::default()/* use setters */);
3796            /// ```
3797            pub fn set_field_value<T>(mut self, v: T) -> Self
3798            where
3799                T: std::convert::Into<crate::model::document::page::Layout>,
3800            {
3801                self.field_value = std::option::Option::Some(v.into());
3802                self
3803            }
3804
3805            /// Sets or clears the value of [field_value][crate::model::document::page::FormField::field_value].
3806            ///
3807            /// # Example
3808            /// ```ignore,no_run
3809            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3810            /// use google_cloud_documentai_v1::model::document::page::Layout;
3811            /// let x = FormField::new().set_or_clear_field_value(Some(Layout::default()/* use setters */));
3812            /// let x = FormField::new().set_or_clear_field_value(None::<Layout>);
3813            /// ```
3814            pub fn set_or_clear_field_value<T>(mut self, v: std::option::Option<T>) -> Self
3815            where
3816                T: std::convert::Into<crate::model::document::page::Layout>,
3817            {
3818                self.field_value = v.map(|x| x.into());
3819                self
3820            }
3821
3822            /// Sets the value of [name_detected_languages][crate::model::document::page::FormField::name_detected_languages].
3823            ///
3824            /// # Example
3825            /// ```ignore,no_run
3826            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3827            /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
3828            /// let x = FormField::new()
3829            ///     .set_name_detected_languages([
3830            ///         DetectedLanguage::default()/* use setters */,
3831            ///         DetectedLanguage::default()/* use (different) setters */,
3832            ///     ]);
3833            /// ```
3834            pub fn set_name_detected_languages<T, V>(mut self, v: T) -> Self
3835            where
3836                T: std::iter::IntoIterator<Item = V>,
3837                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
3838            {
3839                use std::iter::Iterator;
3840                self.name_detected_languages = v.into_iter().map(|i| i.into()).collect();
3841                self
3842            }
3843
3844            /// Sets the value of [value_detected_languages][crate::model::document::page::FormField::value_detected_languages].
3845            ///
3846            /// # Example
3847            /// ```ignore,no_run
3848            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3849            /// use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
3850            /// let x = FormField::new()
3851            ///     .set_value_detected_languages([
3852            ///         DetectedLanguage::default()/* use setters */,
3853            ///         DetectedLanguage::default()/* use (different) setters */,
3854            ///     ]);
3855            /// ```
3856            pub fn set_value_detected_languages<T, V>(mut self, v: T) -> Self
3857            where
3858                T: std::iter::IntoIterator<Item = V>,
3859                V: std::convert::Into<crate::model::document::page::DetectedLanguage>,
3860            {
3861                use std::iter::Iterator;
3862                self.value_detected_languages = v.into_iter().map(|i| i.into()).collect();
3863                self
3864            }
3865
3866            /// Sets the value of [value_type][crate::model::document::page::FormField::value_type].
3867            ///
3868            /// # Example
3869            /// ```ignore,no_run
3870            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3871            /// let x = FormField::new().set_value_type("example");
3872            /// ```
3873            pub fn set_value_type<T: std::convert::Into<std::string::String>>(
3874                mut self,
3875                v: T,
3876            ) -> Self {
3877                self.value_type = v.into();
3878                self
3879            }
3880
3881            /// Sets the value of [corrected_key_text][crate::model::document::page::FormField::corrected_key_text].
3882            ///
3883            /// # Example
3884            /// ```ignore,no_run
3885            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3886            /// let x = FormField::new().set_corrected_key_text("example");
3887            /// ```
3888            pub fn set_corrected_key_text<T: std::convert::Into<std::string::String>>(
3889                mut self,
3890                v: T,
3891            ) -> Self {
3892                self.corrected_key_text = v.into();
3893                self
3894            }
3895
3896            /// Sets the value of [corrected_value_text][crate::model::document::page::FormField::corrected_value_text].
3897            ///
3898            /// # Example
3899            /// ```ignore,no_run
3900            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3901            /// let x = FormField::new().set_corrected_value_text("example");
3902            /// ```
3903            pub fn set_corrected_value_text<T: std::convert::Into<std::string::String>>(
3904                mut self,
3905                v: T,
3906            ) -> Self {
3907                self.corrected_value_text = v.into();
3908                self
3909            }
3910
3911            /// Sets the value of [provenance][crate::model::document::page::FormField::provenance].
3912            ///
3913            /// # Example
3914            /// ```ignore,no_run
3915            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3916            /// use google_cloud_documentai_v1::model::document::Provenance;
3917            /// let x = FormField::new().set_provenance(Provenance::default()/* use setters */);
3918            /// ```
3919            pub fn set_provenance<T>(mut self, v: T) -> Self
3920            where
3921                T: std::convert::Into<crate::model::document::Provenance>,
3922            {
3923                self.provenance = std::option::Option::Some(v.into());
3924                self
3925            }
3926
3927            /// Sets or clears the value of [provenance][crate::model::document::page::FormField::provenance].
3928            ///
3929            /// # Example
3930            /// ```ignore,no_run
3931            /// # use google_cloud_documentai_v1::model::document::page::FormField;
3932            /// use google_cloud_documentai_v1::model::document::Provenance;
3933            /// let x = FormField::new().set_or_clear_provenance(Some(Provenance::default()/* use setters */));
3934            /// let x = FormField::new().set_or_clear_provenance(None::<Provenance>);
3935            /// ```
3936            pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
3937            where
3938                T: std::convert::Into<crate::model::document::Provenance>,
3939            {
3940                self.provenance = v.map(|x| x.into());
3941                self
3942            }
3943        }
3944
3945        impl wkt::message::Message for FormField {
3946            fn typename() -> &'static str {
3947                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.FormField"
3948            }
3949        }
3950
3951        /// A detected barcode.
3952        #[derive(Clone, Default, PartialEq)]
3953        #[non_exhaustive]
3954        pub struct DetectedBarcode {
3955            /// [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
3956            /// [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
3957            ///
3958            /// [google.cloud.documentai.v1.Document.Page.DetectedBarcode]: crate::model::document::page::DetectedBarcode
3959            /// [google.cloud.documentai.v1.Document.Page.Layout]: crate::model::document::page::Layout
3960            pub layout: std::option::Option<crate::model::document::page::Layout>,
3961
3962            /// Detailed barcode information of the
3963            /// [DetectedBarcode][google.cloud.documentai.v1.Document.Page.DetectedBarcode].
3964            ///
3965            /// [google.cloud.documentai.v1.Document.Page.DetectedBarcode]: crate::model::document::page::DetectedBarcode
3966            pub barcode: std::option::Option<crate::model::Barcode>,
3967
3968            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3969        }
3970
3971        impl DetectedBarcode {
3972            pub fn new() -> Self {
3973                std::default::Default::default()
3974            }
3975
3976            /// Sets the value of [layout][crate::model::document::page::DetectedBarcode::layout].
3977            ///
3978            /// # Example
3979            /// ```ignore,no_run
3980            /// # use google_cloud_documentai_v1::model::document::page::DetectedBarcode;
3981            /// use google_cloud_documentai_v1::model::document::page::Layout;
3982            /// let x = DetectedBarcode::new().set_layout(Layout::default()/* use setters */);
3983            /// ```
3984            pub fn set_layout<T>(mut self, v: T) -> Self
3985            where
3986                T: std::convert::Into<crate::model::document::page::Layout>,
3987            {
3988                self.layout = std::option::Option::Some(v.into());
3989                self
3990            }
3991
3992            /// Sets or clears the value of [layout][crate::model::document::page::DetectedBarcode::layout].
3993            ///
3994            /// # Example
3995            /// ```ignore,no_run
3996            /// # use google_cloud_documentai_v1::model::document::page::DetectedBarcode;
3997            /// use google_cloud_documentai_v1::model::document::page::Layout;
3998            /// let x = DetectedBarcode::new().set_or_clear_layout(Some(Layout::default()/* use setters */));
3999            /// let x = DetectedBarcode::new().set_or_clear_layout(None::<Layout>);
4000            /// ```
4001            pub fn set_or_clear_layout<T>(mut self, v: std::option::Option<T>) -> Self
4002            where
4003                T: std::convert::Into<crate::model::document::page::Layout>,
4004            {
4005                self.layout = v.map(|x| x.into());
4006                self
4007            }
4008
4009            /// Sets the value of [barcode][crate::model::document::page::DetectedBarcode::barcode].
4010            ///
4011            /// # Example
4012            /// ```ignore,no_run
4013            /// # use google_cloud_documentai_v1::model::document::page::DetectedBarcode;
4014            /// use google_cloud_documentai_v1::model::Barcode;
4015            /// let x = DetectedBarcode::new().set_barcode(Barcode::default()/* use setters */);
4016            /// ```
4017            pub fn set_barcode<T>(mut self, v: T) -> Self
4018            where
4019                T: std::convert::Into<crate::model::Barcode>,
4020            {
4021                self.barcode = std::option::Option::Some(v.into());
4022                self
4023            }
4024
4025            /// Sets or clears the value of [barcode][crate::model::document::page::DetectedBarcode::barcode].
4026            ///
4027            /// # Example
4028            /// ```ignore,no_run
4029            /// # use google_cloud_documentai_v1::model::document::page::DetectedBarcode;
4030            /// use google_cloud_documentai_v1::model::Barcode;
4031            /// let x = DetectedBarcode::new().set_or_clear_barcode(Some(Barcode::default()/* use setters */));
4032            /// let x = DetectedBarcode::new().set_or_clear_barcode(None::<Barcode>);
4033            /// ```
4034            pub fn set_or_clear_barcode<T>(mut self, v: std::option::Option<T>) -> Self
4035            where
4036                T: std::convert::Into<crate::model::Barcode>,
4037            {
4038                self.barcode = v.map(|x| x.into());
4039                self
4040            }
4041        }
4042
4043        impl wkt::message::Message for DetectedBarcode {
4044            fn typename() -> &'static str {
4045                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.DetectedBarcode"
4046            }
4047        }
4048
4049        /// Detected language for a structural component.
4050        #[derive(Clone, Default, PartialEq)]
4051        #[non_exhaustive]
4052        pub struct DetectedLanguage {
4053            /// The [BCP-47 language
4054            /// code](https://www.unicode.org/reports/tr35/#Unicode_locale_identifier),
4055            /// such as `en-US` or `sr-Latn`.
4056            pub language_code: std::string::String,
4057
4058            /// Confidence of detected language. Range `[0, 1]`.
4059            pub confidence: f32,
4060
4061            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4062        }
4063
4064        impl DetectedLanguage {
4065            pub fn new() -> Self {
4066                std::default::Default::default()
4067            }
4068
4069            /// Sets the value of [language_code][crate::model::document::page::DetectedLanguage::language_code].
4070            ///
4071            /// # Example
4072            /// ```ignore,no_run
4073            /// # use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
4074            /// let x = DetectedLanguage::new().set_language_code("example");
4075            /// ```
4076            pub fn set_language_code<T: std::convert::Into<std::string::String>>(
4077                mut self,
4078                v: T,
4079            ) -> Self {
4080                self.language_code = v.into();
4081                self
4082            }
4083
4084            /// Sets the value of [confidence][crate::model::document::page::DetectedLanguage::confidence].
4085            ///
4086            /// # Example
4087            /// ```ignore,no_run
4088            /// # use google_cloud_documentai_v1::model::document::page::DetectedLanguage;
4089            /// let x = DetectedLanguage::new().set_confidence(42.0);
4090            /// ```
4091            pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
4092                self.confidence = v.into();
4093                self
4094            }
4095        }
4096
4097        impl wkt::message::Message for DetectedLanguage {
4098            fn typename() -> &'static str {
4099                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.DetectedLanguage"
4100            }
4101        }
4102
4103        /// Image quality scores for the page image.
4104        #[derive(Clone, Default, PartialEq)]
4105        #[non_exhaustive]
4106        pub struct ImageQualityScores {
4107            /// The overall quality score. Range `[0, 1]` where `1` is perfect quality.
4108            pub quality_score: f32,
4109
4110            /// A list of detected defects.
4111            pub detected_defects:
4112                std::vec::Vec<crate::model::document::page::image_quality_scores::DetectedDefect>,
4113
4114            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4115        }
4116
4117        impl ImageQualityScores {
4118            pub fn new() -> Self {
4119                std::default::Default::default()
4120            }
4121
4122            /// Sets the value of [quality_score][crate::model::document::page::ImageQualityScores::quality_score].
4123            ///
4124            /// # Example
4125            /// ```ignore,no_run
4126            /// # use google_cloud_documentai_v1::model::document::page::ImageQualityScores;
4127            /// let x = ImageQualityScores::new().set_quality_score(42.0);
4128            /// ```
4129            pub fn set_quality_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
4130                self.quality_score = v.into();
4131                self
4132            }
4133
4134            /// Sets the value of [detected_defects][crate::model::document::page::ImageQualityScores::detected_defects].
4135            ///
4136            /// # Example
4137            /// ```ignore,no_run
4138            /// # use google_cloud_documentai_v1::model::document::page::ImageQualityScores;
4139            /// use google_cloud_documentai_v1::model::document::page::image_quality_scores::DetectedDefect;
4140            /// let x = ImageQualityScores::new()
4141            ///     .set_detected_defects([
4142            ///         DetectedDefect::default()/* use setters */,
4143            ///         DetectedDefect::default()/* use (different) setters */,
4144            ///     ]);
4145            /// ```
4146            pub fn set_detected_defects<T, V>(mut self, v: T) -> Self
4147            where
4148                T: std::iter::IntoIterator<Item = V>,
4149                V: std::convert::Into<
4150                        crate::model::document::page::image_quality_scores::DetectedDefect,
4151                    >,
4152            {
4153                use std::iter::Iterator;
4154                self.detected_defects = v.into_iter().map(|i| i.into()).collect();
4155                self
4156            }
4157        }
4158
4159        impl wkt::message::Message for ImageQualityScores {
4160            fn typename() -> &'static str {
4161                "type.googleapis.com/google.cloud.documentai.v1.Document.Page.ImageQualityScores"
4162            }
4163        }
4164
4165        /// Defines additional types related to [ImageQualityScores].
4166        pub mod image_quality_scores {
4167            #[allow(unused_imports)]
4168            use super::*;
4169
4170            /// Image Quality Defects
4171            #[derive(Clone, Default, PartialEq)]
4172            #[non_exhaustive]
4173            pub struct DetectedDefect {
4174                /// Name of the defect type. Supported values are:
4175                ///
4176                /// - `quality/defect_blurry`
4177                /// - `quality/defect_noisy`
4178                /// - `quality/defect_dark`
4179                /// - `quality/defect_faint`
4180                /// - `quality/defect_text_too_small`
4181                /// - `quality/defect_document_cutoff`
4182                /// - `quality/defect_text_cutoff`
4183                /// - `quality/defect_glare`
4184                pub r#type: std::string::String,
4185
4186                /// Confidence of detected defect. Range `[0, 1]` where `1` indicates
4187                /// strong confidence that the defect exists.
4188                pub confidence: f32,
4189
4190                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4191            }
4192
4193            impl DetectedDefect {
4194                pub fn new() -> Self {
4195                    std::default::Default::default()
4196                }
4197
4198                /// Sets the value of [r#type][crate::model::document::page::image_quality_scores::DetectedDefect::type].
4199                ///
4200                /// # Example
4201                /// ```ignore,no_run
4202                /// # use google_cloud_documentai_v1::model::document::page::image_quality_scores::DetectedDefect;
4203                /// let x = DetectedDefect::new().set_type("example");
4204                /// ```
4205                pub fn set_type<T: std::convert::Into<std::string::String>>(
4206                    mut self,
4207                    v: T,
4208                ) -> Self {
4209                    self.r#type = v.into();
4210                    self
4211                }
4212
4213                /// Sets the value of [confidence][crate::model::document::page::image_quality_scores::DetectedDefect::confidence].
4214                ///
4215                /// # Example
4216                /// ```ignore,no_run
4217                /// # use google_cloud_documentai_v1::model::document::page::image_quality_scores::DetectedDefect;
4218                /// let x = DetectedDefect::new().set_confidence(42.0);
4219                /// ```
4220                pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
4221                    self.confidence = v.into();
4222                    self
4223                }
4224            }
4225
4226            impl wkt::message::Message for DetectedDefect {
4227                fn typename() -> &'static str {
4228                    "type.googleapis.com/google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect"
4229                }
4230            }
4231        }
4232    }
4233
4234    /// An entity that could be a phrase in the text or a property that belongs to
4235    /// the document. It is a known entity type, such as a person, an organization,
4236    /// or location.
4237    #[derive(Clone, Default, PartialEq)]
4238    #[non_exhaustive]
4239    pub struct Entity {
4240        /// Optional. Provenance of the entity.
4241        /// Text anchor indexing into the
4242        /// [Document.text][google.cloud.documentai.v1.Document.text].
4243        ///
4244        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
4245        pub text_anchor: std::option::Option<crate::model::document::TextAnchor>,
4246
4247        /// Required. Entity type from a schema e.g. `Address`.
4248        pub r#type: std::string::String,
4249
4250        /// Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`.
4251        pub mention_text: std::string::String,
4252
4253        /// Optional. Deprecated.  Use `id` field instead.
4254        pub mention_id: std::string::String,
4255
4256        /// Optional. Confidence of detected Schema entity. Range `[0, 1]`.
4257        pub confidence: f32,
4258
4259        /// Optional. Represents the provenance of this entity wrt. the location on
4260        /// the page where it was found.
4261        pub page_anchor: std::option::Option<crate::model::document::PageAnchor>,
4262
4263        /// Optional. Canonical id. This will be a unique value in the entity list
4264        /// for this document.
4265        pub id: std::string::String,
4266
4267        /// Optional. Normalized entity value. Absent if the extracted value could
4268        /// not be converted or the type (e.g. address) is not supported for certain
4269        /// parsers. This field is also only populated for certain supported document
4270        /// types.
4271        pub normalized_value: std::option::Option<crate::model::document::entity::NormalizedValue>,
4272
4273        /// Optional. Entities can be nested to form a hierarchical data structure
4274        /// representing the content in the document.
4275        pub properties: std::vec::Vec<crate::model::document::Entity>,
4276
4277        /// Optional. The history of this annotation.
4278        pub provenance: std::option::Option<crate::model::document::Provenance>,
4279
4280        /// Optional. Whether the entity will be redacted for de-identification
4281        /// purposes.
4282        pub redacted: bool,
4283
4284        /// Optional. Specifies how the entity's value is obtained.
4285        pub method: crate::model::document::entity::Method,
4286
4287        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4288    }
4289
4290    impl Entity {
4291        pub fn new() -> Self {
4292            std::default::Default::default()
4293        }
4294
4295        /// Sets the value of [text_anchor][crate::model::document::Entity::text_anchor].
4296        ///
4297        /// # Example
4298        /// ```ignore,no_run
4299        /// # use google_cloud_documentai_v1::model::document::Entity;
4300        /// use google_cloud_documentai_v1::model::document::TextAnchor;
4301        /// let x = Entity::new().set_text_anchor(TextAnchor::default()/* use setters */);
4302        /// ```
4303        pub fn set_text_anchor<T>(mut self, v: T) -> Self
4304        where
4305            T: std::convert::Into<crate::model::document::TextAnchor>,
4306        {
4307            self.text_anchor = std::option::Option::Some(v.into());
4308            self
4309        }
4310
4311        /// Sets or clears the value of [text_anchor][crate::model::document::Entity::text_anchor].
4312        ///
4313        /// # Example
4314        /// ```ignore,no_run
4315        /// # use google_cloud_documentai_v1::model::document::Entity;
4316        /// use google_cloud_documentai_v1::model::document::TextAnchor;
4317        /// let x = Entity::new().set_or_clear_text_anchor(Some(TextAnchor::default()/* use setters */));
4318        /// let x = Entity::new().set_or_clear_text_anchor(None::<TextAnchor>);
4319        /// ```
4320        pub fn set_or_clear_text_anchor<T>(mut self, v: std::option::Option<T>) -> Self
4321        where
4322            T: std::convert::Into<crate::model::document::TextAnchor>,
4323        {
4324            self.text_anchor = v.map(|x| x.into());
4325            self
4326        }
4327
4328        /// Sets the value of [r#type][crate::model::document::Entity::type].
4329        ///
4330        /// # Example
4331        /// ```ignore,no_run
4332        /// # use google_cloud_documentai_v1::model::document::Entity;
4333        /// let x = Entity::new().set_type("example");
4334        /// ```
4335        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4336            self.r#type = v.into();
4337            self
4338        }
4339
4340        /// Sets the value of [mention_text][crate::model::document::Entity::mention_text].
4341        ///
4342        /// # Example
4343        /// ```ignore,no_run
4344        /// # use google_cloud_documentai_v1::model::document::Entity;
4345        /// let x = Entity::new().set_mention_text("example");
4346        /// ```
4347        pub fn set_mention_text<T: std::convert::Into<std::string::String>>(
4348            mut self,
4349            v: T,
4350        ) -> Self {
4351            self.mention_text = v.into();
4352            self
4353        }
4354
4355        /// Sets the value of [mention_id][crate::model::document::Entity::mention_id].
4356        ///
4357        /// # Example
4358        /// ```ignore,no_run
4359        /// # use google_cloud_documentai_v1::model::document::Entity;
4360        /// let x = Entity::new().set_mention_id("example");
4361        /// ```
4362        pub fn set_mention_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4363            self.mention_id = v.into();
4364            self
4365        }
4366
4367        /// Sets the value of [confidence][crate::model::document::Entity::confidence].
4368        ///
4369        /// # Example
4370        /// ```ignore,no_run
4371        /// # use google_cloud_documentai_v1::model::document::Entity;
4372        /// let x = Entity::new().set_confidence(42.0);
4373        /// ```
4374        pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
4375            self.confidence = v.into();
4376            self
4377        }
4378
4379        /// Sets the value of [page_anchor][crate::model::document::Entity::page_anchor].
4380        ///
4381        /// # Example
4382        /// ```ignore,no_run
4383        /// # use google_cloud_documentai_v1::model::document::Entity;
4384        /// use google_cloud_documentai_v1::model::document::PageAnchor;
4385        /// let x = Entity::new().set_page_anchor(PageAnchor::default()/* use setters */);
4386        /// ```
4387        pub fn set_page_anchor<T>(mut self, v: T) -> Self
4388        where
4389            T: std::convert::Into<crate::model::document::PageAnchor>,
4390        {
4391            self.page_anchor = std::option::Option::Some(v.into());
4392            self
4393        }
4394
4395        /// Sets or clears the value of [page_anchor][crate::model::document::Entity::page_anchor].
4396        ///
4397        /// # Example
4398        /// ```ignore,no_run
4399        /// # use google_cloud_documentai_v1::model::document::Entity;
4400        /// use google_cloud_documentai_v1::model::document::PageAnchor;
4401        /// let x = Entity::new().set_or_clear_page_anchor(Some(PageAnchor::default()/* use setters */));
4402        /// let x = Entity::new().set_or_clear_page_anchor(None::<PageAnchor>);
4403        /// ```
4404        pub fn set_or_clear_page_anchor<T>(mut self, v: std::option::Option<T>) -> Self
4405        where
4406            T: std::convert::Into<crate::model::document::PageAnchor>,
4407        {
4408            self.page_anchor = v.map(|x| x.into());
4409            self
4410        }
4411
4412        /// Sets the value of [id][crate::model::document::Entity::id].
4413        ///
4414        /// # Example
4415        /// ```ignore,no_run
4416        /// # use google_cloud_documentai_v1::model::document::Entity;
4417        /// let x = Entity::new().set_id("example");
4418        /// ```
4419        pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4420            self.id = v.into();
4421            self
4422        }
4423
4424        /// Sets the value of [normalized_value][crate::model::document::Entity::normalized_value].
4425        ///
4426        /// # Example
4427        /// ```ignore,no_run
4428        /// # use google_cloud_documentai_v1::model::document::Entity;
4429        /// use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4430        /// let x = Entity::new().set_normalized_value(NormalizedValue::default()/* use setters */);
4431        /// ```
4432        pub fn set_normalized_value<T>(mut self, v: T) -> Self
4433        where
4434            T: std::convert::Into<crate::model::document::entity::NormalizedValue>,
4435        {
4436            self.normalized_value = std::option::Option::Some(v.into());
4437            self
4438        }
4439
4440        /// Sets or clears the value of [normalized_value][crate::model::document::Entity::normalized_value].
4441        ///
4442        /// # Example
4443        /// ```ignore,no_run
4444        /// # use google_cloud_documentai_v1::model::document::Entity;
4445        /// use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4446        /// let x = Entity::new().set_or_clear_normalized_value(Some(NormalizedValue::default()/* use setters */));
4447        /// let x = Entity::new().set_or_clear_normalized_value(None::<NormalizedValue>);
4448        /// ```
4449        pub fn set_or_clear_normalized_value<T>(mut self, v: std::option::Option<T>) -> Self
4450        where
4451            T: std::convert::Into<crate::model::document::entity::NormalizedValue>,
4452        {
4453            self.normalized_value = v.map(|x| x.into());
4454            self
4455        }
4456
4457        /// Sets the value of [properties][crate::model::document::Entity::properties].
4458        ///
4459        /// # Example
4460        /// ```ignore,no_run
4461        /// # use google_cloud_documentai_v1::model::document::Entity;
4462        /// let x = Entity::new()
4463        ///     .set_properties([
4464        ///         Entity::default()/* use setters */,
4465        ///         Entity::default()/* use (different) setters */,
4466        ///     ]);
4467        /// ```
4468        pub fn set_properties<T, V>(mut self, v: T) -> Self
4469        where
4470            T: std::iter::IntoIterator<Item = V>,
4471            V: std::convert::Into<crate::model::document::Entity>,
4472        {
4473            use std::iter::Iterator;
4474            self.properties = v.into_iter().map(|i| i.into()).collect();
4475            self
4476        }
4477
4478        /// Sets the value of [provenance][crate::model::document::Entity::provenance].
4479        ///
4480        /// # Example
4481        /// ```ignore,no_run
4482        /// # use google_cloud_documentai_v1::model::document::Entity;
4483        /// use google_cloud_documentai_v1::model::document::Provenance;
4484        /// let x = Entity::new().set_provenance(Provenance::default()/* use setters */);
4485        /// ```
4486        pub fn set_provenance<T>(mut self, v: T) -> Self
4487        where
4488            T: std::convert::Into<crate::model::document::Provenance>,
4489        {
4490            self.provenance = std::option::Option::Some(v.into());
4491            self
4492        }
4493
4494        /// Sets or clears the value of [provenance][crate::model::document::Entity::provenance].
4495        ///
4496        /// # Example
4497        /// ```ignore,no_run
4498        /// # use google_cloud_documentai_v1::model::document::Entity;
4499        /// use google_cloud_documentai_v1::model::document::Provenance;
4500        /// let x = Entity::new().set_or_clear_provenance(Some(Provenance::default()/* use setters */));
4501        /// let x = Entity::new().set_or_clear_provenance(None::<Provenance>);
4502        /// ```
4503        pub fn set_or_clear_provenance<T>(mut self, v: std::option::Option<T>) -> Self
4504        where
4505            T: std::convert::Into<crate::model::document::Provenance>,
4506        {
4507            self.provenance = v.map(|x| x.into());
4508            self
4509        }
4510
4511        /// Sets the value of [redacted][crate::model::document::Entity::redacted].
4512        ///
4513        /// # Example
4514        /// ```ignore,no_run
4515        /// # use google_cloud_documentai_v1::model::document::Entity;
4516        /// let x = Entity::new().set_redacted(true);
4517        /// ```
4518        pub fn set_redacted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4519            self.redacted = v.into();
4520            self
4521        }
4522
4523        /// Sets the value of [method][crate::model::document::Entity::method].
4524        ///
4525        /// # Example
4526        /// ```ignore,no_run
4527        /// # use google_cloud_documentai_v1::model::document::Entity;
4528        /// use google_cloud_documentai_v1::model::document::entity::Method;
4529        /// let x0 = Entity::new().set_method(Method::Extract);
4530        /// let x1 = Entity::new().set_method(Method::Derive);
4531        /// ```
4532        pub fn set_method<T: std::convert::Into<crate::model::document::entity::Method>>(
4533            mut self,
4534            v: T,
4535        ) -> Self {
4536            self.method = v.into();
4537            self
4538        }
4539    }
4540
4541    impl wkt::message::Message for Entity {
4542        fn typename() -> &'static str {
4543            "type.googleapis.com/google.cloud.documentai.v1.Document.Entity"
4544        }
4545    }
4546
4547    /// Defines additional types related to [Entity].
4548    pub mod entity {
4549        #[allow(unused_imports)]
4550        use super::*;
4551
4552        /// Parsed and normalized entity value.
4553        #[derive(Clone, Default, PartialEq)]
4554        #[non_exhaustive]
4555        pub struct NormalizedValue {
4556            /// Optional. An optional field to store a normalized string.
4557            /// For some entity types, one of respective `structured_value` fields may
4558            /// also be populated. Also not all the types of `structured_value` will be
4559            /// normalized. For example, some processors may not generate `float`
4560            /// or `integer` normalized text by default.
4561            ///
4562            /// Below are sample formats mapped to structured values.
4563            ///
4564            /// - Money/Currency type (`money_value`) is in the ISO 4217 text format.
4565            /// - Date type (`date_value`) is in the ISO 8601 text format.
4566            /// - Datetime type (`datetime_value`) is in the ISO 8601 text format.
4567            pub text: std::string::String,
4568
4569            /// An optional structured entity value.
4570            /// Must match entity type defined in schema if
4571            /// known. If this field is present, the `text` field could also be
4572            /// populated.
4573            pub structured_value: std::option::Option<
4574                crate::model::document::entity::normalized_value::StructuredValue,
4575            >,
4576
4577            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4578        }
4579
4580        impl NormalizedValue {
4581            pub fn new() -> Self {
4582                std::default::Default::default()
4583            }
4584
4585            /// Sets the value of [text][crate::model::document::entity::NormalizedValue::text].
4586            ///
4587            /// # Example
4588            /// ```ignore,no_run
4589            /// # use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4590            /// let x = NormalizedValue::new().set_text("example");
4591            /// ```
4592            pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4593                self.text = v.into();
4594                self
4595            }
4596
4597            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value].
4598            ///
4599            /// Note that all the setters affecting `structured_value` are mutually
4600            /// exclusive.
4601            ///
4602            /// # Example
4603            /// ```ignore,no_run
4604            /// # use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4605            /// use google_cloud_documentai_v1::model::document::entity::normalized_value::StructuredValue;
4606            /// let x = NormalizedValue::new().set_structured_value(Some(StructuredValue::BooleanValue(true)));
4607            /// ```
4608            pub fn set_structured_value<
4609                T: std::convert::Into<
4610                        std::option::Option<
4611                            crate::model::document::entity::normalized_value::StructuredValue,
4612                        >,
4613                    >,
4614            >(
4615                mut self,
4616                v: T,
4617            ) -> Self {
4618                self.structured_value = v.into();
4619                self
4620            }
4621
4622            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4623            /// if it holds a `MoneyValue`, `None` if the field is not set or
4624            /// holds a different branch.
4625            pub fn money_value(
4626                &self,
4627            ) -> std::option::Option<&std::boxed::Box<google_cloud_type::model::Money>>
4628            {
4629                #[allow(unreachable_patterns)]
4630                self.structured_value.as_ref().and_then(|v| match v {
4631                    crate::model::document::entity::normalized_value::StructuredValue::MoneyValue(v) => std::option::Option::Some(v),
4632                    _ => std::option::Option::None,
4633                })
4634            }
4635
4636            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4637            /// to hold a `MoneyValue`.
4638            ///
4639            /// Note that all the setters affecting `structured_value` are
4640            /// mutually exclusive.
4641            ///
4642            /// # Example
4643            /// ```ignore,no_run
4644            /// # use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4645            /// use google_cloud_type::model::Money;
4646            /// let x = NormalizedValue::new().set_money_value(Money::default()/* use setters */);
4647            /// assert!(x.money_value().is_some());
4648            /// assert!(x.date_value().is_none());
4649            /// assert!(x.datetime_value().is_none());
4650            /// assert!(x.address_value().is_none());
4651            /// assert!(x.boolean_value().is_none());
4652            /// assert!(x.integer_value().is_none());
4653            /// assert!(x.float_value().is_none());
4654            /// assert!(x.signature_value().is_none());
4655            /// ```
4656            pub fn set_money_value<
4657                T: std::convert::Into<std::boxed::Box<google_cloud_type::model::Money>>,
4658            >(
4659                mut self,
4660                v: T,
4661            ) -> Self {
4662                self.structured_value = std::option::Option::Some(
4663                    crate::model::document::entity::normalized_value::StructuredValue::MoneyValue(
4664                        v.into(),
4665                    ),
4666                );
4667                self
4668            }
4669
4670            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4671            /// if it holds a `DateValue`, `None` if the field is not set or
4672            /// holds a different branch.
4673            pub fn date_value(
4674                &self,
4675            ) -> std::option::Option<&std::boxed::Box<google_cloud_type::model::Date>> {
4676                #[allow(unreachable_patterns)]
4677                self.structured_value.as_ref().and_then(|v| match v {
4678                    crate::model::document::entity::normalized_value::StructuredValue::DateValue(v) => std::option::Option::Some(v),
4679                    _ => std::option::Option::None,
4680                })
4681            }
4682
4683            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4684            /// to hold a `DateValue`.
4685            ///
4686            /// Note that all the setters affecting `structured_value` are
4687            /// mutually exclusive.
4688            ///
4689            /// # Example
4690            /// ```ignore,no_run
4691            /// # use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4692            /// use google_cloud_type::model::Date;
4693            /// let x = NormalizedValue::new().set_date_value(Date::default()/* use setters */);
4694            /// assert!(x.date_value().is_some());
4695            /// assert!(x.money_value().is_none());
4696            /// assert!(x.datetime_value().is_none());
4697            /// assert!(x.address_value().is_none());
4698            /// assert!(x.boolean_value().is_none());
4699            /// assert!(x.integer_value().is_none());
4700            /// assert!(x.float_value().is_none());
4701            /// assert!(x.signature_value().is_none());
4702            /// ```
4703            pub fn set_date_value<
4704                T: std::convert::Into<std::boxed::Box<google_cloud_type::model::Date>>,
4705            >(
4706                mut self,
4707                v: T,
4708            ) -> Self {
4709                self.structured_value = std::option::Option::Some(
4710                    crate::model::document::entity::normalized_value::StructuredValue::DateValue(
4711                        v.into(),
4712                    ),
4713                );
4714                self
4715            }
4716
4717            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4718            /// if it holds a `DatetimeValue`, `None` if the field is not set or
4719            /// holds a different branch.
4720            pub fn datetime_value(
4721                &self,
4722            ) -> std::option::Option<&std::boxed::Box<google_cloud_type::model::DateTime>>
4723            {
4724                #[allow(unreachable_patterns)]
4725                self.structured_value.as_ref().and_then(|v| match v {
4726                    crate::model::document::entity::normalized_value::StructuredValue::DatetimeValue(v) => std::option::Option::Some(v),
4727                    _ => std::option::Option::None,
4728                })
4729            }
4730
4731            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4732            /// to hold a `DatetimeValue`.
4733            ///
4734            /// Note that all the setters affecting `structured_value` are
4735            /// mutually exclusive.
4736            ///
4737            /// # Example
4738            /// ```ignore,no_run
4739            /// # use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4740            /// use google_cloud_type::model::DateTime;
4741            /// let x = NormalizedValue::new().set_datetime_value(DateTime::default()/* use setters */);
4742            /// assert!(x.datetime_value().is_some());
4743            /// assert!(x.money_value().is_none());
4744            /// assert!(x.date_value().is_none());
4745            /// assert!(x.address_value().is_none());
4746            /// assert!(x.boolean_value().is_none());
4747            /// assert!(x.integer_value().is_none());
4748            /// assert!(x.float_value().is_none());
4749            /// assert!(x.signature_value().is_none());
4750            /// ```
4751            pub fn set_datetime_value<
4752                T: std::convert::Into<std::boxed::Box<google_cloud_type::model::DateTime>>,
4753            >(
4754                mut self,
4755                v: T,
4756            ) -> Self {
4757                self.structured_value = std::option::Option::Some(
4758                    crate::model::document::entity::normalized_value::StructuredValue::DatetimeValue(
4759                        v.into()
4760                    )
4761                );
4762                self
4763            }
4764
4765            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4766            /// if it holds a `AddressValue`, `None` if the field is not set or
4767            /// holds a different branch.
4768            pub fn address_value(
4769                &self,
4770            ) -> std::option::Option<&std::boxed::Box<google_cloud_type::model::PostalAddress>>
4771            {
4772                #[allow(unreachable_patterns)]
4773                self.structured_value.as_ref().and_then(|v| match v {
4774                    crate::model::document::entity::normalized_value::StructuredValue::AddressValue(v) => std::option::Option::Some(v),
4775                    _ => std::option::Option::None,
4776                })
4777            }
4778
4779            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4780            /// to hold a `AddressValue`.
4781            ///
4782            /// Note that all the setters affecting `structured_value` are
4783            /// mutually exclusive.
4784            ///
4785            /// # Example
4786            /// ```ignore,no_run
4787            /// # use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4788            /// use google_cloud_type::model::PostalAddress;
4789            /// let x = NormalizedValue::new().set_address_value(PostalAddress::default()/* use setters */);
4790            /// assert!(x.address_value().is_some());
4791            /// assert!(x.money_value().is_none());
4792            /// assert!(x.date_value().is_none());
4793            /// assert!(x.datetime_value().is_none());
4794            /// assert!(x.boolean_value().is_none());
4795            /// assert!(x.integer_value().is_none());
4796            /// assert!(x.float_value().is_none());
4797            /// assert!(x.signature_value().is_none());
4798            /// ```
4799            pub fn set_address_value<
4800                T: std::convert::Into<std::boxed::Box<google_cloud_type::model::PostalAddress>>,
4801            >(
4802                mut self,
4803                v: T,
4804            ) -> Self {
4805                self.structured_value = std::option::Option::Some(
4806                    crate::model::document::entity::normalized_value::StructuredValue::AddressValue(
4807                        v.into(),
4808                    ),
4809                );
4810                self
4811            }
4812
4813            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4814            /// if it holds a `BooleanValue`, `None` if the field is not set or
4815            /// holds a different branch.
4816            pub fn boolean_value(&self) -> std::option::Option<&bool> {
4817                #[allow(unreachable_patterns)]
4818                self.structured_value.as_ref().and_then(|v| match v {
4819                    crate::model::document::entity::normalized_value::StructuredValue::BooleanValue(v) => std::option::Option::Some(v),
4820                    _ => std::option::Option::None,
4821                })
4822            }
4823
4824            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4825            /// to hold a `BooleanValue`.
4826            ///
4827            /// Note that all the setters affecting `structured_value` are
4828            /// mutually exclusive.
4829            ///
4830            /// # Example
4831            /// ```ignore,no_run
4832            /// # use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4833            /// let x = NormalizedValue::new().set_boolean_value(true);
4834            /// assert!(x.boolean_value().is_some());
4835            /// assert!(x.money_value().is_none());
4836            /// assert!(x.date_value().is_none());
4837            /// assert!(x.datetime_value().is_none());
4838            /// assert!(x.address_value().is_none());
4839            /// assert!(x.integer_value().is_none());
4840            /// assert!(x.float_value().is_none());
4841            /// assert!(x.signature_value().is_none());
4842            /// ```
4843            pub fn set_boolean_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4844                self.structured_value = std::option::Option::Some(
4845                    crate::model::document::entity::normalized_value::StructuredValue::BooleanValue(
4846                        v.into(),
4847                    ),
4848                );
4849                self
4850            }
4851
4852            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4853            /// if it holds a `IntegerValue`, `None` if the field is not set or
4854            /// holds a different branch.
4855            pub fn integer_value(&self) -> std::option::Option<&i32> {
4856                #[allow(unreachable_patterns)]
4857                self.structured_value.as_ref().and_then(|v| match v {
4858                    crate::model::document::entity::normalized_value::StructuredValue::IntegerValue(v) => std::option::Option::Some(v),
4859                    _ => std::option::Option::None,
4860                })
4861            }
4862
4863            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4864            /// to hold a `IntegerValue`.
4865            ///
4866            /// Note that all the setters affecting `structured_value` are
4867            /// mutually exclusive.
4868            ///
4869            /// # Example
4870            /// ```ignore,no_run
4871            /// # use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4872            /// let x = NormalizedValue::new().set_integer_value(42);
4873            /// assert!(x.integer_value().is_some());
4874            /// assert!(x.money_value().is_none());
4875            /// assert!(x.date_value().is_none());
4876            /// assert!(x.datetime_value().is_none());
4877            /// assert!(x.address_value().is_none());
4878            /// assert!(x.boolean_value().is_none());
4879            /// assert!(x.float_value().is_none());
4880            /// assert!(x.signature_value().is_none());
4881            /// ```
4882            pub fn set_integer_value<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4883                self.structured_value = std::option::Option::Some(
4884                    crate::model::document::entity::normalized_value::StructuredValue::IntegerValue(
4885                        v.into(),
4886                    ),
4887                );
4888                self
4889            }
4890
4891            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4892            /// if it holds a `FloatValue`, `None` if the field is not set or
4893            /// holds a different branch.
4894            pub fn float_value(&self) -> std::option::Option<&f32> {
4895                #[allow(unreachable_patterns)]
4896                self.structured_value.as_ref().and_then(|v| match v {
4897                    crate::model::document::entity::normalized_value::StructuredValue::FloatValue(v) => std::option::Option::Some(v),
4898                    _ => std::option::Option::None,
4899                })
4900            }
4901
4902            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4903            /// to hold a `FloatValue`.
4904            ///
4905            /// Note that all the setters affecting `structured_value` are
4906            /// mutually exclusive.
4907            ///
4908            /// # Example
4909            /// ```ignore,no_run
4910            /// # use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4911            /// let x = NormalizedValue::new().set_float_value(42.0);
4912            /// assert!(x.float_value().is_some());
4913            /// assert!(x.money_value().is_none());
4914            /// assert!(x.date_value().is_none());
4915            /// assert!(x.datetime_value().is_none());
4916            /// assert!(x.address_value().is_none());
4917            /// assert!(x.boolean_value().is_none());
4918            /// assert!(x.integer_value().is_none());
4919            /// assert!(x.signature_value().is_none());
4920            /// ```
4921            pub fn set_float_value<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
4922                self.structured_value = std::option::Option::Some(
4923                    crate::model::document::entity::normalized_value::StructuredValue::FloatValue(
4924                        v.into(),
4925                    ),
4926                );
4927                self
4928            }
4929
4930            /// The value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4931            /// if it holds a `SignatureValue`, `None` if the field is not set or
4932            /// holds a different branch.
4933            pub fn signature_value(&self) -> std::option::Option<&bool> {
4934                #[allow(unreachable_patterns)]
4935                self.structured_value.as_ref().and_then(|v| match v {
4936                    crate::model::document::entity::normalized_value::StructuredValue::SignatureValue(v) => std::option::Option::Some(v),
4937                    _ => std::option::Option::None,
4938                })
4939            }
4940
4941            /// Sets the value of [structured_value][crate::model::document::entity::NormalizedValue::structured_value]
4942            /// to hold a `SignatureValue`.
4943            ///
4944            /// Note that all the setters affecting `structured_value` are
4945            /// mutually exclusive.
4946            ///
4947            /// # Example
4948            /// ```ignore,no_run
4949            /// # use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
4950            /// let x = NormalizedValue::new().set_signature_value(true);
4951            /// assert!(x.signature_value().is_some());
4952            /// assert!(x.money_value().is_none());
4953            /// assert!(x.date_value().is_none());
4954            /// assert!(x.datetime_value().is_none());
4955            /// assert!(x.address_value().is_none());
4956            /// assert!(x.boolean_value().is_none());
4957            /// assert!(x.integer_value().is_none());
4958            /// assert!(x.float_value().is_none());
4959            /// ```
4960            pub fn set_signature_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4961                self.structured_value = std::option::Option::Some(
4962                    crate::model::document::entity::normalized_value::StructuredValue::SignatureValue(
4963                        v.into()
4964                    )
4965                );
4966                self
4967            }
4968        }
4969
4970        impl wkt::message::Message for NormalizedValue {
4971            fn typename() -> &'static str {
4972                "type.googleapis.com/google.cloud.documentai.v1.Document.Entity.NormalizedValue"
4973            }
4974        }
4975
4976        /// Defines additional types related to [NormalizedValue].
4977        pub mod normalized_value {
4978            #[allow(unused_imports)]
4979            use super::*;
4980
4981            /// An optional structured entity value.
4982            /// Must match entity type defined in schema if
4983            /// known. If this field is present, the `text` field could also be
4984            /// populated.
4985            #[derive(Clone, Debug, PartialEq)]
4986            #[non_exhaustive]
4987            pub enum StructuredValue {
4988                /// Money value. See also:
4989                /// <https://github.com/googleapis/googleapis/blob/master/google/type/money.proto>
4990                MoneyValue(std::boxed::Box<google_cloud_type::model::Money>),
4991                /// Date value. Includes year, month, day. See also:
4992                /// <https://github.com/googleapis/googleapis/blob/master/google/type/date.proto>
4993                DateValue(std::boxed::Box<google_cloud_type::model::Date>),
4994                /// DateTime value. Includes date, time, and timezone. See also:
4995                /// <https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto>
4996                DatetimeValue(std::boxed::Box<google_cloud_type::model::DateTime>),
4997                /// Postal address. See also:
4998                /// <https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto>
4999                AddressValue(std::boxed::Box<google_cloud_type::model::PostalAddress>),
5000                /// Boolean value. Can be used for entities with binary values, or for
5001                /// checkboxes.
5002                BooleanValue(bool),
5003                /// Integer value.
5004                IntegerValue(i32),
5005                /// Float value.
5006                FloatValue(f32),
5007                SignatureValue(bool),
5008            }
5009        }
5010
5011        /// Specifies how the entity's value is obtained.
5012        ///
5013        /// # Working with unknown values
5014        ///
5015        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5016        /// additional enum variants at any time. Adding new variants is not considered
5017        /// a breaking change. Applications should write their code in anticipation of:
5018        ///
5019        /// - New values appearing in future releases of the client library, **and**
5020        /// - New values received dynamically, without application changes.
5021        ///
5022        /// Please consult the [Working with enums] section in the user guide for some
5023        /// guidelines.
5024        ///
5025        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5026        #[derive(Clone, Debug, PartialEq)]
5027        #[non_exhaustive]
5028        pub enum Method {
5029            /// When the method is not specified, it should be treated as `EXTRACT`.
5030            Unspecified,
5031            /// The entity's value is directly extracted as-is from the document
5032            /// text.
5033            Extract,
5034            /// The entity's value is derived through inference and is not
5035            /// necessarily an exact text extraction from the document.
5036            Derive,
5037            /// If set, the enum was initialized with an unknown value.
5038            ///
5039            /// Applications can examine the value using [Method::value] or
5040            /// [Method::name].
5041            UnknownValue(method::UnknownValue),
5042        }
5043
5044        #[doc(hidden)]
5045        pub mod method {
5046            #[allow(unused_imports)]
5047            use super::*;
5048            #[derive(Clone, Debug, PartialEq)]
5049            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5050        }
5051
5052        impl Method {
5053            /// Gets the enum value.
5054            ///
5055            /// Returns `None` if the enum contains an unknown value deserialized from
5056            /// the string representation of enums.
5057            pub fn value(&self) -> std::option::Option<i32> {
5058                match self {
5059                    Self::Unspecified => std::option::Option::Some(0),
5060                    Self::Extract => std::option::Option::Some(1),
5061                    Self::Derive => std::option::Option::Some(2),
5062                    Self::UnknownValue(u) => u.0.value(),
5063                }
5064            }
5065
5066            /// Gets the enum value as a string.
5067            ///
5068            /// Returns `None` if the enum contains an unknown value deserialized from
5069            /// the integer representation of enums.
5070            pub fn name(&self) -> std::option::Option<&str> {
5071                match self {
5072                    Self::Unspecified => std::option::Option::Some("METHOD_UNSPECIFIED"),
5073                    Self::Extract => std::option::Option::Some("EXTRACT"),
5074                    Self::Derive => std::option::Option::Some("DERIVE"),
5075                    Self::UnknownValue(u) => u.0.name(),
5076                }
5077            }
5078        }
5079
5080        impl std::default::Default for Method {
5081            fn default() -> Self {
5082                use std::convert::From;
5083                Self::from(0)
5084            }
5085        }
5086
5087        impl std::fmt::Display for Method {
5088            fn fmt(
5089                &self,
5090                f: &mut std::fmt::Formatter<'_>,
5091            ) -> std::result::Result<(), std::fmt::Error> {
5092                wkt::internal::display_enum(f, self.name(), self.value())
5093            }
5094        }
5095
5096        impl std::convert::From<i32> for Method {
5097            fn from(value: i32) -> Self {
5098                match value {
5099                    0 => Self::Unspecified,
5100                    1 => Self::Extract,
5101                    2 => Self::Derive,
5102                    _ => Self::UnknownValue(method::UnknownValue(
5103                        wkt::internal::UnknownEnumValue::Integer(value),
5104                    )),
5105                }
5106            }
5107        }
5108
5109        impl std::convert::From<&str> for Method {
5110            fn from(value: &str) -> Self {
5111                use std::string::ToString;
5112                match value {
5113                    "METHOD_UNSPECIFIED" => Self::Unspecified,
5114                    "EXTRACT" => Self::Extract,
5115                    "DERIVE" => Self::Derive,
5116                    _ => Self::UnknownValue(method::UnknownValue(
5117                        wkt::internal::UnknownEnumValue::String(value.to_string()),
5118                    )),
5119                }
5120            }
5121        }
5122
5123        impl serde::ser::Serialize for Method {
5124            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5125            where
5126                S: serde::Serializer,
5127            {
5128                match self {
5129                    Self::Unspecified => serializer.serialize_i32(0),
5130                    Self::Extract => serializer.serialize_i32(1),
5131                    Self::Derive => serializer.serialize_i32(2),
5132                    Self::UnknownValue(u) => u.0.serialize(serializer),
5133                }
5134            }
5135        }
5136
5137        impl<'de> serde::de::Deserialize<'de> for Method {
5138            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5139            where
5140                D: serde::Deserializer<'de>,
5141            {
5142                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Method>::new(
5143                    ".google.cloud.documentai.v1.Document.Entity.Method",
5144                ))
5145            }
5146        }
5147    }
5148
5149    /// Relationship between
5150    /// [Entities][google.cloud.documentai.v1.Document.Entity].
5151    ///
5152    /// [google.cloud.documentai.v1.Document.Entity]: crate::model::document::Entity
5153    #[derive(Clone, Default, PartialEq)]
5154    #[non_exhaustive]
5155    pub struct EntityRelation {
5156        /// Subject entity id.
5157        pub subject_id: std::string::String,
5158
5159        /// Object entity id.
5160        pub object_id: std::string::String,
5161
5162        /// Relationship description.
5163        pub relation: std::string::String,
5164
5165        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5166    }
5167
5168    impl EntityRelation {
5169        pub fn new() -> Self {
5170            std::default::Default::default()
5171        }
5172
5173        /// Sets the value of [subject_id][crate::model::document::EntityRelation::subject_id].
5174        ///
5175        /// # Example
5176        /// ```ignore,no_run
5177        /// # use google_cloud_documentai_v1::model::document::EntityRelation;
5178        /// let x = EntityRelation::new().set_subject_id("example");
5179        /// ```
5180        pub fn set_subject_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5181            self.subject_id = v.into();
5182            self
5183        }
5184
5185        /// Sets the value of [object_id][crate::model::document::EntityRelation::object_id].
5186        ///
5187        /// # Example
5188        /// ```ignore,no_run
5189        /// # use google_cloud_documentai_v1::model::document::EntityRelation;
5190        /// let x = EntityRelation::new().set_object_id("example");
5191        /// ```
5192        pub fn set_object_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5193            self.object_id = v.into();
5194            self
5195        }
5196
5197        /// Sets the value of [relation][crate::model::document::EntityRelation::relation].
5198        ///
5199        /// # Example
5200        /// ```ignore,no_run
5201        /// # use google_cloud_documentai_v1::model::document::EntityRelation;
5202        /// let x = EntityRelation::new().set_relation("example");
5203        /// ```
5204        pub fn set_relation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5205            self.relation = v.into();
5206            self
5207        }
5208    }
5209
5210    impl wkt::message::Message for EntityRelation {
5211        fn typename() -> &'static str {
5212            "type.googleapis.com/google.cloud.documentai.v1.Document.EntityRelation"
5213        }
5214    }
5215
5216    /// Text reference indexing into the
5217    /// [Document.text][google.cloud.documentai.v1.Document.text].
5218    ///
5219    /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
5220    #[derive(Clone, Default, PartialEq)]
5221    #[non_exhaustive]
5222    pub struct TextAnchor {
5223        /// The text segments from the
5224        /// [Document.text][google.cloud.documentai.v1.Document.text].
5225        ///
5226        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
5227        pub text_segments: std::vec::Vec<crate::model::document::text_anchor::TextSegment>,
5228
5229        /// Contains the content of the text span so that users do
5230        /// not have to look it up in the text_segments.  It is always
5231        /// populated for formFields.
5232        pub content: std::string::String,
5233
5234        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5235    }
5236
5237    impl TextAnchor {
5238        pub fn new() -> Self {
5239            std::default::Default::default()
5240        }
5241
5242        /// Sets the value of [text_segments][crate::model::document::TextAnchor::text_segments].
5243        ///
5244        /// # Example
5245        /// ```ignore,no_run
5246        /// # use google_cloud_documentai_v1::model::document::TextAnchor;
5247        /// use google_cloud_documentai_v1::model::document::text_anchor::TextSegment;
5248        /// let x = TextAnchor::new()
5249        ///     .set_text_segments([
5250        ///         TextSegment::default()/* use setters */,
5251        ///         TextSegment::default()/* use (different) setters */,
5252        ///     ]);
5253        /// ```
5254        pub fn set_text_segments<T, V>(mut self, v: T) -> Self
5255        where
5256            T: std::iter::IntoIterator<Item = V>,
5257            V: std::convert::Into<crate::model::document::text_anchor::TextSegment>,
5258        {
5259            use std::iter::Iterator;
5260            self.text_segments = v.into_iter().map(|i| i.into()).collect();
5261            self
5262        }
5263
5264        /// Sets the value of [content][crate::model::document::TextAnchor::content].
5265        ///
5266        /// # Example
5267        /// ```ignore,no_run
5268        /// # use google_cloud_documentai_v1::model::document::TextAnchor;
5269        /// let x = TextAnchor::new().set_content("example");
5270        /// ```
5271        pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5272            self.content = v.into();
5273            self
5274        }
5275    }
5276
5277    impl wkt::message::Message for TextAnchor {
5278        fn typename() -> &'static str {
5279            "type.googleapis.com/google.cloud.documentai.v1.Document.TextAnchor"
5280        }
5281    }
5282
5283    /// Defines additional types related to [TextAnchor].
5284    pub mod text_anchor {
5285        #[allow(unused_imports)]
5286        use super::*;
5287
5288        /// A text segment in the
5289        /// [Document.text][google.cloud.documentai.v1.Document.text]. The indices
5290        /// may be out of bounds which indicate that the text extends into another
5291        /// document shard for large sharded documents. See
5292        /// [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset]
5293        ///
5294        /// [google.cloud.documentai.v1.Document.ShardInfo.text_offset]: crate::model::document::ShardInfo::text_offset
5295        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
5296        #[derive(Clone, Default, PartialEq)]
5297        #[non_exhaustive]
5298        pub struct TextSegment {
5299            /// [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
5300            /// start UTF-8 char index in the
5301            /// [Document.text][google.cloud.documentai.v1.Document.text].
5302            ///
5303            /// [google.cloud.documentai.v1.Document.TextAnchor.TextSegment]: crate::model::document::text_anchor::TextSegment
5304            /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
5305            pub start_index: i64,
5306
5307            /// [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
5308            /// half open end UTF-8 char index in the
5309            /// [Document.text][google.cloud.documentai.v1.Document.text].
5310            ///
5311            /// [google.cloud.documentai.v1.Document.TextAnchor.TextSegment]: crate::model::document::text_anchor::TextSegment
5312            /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
5313            pub end_index: i64,
5314
5315            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5316        }
5317
5318        impl TextSegment {
5319            pub fn new() -> Self {
5320                std::default::Default::default()
5321            }
5322
5323            /// Sets the value of [start_index][crate::model::document::text_anchor::TextSegment::start_index].
5324            ///
5325            /// # Example
5326            /// ```ignore,no_run
5327            /// # use google_cloud_documentai_v1::model::document::text_anchor::TextSegment;
5328            /// let x = TextSegment::new().set_start_index(42);
5329            /// ```
5330            pub fn set_start_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5331                self.start_index = v.into();
5332                self
5333            }
5334
5335            /// Sets the value of [end_index][crate::model::document::text_anchor::TextSegment::end_index].
5336            ///
5337            /// # Example
5338            /// ```ignore,no_run
5339            /// # use google_cloud_documentai_v1::model::document::text_anchor::TextSegment;
5340            /// let x = TextSegment::new().set_end_index(42);
5341            /// ```
5342            pub fn set_end_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5343                self.end_index = v.into();
5344                self
5345            }
5346        }
5347
5348        impl wkt::message::Message for TextSegment {
5349            fn typename() -> &'static str {
5350                "type.googleapis.com/google.cloud.documentai.v1.Document.TextAnchor.TextSegment"
5351            }
5352        }
5353    }
5354
5355    /// Referencing the visual context of the entity in the
5356    /// [Document.pages][google.cloud.documentai.v1.Document.pages]. Page anchors
5357    /// can be cross-page, consist of multiple bounding polygons and optionally
5358    /// reference specific layout element types.
5359    ///
5360    /// [google.cloud.documentai.v1.Document.pages]: crate::model::Document::pages
5361    #[derive(Clone, Default, PartialEq)]
5362    #[non_exhaustive]
5363    pub struct PageAnchor {
5364        /// One or more references to visual page elements
5365        pub page_refs: std::vec::Vec<crate::model::document::page_anchor::PageRef>,
5366
5367        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5368    }
5369
5370    impl PageAnchor {
5371        pub fn new() -> Self {
5372            std::default::Default::default()
5373        }
5374
5375        /// Sets the value of [page_refs][crate::model::document::PageAnchor::page_refs].
5376        ///
5377        /// # Example
5378        /// ```ignore,no_run
5379        /// # use google_cloud_documentai_v1::model::document::PageAnchor;
5380        /// use google_cloud_documentai_v1::model::document::page_anchor::PageRef;
5381        /// let x = PageAnchor::new()
5382        ///     .set_page_refs([
5383        ///         PageRef::default()/* use setters */,
5384        ///         PageRef::default()/* use (different) setters */,
5385        ///     ]);
5386        /// ```
5387        pub fn set_page_refs<T, V>(mut self, v: T) -> Self
5388        where
5389            T: std::iter::IntoIterator<Item = V>,
5390            V: std::convert::Into<crate::model::document::page_anchor::PageRef>,
5391        {
5392            use std::iter::Iterator;
5393            self.page_refs = v.into_iter().map(|i| i.into()).collect();
5394            self
5395        }
5396    }
5397
5398    impl wkt::message::Message for PageAnchor {
5399        fn typename() -> &'static str {
5400            "type.googleapis.com/google.cloud.documentai.v1.Document.PageAnchor"
5401        }
5402    }
5403
5404    /// Defines additional types related to [PageAnchor].
5405    pub mod page_anchor {
5406        #[allow(unused_imports)]
5407        use super::*;
5408
5409        /// Represents a weak reference to a page element within a document.
5410        #[derive(Clone, Default, PartialEq)]
5411        #[non_exhaustive]
5412        pub struct PageRef {
5413            /// Required. Index into the
5414            /// [Document.pages][google.cloud.documentai.v1.Document.pages] element,
5415            /// for example using
5416            /// `[Document.pages][page_refs.page]` to locate the related page element.
5417            /// This field is skipped when its value is the default `0`. See
5418            /// <https://developers.google.com/protocol-buffers/docs/proto3#json>.
5419            ///
5420            /// [google.cloud.documentai.v1.Document.pages]: crate::model::Document::pages
5421            pub page: i64,
5422
5423            /// Optional. The type of the layout element that is being referenced if
5424            /// any.
5425            pub layout_type: crate::model::document::page_anchor::page_ref::LayoutType,
5426
5427            /// Optional. Deprecated.  Use
5428            /// [PageRef.bounding_poly][google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]
5429            /// instead.
5430            ///
5431            /// [google.cloud.documentai.v1.Document.PageAnchor.PageRef.bounding_poly]: crate::model::document::page_anchor::PageRef::bounding_poly
5432            #[deprecated]
5433            pub layout_id: std::string::String,
5434
5435            /// Optional. Identifies the bounding polygon of a layout element on the
5436            /// page. If `layout_type` is set, the bounding polygon must be exactly the
5437            /// same to the layout element it's referring to.
5438            pub bounding_poly: std::option::Option<crate::model::BoundingPoly>,
5439
5440            /// Optional. Confidence of detected page element, if applicable. Range
5441            /// `[0, 1]`.
5442            pub confidence: f32,
5443
5444            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5445        }
5446
5447        impl PageRef {
5448            pub fn new() -> Self {
5449                std::default::Default::default()
5450            }
5451
5452            /// Sets the value of [page][crate::model::document::page_anchor::PageRef::page].
5453            ///
5454            /// # Example
5455            /// ```ignore,no_run
5456            /// # use google_cloud_documentai_v1::model::document::page_anchor::PageRef;
5457            /// let x = PageRef::new().set_page(42);
5458            /// ```
5459            pub fn set_page<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5460                self.page = v.into();
5461                self
5462            }
5463
5464            /// Sets the value of [layout_type][crate::model::document::page_anchor::PageRef::layout_type].
5465            ///
5466            /// # Example
5467            /// ```ignore,no_run
5468            /// # use google_cloud_documentai_v1::model::document::page_anchor::PageRef;
5469            /// use google_cloud_documentai_v1::model::document::page_anchor::page_ref::LayoutType;
5470            /// let x0 = PageRef::new().set_layout_type(LayoutType::Block);
5471            /// let x1 = PageRef::new().set_layout_type(LayoutType::Paragraph);
5472            /// let x2 = PageRef::new().set_layout_type(LayoutType::Line);
5473            /// ```
5474            pub fn set_layout_type<
5475                T: std::convert::Into<crate::model::document::page_anchor::page_ref::LayoutType>,
5476            >(
5477                mut self,
5478                v: T,
5479            ) -> Self {
5480                self.layout_type = v.into();
5481                self
5482            }
5483
5484            /// Sets the value of [layout_id][crate::model::document::page_anchor::PageRef::layout_id].
5485            ///
5486            /// # Example
5487            /// ```ignore,no_run
5488            /// # use google_cloud_documentai_v1::model::document::page_anchor::PageRef;
5489            /// let x = PageRef::new().set_layout_id("example");
5490            /// ```
5491            #[deprecated]
5492            pub fn set_layout_id<T: std::convert::Into<std::string::String>>(
5493                mut self,
5494                v: T,
5495            ) -> Self {
5496                self.layout_id = v.into();
5497                self
5498            }
5499
5500            /// Sets the value of [bounding_poly][crate::model::document::page_anchor::PageRef::bounding_poly].
5501            ///
5502            /// # Example
5503            /// ```ignore,no_run
5504            /// # use google_cloud_documentai_v1::model::document::page_anchor::PageRef;
5505            /// use google_cloud_documentai_v1::model::BoundingPoly;
5506            /// let x = PageRef::new().set_bounding_poly(BoundingPoly::default()/* use setters */);
5507            /// ```
5508            pub fn set_bounding_poly<T>(mut self, v: T) -> Self
5509            where
5510                T: std::convert::Into<crate::model::BoundingPoly>,
5511            {
5512                self.bounding_poly = std::option::Option::Some(v.into());
5513                self
5514            }
5515
5516            /// Sets or clears the value of [bounding_poly][crate::model::document::page_anchor::PageRef::bounding_poly].
5517            ///
5518            /// # Example
5519            /// ```ignore,no_run
5520            /// # use google_cloud_documentai_v1::model::document::page_anchor::PageRef;
5521            /// use google_cloud_documentai_v1::model::BoundingPoly;
5522            /// let x = PageRef::new().set_or_clear_bounding_poly(Some(BoundingPoly::default()/* use setters */));
5523            /// let x = PageRef::new().set_or_clear_bounding_poly(None::<BoundingPoly>);
5524            /// ```
5525            pub fn set_or_clear_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
5526            where
5527                T: std::convert::Into<crate::model::BoundingPoly>,
5528            {
5529                self.bounding_poly = v.map(|x| x.into());
5530                self
5531            }
5532
5533            /// Sets the value of [confidence][crate::model::document::page_anchor::PageRef::confidence].
5534            ///
5535            /// # Example
5536            /// ```ignore,no_run
5537            /// # use google_cloud_documentai_v1::model::document::page_anchor::PageRef;
5538            /// let x = PageRef::new().set_confidence(42.0);
5539            /// ```
5540            pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
5541                self.confidence = v.into();
5542                self
5543            }
5544        }
5545
5546        impl wkt::message::Message for PageRef {
5547            fn typename() -> &'static str {
5548                "type.googleapis.com/google.cloud.documentai.v1.Document.PageAnchor.PageRef"
5549            }
5550        }
5551
5552        /// Defines additional types related to [PageRef].
5553        pub mod page_ref {
5554            #[allow(unused_imports)]
5555            use super::*;
5556
5557            /// The type of layout that is being referenced.
5558            ///
5559            /// # Working with unknown values
5560            ///
5561            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5562            /// additional enum variants at any time. Adding new variants is not considered
5563            /// a breaking change. Applications should write their code in anticipation of:
5564            ///
5565            /// - New values appearing in future releases of the client library, **and**
5566            /// - New values received dynamically, without application changes.
5567            ///
5568            /// Please consult the [Working with enums] section in the user guide for some
5569            /// guidelines.
5570            ///
5571            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5572            #[derive(Clone, Debug, PartialEq)]
5573            #[non_exhaustive]
5574            pub enum LayoutType {
5575                /// Layout Unspecified.
5576                Unspecified,
5577                /// References a
5578                /// [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks]
5579                /// element.
5580                ///
5581                /// [google.cloud.documentai.v1.Document.Page.blocks]: crate::model::document::Page::blocks
5582                Block,
5583                /// References a
5584                /// [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs]
5585                /// element.
5586                ///
5587                /// [google.cloud.documentai.v1.Document.Page.paragraphs]: crate::model::document::Page::paragraphs
5588                Paragraph,
5589                /// References a
5590                /// [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element.
5591                ///
5592                /// [google.cloud.documentai.v1.Document.Page.lines]: crate::model::document::Page::lines
5593                Line,
5594                /// References a
5595                /// [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens]
5596                /// element.
5597                ///
5598                /// [google.cloud.documentai.v1.Document.Page.tokens]: crate::model::document::Page::tokens
5599                Token,
5600                /// References a
5601                /// [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements]
5602                /// element.
5603                ///
5604                /// [google.cloud.documentai.v1.Document.Page.visual_elements]: crate::model::document::Page::visual_elements
5605                VisualElement,
5606                /// Refrrences a
5607                /// [Page.tables][google.cloud.documentai.v1.Document.Page.tables]
5608                /// element.
5609                ///
5610                /// [google.cloud.documentai.v1.Document.Page.tables]: crate::model::document::Page::tables
5611                Table,
5612                /// References a
5613                /// [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields]
5614                /// element.
5615                ///
5616                /// [google.cloud.documentai.v1.Document.Page.form_fields]: crate::model::document::Page::form_fields
5617                FormField,
5618                /// If set, the enum was initialized with an unknown value.
5619                ///
5620                /// Applications can examine the value using [LayoutType::value] or
5621                /// [LayoutType::name].
5622                UnknownValue(layout_type::UnknownValue),
5623            }
5624
5625            #[doc(hidden)]
5626            pub mod layout_type {
5627                #[allow(unused_imports)]
5628                use super::*;
5629                #[derive(Clone, Debug, PartialEq)]
5630                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5631            }
5632
5633            impl LayoutType {
5634                /// Gets the enum value.
5635                ///
5636                /// Returns `None` if the enum contains an unknown value deserialized from
5637                /// the string representation of enums.
5638                pub fn value(&self) -> std::option::Option<i32> {
5639                    match self {
5640                        Self::Unspecified => std::option::Option::Some(0),
5641                        Self::Block => std::option::Option::Some(1),
5642                        Self::Paragraph => std::option::Option::Some(2),
5643                        Self::Line => std::option::Option::Some(3),
5644                        Self::Token => std::option::Option::Some(4),
5645                        Self::VisualElement => std::option::Option::Some(5),
5646                        Self::Table => std::option::Option::Some(6),
5647                        Self::FormField => std::option::Option::Some(7),
5648                        Self::UnknownValue(u) => u.0.value(),
5649                    }
5650                }
5651
5652                /// Gets the enum value as a string.
5653                ///
5654                /// Returns `None` if the enum contains an unknown value deserialized from
5655                /// the integer representation of enums.
5656                pub fn name(&self) -> std::option::Option<&str> {
5657                    match self {
5658                        Self::Unspecified => std::option::Option::Some("LAYOUT_TYPE_UNSPECIFIED"),
5659                        Self::Block => std::option::Option::Some("BLOCK"),
5660                        Self::Paragraph => std::option::Option::Some("PARAGRAPH"),
5661                        Self::Line => std::option::Option::Some("LINE"),
5662                        Self::Token => std::option::Option::Some("TOKEN"),
5663                        Self::VisualElement => std::option::Option::Some("VISUAL_ELEMENT"),
5664                        Self::Table => std::option::Option::Some("TABLE"),
5665                        Self::FormField => std::option::Option::Some("FORM_FIELD"),
5666                        Self::UnknownValue(u) => u.0.name(),
5667                    }
5668                }
5669            }
5670
5671            impl std::default::Default for LayoutType {
5672                fn default() -> Self {
5673                    use std::convert::From;
5674                    Self::from(0)
5675                }
5676            }
5677
5678            impl std::fmt::Display for LayoutType {
5679                fn fmt(
5680                    &self,
5681                    f: &mut std::fmt::Formatter<'_>,
5682                ) -> std::result::Result<(), std::fmt::Error> {
5683                    wkt::internal::display_enum(f, self.name(), self.value())
5684                }
5685            }
5686
5687            impl std::convert::From<i32> for LayoutType {
5688                fn from(value: i32) -> Self {
5689                    match value {
5690                        0 => Self::Unspecified,
5691                        1 => Self::Block,
5692                        2 => Self::Paragraph,
5693                        3 => Self::Line,
5694                        4 => Self::Token,
5695                        5 => Self::VisualElement,
5696                        6 => Self::Table,
5697                        7 => Self::FormField,
5698                        _ => Self::UnknownValue(layout_type::UnknownValue(
5699                            wkt::internal::UnknownEnumValue::Integer(value),
5700                        )),
5701                    }
5702                }
5703            }
5704
5705            impl std::convert::From<&str> for LayoutType {
5706                fn from(value: &str) -> Self {
5707                    use std::string::ToString;
5708                    match value {
5709                        "LAYOUT_TYPE_UNSPECIFIED" => Self::Unspecified,
5710                        "BLOCK" => Self::Block,
5711                        "PARAGRAPH" => Self::Paragraph,
5712                        "LINE" => Self::Line,
5713                        "TOKEN" => Self::Token,
5714                        "VISUAL_ELEMENT" => Self::VisualElement,
5715                        "TABLE" => Self::Table,
5716                        "FORM_FIELD" => Self::FormField,
5717                        _ => Self::UnknownValue(layout_type::UnknownValue(
5718                            wkt::internal::UnknownEnumValue::String(value.to_string()),
5719                        )),
5720                    }
5721                }
5722            }
5723
5724            impl serde::ser::Serialize for LayoutType {
5725                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5726                where
5727                    S: serde::Serializer,
5728                {
5729                    match self {
5730                        Self::Unspecified => serializer.serialize_i32(0),
5731                        Self::Block => serializer.serialize_i32(1),
5732                        Self::Paragraph => serializer.serialize_i32(2),
5733                        Self::Line => serializer.serialize_i32(3),
5734                        Self::Token => serializer.serialize_i32(4),
5735                        Self::VisualElement => serializer.serialize_i32(5),
5736                        Self::Table => serializer.serialize_i32(6),
5737                        Self::FormField => serializer.serialize_i32(7),
5738                        Self::UnknownValue(u) => u.0.serialize(serializer),
5739                    }
5740                }
5741            }
5742
5743            impl<'de> serde::de::Deserialize<'de> for LayoutType {
5744                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5745                where
5746                    D: serde::Deserializer<'de>,
5747                {
5748                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<LayoutType>::new(
5749                        ".google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType",
5750                    ))
5751                }
5752            }
5753        }
5754    }
5755
5756    /// Structure to identify provenance relationships between annotations in
5757    /// different revisions.
5758    #[derive(Clone, Default, PartialEq)]
5759    #[non_exhaustive]
5760    pub struct Provenance {
5761        /// The index of the revision that produced this element.
5762        #[deprecated]
5763        pub revision: i32,
5764
5765        /// The Id of this operation.  Needs to be unique within the scope of the
5766        /// revision.
5767        #[deprecated]
5768        pub id: i32,
5769
5770        /// References to the original elements that are replaced.
5771        pub parents: std::vec::Vec<crate::model::document::provenance::Parent>,
5772
5773        /// The type of provenance operation.
5774        pub r#type: crate::model::document::provenance::OperationType,
5775
5776        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5777    }
5778
5779    impl Provenance {
5780        pub fn new() -> Self {
5781            std::default::Default::default()
5782        }
5783
5784        /// Sets the value of [revision][crate::model::document::Provenance::revision].
5785        ///
5786        /// # Example
5787        /// ```ignore,no_run
5788        /// # use google_cloud_documentai_v1::model::document::Provenance;
5789        /// let x = Provenance::new().set_revision(42);
5790        /// ```
5791        #[deprecated]
5792        pub fn set_revision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5793            self.revision = v.into();
5794            self
5795        }
5796
5797        /// Sets the value of [id][crate::model::document::Provenance::id].
5798        ///
5799        /// # Example
5800        /// ```ignore,no_run
5801        /// # use google_cloud_documentai_v1::model::document::Provenance;
5802        /// let x = Provenance::new().set_id(42);
5803        /// ```
5804        #[deprecated]
5805        pub fn set_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5806            self.id = v.into();
5807            self
5808        }
5809
5810        /// Sets the value of [parents][crate::model::document::Provenance::parents].
5811        ///
5812        /// # Example
5813        /// ```ignore,no_run
5814        /// # use google_cloud_documentai_v1::model::document::Provenance;
5815        /// use google_cloud_documentai_v1::model::document::provenance::Parent;
5816        /// let x = Provenance::new()
5817        ///     .set_parents([
5818        ///         Parent::default()/* use setters */,
5819        ///         Parent::default()/* use (different) setters */,
5820        ///     ]);
5821        /// ```
5822        pub fn set_parents<T, V>(mut self, v: T) -> Self
5823        where
5824            T: std::iter::IntoIterator<Item = V>,
5825            V: std::convert::Into<crate::model::document::provenance::Parent>,
5826        {
5827            use std::iter::Iterator;
5828            self.parents = v.into_iter().map(|i| i.into()).collect();
5829            self
5830        }
5831
5832        /// Sets the value of [r#type][crate::model::document::Provenance::type].
5833        ///
5834        /// # Example
5835        /// ```ignore,no_run
5836        /// # use google_cloud_documentai_v1::model::document::Provenance;
5837        /// use google_cloud_documentai_v1::model::document::provenance::OperationType;
5838        /// let x0 = Provenance::new().set_type(OperationType::Add);
5839        /// let x1 = Provenance::new().set_type(OperationType::Remove);
5840        /// let x2 = Provenance::new().set_type(OperationType::Update);
5841        /// ```
5842        pub fn set_type<
5843            T: std::convert::Into<crate::model::document::provenance::OperationType>,
5844        >(
5845            mut self,
5846            v: T,
5847        ) -> Self {
5848            self.r#type = v.into();
5849            self
5850        }
5851    }
5852
5853    impl wkt::message::Message for Provenance {
5854        fn typename() -> &'static str {
5855            "type.googleapis.com/google.cloud.documentai.v1.Document.Provenance"
5856        }
5857    }
5858
5859    /// Defines additional types related to [Provenance].
5860    pub mod provenance {
5861        #[allow(unused_imports)]
5862        use super::*;
5863
5864        /// The parent element the current element is based on. Used for
5865        /// referencing/aligning, removal and replacement operations.
5866        #[derive(Clone, Default, PartialEq)]
5867        #[non_exhaustive]
5868        pub struct Parent {
5869            /// The index of the index into current revision's parent_ids list.
5870            pub revision: i32,
5871
5872            /// The index of the parent item in the corresponding item list (eg. list
5873            /// of entities, properties within entities, etc.) in the parent revision.
5874            pub index: i32,
5875
5876            /// The id of the parent provenance.
5877            #[deprecated]
5878            pub id: i32,
5879
5880            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5881        }
5882
5883        impl Parent {
5884            pub fn new() -> Self {
5885                std::default::Default::default()
5886            }
5887
5888            /// Sets the value of [revision][crate::model::document::provenance::Parent::revision].
5889            ///
5890            /// # Example
5891            /// ```ignore,no_run
5892            /// # use google_cloud_documentai_v1::model::document::provenance::Parent;
5893            /// let x = Parent::new().set_revision(42);
5894            /// ```
5895            pub fn set_revision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5896                self.revision = v.into();
5897                self
5898            }
5899
5900            /// Sets the value of [index][crate::model::document::provenance::Parent::index].
5901            ///
5902            /// # Example
5903            /// ```ignore,no_run
5904            /// # use google_cloud_documentai_v1::model::document::provenance::Parent;
5905            /// let x = Parent::new().set_index(42);
5906            /// ```
5907            pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5908                self.index = v.into();
5909                self
5910            }
5911
5912            /// Sets the value of [id][crate::model::document::provenance::Parent::id].
5913            ///
5914            /// # Example
5915            /// ```ignore,no_run
5916            /// # use google_cloud_documentai_v1::model::document::provenance::Parent;
5917            /// let x = Parent::new().set_id(42);
5918            /// ```
5919            #[deprecated]
5920            pub fn set_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5921                self.id = v.into();
5922                self
5923            }
5924        }
5925
5926        impl wkt::message::Message for Parent {
5927            fn typename() -> &'static str {
5928                "type.googleapis.com/google.cloud.documentai.v1.Document.Provenance.Parent"
5929            }
5930        }
5931
5932        /// If a processor or agent does an explicit operation on existing elements.
5933        ///
5934        /// # Working with unknown values
5935        ///
5936        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5937        /// additional enum variants at any time. Adding new variants is not considered
5938        /// a breaking change. Applications should write their code in anticipation of:
5939        ///
5940        /// - New values appearing in future releases of the client library, **and**
5941        /// - New values received dynamically, without application changes.
5942        ///
5943        /// Please consult the [Working with enums] section in the user guide for some
5944        /// guidelines.
5945        ///
5946        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5947        #[derive(Clone, Debug, PartialEq)]
5948        #[non_exhaustive]
5949        pub enum OperationType {
5950            /// Operation type unspecified. If no operation is specified a provenance
5951            /// entry is simply used to match against a `parent`.
5952            Unspecified,
5953            /// Add an element.
5954            Add,
5955            /// Remove an element identified by `parent`.
5956            Remove,
5957            /// Updates any fields within the given provenance scope of the message. It
5958            /// overwrites the fields rather than replacing them.  Use this when you
5959            /// want to update a field value of an entity without also updating all the
5960            /// child properties.
5961            Update,
5962            /// Currently unused. Replace an element identified by `parent`.
5963            Replace,
5964            /// Deprecated. Request human review for the element identified by
5965            /// `parent`.
5966            #[deprecated]
5967            EvalRequested,
5968            /// Deprecated. Element is reviewed and approved at human review,
5969            /// confidence will be set to 1.0.
5970            #[deprecated]
5971            EvalApproved,
5972            /// Deprecated. Element is skipped in the validation process.
5973            #[deprecated]
5974            EvalSkipped,
5975            /// If set, the enum was initialized with an unknown value.
5976            ///
5977            /// Applications can examine the value using [OperationType::value] or
5978            /// [OperationType::name].
5979            UnknownValue(operation_type::UnknownValue),
5980        }
5981
5982        #[doc(hidden)]
5983        pub mod operation_type {
5984            #[allow(unused_imports)]
5985            use super::*;
5986            #[derive(Clone, Debug, PartialEq)]
5987            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5988        }
5989
5990        impl OperationType {
5991            /// Gets the enum value.
5992            ///
5993            /// Returns `None` if the enum contains an unknown value deserialized from
5994            /// the string representation of enums.
5995            pub fn value(&self) -> std::option::Option<i32> {
5996                match self {
5997                    Self::Unspecified => std::option::Option::Some(0),
5998                    Self::Add => std::option::Option::Some(1),
5999                    Self::Remove => std::option::Option::Some(2),
6000                    Self::Update => std::option::Option::Some(7),
6001                    Self::Replace => std::option::Option::Some(3),
6002                    Self::EvalRequested => std::option::Option::Some(4),
6003                    Self::EvalApproved => std::option::Option::Some(5),
6004                    Self::EvalSkipped => std::option::Option::Some(6),
6005                    Self::UnknownValue(u) => u.0.value(),
6006                }
6007            }
6008
6009            /// Gets the enum value as a string.
6010            ///
6011            /// Returns `None` if the enum contains an unknown value deserialized from
6012            /// the integer representation of enums.
6013            pub fn name(&self) -> std::option::Option<&str> {
6014                match self {
6015                    Self::Unspecified => std::option::Option::Some("OPERATION_TYPE_UNSPECIFIED"),
6016                    Self::Add => std::option::Option::Some("ADD"),
6017                    Self::Remove => std::option::Option::Some("REMOVE"),
6018                    Self::Update => std::option::Option::Some("UPDATE"),
6019                    Self::Replace => std::option::Option::Some("REPLACE"),
6020                    Self::EvalRequested => std::option::Option::Some("EVAL_REQUESTED"),
6021                    Self::EvalApproved => std::option::Option::Some("EVAL_APPROVED"),
6022                    Self::EvalSkipped => std::option::Option::Some("EVAL_SKIPPED"),
6023                    Self::UnknownValue(u) => u.0.name(),
6024                }
6025            }
6026        }
6027
6028        impl std::default::Default for OperationType {
6029            fn default() -> Self {
6030                use std::convert::From;
6031                Self::from(0)
6032            }
6033        }
6034
6035        impl std::fmt::Display for OperationType {
6036            fn fmt(
6037                &self,
6038                f: &mut std::fmt::Formatter<'_>,
6039            ) -> std::result::Result<(), std::fmt::Error> {
6040                wkt::internal::display_enum(f, self.name(), self.value())
6041            }
6042        }
6043
6044        impl std::convert::From<i32> for OperationType {
6045            fn from(value: i32) -> Self {
6046                match value {
6047                    0 => Self::Unspecified,
6048                    1 => Self::Add,
6049                    2 => Self::Remove,
6050                    3 => Self::Replace,
6051                    4 => Self::EvalRequested,
6052                    5 => Self::EvalApproved,
6053                    6 => Self::EvalSkipped,
6054                    7 => Self::Update,
6055                    _ => Self::UnknownValue(operation_type::UnknownValue(
6056                        wkt::internal::UnknownEnumValue::Integer(value),
6057                    )),
6058                }
6059            }
6060        }
6061
6062        impl std::convert::From<&str> for OperationType {
6063            fn from(value: &str) -> Self {
6064                use std::string::ToString;
6065                match value {
6066                    "OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
6067                    "ADD" => Self::Add,
6068                    "REMOVE" => Self::Remove,
6069                    "UPDATE" => Self::Update,
6070                    "REPLACE" => Self::Replace,
6071                    "EVAL_REQUESTED" => Self::EvalRequested,
6072                    "EVAL_APPROVED" => Self::EvalApproved,
6073                    "EVAL_SKIPPED" => Self::EvalSkipped,
6074                    _ => Self::UnknownValue(operation_type::UnknownValue(
6075                        wkt::internal::UnknownEnumValue::String(value.to_string()),
6076                    )),
6077                }
6078            }
6079        }
6080
6081        impl serde::ser::Serialize for OperationType {
6082            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6083            where
6084                S: serde::Serializer,
6085            {
6086                match self {
6087                    Self::Unspecified => serializer.serialize_i32(0),
6088                    Self::Add => serializer.serialize_i32(1),
6089                    Self::Remove => serializer.serialize_i32(2),
6090                    Self::Update => serializer.serialize_i32(7),
6091                    Self::Replace => serializer.serialize_i32(3),
6092                    Self::EvalRequested => serializer.serialize_i32(4),
6093                    Self::EvalApproved => serializer.serialize_i32(5),
6094                    Self::EvalSkipped => serializer.serialize_i32(6),
6095                    Self::UnknownValue(u) => u.0.serialize(serializer),
6096                }
6097            }
6098        }
6099
6100        impl<'de> serde::de::Deserialize<'de> for OperationType {
6101            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6102            where
6103                D: serde::Deserializer<'de>,
6104            {
6105                deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
6106                    ".google.cloud.documentai.v1.Document.Provenance.OperationType",
6107                ))
6108            }
6109        }
6110    }
6111
6112    /// Contains past or forward revisions of this document.
6113    #[derive(Clone, Default, PartialEq)]
6114    #[non_exhaustive]
6115    pub struct Revision {
6116        /// Id of the revision, internally generated by doc proto storage.
6117        /// Unique within the context of the document.
6118        pub id: std::string::String,
6119
6120        /// The revisions that this revision is based on.  This can include one or
6121        /// more parent (when documents are merged.)  This field represents the
6122        /// index into the `revisions` field.
6123        #[deprecated]
6124        pub parent: std::vec::Vec<i32>,
6125
6126        /// The revisions that this revision is based on. Must include all the ids
6127        /// that have anything to do with this revision - eg. there are
6128        /// `provenance.parent.revision` fields that index into this field.
6129        pub parent_ids: std::vec::Vec<std::string::String>,
6130
6131        /// The time that the revision was created, internally generated by
6132        /// doc proto storage at the time of create.
6133        pub create_time: std::option::Option<wkt::Timestamp>,
6134
6135        /// Human Review information of this revision.
6136        pub human_review: std::option::Option<crate::model::document::revision::HumanReview>,
6137
6138        /// Who/what made the change
6139        pub source: std::option::Option<crate::model::document::revision::Source>,
6140
6141        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6142    }
6143
6144    impl Revision {
6145        pub fn new() -> Self {
6146            std::default::Default::default()
6147        }
6148
6149        /// Sets the value of [id][crate::model::document::Revision::id].
6150        ///
6151        /// # Example
6152        /// ```ignore,no_run
6153        /// # use google_cloud_documentai_v1::model::document::Revision;
6154        /// let x = Revision::new().set_id("example");
6155        /// ```
6156        pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6157            self.id = v.into();
6158            self
6159        }
6160
6161        /// Sets the value of [parent][crate::model::document::Revision::parent].
6162        ///
6163        /// # Example
6164        /// ```ignore,no_run
6165        /// # use google_cloud_documentai_v1::model::document::Revision;
6166        /// let x = Revision::new().set_parent([1, 2, 3]);
6167        /// ```
6168        #[deprecated]
6169        pub fn set_parent<T, V>(mut self, v: T) -> Self
6170        where
6171            T: std::iter::IntoIterator<Item = V>,
6172            V: std::convert::Into<i32>,
6173        {
6174            use std::iter::Iterator;
6175            self.parent = v.into_iter().map(|i| i.into()).collect();
6176            self
6177        }
6178
6179        /// Sets the value of [parent_ids][crate::model::document::Revision::parent_ids].
6180        ///
6181        /// # Example
6182        /// ```ignore,no_run
6183        /// # use google_cloud_documentai_v1::model::document::Revision;
6184        /// let x = Revision::new().set_parent_ids(["a", "b", "c"]);
6185        /// ```
6186        pub fn set_parent_ids<T, V>(mut self, v: T) -> Self
6187        where
6188            T: std::iter::IntoIterator<Item = V>,
6189            V: std::convert::Into<std::string::String>,
6190        {
6191            use std::iter::Iterator;
6192            self.parent_ids = v.into_iter().map(|i| i.into()).collect();
6193            self
6194        }
6195
6196        /// Sets the value of [create_time][crate::model::document::Revision::create_time].
6197        ///
6198        /// # Example
6199        /// ```ignore,no_run
6200        /// # use google_cloud_documentai_v1::model::document::Revision;
6201        /// use wkt::Timestamp;
6202        /// let x = Revision::new().set_create_time(Timestamp::default()/* use setters */);
6203        /// ```
6204        pub fn set_create_time<T>(mut self, v: T) -> Self
6205        where
6206            T: std::convert::Into<wkt::Timestamp>,
6207        {
6208            self.create_time = std::option::Option::Some(v.into());
6209            self
6210        }
6211
6212        /// Sets or clears the value of [create_time][crate::model::document::Revision::create_time].
6213        ///
6214        /// # Example
6215        /// ```ignore,no_run
6216        /// # use google_cloud_documentai_v1::model::document::Revision;
6217        /// use wkt::Timestamp;
6218        /// let x = Revision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6219        /// let x = Revision::new().set_or_clear_create_time(None::<Timestamp>);
6220        /// ```
6221        pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6222        where
6223            T: std::convert::Into<wkt::Timestamp>,
6224        {
6225            self.create_time = v.map(|x| x.into());
6226            self
6227        }
6228
6229        /// Sets the value of [human_review][crate::model::document::Revision::human_review].
6230        ///
6231        /// # Example
6232        /// ```ignore,no_run
6233        /// # use google_cloud_documentai_v1::model::document::Revision;
6234        /// use google_cloud_documentai_v1::model::document::revision::HumanReview;
6235        /// let x = Revision::new().set_human_review(HumanReview::default()/* use setters */);
6236        /// ```
6237        pub fn set_human_review<T>(mut self, v: T) -> Self
6238        where
6239            T: std::convert::Into<crate::model::document::revision::HumanReview>,
6240        {
6241            self.human_review = std::option::Option::Some(v.into());
6242            self
6243        }
6244
6245        /// Sets or clears the value of [human_review][crate::model::document::Revision::human_review].
6246        ///
6247        /// # Example
6248        /// ```ignore,no_run
6249        /// # use google_cloud_documentai_v1::model::document::Revision;
6250        /// use google_cloud_documentai_v1::model::document::revision::HumanReview;
6251        /// let x = Revision::new().set_or_clear_human_review(Some(HumanReview::default()/* use setters */));
6252        /// let x = Revision::new().set_or_clear_human_review(None::<HumanReview>);
6253        /// ```
6254        pub fn set_or_clear_human_review<T>(mut self, v: std::option::Option<T>) -> Self
6255        where
6256            T: std::convert::Into<crate::model::document::revision::HumanReview>,
6257        {
6258            self.human_review = v.map(|x| x.into());
6259            self
6260        }
6261
6262        /// Sets the value of [source][crate::model::document::Revision::source].
6263        ///
6264        /// Note that all the setters affecting `source` are mutually
6265        /// exclusive.
6266        ///
6267        /// # Example
6268        /// ```ignore,no_run
6269        /// # use google_cloud_documentai_v1::model::document::Revision;
6270        /// use google_cloud_documentai_v1::model::document::revision::Source;
6271        /// let x = Revision::new().set_source(Some(Source::Agent("example".to_string())));
6272        /// ```
6273        pub fn set_source<
6274            T: std::convert::Into<std::option::Option<crate::model::document::revision::Source>>,
6275        >(
6276            mut self,
6277            v: T,
6278        ) -> Self {
6279            self.source = v.into();
6280            self
6281        }
6282
6283        /// The value of [source][crate::model::document::Revision::source]
6284        /// if it holds a `Agent`, `None` if the field is not set or
6285        /// holds a different branch.
6286        pub fn agent(&self) -> std::option::Option<&std::string::String> {
6287            #[allow(unreachable_patterns)]
6288            self.source.as_ref().and_then(|v| match v {
6289                crate::model::document::revision::Source::Agent(v) => std::option::Option::Some(v),
6290                _ => std::option::Option::None,
6291            })
6292        }
6293
6294        /// Sets the value of [source][crate::model::document::Revision::source]
6295        /// to hold a `Agent`.
6296        ///
6297        /// Note that all the setters affecting `source` are
6298        /// mutually exclusive.
6299        ///
6300        /// # Example
6301        /// ```ignore,no_run
6302        /// # use google_cloud_documentai_v1::model::document::Revision;
6303        /// let x = Revision::new().set_agent("example");
6304        /// assert!(x.agent().is_some());
6305        /// assert!(x.processor().is_none());
6306        /// ```
6307        pub fn set_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6308            self.source = std::option::Option::Some(
6309                crate::model::document::revision::Source::Agent(v.into()),
6310            );
6311            self
6312        }
6313
6314        /// The value of [source][crate::model::document::Revision::source]
6315        /// if it holds a `Processor`, `None` if the field is not set or
6316        /// holds a different branch.
6317        pub fn processor(&self) -> std::option::Option<&std::string::String> {
6318            #[allow(unreachable_patterns)]
6319            self.source.as_ref().and_then(|v| match v {
6320                crate::model::document::revision::Source::Processor(v) => {
6321                    std::option::Option::Some(v)
6322                }
6323                _ => std::option::Option::None,
6324            })
6325        }
6326
6327        /// Sets the value of [source][crate::model::document::Revision::source]
6328        /// to hold a `Processor`.
6329        ///
6330        /// Note that all the setters affecting `source` are
6331        /// mutually exclusive.
6332        ///
6333        /// # Example
6334        /// ```ignore,no_run
6335        /// # use google_cloud_documentai_v1::model::document::Revision;
6336        /// let x = Revision::new().set_processor("example");
6337        /// assert!(x.processor().is_some());
6338        /// assert!(x.agent().is_none());
6339        /// ```
6340        pub fn set_processor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6341            self.source = std::option::Option::Some(
6342                crate::model::document::revision::Source::Processor(v.into()),
6343            );
6344            self
6345        }
6346    }
6347
6348    impl wkt::message::Message for Revision {
6349        fn typename() -> &'static str {
6350            "type.googleapis.com/google.cloud.documentai.v1.Document.Revision"
6351        }
6352    }
6353
6354    /// Defines additional types related to [Revision].
6355    pub mod revision {
6356        #[allow(unused_imports)]
6357        use super::*;
6358
6359        /// Human Review information of the document.
6360        #[derive(Clone, Default, PartialEq)]
6361        #[non_exhaustive]
6362        pub struct HumanReview {
6363            /// Human review state. e.g. `requested`, `succeeded`, `rejected`.
6364            pub state: std::string::String,
6365
6366            /// A message providing more details about the current state of processing.
6367            /// For example, the rejection reason when the state is `rejected`.
6368            pub state_message: std::string::String,
6369
6370            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6371        }
6372
6373        impl HumanReview {
6374            pub fn new() -> Self {
6375                std::default::Default::default()
6376            }
6377
6378            /// Sets the value of [state][crate::model::document::revision::HumanReview::state].
6379            ///
6380            /// # Example
6381            /// ```ignore,no_run
6382            /// # use google_cloud_documentai_v1::model::document::revision::HumanReview;
6383            /// let x = HumanReview::new().set_state("example");
6384            /// ```
6385            pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6386                self.state = v.into();
6387                self
6388            }
6389
6390            /// Sets the value of [state_message][crate::model::document::revision::HumanReview::state_message].
6391            ///
6392            /// # Example
6393            /// ```ignore,no_run
6394            /// # use google_cloud_documentai_v1::model::document::revision::HumanReview;
6395            /// let x = HumanReview::new().set_state_message("example");
6396            /// ```
6397            pub fn set_state_message<T: std::convert::Into<std::string::String>>(
6398                mut self,
6399                v: T,
6400            ) -> Self {
6401                self.state_message = v.into();
6402                self
6403            }
6404        }
6405
6406        impl wkt::message::Message for HumanReview {
6407            fn typename() -> &'static str {
6408                "type.googleapis.com/google.cloud.documentai.v1.Document.Revision.HumanReview"
6409            }
6410        }
6411
6412        /// Who/what made the change
6413        #[derive(Clone, Debug, PartialEq)]
6414        #[non_exhaustive]
6415        pub enum Source {
6416            /// If the change was made by a person specify the name or id of that
6417            /// person.
6418            Agent(std::string::String),
6419            /// If the annotation was made by processor identify the processor by its
6420            /// resource name.
6421            Processor(std::string::String),
6422        }
6423    }
6424
6425    /// This message is used for text changes aka. OCR corrections.
6426    #[derive(Clone, Default, PartialEq)]
6427    #[non_exhaustive]
6428    pub struct TextChange {
6429        /// Provenance of the correction.
6430        /// Text anchor indexing into the
6431        /// [Document.text][google.cloud.documentai.v1.Document.text].  There can
6432        /// only be a single `TextAnchor.text_segments` element.  If the start and
6433        /// end index of the text segment are the same, the text change is inserted
6434        /// before that index.
6435        ///
6436        /// [google.cloud.documentai.v1.Document.text]: crate::model::Document::text
6437        pub text_anchor: std::option::Option<crate::model::document::TextAnchor>,
6438
6439        /// The text that replaces the text identified in the `text_anchor`.
6440        pub changed_text: std::string::String,
6441
6442        /// The history of this annotation.
6443        #[deprecated]
6444        pub provenance: std::vec::Vec<crate::model::document::Provenance>,
6445
6446        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6447    }
6448
6449    impl TextChange {
6450        pub fn new() -> Self {
6451            std::default::Default::default()
6452        }
6453
6454        /// Sets the value of [text_anchor][crate::model::document::TextChange::text_anchor].
6455        ///
6456        /// # Example
6457        /// ```ignore,no_run
6458        /// # use google_cloud_documentai_v1::model::document::TextChange;
6459        /// use google_cloud_documentai_v1::model::document::TextAnchor;
6460        /// let x = TextChange::new().set_text_anchor(TextAnchor::default()/* use setters */);
6461        /// ```
6462        pub fn set_text_anchor<T>(mut self, v: T) -> Self
6463        where
6464            T: std::convert::Into<crate::model::document::TextAnchor>,
6465        {
6466            self.text_anchor = std::option::Option::Some(v.into());
6467            self
6468        }
6469
6470        /// Sets or clears the value of [text_anchor][crate::model::document::TextChange::text_anchor].
6471        ///
6472        /// # Example
6473        /// ```ignore,no_run
6474        /// # use google_cloud_documentai_v1::model::document::TextChange;
6475        /// use google_cloud_documentai_v1::model::document::TextAnchor;
6476        /// let x = TextChange::new().set_or_clear_text_anchor(Some(TextAnchor::default()/* use setters */));
6477        /// let x = TextChange::new().set_or_clear_text_anchor(None::<TextAnchor>);
6478        /// ```
6479        pub fn set_or_clear_text_anchor<T>(mut self, v: std::option::Option<T>) -> Self
6480        where
6481            T: std::convert::Into<crate::model::document::TextAnchor>,
6482        {
6483            self.text_anchor = v.map(|x| x.into());
6484            self
6485        }
6486
6487        /// Sets the value of [changed_text][crate::model::document::TextChange::changed_text].
6488        ///
6489        /// # Example
6490        /// ```ignore,no_run
6491        /// # use google_cloud_documentai_v1::model::document::TextChange;
6492        /// let x = TextChange::new().set_changed_text("example");
6493        /// ```
6494        pub fn set_changed_text<T: std::convert::Into<std::string::String>>(
6495            mut self,
6496            v: T,
6497        ) -> Self {
6498            self.changed_text = v.into();
6499            self
6500        }
6501
6502        /// Sets the value of [provenance][crate::model::document::TextChange::provenance].
6503        ///
6504        /// # Example
6505        /// ```ignore,no_run
6506        /// # use google_cloud_documentai_v1::model::document::TextChange;
6507        /// use google_cloud_documentai_v1::model::document::Provenance;
6508        /// let x = TextChange::new()
6509        ///     .set_provenance([
6510        ///         Provenance::default()/* use setters */,
6511        ///         Provenance::default()/* use (different) setters */,
6512        ///     ]);
6513        /// ```
6514        #[deprecated]
6515        pub fn set_provenance<T, V>(mut self, v: T) -> Self
6516        where
6517            T: std::iter::IntoIterator<Item = V>,
6518            V: std::convert::Into<crate::model::document::Provenance>,
6519        {
6520            use std::iter::Iterator;
6521            self.provenance = v.into_iter().map(|i| i.into()).collect();
6522            self
6523        }
6524    }
6525
6526    impl wkt::message::Message for TextChange {
6527        fn typename() -> &'static str {
6528            "type.googleapis.com/google.cloud.documentai.v1.Document.TextChange"
6529        }
6530    }
6531
6532    /// Represents the parsed layout of a document as a collection of blocks that
6533    /// the document is divided into.
6534    #[derive(Clone, Default, PartialEq)]
6535    #[non_exhaustive]
6536    pub struct DocumentLayout {
6537        /// List of blocks in the document.
6538        pub blocks: std::vec::Vec<crate::model::document::document_layout::DocumentLayoutBlock>,
6539
6540        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6541    }
6542
6543    impl DocumentLayout {
6544        pub fn new() -> Self {
6545            std::default::Default::default()
6546        }
6547
6548        /// Sets the value of [blocks][crate::model::document::DocumentLayout::blocks].
6549        ///
6550        /// # Example
6551        /// ```ignore,no_run
6552        /// # use google_cloud_documentai_v1::model::document::DocumentLayout;
6553        /// use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6554        /// let x = DocumentLayout::new()
6555        ///     .set_blocks([
6556        ///         DocumentLayoutBlock::default()/* use setters */,
6557        ///         DocumentLayoutBlock::default()/* use (different) setters */,
6558        ///     ]);
6559        /// ```
6560        pub fn set_blocks<T, V>(mut self, v: T) -> Self
6561        where
6562            T: std::iter::IntoIterator<Item = V>,
6563            V: std::convert::Into<crate::model::document::document_layout::DocumentLayoutBlock>,
6564        {
6565            use std::iter::Iterator;
6566            self.blocks = v.into_iter().map(|i| i.into()).collect();
6567            self
6568        }
6569    }
6570
6571    impl wkt::message::Message for DocumentLayout {
6572        fn typename() -> &'static str {
6573            "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout"
6574        }
6575    }
6576
6577    /// Defines additional types related to [DocumentLayout].
6578    pub mod document_layout {
6579        #[allow(unused_imports)]
6580        use super::*;
6581
6582        /// Represents a block. A block could be one of the various types (text,
6583        /// table, list) supported.
6584        #[derive(Clone, Default, PartialEq)]
6585        #[non_exhaustive]
6586        pub struct DocumentLayoutBlock {
6587            /// ID of the block.
6588            pub block_id: std::string::String,
6589
6590            /// Page span of the block.
6591            pub page_span: std::option::Option<
6592                crate::model::document::document_layout::document_layout_block::LayoutPageSpan,
6593            >,
6594
6595            /// Identifies the bounding box for the block.
6596            pub bounding_box: std::option::Option<crate::model::BoundingPoly>,
6597
6598            pub block: std::option::Option<
6599                crate::model::document::document_layout::document_layout_block::Block,
6600            >,
6601
6602            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6603        }
6604
6605        impl DocumentLayoutBlock {
6606            pub fn new() -> Self {
6607                std::default::Default::default()
6608            }
6609
6610            /// Sets the value of [block_id][crate::model::document::document_layout::DocumentLayoutBlock::block_id].
6611            ///
6612            /// # Example
6613            /// ```ignore,no_run
6614            /// # use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6615            /// let x = DocumentLayoutBlock::new().set_block_id("example");
6616            /// ```
6617            pub fn set_block_id<T: std::convert::Into<std::string::String>>(
6618                mut self,
6619                v: T,
6620            ) -> Self {
6621                self.block_id = v.into();
6622                self
6623            }
6624
6625            /// Sets the value of [page_span][crate::model::document::document_layout::DocumentLayoutBlock::page_span].
6626            ///
6627            /// # Example
6628            /// ```ignore,no_run
6629            /// # use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6630            /// use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutPageSpan;
6631            /// let x = DocumentLayoutBlock::new().set_page_span(LayoutPageSpan::default()/* use setters */);
6632            /// ```
6633            pub fn set_page_span<T>(mut self, v: T) -> Self
6634            where T: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutPageSpan>
6635            {
6636                self.page_span = std::option::Option::Some(v.into());
6637                self
6638            }
6639
6640            /// Sets or clears the value of [page_span][crate::model::document::document_layout::DocumentLayoutBlock::page_span].
6641            ///
6642            /// # Example
6643            /// ```ignore,no_run
6644            /// # use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6645            /// use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutPageSpan;
6646            /// let x = DocumentLayoutBlock::new().set_or_clear_page_span(Some(LayoutPageSpan::default()/* use setters */));
6647            /// let x = DocumentLayoutBlock::new().set_or_clear_page_span(None::<LayoutPageSpan>);
6648            /// ```
6649            pub fn set_or_clear_page_span<T>(mut self, v: std::option::Option<T>) -> Self
6650            where T: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutPageSpan>
6651            {
6652                self.page_span = v.map(|x| x.into());
6653                self
6654            }
6655
6656            /// Sets the value of [bounding_box][crate::model::document::document_layout::DocumentLayoutBlock::bounding_box].
6657            ///
6658            /// # Example
6659            /// ```ignore,no_run
6660            /// # use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6661            /// use google_cloud_documentai_v1::model::BoundingPoly;
6662            /// let x = DocumentLayoutBlock::new().set_bounding_box(BoundingPoly::default()/* use setters */);
6663            /// ```
6664            pub fn set_bounding_box<T>(mut self, v: T) -> Self
6665            where
6666                T: std::convert::Into<crate::model::BoundingPoly>,
6667            {
6668                self.bounding_box = std::option::Option::Some(v.into());
6669                self
6670            }
6671
6672            /// Sets or clears the value of [bounding_box][crate::model::document::document_layout::DocumentLayoutBlock::bounding_box].
6673            ///
6674            /// # Example
6675            /// ```ignore,no_run
6676            /// # use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6677            /// use google_cloud_documentai_v1::model::BoundingPoly;
6678            /// let x = DocumentLayoutBlock::new().set_or_clear_bounding_box(Some(BoundingPoly::default()/* use setters */));
6679            /// let x = DocumentLayoutBlock::new().set_or_clear_bounding_box(None::<BoundingPoly>);
6680            /// ```
6681            pub fn set_or_clear_bounding_box<T>(mut self, v: std::option::Option<T>) -> Self
6682            where
6683                T: std::convert::Into<crate::model::BoundingPoly>,
6684            {
6685                self.bounding_box = v.map(|x| x.into());
6686                self
6687            }
6688
6689            /// Sets the value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block].
6690            ///
6691            /// Note that all the setters affecting `block` are mutually
6692            /// exclusive.
6693            ///
6694            /// # Example
6695            /// ```ignore,no_run
6696            /// # use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6697            /// use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTextBlock;
6698            /// let x = DocumentLayoutBlock::new().set_block(Some(
6699            ///     google_cloud_documentai_v1::model::document::document_layout::document_layout_block::Block::TextBlock(LayoutTextBlock::default().into())));
6700            /// ```
6701            pub fn set_block<
6702                T: std::convert::Into<
6703                        std::option::Option<
6704                            crate::model::document::document_layout::document_layout_block::Block,
6705                        >,
6706                    >,
6707            >(
6708                mut self,
6709                v: T,
6710            ) -> Self {
6711                self.block = v.into();
6712                self
6713            }
6714
6715            /// The value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
6716            /// if it holds a `TextBlock`, `None` if the field is not set or
6717            /// holds a different branch.
6718            pub fn text_block(
6719                &self,
6720            ) -> std::option::Option<
6721                &std::boxed::Box<
6722                    crate::model::document::document_layout::document_layout_block::LayoutTextBlock,
6723                >,
6724            > {
6725                #[allow(unreachable_patterns)]
6726                self.block.as_ref().and_then(|v| match v {
6727                    crate::model::document::document_layout::document_layout_block::Block::TextBlock(v) => std::option::Option::Some(v),
6728                    _ => std::option::Option::None,
6729                })
6730            }
6731
6732            /// Sets the value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
6733            /// to hold a `TextBlock`.
6734            ///
6735            /// Note that all the setters affecting `block` are
6736            /// mutually exclusive.
6737            ///
6738            /// # Example
6739            /// ```ignore,no_run
6740            /// # use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6741            /// use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTextBlock;
6742            /// let x = DocumentLayoutBlock::new().set_text_block(LayoutTextBlock::default()/* use setters */);
6743            /// assert!(x.text_block().is_some());
6744            /// assert!(x.table_block().is_none());
6745            /// assert!(x.list_block().is_none());
6746            /// ```
6747            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{
6748                self.block = std::option::Option::Some(
6749                    crate::model::document::document_layout::document_layout_block::Block::TextBlock(
6750                        v.into()
6751                    )
6752                );
6753                self
6754            }
6755
6756            /// The value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
6757            /// if it holds a `TableBlock`, `None` if the field is not set or
6758            /// holds a different branch.
6759            pub fn table_block(&self) -> std::option::Option<&std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutTableBlock>>{
6760                #[allow(unreachable_patterns)]
6761                self.block.as_ref().and_then(|v| match v {
6762                    crate::model::document::document_layout::document_layout_block::Block::TableBlock(v) => std::option::Option::Some(v),
6763                    _ => std::option::Option::None,
6764                })
6765            }
6766
6767            /// Sets the value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
6768            /// to hold a `TableBlock`.
6769            ///
6770            /// Note that all the setters affecting `block` are
6771            /// mutually exclusive.
6772            ///
6773            /// # Example
6774            /// ```ignore,no_run
6775            /// # use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6776            /// use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableBlock;
6777            /// let x = DocumentLayoutBlock::new().set_table_block(LayoutTableBlock::default()/* use setters */);
6778            /// assert!(x.table_block().is_some());
6779            /// assert!(x.text_block().is_none());
6780            /// assert!(x.list_block().is_none());
6781            /// ```
6782            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{
6783                self.block = std::option::Option::Some(
6784                    crate::model::document::document_layout::document_layout_block::Block::TableBlock(
6785                        v.into()
6786                    )
6787                );
6788                self
6789            }
6790
6791            /// The value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
6792            /// if it holds a `ListBlock`, `None` if the field is not set or
6793            /// holds a different branch.
6794            pub fn list_block(
6795                &self,
6796            ) -> std::option::Option<
6797                &std::boxed::Box<
6798                    crate::model::document::document_layout::document_layout_block::LayoutListBlock,
6799                >,
6800            > {
6801                #[allow(unreachable_patterns)]
6802                self.block.as_ref().and_then(|v| match v {
6803                    crate::model::document::document_layout::document_layout_block::Block::ListBlock(v) => std::option::Option::Some(v),
6804                    _ => std::option::Option::None,
6805                })
6806            }
6807
6808            /// Sets the value of [block][crate::model::document::document_layout::DocumentLayoutBlock::block]
6809            /// to hold a `ListBlock`.
6810            ///
6811            /// Note that all the setters affecting `block` are
6812            /// mutually exclusive.
6813            ///
6814            /// # Example
6815            /// ```ignore,no_run
6816            /// # use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6817            /// use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutListBlock;
6818            /// let x = DocumentLayoutBlock::new().set_list_block(LayoutListBlock::default()/* use setters */);
6819            /// assert!(x.list_block().is_some());
6820            /// assert!(x.text_block().is_none());
6821            /// assert!(x.table_block().is_none());
6822            /// ```
6823            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{
6824                self.block = std::option::Option::Some(
6825                    crate::model::document::document_layout::document_layout_block::Block::ListBlock(
6826                        v.into()
6827                    )
6828                );
6829                self
6830            }
6831        }
6832
6833        impl wkt::message::Message for DocumentLayoutBlock {
6834            fn typename() -> &'static str {
6835                "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock"
6836            }
6837        }
6838
6839        /// Defines additional types related to [DocumentLayoutBlock].
6840        pub mod document_layout_block {
6841            #[allow(unused_imports)]
6842            use super::*;
6843
6844            /// Represents where the block starts and ends in the document.
6845            #[derive(Clone, Default, PartialEq)]
6846            #[non_exhaustive]
6847            pub struct LayoutPageSpan {
6848                /// Page where block starts in the document.
6849                pub page_start: i32,
6850
6851                /// Page where block ends in the document.
6852                pub page_end: i32,
6853
6854                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6855            }
6856
6857            impl LayoutPageSpan {
6858                pub fn new() -> Self {
6859                    std::default::Default::default()
6860                }
6861
6862                /// Sets the value of [page_start][crate::model::document::document_layout::document_layout_block::LayoutPageSpan::page_start].
6863                ///
6864                /// # Example
6865                /// ```ignore,no_run
6866                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutPageSpan;
6867                /// let x = LayoutPageSpan::new().set_page_start(42);
6868                /// ```
6869                pub fn set_page_start<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6870                    self.page_start = v.into();
6871                    self
6872                }
6873
6874                /// Sets the value of [page_end][crate::model::document::document_layout::document_layout_block::LayoutPageSpan::page_end].
6875                ///
6876                /// # Example
6877                /// ```ignore,no_run
6878                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutPageSpan;
6879                /// let x = LayoutPageSpan::new().set_page_end(42);
6880                /// ```
6881                pub fn set_page_end<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6882                    self.page_end = v.into();
6883                    self
6884                }
6885            }
6886
6887            impl wkt::message::Message for LayoutPageSpan {
6888                fn typename() -> &'static str {
6889                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan"
6890                }
6891            }
6892
6893            /// Represents a text type block.
6894            #[derive(Clone, Default, PartialEq)]
6895            #[non_exhaustive]
6896            pub struct LayoutTextBlock {
6897                /// Text content stored in the block.
6898                pub text: std::string::String,
6899
6900                /// Type of the text in the block. Available options are: `paragraph`,
6901                /// `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`,
6902                /// `heading-5`, `header`, `footer`.
6903                pub r#type: std::string::String,
6904
6905                /// A text block could further have child blocks.
6906                /// Repeated blocks support further hierarchies and nested blocks.
6907                pub blocks:
6908                    std::vec::Vec<crate::model::document::document_layout::DocumentLayoutBlock>,
6909
6910                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6911            }
6912
6913            impl LayoutTextBlock {
6914                pub fn new() -> Self {
6915                    std::default::Default::default()
6916                }
6917
6918                /// Sets the value of [text][crate::model::document::document_layout::document_layout_block::LayoutTextBlock::text].
6919                ///
6920                /// # Example
6921                /// ```ignore,no_run
6922                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTextBlock;
6923                /// let x = LayoutTextBlock::new().set_text("example");
6924                /// ```
6925                pub fn set_text<T: std::convert::Into<std::string::String>>(
6926                    mut self,
6927                    v: T,
6928                ) -> Self {
6929                    self.text = v.into();
6930                    self
6931                }
6932
6933                /// Sets the value of [r#type][crate::model::document::document_layout::document_layout_block::LayoutTextBlock::type].
6934                ///
6935                /// # Example
6936                /// ```ignore,no_run
6937                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTextBlock;
6938                /// let x = LayoutTextBlock::new().set_type("example");
6939                /// ```
6940                pub fn set_type<T: std::convert::Into<std::string::String>>(
6941                    mut self,
6942                    v: T,
6943                ) -> Self {
6944                    self.r#type = v.into();
6945                    self
6946                }
6947
6948                /// Sets the value of [blocks][crate::model::document::document_layout::document_layout_block::LayoutTextBlock::blocks].
6949                ///
6950                /// # Example
6951                /// ```ignore,no_run
6952                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTextBlock;
6953                /// use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
6954                /// let x = LayoutTextBlock::new()
6955                ///     .set_blocks([
6956                ///         DocumentLayoutBlock::default()/* use setters */,
6957                ///         DocumentLayoutBlock::default()/* use (different) setters */,
6958                ///     ]);
6959                /// ```
6960                pub fn set_blocks<T, V>(mut self, v: T) -> Self
6961                where
6962                    T: std::iter::IntoIterator<Item = V>,
6963                    V: std::convert::Into<
6964                            crate::model::document::document_layout::DocumentLayoutBlock,
6965                        >,
6966                {
6967                    use std::iter::Iterator;
6968                    self.blocks = v.into_iter().map(|i| i.into()).collect();
6969                    self
6970                }
6971            }
6972
6973            impl wkt::message::Message for LayoutTextBlock {
6974                fn typename() -> &'static str {
6975                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock"
6976                }
6977            }
6978
6979            /// Represents a table type block.
6980            #[derive(Clone, Default, PartialEq)]
6981            #[non_exhaustive]
6982            pub struct LayoutTableBlock {
6983                /// Header rows at the top of the table.
6984                pub header_rows: std::vec::Vec<
6985                    crate::model::document::document_layout::document_layout_block::LayoutTableRow,
6986                >,
6987
6988                /// Body rows containing main table content.
6989                pub body_rows: std::vec::Vec<
6990                    crate::model::document::document_layout::document_layout_block::LayoutTableRow,
6991                >,
6992
6993                /// Table caption/title.
6994                pub caption: std::string::String,
6995
6996                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6997            }
6998
6999            impl LayoutTableBlock {
7000                pub fn new() -> Self {
7001                    std::default::Default::default()
7002                }
7003
7004                /// Sets the value of [header_rows][crate::model::document::document_layout::document_layout_block::LayoutTableBlock::header_rows].
7005                ///
7006                /// # Example
7007                /// ```ignore,no_run
7008                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableBlock;
7009                /// use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableRow;
7010                /// let x = LayoutTableBlock::new()
7011                ///     .set_header_rows([
7012                ///         LayoutTableRow::default()/* use setters */,
7013                ///         LayoutTableRow::default()/* use (different) setters */,
7014                ///     ]);
7015                /// ```
7016                pub fn set_header_rows<T, V>(mut self, v: T) -> Self
7017                where
7018                    T: std::iter::IntoIterator<Item = V>,
7019                    V: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutTableRow>
7020                {
7021                    use std::iter::Iterator;
7022                    self.header_rows = v.into_iter().map(|i| i.into()).collect();
7023                    self
7024                }
7025
7026                /// Sets the value of [body_rows][crate::model::document::document_layout::document_layout_block::LayoutTableBlock::body_rows].
7027                ///
7028                /// # Example
7029                /// ```ignore,no_run
7030                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableBlock;
7031                /// use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableRow;
7032                /// let x = LayoutTableBlock::new()
7033                ///     .set_body_rows([
7034                ///         LayoutTableRow::default()/* use setters */,
7035                ///         LayoutTableRow::default()/* use (different) setters */,
7036                ///     ]);
7037                /// ```
7038                pub fn set_body_rows<T, V>(mut self, v: T) -> Self
7039                where
7040                    T: std::iter::IntoIterator<Item = V>,
7041                    V: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutTableRow>
7042                {
7043                    use std::iter::Iterator;
7044                    self.body_rows = v.into_iter().map(|i| i.into()).collect();
7045                    self
7046                }
7047
7048                /// Sets the value of [caption][crate::model::document::document_layout::document_layout_block::LayoutTableBlock::caption].
7049                ///
7050                /// # Example
7051                /// ```ignore,no_run
7052                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableBlock;
7053                /// let x = LayoutTableBlock::new().set_caption("example");
7054                /// ```
7055                pub fn set_caption<T: std::convert::Into<std::string::String>>(
7056                    mut self,
7057                    v: T,
7058                ) -> Self {
7059                    self.caption = v.into();
7060                    self
7061                }
7062            }
7063
7064            impl wkt::message::Message for LayoutTableBlock {
7065                fn typename() -> &'static str {
7066                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock"
7067                }
7068            }
7069
7070            /// Represents a row in a table.
7071            #[derive(Clone, Default, PartialEq)]
7072            #[non_exhaustive]
7073            pub struct LayoutTableRow {
7074                /// A table row is a list of table cells.
7075                pub cells: std::vec::Vec<
7076                    crate::model::document::document_layout::document_layout_block::LayoutTableCell,
7077                >,
7078
7079                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7080            }
7081
7082            impl LayoutTableRow {
7083                pub fn new() -> Self {
7084                    std::default::Default::default()
7085                }
7086
7087                /// Sets the value of [cells][crate::model::document::document_layout::document_layout_block::LayoutTableRow::cells].
7088                ///
7089                /// # Example
7090                /// ```ignore,no_run
7091                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableRow;
7092                /// use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableCell;
7093                /// let x = LayoutTableRow::new()
7094                ///     .set_cells([
7095                ///         LayoutTableCell::default()/* use setters */,
7096                ///         LayoutTableCell::default()/* use (different) setters */,
7097                ///     ]);
7098                /// ```
7099                pub fn set_cells<T, V>(mut self, v: T) -> Self
7100                where
7101                    T: std::iter::IntoIterator<Item = V>,
7102                    V: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutTableCell>
7103                {
7104                    use std::iter::Iterator;
7105                    self.cells = v.into_iter().map(|i| i.into()).collect();
7106                    self
7107                }
7108            }
7109
7110            impl wkt::message::Message for LayoutTableRow {
7111                fn typename() -> &'static str {
7112                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow"
7113                }
7114            }
7115
7116            /// Represents a cell in a table row.
7117            #[derive(Clone, Default, PartialEq)]
7118            #[non_exhaustive]
7119            pub struct LayoutTableCell {
7120                /// A table cell is a list of blocks.
7121                /// Repeated blocks support further hierarchies and nested blocks.
7122                pub blocks:
7123                    std::vec::Vec<crate::model::document::document_layout::DocumentLayoutBlock>,
7124
7125                /// How many rows this cell spans.
7126                pub row_span: i32,
7127
7128                /// How many columns this cell spans.
7129                pub col_span: i32,
7130
7131                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7132            }
7133
7134            impl LayoutTableCell {
7135                pub fn new() -> Self {
7136                    std::default::Default::default()
7137                }
7138
7139                /// Sets the value of [blocks][crate::model::document::document_layout::document_layout_block::LayoutTableCell::blocks].
7140                ///
7141                /// # Example
7142                /// ```ignore,no_run
7143                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableCell;
7144                /// use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
7145                /// let x = LayoutTableCell::new()
7146                ///     .set_blocks([
7147                ///         DocumentLayoutBlock::default()/* use setters */,
7148                ///         DocumentLayoutBlock::default()/* use (different) setters */,
7149                ///     ]);
7150                /// ```
7151                pub fn set_blocks<T, V>(mut self, v: T) -> Self
7152                where
7153                    T: std::iter::IntoIterator<Item = V>,
7154                    V: std::convert::Into<
7155                            crate::model::document::document_layout::DocumentLayoutBlock,
7156                        >,
7157                {
7158                    use std::iter::Iterator;
7159                    self.blocks = v.into_iter().map(|i| i.into()).collect();
7160                    self
7161                }
7162
7163                /// Sets the value of [row_span][crate::model::document::document_layout::document_layout_block::LayoutTableCell::row_span].
7164                ///
7165                /// # Example
7166                /// ```ignore,no_run
7167                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableCell;
7168                /// let x = LayoutTableCell::new().set_row_span(42);
7169                /// ```
7170                pub fn set_row_span<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7171                    self.row_span = v.into();
7172                    self
7173                }
7174
7175                /// Sets the value of [col_span][crate::model::document::document_layout::document_layout_block::LayoutTableCell::col_span].
7176                ///
7177                /// # Example
7178                /// ```ignore,no_run
7179                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableCell;
7180                /// let x = LayoutTableCell::new().set_col_span(42);
7181                /// ```
7182                pub fn set_col_span<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7183                    self.col_span = v.into();
7184                    self
7185                }
7186            }
7187
7188            impl wkt::message::Message for LayoutTableCell {
7189                fn typename() -> &'static str {
7190                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell"
7191                }
7192            }
7193
7194            /// Represents a list type block.
7195            #[derive(Clone, Default, PartialEq)]
7196            #[non_exhaustive]
7197            pub struct LayoutListBlock {
7198                /// List entries that constitute a list block.
7199                pub list_entries: std::vec::Vec<
7200                    crate::model::document::document_layout::document_layout_block::LayoutListEntry,
7201                >,
7202
7203                /// Type of the list_entries (if exist). Available options are `ordered`
7204                /// and `unordered`.
7205                pub r#type: std::string::String,
7206
7207                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7208            }
7209
7210            impl LayoutListBlock {
7211                pub fn new() -> Self {
7212                    std::default::Default::default()
7213                }
7214
7215                /// Sets the value of [list_entries][crate::model::document::document_layout::document_layout_block::LayoutListBlock::list_entries].
7216                ///
7217                /// # Example
7218                /// ```ignore,no_run
7219                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutListBlock;
7220                /// use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutListEntry;
7221                /// let x = LayoutListBlock::new()
7222                ///     .set_list_entries([
7223                ///         LayoutListEntry::default()/* use setters */,
7224                ///         LayoutListEntry::default()/* use (different) setters */,
7225                ///     ]);
7226                /// ```
7227                pub fn set_list_entries<T, V>(mut self, v: T) -> Self
7228                where
7229                    T: std::iter::IntoIterator<Item = V>,
7230                    V: std::convert::Into<crate::model::document::document_layout::document_layout_block::LayoutListEntry>
7231                {
7232                    use std::iter::Iterator;
7233                    self.list_entries = v.into_iter().map(|i| i.into()).collect();
7234                    self
7235                }
7236
7237                /// Sets the value of [r#type][crate::model::document::document_layout::document_layout_block::LayoutListBlock::type].
7238                ///
7239                /// # Example
7240                /// ```ignore,no_run
7241                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutListBlock;
7242                /// let x = LayoutListBlock::new().set_type("example");
7243                /// ```
7244                pub fn set_type<T: std::convert::Into<std::string::String>>(
7245                    mut self,
7246                    v: T,
7247                ) -> Self {
7248                    self.r#type = v.into();
7249                    self
7250                }
7251            }
7252
7253            impl wkt::message::Message for LayoutListBlock {
7254                fn typename() -> &'static str {
7255                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock"
7256                }
7257            }
7258
7259            /// Represents an entry in the list.
7260            #[derive(Clone, Default, PartialEq)]
7261            #[non_exhaustive]
7262            pub struct LayoutListEntry {
7263                /// A list entry is a list of blocks.
7264                /// Repeated blocks support further hierarchies and nested blocks.
7265                pub blocks:
7266                    std::vec::Vec<crate::model::document::document_layout::DocumentLayoutBlock>,
7267
7268                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7269            }
7270
7271            impl LayoutListEntry {
7272                pub fn new() -> Self {
7273                    std::default::Default::default()
7274                }
7275
7276                /// Sets the value of [blocks][crate::model::document::document_layout::document_layout_block::LayoutListEntry::blocks].
7277                ///
7278                /// # Example
7279                /// ```ignore,no_run
7280                /// # use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutListEntry;
7281                /// use google_cloud_documentai_v1::model::document::document_layout::DocumentLayoutBlock;
7282                /// let x = LayoutListEntry::new()
7283                ///     .set_blocks([
7284                ///         DocumentLayoutBlock::default()/* use setters */,
7285                ///         DocumentLayoutBlock::default()/* use (different) setters */,
7286                ///     ]);
7287                /// ```
7288                pub fn set_blocks<T, V>(mut self, v: T) -> Self
7289                where
7290                    T: std::iter::IntoIterator<Item = V>,
7291                    V: std::convert::Into<
7292                            crate::model::document::document_layout::DocumentLayoutBlock,
7293                        >,
7294                {
7295                    use std::iter::Iterator;
7296                    self.blocks = v.into_iter().map(|i| i.into()).collect();
7297                    self
7298                }
7299            }
7300
7301            impl wkt::message::Message for LayoutListEntry {
7302                fn typename() -> &'static str {
7303                    "type.googleapis.com/google.cloud.documentai.v1.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry"
7304                }
7305            }
7306
7307            #[derive(Clone, Debug, PartialEq)]
7308            #[non_exhaustive]
7309            pub enum Block {
7310                /// Block consisting of text content.
7311                TextBlock(std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutTextBlock>),
7312                /// Block consisting of table content/structure.
7313                TableBlock(std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutTableBlock>),
7314                /// Block consisting of list content/structure.
7315                ListBlock(std::boxed::Box<crate::model::document::document_layout::document_layout_block::LayoutListBlock>),
7316            }
7317        }
7318    }
7319
7320    /// Represents the chunks that the document is divided into.
7321    #[derive(Clone, Default, PartialEq)]
7322    #[non_exhaustive]
7323    pub struct ChunkedDocument {
7324        /// List of chunks.
7325        pub chunks: std::vec::Vec<crate::model::document::chunked_document::Chunk>,
7326
7327        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7328    }
7329
7330    impl ChunkedDocument {
7331        pub fn new() -> Self {
7332            std::default::Default::default()
7333        }
7334
7335        /// Sets the value of [chunks][crate::model::document::ChunkedDocument::chunks].
7336        ///
7337        /// # Example
7338        /// ```ignore,no_run
7339        /// # use google_cloud_documentai_v1::model::document::ChunkedDocument;
7340        /// use google_cloud_documentai_v1::model::document::chunked_document::Chunk;
7341        /// let x = ChunkedDocument::new()
7342        ///     .set_chunks([
7343        ///         Chunk::default()/* use setters */,
7344        ///         Chunk::default()/* use (different) setters */,
7345        ///     ]);
7346        /// ```
7347        pub fn set_chunks<T, V>(mut self, v: T) -> Self
7348        where
7349            T: std::iter::IntoIterator<Item = V>,
7350            V: std::convert::Into<crate::model::document::chunked_document::Chunk>,
7351        {
7352            use std::iter::Iterator;
7353            self.chunks = v.into_iter().map(|i| i.into()).collect();
7354            self
7355        }
7356    }
7357
7358    impl wkt::message::Message for ChunkedDocument {
7359        fn typename() -> &'static str {
7360            "type.googleapis.com/google.cloud.documentai.v1.Document.ChunkedDocument"
7361        }
7362    }
7363
7364    /// Defines additional types related to [ChunkedDocument].
7365    pub mod chunked_document {
7366        #[allow(unused_imports)]
7367        use super::*;
7368
7369        /// Represents a chunk.
7370        #[derive(Clone, Default, PartialEq)]
7371        #[non_exhaustive]
7372        pub struct Chunk {
7373            /// ID of the chunk.
7374            pub chunk_id: std::string::String,
7375
7376            /// Unused.
7377            pub source_block_ids: std::vec::Vec<std::string::String>,
7378
7379            /// Text content of the chunk.
7380            pub content: std::string::String,
7381
7382            /// Page span of the chunk.
7383            pub page_span:
7384                std::option::Option<crate::model::document::chunked_document::chunk::ChunkPageSpan>,
7385
7386            /// Page headers associated with the chunk.
7387            pub page_headers:
7388                std::vec::Vec<crate::model::document::chunked_document::chunk::ChunkPageHeader>,
7389
7390            /// Page footers associated with the chunk.
7391            pub page_footers:
7392                std::vec::Vec<crate::model::document::chunked_document::chunk::ChunkPageFooter>,
7393
7394            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7395        }
7396
7397        impl Chunk {
7398            pub fn new() -> Self {
7399                std::default::Default::default()
7400            }
7401
7402            /// Sets the value of [chunk_id][crate::model::document::chunked_document::Chunk::chunk_id].
7403            ///
7404            /// # Example
7405            /// ```ignore,no_run
7406            /// # use google_cloud_documentai_v1::model::document::chunked_document::Chunk;
7407            /// let x = Chunk::new().set_chunk_id("example");
7408            /// ```
7409            pub fn set_chunk_id<T: std::convert::Into<std::string::String>>(
7410                mut self,
7411                v: T,
7412            ) -> Self {
7413                self.chunk_id = v.into();
7414                self
7415            }
7416
7417            /// Sets the value of [source_block_ids][crate::model::document::chunked_document::Chunk::source_block_ids].
7418            ///
7419            /// # Example
7420            /// ```ignore,no_run
7421            /// # use google_cloud_documentai_v1::model::document::chunked_document::Chunk;
7422            /// let x = Chunk::new().set_source_block_ids(["a", "b", "c"]);
7423            /// ```
7424            pub fn set_source_block_ids<T, V>(mut self, v: T) -> Self
7425            where
7426                T: std::iter::IntoIterator<Item = V>,
7427                V: std::convert::Into<std::string::String>,
7428            {
7429                use std::iter::Iterator;
7430                self.source_block_ids = v.into_iter().map(|i| i.into()).collect();
7431                self
7432            }
7433
7434            /// Sets the value of [content][crate::model::document::chunked_document::Chunk::content].
7435            ///
7436            /// # Example
7437            /// ```ignore,no_run
7438            /// # use google_cloud_documentai_v1::model::document::chunked_document::Chunk;
7439            /// let x = Chunk::new().set_content("example");
7440            /// ```
7441            pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7442                self.content = v.into();
7443                self
7444            }
7445
7446            /// Sets the value of [page_span][crate::model::document::chunked_document::Chunk::page_span].
7447            ///
7448            /// # Example
7449            /// ```ignore,no_run
7450            /// # use google_cloud_documentai_v1::model::document::chunked_document::Chunk;
7451            /// use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageSpan;
7452            /// let x = Chunk::new().set_page_span(ChunkPageSpan::default()/* use setters */);
7453            /// ```
7454            pub fn set_page_span<T>(mut self, v: T) -> Self
7455            where
7456                T: std::convert::Into<
7457                        crate::model::document::chunked_document::chunk::ChunkPageSpan,
7458                    >,
7459            {
7460                self.page_span = std::option::Option::Some(v.into());
7461                self
7462            }
7463
7464            /// Sets or clears the value of [page_span][crate::model::document::chunked_document::Chunk::page_span].
7465            ///
7466            /// # Example
7467            /// ```ignore,no_run
7468            /// # use google_cloud_documentai_v1::model::document::chunked_document::Chunk;
7469            /// use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageSpan;
7470            /// let x = Chunk::new().set_or_clear_page_span(Some(ChunkPageSpan::default()/* use setters */));
7471            /// let x = Chunk::new().set_or_clear_page_span(None::<ChunkPageSpan>);
7472            /// ```
7473            pub fn set_or_clear_page_span<T>(mut self, v: std::option::Option<T>) -> Self
7474            where
7475                T: std::convert::Into<
7476                        crate::model::document::chunked_document::chunk::ChunkPageSpan,
7477                    >,
7478            {
7479                self.page_span = v.map(|x| x.into());
7480                self
7481            }
7482
7483            /// Sets the value of [page_headers][crate::model::document::chunked_document::Chunk::page_headers].
7484            ///
7485            /// # Example
7486            /// ```ignore,no_run
7487            /// # use google_cloud_documentai_v1::model::document::chunked_document::Chunk;
7488            /// use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageHeader;
7489            /// let x = Chunk::new()
7490            ///     .set_page_headers([
7491            ///         ChunkPageHeader::default()/* use setters */,
7492            ///         ChunkPageHeader::default()/* use (different) setters */,
7493            ///     ]);
7494            /// ```
7495            pub fn set_page_headers<T, V>(mut self, v: T) -> Self
7496            where
7497                T: std::iter::IntoIterator<Item = V>,
7498                V: std::convert::Into<
7499                        crate::model::document::chunked_document::chunk::ChunkPageHeader,
7500                    >,
7501            {
7502                use std::iter::Iterator;
7503                self.page_headers = v.into_iter().map(|i| i.into()).collect();
7504                self
7505            }
7506
7507            /// Sets the value of [page_footers][crate::model::document::chunked_document::Chunk::page_footers].
7508            ///
7509            /// # Example
7510            /// ```ignore,no_run
7511            /// # use google_cloud_documentai_v1::model::document::chunked_document::Chunk;
7512            /// use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageFooter;
7513            /// let x = Chunk::new()
7514            ///     .set_page_footers([
7515            ///         ChunkPageFooter::default()/* use setters */,
7516            ///         ChunkPageFooter::default()/* use (different) setters */,
7517            ///     ]);
7518            /// ```
7519            pub fn set_page_footers<T, V>(mut self, v: T) -> Self
7520            where
7521                T: std::iter::IntoIterator<Item = V>,
7522                V: std::convert::Into<
7523                        crate::model::document::chunked_document::chunk::ChunkPageFooter,
7524                    >,
7525            {
7526                use std::iter::Iterator;
7527                self.page_footers = v.into_iter().map(|i| i.into()).collect();
7528                self
7529            }
7530        }
7531
7532        impl wkt::message::Message for Chunk {
7533            fn typename() -> &'static str {
7534                "type.googleapis.com/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk"
7535            }
7536        }
7537
7538        /// Defines additional types related to [Chunk].
7539        pub mod chunk {
7540            #[allow(unused_imports)]
7541            use super::*;
7542
7543            /// Represents where the chunk starts and ends in the document.
7544            #[derive(Clone, Default, PartialEq)]
7545            #[non_exhaustive]
7546            pub struct ChunkPageSpan {
7547                /// Page where chunk starts in the document.
7548                pub page_start: i32,
7549
7550                /// Page where chunk ends in the document.
7551                pub page_end: i32,
7552
7553                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7554            }
7555
7556            impl ChunkPageSpan {
7557                pub fn new() -> Self {
7558                    std::default::Default::default()
7559                }
7560
7561                /// Sets the value of [page_start][crate::model::document::chunked_document::chunk::ChunkPageSpan::page_start].
7562                ///
7563                /// # Example
7564                /// ```ignore,no_run
7565                /// # use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageSpan;
7566                /// let x = ChunkPageSpan::new().set_page_start(42);
7567                /// ```
7568                pub fn set_page_start<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7569                    self.page_start = v.into();
7570                    self
7571                }
7572
7573                /// Sets the value of [page_end][crate::model::document::chunked_document::chunk::ChunkPageSpan::page_end].
7574                ///
7575                /// # Example
7576                /// ```ignore,no_run
7577                /// # use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageSpan;
7578                /// let x = ChunkPageSpan::new().set_page_end(42);
7579                /// ```
7580                pub fn set_page_end<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7581                    self.page_end = v.into();
7582                    self
7583                }
7584            }
7585
7586            impl wkt::message::Message for ChunkPageSpan {
7587                fn typename() -> &'static str {
7588                    "type.googleapis.com/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageSpan"
7589                }
7590            }
7591
7592            /// Represents the page header associated with the chunk.
7593            #[derive(Clone, Default, PartialEq)]
7594            #[non_exhaustive]
7595            pub struct ChunkPageHeader {
7596                /// Header in text format.
7597                pub text: std::string::String,
7598
7599                /// Page span of the header.
7600                pub page_span: std::option::Option<
7601                    crate::model::document::chunked_document::chunk::ChunkPageSpan,
7602                >,
7603
7604                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7605            }
7606
7607            impl ChunkPageHeader {
7608                pub fn new() -> Self {
7609                    std::default::Default::default()
7610                }
7611
7612                /// Sets the value of [text][crate::model::document::chunked_document::chunk::ChunkPageHeader::text].
7613                ///
7614                /// # Example
7615                /// ```ignore,no_run
7616                /// # use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageHeader;
7617                /// let x = ChunkPageHeader::new().set_text("example");
7618                /// ```
7619                pub fn set_text<T: std::convert::Into<std::string::String>>(
7620                    mut self,
7621                    v: T,
7622                ) -> Self {
7623                    self.text = v.into();
7624                    self
7625                }
7626
7627                /// Sets the value of [page_span][crate::model::document::chunked_document::chunk::ChunkPageHeader::page_span].
7628                ///
7629                /// # Example
7630                /// ```ignore,no_run
7631                /// # use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageHeader;
7632                /// use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageSpan;
7633                /// let x = ChunkPageHeader::new().set_page_span(ChunkPageSpan::default()/* use setters */);
7634                /// ```
7635                pub fn set_page_span<T>(mut self, v: T) -> Self
7636                where
7637                    T: std::convert::Into<
7638                            crate::model::document::chunked_document::chunk::ChunkPageSpan,
7639                        >,
7640                {
7641                    self.page_span = std::option::Option::Some(v.into());
7642                    self
7643                }
7644
7645                /// Sets or clears the value of [page_span][crate::model::document::chunked_document::chunk::ChunkPageHeader::page_span].
7646                ///
7647                /// # Example
7648                /// ```ignore,no_run
7649                /// # use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageHeader;
7650                /// use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageSpan;
7651                /// let x = ChunkPageHeader::new().set_or_clear_page_span(Some(ChunkPageSpan::default()/* use setters */));
7652                /// let x = ChunkPageHeader::new().set_or_clear_page_span(None::<ChunkPageSpan>);
7653                /// ```
7654                pub fn set_or_clear_page_span<T>(mut self, v: std::option::Option<T>) -> Self
7655                where
7656                    T: std::convert::Into<
7657                            crate::model::document::chunked_document::chunk::ChunkPageSpan,
7658                        >,
7659                {
7660                    self.page_span = v.map(|x| x.into());
7661                    self
7662                }
7663            }
7664
7665            impl wkt::message::Message for ChunkPageHeader {
7666                fn typename() -> &'static str {
7667                    "type.googleapis.com/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageHeader"
7668                }
7669            }
7670
7671            /// Represents the page footer associated with the chunk.
7672            #[derive(Clone, Default, PartialEq)]
7673            #[non_exhaustive]
7674            pub struct ChunkPageFooter {
7675                /// Footer in text format.
7676                pub text: std::string::String,
7677
7678                /// Page span of the footer.
7679                pub page_span: std::option::Option<
7680                    crate::model::document::chunked_document::chunk::ChunkPageSpan,
7681                >,
7682
7683                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7684            }
7685
7686            impl ChunkPageFooter {
7687                pub fn new() -> Self {
7688                    std::default::Default::default()
7689                }
7690
7691                /// Sets the value of [text][crate::model::document::chunked_document::chunk::ChunkPageFooter::text].
7692                ///
7693                /// # Example
7694                /// ```ignore,no_run
7695                /// # use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageFooter;
7696                /// let x = ChunkPageFooter::new().set_text("example");
7697                /// ```
7698                pub fn set_text<T: std::convert::Into<std::string::String>>(
7699                    mut self,
7700                    v: T,
7701                ) -> Self {
7702                    self.text = v.into();
7703                    self
7704                }
7705
7706                /// Sets the value of [page_span][crate::model::document::chunked_document::chunk::ChunkPageFooter::page_span].
7707                ///
7708                /// # Example
7709                /// ```ignore,no_run
7710                /// # use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageFooter;
7711                /// use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageSpan;
7712                /// let x = ChunkPageFooter::new().set_page_span(ChunkPageSpan::default()/* use setters */);
7713                /// ```
7714                pub fn set_page_span<T>(mut self, v: T) -> Self
7715                where
7716                    T: std::convert::Into<
7717                            crate::model::document::chunked_document::chunk::ChunkPageSpan,
7718                        >,
7719                {
7720                    self.page_span = std::option::Option::Some(v.into());
7721                    self
7722                }
7723
7724                /// Sets or clears the value of [page_span][crate::model::document::chunked_document::chunk::ChunkPageFooter::page_span].
7725                ///
7726                /// # Example
7727                /// ```ignore,no_run
7728                /// # use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageFooter;
7729                /// use google_cloud_documentai_v1::model::document::chunked_document::chunk::ChunkPageSpan;
7730                /// let x = ChunkPageFooter::new().set_or_clear_page_span(Some(ChunkPageSpan::default()/* use setters */));
7731                /// let x = ChunkPageFooter::new().set_or_clear_page_span(None::<ChunkPageSpan>);
7732                /// ```
7733                pub fn set_or_clear_page_span<T>(mut self, v: std::option::Option<T>) -> Self
7734                where
7735                    T: std::convert::Into<
7736                            crate::model::document::chunked_document::chunk::ChunkPageSpan,
7737                        >,
7738                {
7739                    self.page_span = v.map(|x| x.into());
7740                    self
7741                }
7742            }
7743
7744            impl wkt::message::Message for ChunkPageFooter {
7745                fn typename() -> &'static str {
7746                    "type.googleapis.com/google.cloud.documentai.v1.Document.ChunkedDocument.Chunk.ChunkPageFooter"
7747                }
7748            }
7749        }
7750    }
7751
7752    /// The output of the validation given the document and the validation rules.
7753    #[derive(Clone, Default, PartialEq)]
7754    #[non_exhaustive]
7755    pub struct EntityValidationOutput {
7756        /// The result of each validation rule.
7757        pub validation_results:
7758            std::vec::Vec<crate::model::document::entity_validation_output::ValidationResult>,
7759
7760        /// The overall result of the validation, true if all applicable rules are
7761        /// valid.
7762        pub pass_all_rules: bool,
7763
7764        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7765    }
7766
7767    impl EntityValidationOutput {
7768        pub fn new() -> Self {
7769            std::default::Default::default()
7770        }
7771
7772        /// Sets the value of [validation_results][crate::model::document::EntityValidationOutput::validation_results].
7773        ///
7774        /// # Example
7775        /// ```ignore,no_run
7776        /// # use google_cloud_documentai_v1::model::document::EntityValidationOutput;
7777        /// use google_cloud_documentai_v1::model::document::entity_validation_output::ValidationResult;
7778        /// let x = EntityValidationOutput::new()
7779        ///     .set_validation_results([
7780        ///         ValidationResult::default()/* use setters */,
7781        ///         ValidationResult::default()/* use (different) setters */,
7782        ///     ]);
7783        /// ```
7784        pub fn set_validation_results<T, V>(mut self, v: T) -> Self
7785        where
7786            T: std::iter::IntoIterator<Item = V>,
7787            V: std::convert::Into<
7788                    crate::model::document::entity_validation_output::ValidationResult,
7789                >,
7790        {
7791            use std::iter::Iterator;
7792            self.validation_results = v.into_iter().map(|i| i.into()).collect();
7793            self
7794        }
7795
7796        /// Sets the value of [pass_all_rules][crate::model::document::EntityValidationOutput::pass_all_rules].
7797        ///
7798        /// # Example
7799        /// ```ignore,no_run
7800        /// # use google_cloud_documentai_v1::model::document::EntityValidationOutput;
7801        /// let x = EntityValidationOutput::new().set_pass_all_rules(true);
7802        /// ```
7803        pub fn set_pass_all_rules<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7804            self.pass_all_rules = v.into();
7805            self
7806        }
7807    }
7808
7809    impl wkt::message::Message for EntityValidationOutput {
7810        fn typename() -> &'static str {
7811            "type.googleapis.com/google.cloud.documentai.v1.Document.EntityValidationOutput"
7812        }
7813    }
7814
7815    /// Defines additional types related to [EntityValidationOutput].
7816    pub mod entity_validation_output {
7817        #[allow(unused_imports)]
7818        use super::*;
7819
7820        /// Validation result for a single validation rule.
7821        #[derive(Clone, Default, PartialEq)]
7822        #[non_exhaustive]
7823        pub struct ValidationResult {
7824
7825            /// The name of the validation rule.
7826            pub rule_name: std::string::String,
7827
7828            /// The description of the validation rule.
7829            pub rule_description: std::string::String,
7830
7831            /// The result of the validation rule.
7832            pub validation_result_type: crate::model::document::entity_validation_output::validation_result::ValidationResultType,
7833
7834            /// The detailed information of the running the validation process using
7835            /// the entity from the document based on the validation rule.
7836            pub validation_details: std::string::String,
7837
7838            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7839        }
7840
7841        impl ValidationResult {
7842            pub fn new() -> Self {
7843                std::default::Default::default()
7844            }
7845
7846            /// Sets the value of [rule_name][crate::model::document::entity_validation_output::ValidationResult::rule_name].
7847            ///
7848            /// # Example
7849            /// ```ignore,no_run
7850            /// # use google_cloud_documentai_v1::model::document::entity_validation_output::ValidationResult;
7851            /// let x = ValidationResult::new().set_rule_name("example");
7852            /// ```
7853            pub fn set_rule_name<T: std::convert::Into<std::string::String>>(
7854                mut self,
7855                v: T,
7856            ) -> Self {
7857                self.rule_name = v.into();
7858                self
7859            }
7860
7861            /// Sets the value of [rule_description][crate::model::document::entity_validation_output::ValidationResult::rule_description].
7862            ///
7863            /// # Example
7864            /// ```ignore,no_run
7865            /// # use google_cloud_documentai_v1::model::document::entity_validation_output::ValidationResult;
7866            /// let x = ValidationResult::new().set_rule_description("example");
7867            /// ```
7868            pub fn set_rule_description<T: std::convert::Into<std::string::String>>(
7869                mut self,
7870                v: T,
7871            ) -> Self {
7872                self.rule_description = v.into();
7873                self
7874            }
7875
7876            /// Sets the value of [validation_result_type][crate::model::document::entity_validation_output::ValidationResult::validation_result_type].
7877            ///
7878            /// # Example
7879            /// ```ignore,no_run
7880            /// # use google_cloud_documentai_v1::model::document::entity_validation_output::ValidationResult;
7881            /// use google_cloud_documentai_v1::model::document::entity_validation_output::validation_result::ValidationResultType;
7882            /// let x0 = ValidationResult::new().set_validation_result_type(ValidationResultType::Valid);
7883            /// let x1 = ValidationResult::new().set_validation_result_type(ValidationResultType::Invalid);
7884            /// let x2 = ValidationResult::new().set_validation_result_type(ValidationResultType::Skipped);
7885            /// ```
7886            pub fn set_validation_result_type<T: std::convert::Into<crate::model::document::entity_validation_output::validation_result::ValidationResultType>>(mut self, v: T) -> Self{
7887                self.validation_result_type = v.into();
7888                self
7889            }
7890
7891            /// Sets the value of [validation_details][crate::model::document::entity_validation_output::ValidationResult::validation_details].
7892            ///
7893            /// # Example
7894            /// ```ignore,no_run
7895            /// # use google_cloud_documentai_v1::model::document::entity_validation_output::ValidationResult;
7896            /// let x = ValidationResult::new().set_validation_details("example");
7897            /// ```
7898            pub fn set_validation_details<T: std::convert::Into<std::string::String>>(
7899                mut self,
7900                v: T,
7901            ) -> Self {
7902                self.validation_details = v.into();
7903                self
7904            }
7905        }
7906
7907        impl wkt::message::Message for ValidationResult {
7908            fn typename() -> &'static str {
7909                "type.googleapis.com/google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult"
7910            }
7911        }
7912
7913        /// Defines additional types related to [ValidationResult].
7914        pub mod validation_result {
7915            #[allow(unused_imports)]
7916            use super::*;
7917
7918            /// The result of the validation rule.
7919            ///
7920            /// # Working with unknown values
7921            ///
7922            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7923            /// additional enum variants at any time. Adding new variants is not considered
7924            /// a breaking change. Applications should write their code in anticipation of:
7925            ///
7926            /// - New values appearing in future releases of the client library, **and**
7927            /// - New values received dynamically, without application changes.
7928            ///
7929            /// Please consult the [Working with enums] section in the user guide for some
7930            /// guidelines.
7931            ///
7932            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7933            #[derive(Clone, Debug, PartialEq)]
7934            #[non_exhaustive]
7935            pub enum ValidationResultType {
7936                /// The validation result type is unspecified.
7937                Unspecified,
7938                /// The validation is valid.
7939                Valid,
7940                /// The validation is invalid.
7941                Invalid,
7942                /// The validation is skipped.
7943                Skipped,
7944                /// The validation is not applicable.
7945                NotApplicable,
7946                /// If set, the enum was initialized with an unknown value.
7947                ///
7948                /// Applications can examine the value using [ValidationResultType::value] or
7949                /// [ValidationResultType::name].
7950                UnknownValue(validation_result_type::UnknownValue),
7951            }
7952
7953            #[doc(hidden)]
7954            pub mod validation_result_type {
7955                #[allow(unused_imports)]
7956                use super::*;
7957                #[derive(Clone, Debug, PartialEq)]
7958                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7959            }
7960
7961            impl ValidationResultType {
7962                /// Gets the enum value.
7963                ///
7964                /// Returns `None` if the enum contains an unknown value deserialized from
7965                /// the string representation of enums.
7966                pub fn value(&self) -> std::option::Option<i32> {
7967                    match self {
7968                        Self::Unspecified => std::option::Option::Some(0),
7969                        Self::Valid => std::option::Option::Some(1),
7970                        Self::Invalid => std::option::Option::Some(2),
7971                        Self::Skipped => std::option::Option::Some(3),
7972                        Self::NotApplicable => std::option::Option::Some(4),
7973                        Self::UnknownValue(u) => u.0.value(),
7974                    }
7975                }
7976
7977                /// Gets the enum value as a string.
7978                ///
7979                /// Returns `None` if the enum contains an unknown value deserialized from
7980                /// the integer representation of enums.
7981                pub fn name(&self) -> std::option::Option<&str> {
7982                    match self {
7983                        Self::Unspecified => {
7984                            std::option::Option::Some("VALIDATION_RESULT_TYPE_UNSPECIFIED")
7985                        }
7986                        Self::Valid => std::option::Option::Some("VALIDATION_RESULT_TYPE_VALID"),
7987                        Self::Invalid => {
7988                            std::option::Option::Some("VALIDATION_RESULT_TYPE_INVALID")
7989                        }
7990                        Self::Skipped => {
7991                            std::option::Option::Some("VALIDATION_RESULT_TYPE_SKIPPED")
7992                        }
7993                        Self::NotApplicable => {
7994                            std::option::Option::Some("VALIDATION_RESULT_TYPE_NOT_APPLICABLE")
7995                        }
7996                        Self::UnknownValue(u) => u.0.name(),
7997                    }
7998                }
7999            }
8000
8001            impl std::default::Default for ValidationResultType {
8002                fn default() -> Self {
8003                    use std::convert::From;
8004                    Self::from(0)
8005                }
8006            }
8007
8008            impl std::fmt::Display for ValidationResultType {
8009                fn fmt(
8010                    &self,
8011                    f: &mut std::fmt::Formatter<'_>,
8012                ) -> std::result::Result<(), std::fmt::Error> {
8013                    wkt::internal::display_enum(f, self.name(), self.value())
8014                }
8015            }
8016
8017            impl std::convert::From<i32> for ValidationResultType {
8018                fn from(value: i32) -> Self {
8019                    match value {
8020                        0 => Self::Unspecified,
8021                        1 => Self::Valid,
8022                        2 => Self::Invalid,
8023                        3 => Self::Skipped,
8024                        4 => Self::NotApplicable,
8025                        _ => Self::UnknownValue(validation_result_type::UnknownValue(
8026                            wkt::internal::UnknownEnumValue::Integer(value),
8027                        )),
8028                    }
8029                }
8030            }
8031
8032            impl std::convert::From<&str> for ValidationResultType {
8033                fn from(value: &str) -> Self {
8034                    use std::string::ToString;
8035                    match value {
8036                        "VALIDATION_RESULT_TYPE_UNSPECIFIED" => Self::Unspecified,
8037                        "VALIDATION_RESULT_TYPE_VALID" => Self::Valid,
8038                        "VALIDATION_RESULT_TYPE_INVALID" => Self::Invalid,
8039                        "VALIDATION_RESULT_TYPE_SKIPPED" => Self::Skipped,
8040                        "VALIDATION_RESULT_TYPE_NOT_APPLICABLE" => Self::NotApplicable,
8041                        _ => Self::UnknownValue(validation_result_type::UnknownValue(
8042                            wkt::internal::UnknownEnumValue::String(value.to_string()),
8043                        )),
8044                    }
8045                }
8046            }
8047
8048            impl serde::ser::Serialize for ValidationResultType {
8049                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8050                where
8051                    S: serde::Serializer,
8052                {
8053                    match self {
8054                        Self::Unspecified => serializer.serialize_i32(0),
8055                        Self::Valid => serializer.serialize_i32(1),
8056                        Self::Invalid => serializer.serialize_i32(2),
8057                        Self::Skipped => serializer.serialize_i32(3),
8058                        Self::NotApplicable => serializer.serialize_i32(4),
8059                        Self::UnknownValue(u) => u.0.serialize(serializer),
8060                    }
8061                }
8062            }
8063
8064            impl<'de> serde::de::Deserialize<'de> for ValidationResultType {
8065                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8066                where
8067                    D: serde::Deserializer<'de>,
8068                {
8069                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValidationResultType>::new(
8070                        ".google.cloud.documentai.v1.Document.EntityValidationOutput.ValidationResult.ValidationResultType"))
8071                }
8072            }
8073        }
8074    }
8075
8076    /// Entity revision.
8077    #[derive(Clone, Default, PartialEq)]
8078    #[non_exhaustive]
8079    pub struct EntitiesRevision {
8080        /// The revision id.
8081        pub revision_id: std::string::String,
8082
8083        /// The entities in this revision.
8084        pub entities: std::vec::Vec<crate::model::document::Entity>,
8085
8086        /// The entity validation output for this revision.
8087        pub entity_validation_output:
8088            std::option::Option<crate::model::document::EntityValidationOutput>,
8089
8090        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8091    }
8092
8093    impl EntitiesRevision {
8094        pub fn new() -> Self {
8095            std::default::Default::default()
8096        }
8097
8098        /// Sets the value of [revision_id][crate::model::document::EntitiesRevision::revision_id].
8099        ///
8100        /// # Example
8101        /// ```ignore,no_run
8102        /// # use google_cloud_documentai_v1::model::document::EntitiesRevision;
8103        /// let x = EntitiesRevision::new().set_revision_id("example");
8104        /// ```
8105        pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8106            self.revision_id = v.into();
8107            self
8108        }
8109
8110        /// Sets the value of [entities][crate::model::document::EntitiesRevision::entities].
8111        ///
8112        /// # Example
8113        /// ```ignore,no_run
8114        /// # use google_cloud_documentai_v1::model::document::EntitiesRevision;
8115        /// use google_cloud_documentai_v1::model::document::Entity;
8116        /// let x = EntitiesRevision::new()
8117        ///     .set_entities([
8118        ///         Entity::default()/* use setters */,
8119        ///         Entity::default()/* use (different) setters */,
8120        ///     ]);
8121        /// ```
8122        pub fn set_entities<T, V>(mut self, v: T) -> Self
8123        where
8124            T: std::iter::IntoIterator<Item = V>,
8125            V: std::convert::Into<crate::model::document::Entity>,
8126        {
8127            use std::iter::Iterator;
8128            self.entities = v.into_iter().map(|i| i.into()).collect();
8129            self
8130        }
8131
8132        /// Sets the value of [entity_validation_output][crate::model::document::EntitiesRevision::entity_validation_output].
8133        ///
8134        /// # Example
8135        /// ```ignore,no_run
8136        /// # use google_cloud_documentai_v1::model::document::EntitiesRevision;
8137        /// use google_cloud_documentai_v1::model::document::EntityValidationOutput;
8138        /// let x = EntitiesRevision::new().set_entity_validation_output(EntityValidationOutput::default()/* use setters */);
8139        /// ```
8140        pub fn set_entity_validation_output<T>(mut self, v: T) -> Self
8141        where
8142            T: std::convert::Into<crate::model::document::EntityValidationOutput>,
8143        {
8144            self.entity_validation_output = std::option::Option::Some(v.into());
8145            self
8146        }
8147
8148        /// Sets or clears the value of [entity_validation_output][crate::model::document::EntitiesRevision::entity_validation_output].
8149        ///
8150        /// # Example
8151        /// ```ignore,no_run
8152        /// # use google_cloud_documentai_v1::model::document::EntitiesRevision;
8153        /// use google_cloud_documentai_v1::model::document::EntityValidationOutput;
8154        /// let x = EntitiesRevision::new().set_or_clear_entity_validation_output(Some(EntityValidationOutput::default()/* use setters */));
8155        /// let x = EntitiesRevision::new().set_or_clear_entity_validation_output(None::<EntityValidationOutput>);
8156        /// ```
8157        pub fn set_or_clear_entity_validation_output<T>(mut self, v: std::option::Option<T>) -> Self
8158        where
8159            T: std::convert::Into<crate::model::document::EntityValidationOutput>,
8160        {
8161            self.entity_validation_output = v.map(|x| x.into());
8162            self
8163        }
8164    }
8165
8166    impl wkt::message::Message for EntitiesRevision {
8167        fn typename() -> &'static str {
8168            "type.googleapis.com/google.cloud.documentai.v1.Document.EntitiesRevision"
8169        }
8170    }
8171
8172    /// Original source document from the user.
8173    #[derive(Clone, Debug, PartialEq)]
8174    #[non_exhaustive]
8175    pub enum Source {
8176        /// Optional. Currently supports Google Cloud Storage URI of the form
8177        /// `gs://bucket_name/object_name`. Object versioning is not supported.
8178        /// For more information, refer to [Google Cloud Storage Request
8179        /// URIs](https://cloud.google.com/storage/docs/reference-uris).
8180        Uri(std::string::String),
8181        /// Optional. Inline document content, represented as a stream of bytes.
8182        /// Note: As with all `bytes` fields, protobuffers use a pure binary
8183        /// representation, whereas JSON representations use base64.
8184        Content(::bytes::Bytes),
8185    }
8186}
8187
8188/// Payload message of raw document content (bytes).
8189#[derive(Clone, Default, PartialEq)]
8190#[non_exhaustive]
8191pub struct RawDocument {
8192    /// Inline document content.
8193    pub content: ::bytes::Bytes,
8194
8195    /// An IANA MIME type (RFC6838) indicating the nature and format of the
8196    /// [content][google.cloud.documentai.v1.RawDocument.content].
8197    ///
8198    /// [google.cloud.documentai.v1.RawDocument.content]: crate::model::RawDocument::content
8199    pub mime_type: std::string::String,
8200
8201    /// The display name of the document, it supports all Unicode characters except
8202    /// the following:
8203    /// `*`, `?`, `[`, `]`, `%`, `{`, `}`,`'`, `\"`, `,`
8204    /// `~`, `=` and `:` are reserved.
8205    /// If not specified, a default ID is generated.
8206    pub display_name: std::string::String,
8207
8208    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8209}
8210
8211impl RawDocument {
8212    pub fn new() -> Self {
8213        std::default::Default::default()
8214    }
8215
8216    /// Sets the value of [content][crate::model::RawDocument::content].
8217    ///
8218    /// # Example
8219    /// ```ignore,no_run
8220    /// # use google_cloud_documentai_v1::model::RawDocument;
8221    /// let x = RawDocument::new().set_content(bytes::Bytes::from_static(b"example"));
8222    /// ```
8223    pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
8224        self.content = v.into();
8225        self
8226    }
8227
8228    /// Sets the value of [mime_type][crate::model::RawDocument::mime_type].
8229    ///
8230    /// # Example
8231    /// ```ignore,no_run
8232    /// # use google_cloud_documentai_v1::model::RawDocument;
8233    /// let x = RawDocument::new().set_mime_type("example");
8234    /// ```
8235    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8236        self.mime_type = v.into();
8237        self
8238    }
8239
8240    /// Sets the value of [display_name][crate::model::RawDocument::display_name].
8241    ///
8242    /// # Example
8243    /// ```ignore,no_run
8244    /// # use google_cloud_documentai_v1::model::RawDocument;
8245    /// let x = RawDocument::new().set_display_name("example");
8246    /// ```
8247    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8248        self.display_name = v.into();
8249        self
8250    }
8251}
8252
8253impl wkt::message::Message for RawDocument {
8254    fn typename() -> &'static str {
8255        "type.googleapis.com/google.cloud.documentai.v1.RawDocument"
8256    }
8257}
8258
8259/// Specifies a document stored on Cloud Storage.
8260#[derive(Clone, Default, PartialEq)]
8261#[non_exhaustive]
8262pub struct GcsDocument {
8263    /// The Cloud Storage object uri.
8264    pub gcs_uri: std::string::String,
8265
8266    /// An IANA MIME type (RFC6838) of the content.
8267    pub mime_type: std::string::String,
8268
8269    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8270}
8271
8272impl GcsDocument {
8273    pub fn new() -> Self {
8274        std::default::Default::default()
8275    }
8276
8277    /// Sets the value of [gcs_uri][crate::model::GcsDocument::gcs_uri].
8278    ///
8279    /// # Example
8280    /// ```ignore,no_run
8281    /// # use google_cloud_documentai_v1::model::GcsDocument;
8282    /// let x = GcsDocument::new().set_gcs_uri("example");
8283    /// ```
8284    pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8285        self.gcs_uri = v.into();
8286        self
8287    }
8288
8289    /// Sets the value of [mime_type][crate::model::GcsDocument::mime_type].
8290    ///
8291    /// # Example
8292    /// ```ignore,no_run
8293    /// # use google_cloud_documentai_v1::model::GcsDocument;
8294    /// let x = GcsDocument::new().set_mime_type("example");
8295    /// ```
8296    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8297        self.mime_type = v.into();
8298        self
8299    }
8300}
8301
8302impl wkt::message::Message for GcsDocument {
8303    fn typename() -> &'static str {
8304        "type.googleapis.com/google.cloud.documentai.v1.GcsDocument"
8305    }
8306}
8307
8308/// Specifies a set of documents on Cloud Storage.
8309#[derive(Clone, Default, PartialEq)]
8310#[non_exhaustive]
8311pub struct GcsDocuments {
8312    /// The list of documents.
8313    pub documents: std::vec::Vec<crate::model::GcsDocument>,
8314
8315    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8316}
8317
8318impl GcsDocuments {
8319    pub fn new() -> Self {
8320        std::default::Default::default()
8321    }
8322
8323    /// Sets the value of [documents][crate::model::GcsDocuments::documents].
8324    ///
8325    /// # Example
8326    /// ```ignore,no_run
8327    /// # use google_cloud_documentai_v1::model::GcsDocuments;
8328    /// use google_cloud_documentai_v1::model::GcsDocument;
8329    /// let x = GcsDocuments::new()
8330    ///     .set_documents([
8331    ///         GcsDocument::default()/* use setters */,
8332    ///         GcsDocument::default()/* use (different) setters */,
8333    ///     ]);
8334    /// ```
8335    pub fn set_documents<T, V>(mut self, v: T) -> Self
8336    where
8337        T: std::iter::IntoIterator<Item = V>,
8338        V: std::convert::Into<crate::model::GcsDocument>,
8339    {
8340        use std::iter::Iterator;
8341        self.documents = v.into_iter().map(|i| i.into()).collect();
8342        self
8343    }
8344}
8345
8346impl wkt::message::Message for GcsDocuments {
8347    fn typename() -> &'static str {
8348        "type.googleapis.com/google.cloud.documentai.v1.GcsDocuments"
8349    }
8350}
8351
8352/// Specifies all documents on Cloud Storage with a common prefix.
8353#[derive(Clone, Default, PartialEq)]
8354#[non_exhaustive]
8355pub struct GcsPrefix {
8356    /// The URI prefix.
8357    pub gcs_uri_prefix: std::string::String,
8358
8359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8360}
8361
8362impl GcsPrefix {
8363    pub fn new() -> Self {
8364        std::default::Default::default()
8365    }
8366
8367    /// Sets the value of [gcs_uri_prefix][crate::model::GcsPrefix::gcs_uri_prefix].
8368    ///
8369    /// # Example
8370    /// ```ignore,no_run
8371    /// # use google_cloud_documentai_v1::model::GcsPrefix;
8372    /// let x = GcsPrefix::new().set_gcs_uri_prefix("example");
8373    /// ```
8374    pub fn set_gcs_uri_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8375        self.gcs_uri_prefix = v.into();
8376        self
8377    }
8378}
8379
8380impl wkt::message::Message for GcsPrefix {
8381    fn typename() -> &'static str {
8382        "type.googleapis.com/google.cloud.documentai.v1.GcsPrefix"
8383    }
8384}
8385
8386/// The common config to specify a set of documents used as input.
8387#[derive(Clone, Default, PartialEq)]
8388#[non_exhaustive]
8389pub struct BatchDocumentsInputConfig {
8390    /// The source. Make sure that the caller of the API has storage.objects.get
8391    /// access to the buckets.
8392    pub source: std::option::Option<crate::model::batch_documents_input_config::Source>,
8393
8394    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8395}
8396
8397impl BatchDocumentsInputConfig {
8398    pub fn new() -> Self {
8399        std::default::Default::default()
8400    }
8401
8402    /// Sets the value of [source][crate::model::BatchDocumentsInputConfig::source].
8403    ///
8404    /// Note that all the setters affecting `source` are mutually
8405    /// exclusive.
8406    ///
8407    /// # Example
8408    /// ```ignore,no_run
8409    /// # use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
8410    /// use google_cloud_documentai_v1::model::GcsPrefix;
8411    /// let x = BatchDocumentsInputConfig::new().set_source(Some(
8412    ///     google_cloud_documentai_v1::model::batch_documents_input_config::Source::GcsPrefix(GcsPrefix::default().into())));
8413    /// ```
8414    pub fn set_source<
8415        T: std::convert::Into<std::option::Option<crate::model::batch_documents_input_config::Source>>,
8416    >(
8417        mut self,
8418        v: T,
8419    ) -> Self {
8420        self.source = v.into();
8421        self
8422    }
8423
8424    /// The value of [source][crate::model::BatchDocumentsInputConfig::source]
8425    /// if it holds a `GcsPrefix`, `None` if the field is not set or
8426    /// holds a different branch.
8427    pub fn gcs_prefix(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsPrefix>> {
8428        #[allow(unreachable_patterns)]
8429        self.source.as_ref().and_then(|v| match v {
8430            crate::model::batch_documents_input_config::Source::GcsPrefix(v) => {
8431                std::option::Option::Some(v)
8432            }
8433            _ => std::option::Option::None,
8434        })
8435    }
8436
8437    /// Sets the value of [source][crate::model::BatchDocumentsInputConfig::source]
8438    /// to hold a `GcsPrefix`.
8439    ///
8440    /// Note that all the setters affecting `source` are
8441    /// mutually exclusive.
8442    ///
8443    /// # Example
8444    /// ```ignore,no_run
8445    /// # use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
8446    /// use google_cloud_documentai_v1::model::GcsPrefix;
8447    /// let x = BatchDocumentsInputConfig::new().set_gcs_prefix(GcsPrefix::default()/* use setters */);
8448    /// assert!(x.gcs_prefix().is_some());
8449    /// assert!(x.gcs_documents().is_none());
8450    /// ```
8451    pub fn set_gcs_prefix<T: std::convert::Into<std::boxed::Box<crate::model::GcsPrefix>>>(
8452        mut self,
8453        v: T,
8454    ) -> Self {
8455        self.source = std::option::Option::Some(
8456            crate::model::batch_documents_input_config::Source::GcsPrefix(v.into()),
8457        );
8458        self
8459    }
8460
8461    /// The value of [source][crate::model::BatchDocumentsInputConfig::source]
8462    /// if it holds a `GcsDocuments`, `None` if the field is not set or
8463    /// holds a different branch.
8464    pub fn gcs_documents(
8465        &self,
8466    ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDocuments>> {
8467        #[allow(unreachable_patterns)]
8468        self.source.as_ref().and_then(|v| match v {
8469            crate::model::batch_documents_input_config::Source::GcsDocuments(v) => {
8470                std::option::Option::Some(v)
8471            }
8472            _ => std::option::Option::None,
8473        })
8474    }
8475
8476    /// Sets the value of [source][crate::model::BatchDocumentsInputConfig::source]
8477    /// to hold a `GcsDocuments`.
8478    ///
8479    /// Note that all the setters affecting `source` are
8480    /// mutually exclusive.
8481    ///
8482    /// # Example
8483    /// ```ignore,no_run
8484    /// # use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
8485    /// use google_cloud_documentai_v1::model::GcsDocuments;
8486    /// let x = BatchDocumentsInputConfig::new().set_gcs_documents(GcsDocuments::default()/* use setters */);
8487    /// assert!(x.gcs_documents().is_some());
8488    /// assert!(x.gcs_prefix().is_none());
8489    /// ```
8490    pub fn set_gcs_documents<T: std::convert::Into<std::boxed::Box<crate::model::GcsDocuments>>>(
8491        mut self,
8492        v: T,
8493    ) -> Self {
8494        self.source = std::option::Option::Some(
8495            crate::model::batch_documents_input_config::Source::GcsDocuments(v.into()),
8496        );
8497        self
8498    }
8499}
8500
8501impl wkt::message::Message for BatchDocumentsInputConfig {
8502    fn typename() -> &'static str {
8503        "type.googleapis.com/google.cloud.documentai.v1.BatchDocumentsInputConfig"
8504    }
8505}
8506
8507/// Defines additional types related to [BatchDocumentsInputConfig].
8508pub mod batch_documents_input_config {
8509    #[allow(unused_imports)]
8510    use super::*;
8511
8512    /// The source. Make sure that the caller of the API has storage.objects.get
8513    /// access to the buckets.
8514    #[derive(Clone, Debug, PartialEq)]
8515    #[non_exhaustive]
8516    pub enum Source {
8517        /// The set of documents that match the specified Cloud Storage `gcs_prefix`.
8518        GcsPrefix(std::boxed::Box<crate::model::GcsPrefix>),
8519        /// The set of documents individually specified on Cloud Storage.
8520        GcsDocuments(std::boxed::Box<crate::model::GcsDocuments>),
8521    }
8522}
8523
8524/// Config that controls the output of documents. All documents will be written
8525/// as a JSON file.
8526#[derive(Clone, Default, PartialEq)]
8527#[non_exhaustive]
8528pub struct DocumentOutputConfig {
8529    /// The destination of the results.
8530    pub destination: std::option::Option<crate::model::document_output_config::Destination>,
8531
8532    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8533}
8534
8535impl DocumentOutputConfig {
8536    pub fn new() -> Self {
8537        std::default::Default::default()
8538    }
8539
8540    /// Sets the value of [destination][crate::model::DocumentOutputConfig::destination].
8541    ///
8542    /// Note that all the setters affecting `destination` are mutually
8543    /// exclusive.
8544    ///
8545    /// # Example
8546    /// ```ignore,no_run
8547    /// # use google_cloud_documentai_v1::model::DocumentOutputConfig;
8548    /// use google_cloud_documentai_v1::model::document_output_config::GcsOutputConfig;
8549    /// let x = DocumentOutputConfig::new().set_destination(Some(
8550    ///     google_cloud_documentai_v1::model::document_output_config::Destination::GcsOutputConfig(GcsOutputConfig::default().into())));
8551    /// ```
8552    pub fn set_destination<
8553        T: std::convert::Into<std::option::Option<crate::model::document_output_config::Destination>>,
8554    >(
8555        mut self,
8556        v: T,
8557    ) -> Self {
8558        self.destination = v.into();
8559        self
8560    }
8561
8562    /// The value of [destination][crate::model::DocumentOutputConfig::destination]
8563    /// if it holds a `GcsOutputConfig`, `None` if the field is not set or
8564    /// holds a different branch.
8565    pub fn gcs_output_config(
8566        &self,
8567    ) -> std::option::Option<&std::boxed::Box<crate::model::document_output_config::GcsOutputConfig>>
8568    {
8569        #[allow(unreachable_patterns)]
8570        self.destination.as_ref().and_then(|v| match v {
8571            crate::model::document_output_config::Destination::GcsOutputConfig(v) => {
8572                std::option::Option::Some(v)
8573            }
8574            _ => std::option::Option::None,
8575        })
8576    }
8577
8578    /// Sets the value of [destination][crate::model::DocumentOutputConfig::destination]
8579    /// to hold a `GcsOutputConfig`.
8580    ///
8581    /// Note that all the setters affecting `destination` are
8582    /// mutually exclusive.
8583    ///
8584    /// # Example
8585    /// ```ignore,no_run
8586    /// # use google_cloud_documentai_v1::model::DocumentOutputConfig;
8587    /// use google_cloud_documentai_v1::model::document_output_config::GcsOutputConfig;
8588    /// let x = DocumentOutputConfig::new().set_gcs_output_config(GcsOutputConfig::default()/* use setters */);
8589    /// assert!(x.gcs_output_config().is_some());
8590    /// ```
8591    pub fn set_gcs_output_config<
8592        T: std::convert::Into<std::boxed::Box<crate::model::document_output_config::GcsOutputConfig>>,
8593    >(
8594        mut self,
8595        v: T,
8596    ) -> Self {
8597        self.destination = std::option::Option::Some(
8598            crate::model::document_output_config::Destination::GcsOutputConfig(v.into()),
8599        );
8600        self
8601    }
8602}
8603
8604impl wkt::message::Message for DocumentOutputConfig {
8605    fn typename() -> &'static str {
8606        "type.googleapis.com/google.cloud.documentai.v1.DocumentOutputConfig"
8607    }
8608}
8609
8610/// Defines additional types related to [DocumentOutputConfig].
8611pub mod document_output_config {
8612    #[allow(unused_imports)]
8613    use super::*;
8614
8615    /// The configuration used when outputting documents.
8616    #[derive(Clone, Default, PartialEq)]
8617    #[non_exhaustive]
8618    pub struct GcsOutputConfig {
8619        /// The Cloud Storage uri (a directory) of the output.
8620        pub gcs_uri: std::string::String,
8621
8622        /// Specifies which fields to include in the output documents.
8623        /// Only supports top level document and pages field so it must be in the
8624        /// form of `{document_field_name}` or `pages.{page_field_name}`.
8625        pub field_mask: std::option::Option<wkt::FieldMask>,
8626
8627        /// Specifies the sharding config for the output document.
8628        pub sharding_config: std::option::Option<
8629            crate::model::document_output_config::gcs_output_config::ShardingConfig,
8630        >,
8631
8632        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8633    }
8634
8635    impl GcsOutputConfig {
8636        pub fn new() -> Self {
8637            std::default::Default::default()
8638        }
8639
8640        /// Sets the value of [gcs_uri][crate::model::document_output_config::GcsOutputConfig::gcs_uri].
8641        ///
8642        /// # Example
8643        /// ```ignore,no_run
8644        /// # use google_cloud_documentai_v1::model::document_output_config::GcsOutputConfig;
8645        /// let x = GcsOutputConfig::new().set_gcs_uri("example");
8646        /// ```
8647        pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8648            self.gcs_uri = v.into();
8649            self
8650        }
8651
8652        /// Sets the value of [field_mask][crate::model::document_output_config::GcsOutputConfig::field_mask].
8653        ///
8654        /// # Example
8655        /// ```ignore,no_run
8656        /// # use google_cloud_documentai_v1::model::document_output_config::GcsOutputConfig;
8657        /// use wkt::FieldMask;
8658        /// let x = GcsOutputConfig::new().set_field_mask(FieldMask::default()/* use setters */);
8659        /// ```
8660        pub fn set_field_mask<T>(mut self, v: T) -> Self
8661        where
8662            T: std::convert::Into<wkt::FieldMask>,
8663        {
8664            self.field_mask = std::option::Option::Some(v.into());
8665            self
8666        }
8667
8668        /// Sets or clears the value of [field_mask][crate::model::document_output_config::GcsOutputConfig::field_mask].
8669        ///
8670        /// # Example
8671        /// ```ignore,no_run
8672        /// # use google_cloud_documentai_v1::model::document_output_config::GcsOutputConfig;
8673        /// use wkt::FieldMask;
8674        /// let x = GcsOutputConfig::new().set_or_clear_field_mask(Some(FieldMask::default()/* use setters */));
8675        /// let x = GcsOutputConfig::new().set_or_clear_field_mask(None::<FieldMask>);
8676        /// ```
8677        pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
8678        where
8679            T: std::convert::Into<wkt::FieldMask>,
8680        {
8681            self.field_mask = v.map(|x| x.into());
8682            self
8683        }
8684
8685        /// Sets the value of [sharding_config][crate::model::document_output_config::GcsOutputConfig::sharding_config].
8686        ///
8687        /// # Example
8688        /// ```ignore,no_run
8689        /// # use google_cloud_documentai_v1::model::document_output_config::GcsOutputConfig;
8690        /// use google_cloud_documentai_v1::model::document_output_config::gcs_output_config::ShardingConfig;
8691        /// let x = GcsOutputConfig::new().set_sharding_config(ShardingConfig::default()/* use setters */);
8692        /// ```
8693        pub fn set_sharding_config<T>(mut self, v: T) -> Self
8694        where
8695            T: std::convert::Into<
8696                    crate::model::document_output_config::gcs_output_config::ShardingConfig,
8697                >,
8698        {
8699            self.sharding_config = std::option::Option::Some(v.into());
8700            self
8701        }
8702
8703        /// Sets or clears the value of [sharding_config][crate::model::document_output_config::GcsOutputConfig::sharding_config].
8704        ///
8705        /// # Example
8706        /// ```ignore,no_run
8707        /// # use google_cloud_documentai_v1::model::document_output_config::GcsOutputConfig;
8708        /// use google_cloud_documentai_v1::model::document_output_config::gcs_output_config::ShardingConfig;
8709        /// let x = GcsOutputConfig::new().set_or_clear_sharding_config(Some(ShardingConfig::default()/* use setters */));
8710        /// let x = GcsOutputConfig::new().set_or_clear_sharding_config(None::<ShardingConfig>);
8711        /// ```
8712        pub fn set_or_clear_sharding_config<T>(mut self, v: std::option::Option<T>) -> Self
8713        where
8714            T: std::convert::Into<
8715                    crate::model::document_output_config::gcs_output_config::ShardingConfig,
8716                >,
8717        {
8718            self.sharding_config = v.map(|x| x.into());
8719            self
8720        }
8721    }
8722
8723    impl wkt::message::Message for GcsOutputConfig {
8724        fn typename() -> &'static str {
8725            "type.googleapis.com/google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig"
8726        }
8727    }
8728
8729    /// Defines additional types related to [GcsOutputConfig].
8730    pub mod gcs_output_config {
8731        #[allow(unused_imports)]
8732        use super::*;
8733
8734        /// The sharding config for the output document.
8735        #[derive(Clone, Default, PartialEq)]
8736        #[non_exhaustive]
8737        pub struct ShardingConfig {
8738            /// The number of pages per shard.
8739            pub pages_per_shard: i32,
8740
8741            /// The number of overlapping pages between consecutive shards.
8742            pub pages_overlap: i32,
8743
8744            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8745        }
8746
8747        impl ShardingConfig {
8748            pub fn new() -> Self {
8749                std::default::Default::default()
8750            }
8751
8752            /// Sets the value of [pages_per_shard][crate::model::document_output_config::gcs_output_config::ShardingConfig::pages_per_shard].
8753            ///
8754            /// # Example
8755            /// ```ignore,no_run
8756            /// # use google_cloud_documentai_v1::model::document_output_config::gcs_output_config::ShardingConfig;
8757            /// let x = ShardingConfig::new().set_pages_per_shard(42);
8758            /// ```
8759            pub fn set_pages_per_shard<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8760                self.pages_per_shard = v.into();
8761                self
8762            }
8763
8764            /// Sets the value of [pages_overlap][crate::model::document_output_config::gcs_output_config::ShardingConfig::pages_overlap].
8765            ///
8766            /// # Example
8767            /// ```ignore,no_run
8768            /// # use google_cloud_documentai_v1::model::document_output_config::gcs_output_config::ShardingConfig;
8769            /// let x = ShardingConfig::new().set_pages_overlap(42);
8770            /// ```
8771            pub fn set_pages_overlap<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8772                self.pages_overlap = v.into();
8773                self
8774            }
8775        }
8776
8777        impl wkt::message::Message for ShardingConfig {
8778            fn typename() -> &'static str {
8779                "type.googleapis.com/google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig"
8780            }
8781        }
8782    }
8783
8784    /// The destination of the results.
8785    #[derive(Clone, Debug, PartialEq)]
8786    #[non_exhaustive]
8787    pub enum Destination {
8788        /// Output config to write the results to Cloud Storage.
8789        GcsOutputConfig(std::boxed::Box<crate::model::document_output_config::GcsOutputConfig>),
8790    }
8791}
8792
8793/// Config for Document OCR.
8794#[derive(Clone, Default, PartialEq)]
8795#[non_exhaustive]
8796pub struct OcrConfig {
8797    /// Hints for the OCR model.
8798    pub hints: std::option::Option<crate::model::ocr_config::Hints>,
8799
8800    /// Enables special handling for PDFs with existing text information. Results
8801    /// in better text extraction quality in such PDF inputs.
8802    pub enable_native_pdf_parsing: bool,
8803
8804    /// Enables intelligent document quality scores after OCR. Can help with
8805    /// diagnosing why OCR responses are of poor quality for a given input.
8806    /// Adds additional latency comparable to regular OCR to the process call.
8807    pub enable_image_quality_scores: bool,
8808
8809    /// A list of advanced OCR options to further fine-tune OCR behavior. Current
8810    /// valid values are:
8811    ///
8812    /// - `legacy_layout`: a heuristics layout detection algorithm, which serves as
8813    ///   an alternative to the current ML-based layout detection algorithm.
8814    ///   Customers can choose the best suitable layout algorithm based on their
8815    ///   situation.
8816    pub advanced_ocr_options: std::vec::Vec<std::string::String>,
8817
8818    /// Includes symbol level OCR information if set to true.
8819    pub enable_symbol: bool,
8820
8821    /// Turn on font identification model and return font style information.
8822    /// Deprecated, use
8823    /// [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info]
8824    /// instead.
8825    ///
8826    /// [google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info]: crate::model::ocr_config::PremiumFeatures::compute_style_info
8827    #[deprecated]
8828    pub compute_style_info: bool,
8829
8830    /// Turn off character box detector in OCR engine. Character box detection is
8831    /// enabled by default in OCR 2.0 (and later) processors.
8832    pub disable_character_boxes_detection: bool,
8833
8834    /// Configurations for premium OCR features.
8835    pub premium_features: std::option::Option<crate::model::ocr_config::PremiumFeatures>,
8836
8837    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8838}
8839
8840impl OcrConfig {
8841    pub fn new() -> Self {
8842        std::default::Default::default()
8843    }
8844
8845    /// Sets the value of [hints][crate::model::OcrConfig::hints].
8846    ///
8847    /// # Example
8848    /// ```ignore,no_run
8849    /// # use google_cloud_documentai_v1::model::OcrConfig;
8850    /// use google_cloud_documentai_v1::model::ocr_config::Hints;
8851    /// let x = OcrConfig::new().set_hints(Hints::default()/* use setters */);
8852    /// ```
8853    pub fn set_hints<T>(mut self, v: T) -> Self
8854    where
8855        T: std::convert::Into<crate::model::ocr_config::Hints>,
8856    {
8857        self.hints = std::option::Option::Some(v.into());
8858        self
8859    }
8860
8861    /// Sets or clears the value of [hints][crate::model::OcrConfig::hints].
8862    ///
8863    /// # Example
8864    /// ```ignore,no_run
8865    /// # use google_cloud_documentai_v1::model::OcrConfig;
8866    /// use google_cloud_documentai_v1::model::ocr_config::Hints;
8867    /// let x = OcrConfig::new().set_or_clear_hints(Some(Hints::default()/* use setters */));
8868    /// let x = OcrConfig::new().set_or_clear_hints(None::<Hints>);
8869    /// ```
8870    pub fn set_or_clear_hints<T>(mut self, v: std::option::Option<T>) -> Self
8871    where
8872        T: std::convert::Into<crate::model::ocr_config::Hints>,
8873    {
8874        self.hints = v.map(|x| x.into());
8875        self
8876    }
8877
8878    /// Sets the value of [enable_native_pdf_parsing][crate::model::OcrConfig::enable_native_pdf_parsing].
8879    ///
8880    /// # Example
8881    /// ```ignore,no_run
8882    /// # use google_cloud_documentai_v1::model::OcrConfig;
8883    /// let x = OcrConfig::new().set_enable_native_pdf_parsing(true);
8884    /// ```
8885    pub fn set_enable_native_pdf_parsing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8886        self.enable_native_pdf_parsing = v.into();
8887        self
8888    }
8889
8890    /// Sets the value of [enable_image_quality_scores][crate::model::OcrConfig::enable_image_quality_scores].
8891    ///
8892    /// # Example
8893    /// ```ignore,no_run
8894    /// # use google_cloud_documentai_v1::model::OcrConfig;
8895    /// let x = OcrConfig::new().set_enable_image_quality_scores(true);
8896    /// ```
8897    pub fn set_enable_image_quality_scores<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8898        self.enable_image_quality_scores = v.into();
8899        self
8900    }
8901
8902    /// Sets the value of [advanced_ocr_options][crate::model::OcrConfig::advanced_ocr_options].
8903    ///
8904    /// # Example
8905    /// ```ignore,no_run
8906    /// # use google_cloud_documentai_v1::model::OcrConfig;
8907    /// let x = OcrConfig::new().set_advanced_ocr_options(["a", "b", "c"]);
8908    /// ```
8909    pub fn set_advanced_ocr_options<T, V>(mut self, v: T) -> Self
8910    where
8911        T: std::iter::IntoIterator<Item = V>,
8912        V: std::convert::Into<std::string::String>,
8913    {
8914        use std::iter::Iterator;
8915        self.advanced_ocr_options = v.into_iter().map(|i| i.into()).collect();
8916        self
8917    }
8918
8919    /// Sets the value of [enable_symbol][crate::model::OcrConfig::enable_symbol].
8920    ///
8921    /// # Example
8922    /// ```ignore,no_run
8923    /// # use google_cloud_documentai_v1::model::OcrConfig;
8924    /// let x = OcrConfig::new().set_enable_symbol(true);
8925    /// ```
8926    pub fn set_enable_symbol<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8927        self.enable_symbol = v.into();
8928        self
8929    }
8930
8931    /// Sets the value of [compute_style_info][crate::model::OcrConfig::compute_style_info].
8932    ///
8933    /// # Example
8934    /// ```ignore,no_run
8935    /// # use google_cloud_documentai_v1::model::OcrConfig;
8936    /// let x = OcrConfig::new().set_compute_style_info(true);
8937    /// ```
8938    #[deprecated]
8939    pub fn set_compute_style_info<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8940        self.compute_style_info = v.into();
8941        self
8942    }
8943
8944    /// Sets the value of [disable_character_boxes_detection][crate::model::OcrConfig::disable_character_boxes_detection].
8945    ///
8946    /// # Example
8947    /// ```ignore,no_run
8948    /// # use google_cloud_documentai_v1::model::OcrConfig;
8949    /// let x = OcrConfig::new().set_disable_character_boxes_detection(true);
8950    /// ```
8951    pub fn set_disable_character_boxes_detection<T: std::convert::Into<bool>>(
8952        mut self,
8953        v: T,
8954    ) -> Self {
8955        self.disable_character_boxes_detection = v.into();
8956        self
8957    }
8958
8959    /// Sets the value of [premium_features][crate::model::OcrConfig::premium_features].
8960    ///
8961    /// # Example
8962    /// ```ignore,no_run
8963    /// # use google_cloud_documentai_v1::model::OcrConfig;
8964    /// use google_cloud_documentai_v1::model::ocr_config::PremiumFeatures;
8965    /// let x = OcrConfig::new().set_premium_features(PremiumFeatures::default()/* use setters */);
8966    /// ```
8967    pub fn set_premium_features<T>(mut self, v: T) -> Self
8968    where
8969        T: std::convert::Into<crate::model::ocr_config::PremiumFeatures>,
8970    {
8971        self.premium_features = std::option::Option::Some(v.into());
8972        self
8973    }
8974
8975    /// Sets or clears the value of [premium_features][crate::model::OcrConfig::premium_features].
8976    ///
8977    /// # Example
8978    /// ```ignore,no_run
8979    /// # use google_cloud_documentai_v1::model::OcrConfig;
8980    /// use google_cloud_documentai_v1::model::ocr_config::PremiumFeatures;
8981    /// let x = OcrConfig::new().set_or_clear_premium_features(Some(PremiumFeatures::default()/* use setters */));
8982    /// let x = OcrConfig::new().set_or_clear_premium_features(None::<PremiumFeatures>);
8983    /// ```
8984    pub fn set_or_clear_premium_features<T>(mut self, v: std::option::Option<T>) -> Self
8985    where
8986        T: std::convert::Into<crate::model::ocr_config::PremiumFeatures>,
8987    {
8988        self.premium_features = v.map(|x| x.into());
8989        self
8990    }
8991}
8992
8993impl wkt::message::Message for OcrConfig {
8994    fn typename() -> &'static str {
8995        "type.googleapis.com/google.cloud.documentai.v1.OcrConfig"
8996    }
8997}
8998
8999/// Defines additional types related to [OcrConfig].
9000pub mod ocr_config {
9001    #[allow(unused_imports)]
9002    use super::*;
9003
9004    /// Hints for OCR Engine
9005    #[derive(Clone, Default, PartialEq)]
9006    #[non_exhaustive]
9007    pub struct Hints {
9008        /// List of BCP-47 language codes to use for OCR. In most cases, not
9009        /// specifying it yields the best results since it enables automatic language
9010        /// detection. For languages based on the Latin alphabet, setting hints is
9011        /// not needed. In rare cases, when the language of the text in the
9012        /// image is known, setting a hint will help get better results (although it
9013        /// will be a significant hindrance if the hint is wrong).
9014        pub language_hints: std::vec::Vec<std::string::String>,
9015
9016        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9017    }
9018
9019    impl Hints {
9020        pub fn new() -> Self {
9021            std::default::Default::default()
9022        }
9023
9024        /// Sets the value of [language_hints][crate::model::ocr_config::Hints::language_hints].
9025        ///
9026        /// # Example
9027        /// ```ignore,no_run
9028        /// # use google_cloud_documentai_v1::model::ocr_config::Hints;
9029        /// let x = Hints::new().set_language_hints(["a", "b", "c"]);
9030        /// ```
9031        pub fn set_language_hints<T, V>(mut self, v: T) -> Self
9032        where
9033            T: std::iter::IntoIterator<Item = V>,
9034            V: std::convert::Into<std::string::String>,
9035        {
9036            use std::iter::Iterator;
9037            self.language_hints = v.into_iter().map(|i| i.into()).collect();
9038            self
9039        }
9040    }
9041
9042    impl wkt::message::Message for Hints {
9043        fn typename() -> &'static str {
9044            "type.googleapis.com/google.cloud.documentai.v1.OcrConfig.Hints"
9045        }
9046    }
9047
9048    /// Configurations for premium OCR features.
9049    #[derive(Clone, Default, PartialEq)]
9050    #[non_exhaustive]
9051    pub struct PremiumFeatures {
9052        /// Turn on selection mark detector in OCR engine. Only available in OCR 2.0
9053        /// (and later) processors.
9054        pub enable_selection_mark_detection: bool,
9055
9056        /// Turn on font identification model and return font style information.
9057        pub compute_style_info: bool,
9058
9059        /// Turn on the model that can extract LaTeX math formulas.
9060        pub enable_math_ocr: bool,
9061
9062        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9063    }
9064
9065    impl PremiumFeatures {
9066        pub fn new() -> Self {
9067            std::default::Default::default()
9068        }
9069
9070        /// Sets the value of [enable_selection_mark_detection][crate::model::ocr_config::PremiumFeatures::enable_selection_mark_detection].
9071        ///
9072        /// # Example
9073        /// ```ignore,no_run
9074        /// # use google_cloud_documentai_v1::model::ocr_config::PremiumFeatures;
9075        /// let x = PremiumFeatures::new().set_enable_selection_mark_detection(true);
9076        /// ```
9077        pub fn set_enable_selection_mark_detection<T: std::convert::Into<bool>>(
9078            mut self,
9079            v: T,
9080        ) -> Self {
9081            self.enable_selection_mark_detection = v.into();
9082            self
9083        }
9084
9085        /// Sets the value of [compute_style_info][crate::model::ocr_config::PremiumFeatures::compute_style_info].
9086        ///
9087        /// # Example
9088        /// ```ignore,no_run
9089        /// # use google_cloud_documentai_v1::model::ocr_config::PremiumFeatures;
9090        /// let x = PremiumFeatures::new().set_compute_style_info(true);
9091        /// ```
9092        pub fn set_compute_style_info<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9093            self.compute_style_info = v.into();
9094            self
9095        }
9096
9097        /// Sets the value of [enable_math_ocr][crate::model::ocr_config::PremiumFeatures::enable_math_ocr].
9098        ///
9099        /// # Example
9100        /// ```ignore,no_run
9101        /// # use google_cloud_documentai_v1::model::ocr_config::PremiumFeatures;
9102        /// let x = PremiumFeatures::new().set_enable_math_ocr(true);
9103        /// ```
9104        pub fn set_enable_math_ocr<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9105            self.enable_math_ocr = v.into();
9106            self
9107        }
9108    }
9109
9110    impl wkt::message::Message for PremiumFeatures {
9111        fn typename() -> &'static str {
9112            "type.googleapis.com/google.cloud.documentai.v1.OcrConfig.PremiumFeatures"
9113        }
9114    }
9115}
9116
9117/// Options for Process API
9118#[derive(Clone, Default, PartialEq)]
9119#[non_exhaustive]
9120pub struct ProcessOptions {
9121    /// Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`.
9122    /// Returns error if set on other processor types.
9123    pub ocr_config: std::option::Option<crate::model::OcrConfig>,
9124
9125    /// Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`.
9126    /// Returns error if set on other processor types.
9127    pub layout_config: std::option::Option<crate::model::process_options::LayoutConfig>,
9128
9129    /// Optional. Override the schema of the
9130    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]. Will
9131    /// return an Invalid Argument error if this field is set when the underlying
9132    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] doesn't
9133    /// support schema override.
9134    ///
9135    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
9136    pub schema_override: std::option::Option<crate::model::DocumentSchema>,
9137
9138    /// A subset of pages to process. If not specified, all pages are processed.
9139    /// If a page range is set, only the given pages are extracted and processed
9140    /// from the document. In the output document,
9141    /// [Document.Page.page_number][google.cloud.documentai.v1.Document.Page.page_number]
9142    /// refers to the page number in the original document.
9143    /// This configuration only applies to online processing with
9144    /// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument].
9145    ///
9146    /// [google.cloud.documentai.v1.Document.Page.page_number]: crate::model::document::Page::page_number
9147    /// [google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]: crate::client::DocumentProcessorService::process_document
9148    pub page_range: std::option::Option<crate::model::process_options::PageRange>,
9149
9150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9151}
9152
9153impl ProcessOptions {
9154    pub fn new() -> Self {
9155        std::default::Default::default()
9156    }
9157
9158    /// Sets the value of [ocr_config][crate::model::ProcessOptions::ocr_config].
9159    ///
9160    /// # Example
9161    /// ```ignore,no_run
9162    /// # use google_cloud_documentai_v1::model::ProcessOptions;
9163    /// use google_cloud_documentai_v1::model::OcrConfig;
9164    /// let x = ProcessOptions::new().set_ocr_config(OcrConfig::default()/* use setters */);
9165    /// ```
9166    pub fn set_ocr_config<T>(mut self, v: T) -> Self
9167    where
9168        T: std::convert::Into<crate::model::OcrConfig>,
9169    {
9170        self.ocr_config = std::option::Option::Some(v.into());
9171        self
9172    }
9173
9174    /// Sets or clears the value of [ocr_config][crate::model::ProcessOptions::ocr_config].
9175    ///
9176    /// # Example
9177    /// ```ignore,no_run
9178    /// # use google_cloud_documentai_v1::model::ProcessOptions;
9179    /// use google_cloud_documentai_v1::model::OcrConfig;
9180    /// let x = ProcessOptions::new().set_or_clear_ocr_config(Some(OcrConfig::default()/* use setters */));
9181    /// let x = ProcessOptions::new().set_or_clear_ocr_config(None::<OcrConfig>);
9182    /// ```
9183    pub fn set_or_clear_ocr_config<T>(mut self, v: std::option::Option<T>) -> Self
9184    where
9185        T: std::convert::Into<crate::model::OcrConfig>,
9186    {
9187        self.ocr_config = v.map(|x| x.into());
9188        self
9189    }
9190
9191    /// Sets the value of [layout_config][crate::model::ProcessOptions::layout_config].
9192    ///
9193    /// # Example
9194    /// ```ignore,no_run
9195    /// # use google_cloud_documentai_v1::model::ProcessOptions;
9196    /// use google_cloud_documentai_v1::model::process_options::LayoutConfig;
9197    /// let x = ProcessOptions::new().set_layout_config(LayoutConfig::default()/* use setters */);
9198    /// ```
9199    pub fn set_layout_config<T>(mut self, v: T) -> Self
9200    where
9201        T: std::convert::Into<crate::model::process_options::LayoutConfig>,
9202    {
9203        self.layout_config = std::option::Option::Some(v.into());
9204        self
9205    }
9206
9207    /// Sets or clears the value of [layout_config][crate::model::ProcessOptions::layout_config].
9208    ///
9209    /// # Example
9210    /// ```ignore,no_run
9211    /// # use google_cloud_documentai_v1::model::ProcessOptions;
9212    /// use google_cloud_documentai_v1::model::process_options::LayoutConfig;
9213    /// let x = ProcessOptions::new().set_or_clear_layout_config(Some(LayoutConfig::default()/* use setters */));
9214    /// let x = ProcessOptions::new().set_or_clear_layout_config(None::<LayoutConfig>);
9215    /// ```
9216    pub fn set_or_clear_layout_config<T>(mut self, v: std::option::Option<T>) -> Self
9217    where
9218        T: std::convert::Into<crate::model::process_options::LayoutConfig>,
9219    {
9220        self.layout_config = v.map(|x| x.into());
9221        self
9222    }
9223
9224    /// Sets the value of [schema_override][crate::model::ProcessOptions::schema_override].
9225    ///
9226    /// # Example
9227    /// ```ignore,no_run
9228    /// # use google_cloud_documentai_v1::model::ProcessOptions;
9229    /// use google_cloud_documentai_v1::model::DocumentSchema;
9230    /// let x = ProcessOptions::new().set_schema_override(DocumentSchema::default()/* use setters */);
9231    /// ```
9232    pub fn set_schema_override<T>(mut self, v: T) -> Self
9233    where
9234        T: std::convert::Into<crate::model::DocumentSchema>,
9235    {
9236        self.schema_override = std::option::Option::Some(v.into());
9237        self
9238    }
9239
9240    /// Sets or clears the value of [schema_override][crate::model::ProcessOptions::schema_override].
9241    ///
9242    /// # Example
9243    /// ```ignore,no_run
9244    /// # use google_cloud_documentai_v1::model::ProcessOptions;
9245    /// use google_cloud_documentai_v1::model::DocumentSchema;
9246    /// let x = ProcessOptions::new().set_or_clear_schema_override(Some(DocumentSchema::default()/* use setters */));
9247    /// let x = ProcessOptions::new().set_or_clear_schema_override(None::<DocumentSchema>);
9248    /// ```
9249    pub fn set_or_clear_schema_override<T>(mut self, v: std::option::Option<T>) -> Self
9250    where
9251        T: std::convert::Into<crate::model::DocumentSchema>,
9252    {
9253        self.schema_override = v.map(|x| x.into());
9254        self
9255    }
9256
9257    /// Sets the value of [page_range][crate::model::ProcessOptions::page_range].
9258    ///
9259    /// Note that all the setters affecting `page_range` are mutually
9260    /// exclusive.
9261    ///
9262    /// # Example
9263    /// ```ignore,no_run
9264    /// # use google_cloud_documentai_v1::model::ProcessOptions;
9265    /// use google_cloud_documentai_v1::model::process_options::PageRange;
9266    /// let x = ProcessOptions::new().set_page_range(Some(PageRange::FromStart(42)));
9267    /// ```
9268    pub fn set_page_range<
9269        T: std::convert::Into<std::option::Option<crate::model::process_options::PageRange>>,
9270    >(
9271        mut self,
9272        v: T,
9273    ) -> Self {
9274        self.page_range = v.into();
9275        self
9276    }
9277
9278    /// The value of [page_range][crate::model::ProcessOptions::page_range]
9279    /// if it holds a `IndividualPageSelector`, `None` if the field is not set or
9280    /// holds a different branch.
9281    pub fn individual_page_selector(
9282        &self,
9283    ) -> std::option::Option<&std::boxed::Box<crate::model::process_options::IndividualPageSelector>>
9284    {
9285        #[allow(unreachable_patterns)]
9286        self.page_range.as_ref().and_then(|v| match v {
9287            crate::model::process_options::PageRange::IndividualPageSelector(v) => {
9288                std::option::Option::Some(v)
9289            }
9290            _ => std::option::Option::None,
9291        })
9292    }
9293
9294    /// Sets the value of [page_range][crate::model::ProcessOptions::page_range]
9295    /// to hold a `IndividualPageSelector`.
9296    ///
9297    /// Note that all the setters affecting `page_range` are
9298    /// mutually exclusive.
9299    ///
9300    /// # Example
9301    /// ```ignore,no_run
9302    /// # use google_cloud_documentai_v1::model::ProcessOptions;
9303    /// use google_cloud_documentai_v1::model::process_options::IndividualPageSelector;
9304    /// let x = ProcessOptions::new().set_individual_page_selector(IndividualPageSelector::default()/* use setters */);
9305    /// assert!(x.individual_page_selector().is_some());
9306    /// assert!(x.from_start().is_none());
9307    /// assert!(x.from_end().is_none());
9308    /// ```
9309    pub fn set_individual_page_selector<
9310        T: std::convert::Into<std::boxed::Box<crate::model::process_options::IndividualPageSelector>>,
9311    >(
9312        mut self,
9313        v: T,
9314    ) -> Self {
9315        self.page_range = std::option::Option::Some(
9316            crate::model::process_options::PageRange::IndividualPageSelector(v.into()),
9317        );
9318        self
9319    }
9320
9321    /// The value of [page_range][crate::model::ProcessOptions::page_range]
9322    /// if it holds a `FromStart`, `None` if the field is not set or
9323    /// holds a different branch.
9324    pub fn from_start(&self) -> std::option::Option<&i32> {
9325        #[allow(unreachable_patterns)]
9326        self.page_range.as_ref().and_then(|v| match v {
9327            crate::model::process_options::PageRange::FromStart(v) => std::option::Option::Some(v),
9328            _ => std::option::Option::None,
9329        })
9330    }
9331
9332    /// Sets the value of [page_range][crate::model::ProcessOptions::page_range]
9333    /// to hold a `FromStart`.
9334    ///
9335    /// Note that all the setters affecting `page_range` are
9336    /// mutually exclusive.
9337    ///
9338    /// # Example
9339    /// ```ignore,no_run
9340    /// # use google_cloud_documentai_v1::model::ProcessOptions;
9341    /// let x = ProcessOptions::new().set_from_start(42);
9342    /// assert!(x.from_start().is_some());
9343    /// assert!(x.individual_page_selector().is_none());
9344    /// assert!(x.from_end().is_none());
9345    /// ```
9346    pub fn set_from_start<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9347        self.page_range = std::option::Option::Some(
9348            crate::model::process_options::PageRange::FromStart(v.into()),
9349        );
9350        self
9351    }
9352
9353    /// The value of [page_range][crate::model::ProcessOptions::page_range]
9354    /// if it holds a `FromEnd`, `None` if the field is not set or
9355    /// holds a different branch.
9356    pub fn from_end(&self) -> std::option::Option<&i32> {
9357        #[allow(unreachable_patterns)]
9358        self.page_range.as_ref().and_then(|v| match v {
9359            crate::model::process_options::PageRange::FromEnd(v) => std::option::Option::Some(v),
9360            _ => std::option::Option::None,
9361        })
9362    }
9363
9364    /// Sets the value of [page_range][crate::model::ProcessOptions::page_range]
9365    /// to hold a `FromEnd`.
9366    ///
9367    /// Note that all the setters affecting `page_range` are
9368    /// mutually exclusive.
9369    ///
9370    /// # Example
9371    /// ```ignore,no_run
9372    /// # use google_cloud_documentai_v1::model::ProcessOptions;
9373    /// let x = ProcessOptions::new().set_from_end(42);
9374    /// assert!(x.from_end().is_some());
9375    /// assert!(x.individual_page_selector().is_none());
9376    /// assert!(x.from_start().is_none());
9377    /// ```
9378    pub fn set_from_end<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9379        self.page_range =
9380            std::option::Option::Some(crate::model::process_options::PageRange::FromEnd(v.into()));
9381        self
9382    }
9383}
9384
9385impl wkt::message::Message for ProcessOptions {
9386    fn typename() -> &'static str {
9387        "type.googleapis.com/google.cloud.documentai.v1.ProcessOptions"
9388    }
9389}
9390
9391/// Defines additional types related to [ProcessOptions].
9392pub mod process_options {
9393    #[allow(unused_imports)]
9394    use super::*;
9395
9396    /// Serving config for layout parser processor.
9397    #[derive(Clone, Default, PartialEq)]
9398    #[non_exhaustive]
9399    pub struct LayoutConfig {
9400        /// Optional. Config for chunking in layout parser processor.
9401        pub chunking_config:
9402            std::option::Option<crate::model::process_options::layout_config::ChunkingConfig>,
9403
9404        /// Optional. Whether to include images in layout parser processor response.
9405        pub return_images: bool,
9406
9407        /// Optional. Whether to include bounding boxes in layout parser processor
9408        /// response.
9409        pub return_bounding_boxes: bool,
9410
9411        /// Optional. Whether to include image annotations in layout parser response.
9412        pub enable_image_annotation: bool,
9413
9414        /// Optional. Whether to include table annotations in layout parser response.
9415        pub enable_table_annotation: bool,
9416
9417        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9418    }
9419
9420    impl LayoutConfig {
9421        pub fn new() -> Self {
9422            std::default::Default::default()
9423        }
9424
9425        /// Sets the value of [chunking_config][crate::model::process_options::LayoutConfig::chunking_config].
9426        ///
9427        /// # Example
9428        /// ```ignore,no_run
9429        /// # use google_cloud_documentai_v1::model::process_options::LayoutConfig;
9430        /// use google_cloud_documentai_v1::model::process_options::layout_config::ChunkingConfig;
9431        /// let x = LayoutConfig::new().set_chunking_config(ChunkingConfig::default()/* use setters */);
9432        /// ```
9433        pub fn set_chunking_config<T>(mut self, v: T) -> Self
9434        where
9435            T: std::convert::Into<crate::model::process_options::layout_config::ChunkingConfig>,
9436        {
9437            self.chunking_config = std::option::Option::Some(v.into());
9438            self
9439        }
9440
9441        /// Sets or clears the value of [chunking_config][crate::model::process_options::LayoutConfig::chunking_config].
9442        ///
9443        /// # Example
9444        /// ```ignore,no_run
9445        /// # use google_cloud_documentai_v1::model::process_options::LayoutConfig;
9446        /// use google_cloud_documentai_v1::model::process_options::layout_config::ChunkingConfig;
9447        /// let x = LayoutConfig::new().set_or_clear_chunking_config(Some(ChunkingConfig::default()/* use setters */));
9448        /// let x = LayoutConfig::new().set_or_clear_chunking_config(None::<ChunkingConfig>);
9449        /// ```
9450        pub fn set_or_clear_chunking_config<T>(mut self, v: std::option::Option<T>) -> Self
9451        where
9452            T: std::convert::Into<crate::model::process_options::layout_config::ChunkingConfig>,
9453        {
9454            self.chunking_config = v.map(|x| x.into());
9455            self
9456        }
9457
9458        /// Sets the value of [return_images][crate::model::process_options::LayoutConfig::return_images].
9459        ///
9460        /// # Example
9461        /// ```ignore,no_run
9462        /// # use google_cloud_documentai_v1::model::process_options::LayoutConfig;
9463        /// let x = LayoutConfig::new().set_return_images(true);
9464        /// ```
9465        pub fn set_return_images<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9466            self.return_images = v.into();
9467            self
9468        }
9469
9470        /// Sets the value of [return_bounding_boxes][crate::model::process_options::LayoutConfig::return_bounding_boxes].
9471        ///
9472        /// # Example
9473        /// ```ignore,no_run
9474        /// # use google_cloud_documentai_v1::model::process_options::LayoutConfig;
9475        /// let x = LayoutConfig::new().set_return_bounding_boxes(true);
9476        /// ```
9477        pub fn set_return_bounding_boxes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9478            self.return_bounding_boxes = v.into();
9479            self
9480        }
9481
9482        /// Sets the value of [enable_image_annotation][crate::model::process_options::LayoutConfig::enable_image_annotation].
9483        ///
9484        /// # Example
9485        /// ```ignore,no_run
9486        /// # use google_cloud_documentai_v1::model::process_options::LayoutConfig;
9487        /// let x = LayoutConfig::new().set_enable_image_annotation(true);
9488        /// ```
9489        pub fn set_enable_image_annotation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9490            self.enable_image_annotation = v.into();
9491            self
9492        }
9493
9494        /// Sets the value of [enable_table_annotation][crate::model::process_options::LayoutConfig::enable_table_annotation].
9495        ///
9496        /// # Example
9497        /// ```ignore,no_run
9498        /// # use google_cloud_documentai_v1::model::process_options::LayoutConfig;
9499        /// let x = LayoutConfig::new().set_enable_table_annotation(true);
9500        /// ```
9501        pub fn set_enable_table_annotation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9502            self.enable_table_annotation = v.into();
9503            self
9504        }
9505    }
9506
9507    impl wkt::message::Message for LayoutConfig {
9508        fn typename() -> &'static str {
9509            "type.googleapis.com/google.cloud.documentai.v1.ProcessOptions.LayoutConfig"
9510        }
9511    }
9512
9513    /// Defines additional types related to [LayoutConfig].
9514    pub mod layout_config {
9515        #[allow(unused_imports)]
9516        use super::*;
9517
9518        /// Serving config for chunking.
9519        #[derive(Clone, Default, PartialEq)]
9520        #[non_exhaustive]
9521        pub struct ChunkingConfig {
9522            /// Optional. The chunk sizes to use when splitting documents, in order of
9523            /// level.
9524            pub chunk_size: i32,
9525
9526            /// Optional. Whether or not to include ancestor headings when splitting.
9527            pub include_ancestor_headings: bool,
9528
9529            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9530        }
9531
9532        impl ChunkingConfig {
9533            pub fn new() -> Self {
9534                std::default::Default::default()
9535            }
9536
9537            /// Sets the value of [chunk_size][crate::model::process_options::layout_config::ChunkingConfig::chunk_size].
9538            ///
9539            /// # Example
9540            /// ```ignore,no_run
9541            /// # use google_cloud_documentai_v1::model::process_options::layout_config::ChunkingConfig;
9542            /// let x = ChunkingConfig::new().set_chunk_size(42);
9543            /// ```
9544            pub fn set_chunk_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9545                self.chunk_size = v.into();
9546                self
9547            }
9548
9549            /// Sets the value of [include_ancestor_headings][crate::model::process_options::layout_config::ChunkingConfig::include_ancestor_headings].
9550            ///
9551            /// # Example
9552            /// ```ignore,no_run
9553            /// # use google_cloud_documentai_v1::model::process_options::layout_config::ChunkingConfig;
9554            /// let x = ChunkingConfig::new().set_include_ancestor_headings(true);
9555            /// ```
9556            pub fn set_include_ancestor_headings<T: std::convert::Into<bool>>(
9557                mut self,
9558                v: T,
9559            ) -> Self {
9560                self.include_ancestor_headings = v.into();
9561                self
9562            }
9563        }
9564
9565        impl wkt::message::Message for ChunkingConfig {
9566            fn typename() -> &'static str {
9567                "type.googleapis.com/google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig"
9568            }
9569        }
9570    }
9571
9572    /// A list of individual page numbers.
9573    #[derive(Clone, Default, PartialEq)]
9574    #[non_exhaustive]
9575    pub struct IndividualPageSelector {
9576        /// Optional. Indices of the pages (starting from 1).
9577        pub pages: std::vec::Vec<i32>,
9578
9579        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9580    }
9581
9582    impl IndividualPageSelector {
9583        pub fn new() -> Self {
9584            std::default::Default::default()
9585        }
9586
9587        /// Sets the value of [pages][crate::model::process_options::IndividualPageSelector::pages].
9588        ///
9589        /// # Example
9590        /// ```ignore,no_run
9591        /// # use google_cloud_documentai_v1::model::process_options::IndividualPageSelector;
9592        /// let x = IndividualPageSelector::new().set_pages([1, 2, 3]);
9593        /// ```
9594        pub fn set_pages<T, V>(mut self, v: T) -> Self
9595        where
9596            T: std::iter::IntoIterator<Item = V>,
9597            V: std::convert::Into<i32>,
9598        {
9599            use std::iter::Iterator;
9600            self.pages = v.into_iter().map(|i| i.into()).collect();
9601            self
9602        }
9603    }
9604
9605    impl wkt::message::Message for IndividualPageSelector {
9606        fn typename() -> &'static str {
9607            "type.googleapis.com/google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector"
9608        }
9609    }
9610
9611    /// A subset of pages to process. If not specified, all pages are processed.
9612    /// If a page range is set, only the given pages are extracted and processed
9613    /// from the document. In the output document,
9614    /// [Document.Page.page_number][google.cloud.documentai.v1.Document.Page.page_number]
9615    /// refers to the page number in the original document.
9616    /// This configuration only applies to online processing with
9617    /// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument].
9618    ///
9619    /// [google.cloud.documentai.v1.Document.Page.page_number]: crate::model::document::Page::page_number
9620    /// [google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]: crate::client::DocumentProcessorService::process_document
9621    #[derive(Clone, Debug, PartialEq)]
9622    #[non_exhaustive]
9623    pub enum PageRange {
9624        /// Which pages to process (1-indexed).
9625        IndividualPageSelector(
9626            std::boxed::Box<crate::model::process_options::IndividualPageSelector>,
9627        ),
9628        /// Only process certain pages from the start. Process all if the document
9629        /// has fewer pages.
9630        FromStart(i32),
9631        /// Only process certain pages from the end, same as above.
9632        FromEnd(i32),
9633    }
9634}
9635
9636/// Request message for the
9637/// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]
9638/// method.
9639///
9640/// [google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]: crate::client::DocumentProcessorService::process_document
9641#[derive(Clone, Default, PartialEq)]
9642#[non_exhaustive]
9643pub struct ProcessRequest {
9644    /// Required. The resource name of the
9645    /// [Processor][google.cloud.documentai.v1.Processor] or
9646    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion]
9647    /// to use for processing. If a
9648    /// [Processor][google.cloud.documentai.v1.Processor] is specified, the server
9649    /// will use its [default
9650    /// version][google.cloud.documentai.v1.Processor.default_processor_version].
9651    /// Format: `projects/{project}/locations/{location}/processors/{processor}`,
9652    /// or
9653    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
9654    ///
9655    /// [google.cloud.documentai.v1.Processor]: crate::model::Processor
9656    /// [google.cloud.documentai.v1.Processor.default_processor_version]: crate::model::Processor::default_processor_version
9657    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
9658    pub name: std::string::String,
9659
9660    /// Whether human review should be skipped for this request. Default to
9661    /// `false`.
9662    pub skip_human_review: bool,
9663
9664    /// Specifies which fields to include in the
9665    /// [ProcessResponse.document][google.cloud.documentai.v1.ProcessResponse.document]
9666    /// output. Only supports top-level document and pages field, so it must be in
9667    /// the form of `{document_field_name}` or `pages.{page_field_name}`.
9668    ///
9669    /// [google.cloud.documentai.v1.ProcessResponse.document]: crate::model::ProcessResponse::document
9670    pub field_mask: std::option::Option<wkt::FieldMask>,
9671
9672    /// Inference-time options for the process API
9673    pub process_options: std::option::Option<crate::model::ProcessOptions>,
9674
9675    /// Optional. The labels with user-defined metadata for the request.
9676    ///
9677    /// Label keys and values can be no longer than 63 characters
9678    /// (Unicode codepoints) and can only contain lowercase letters, numeric
9679    /// characters, underscores, and dashes. International characters are allowed.
9680    /// Label values are optional. Label keys must start with a letter.
9681    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9682
9683    /// Optional. Option to remove images from the document.
9684    pub imageless_mode: bool,
9685
9686    /// The document payload.
9687    pub source: std::option::Option<crate::model::process_request::Source>,
9688
9689    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9690}
9691
9692impl ProcessRequest {
9693    pub fn new() -> Self {
9694        std::default::Default::default()
9695    }
9696
9697    /// Sets the value of [name][crate::model::ProcessRequest::name].
9698    ///
9699    /// # Example
9700    /// ```ignore,no_run
9701    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9702    /// let x = ProcessRequest::new().set_name("example");
9703    /// ```
9704    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9705        self.name = v.into();
9706        self
9707    }
9708
9709    /// Sets the value of [skip_human_review][crate::model::ProcessRequest::skip_human_review].
9710    ///
9711    /// # Example
9712    /// ```ignore,no_run
9713    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9714    /// let x = ProcessRequest::new().set_skip_human_review(true);
9715    /// ```
9716    pub fn set_skip_human_review<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9717        self.skip_human_review = v.into();
9718        self
9719    }
9720
9721    /// Sets the value of [field_mask][crate::model::ProcessRequest::field_mask].
9722    ///
9723    /// # Example
9724    /// ```ignore,no_run
9725    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9726    /// use wkt::FieldMask;
9727    /// let x = ProcessRequest::new().set_field_mask(FieldMask::default()/* use setters */);
9728    /// ```
9729    pub fn set_field_mask<T>(mut self, v: T) -> Self
9730    where
9731        T: std::convert::Into<wkt::FieldMask>,
9732    {
9733        self.field_mask = std::option::Option::Some(v.into());
9734        self
9735    }
9736
9737    /// Sets or clears the value of [field_mask][crate::model::ProcessRequest::field_mask].
9738    ///
9739    /// # Example
9740    /// ```ignore,no_run
9741    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9742    /// use wkt::FieldMask;
9743    /// let x = ProcessRequest::new().set_or_clear_field_mask(Some(FieldMask::default()/* use setters */));
9744    /// let x = ProcessRequest::new().set_or_clear_field_mask(None::<FieldMask>);
9745    /// ```
9746    pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
9747    where
9748        T: std::convert::Into<wkt::FieldMask>,
9749    {
9750        self.field_mask = v.map(|x| x.into());
9751        self
9752    }
9753
9754    /// Sets the value of [process_options][crate::model::ProcessRequest::process_options].
9755    ///
9756    /// # Example
9757    /// ```ignore,no_run
9758    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9759    /// use google_cloud_documentai_v1::model::ProcessOptions;
9760    /// let x = ProcessRequest::new().set_process_options(ProcessOptions::default()/* use setters */);
9761    /// ```
9762    pub fn set_process_options<T>(mut self, v: T) -> Self
9763    where
9764        T: std::convert::Into<crate::model::ProcessOptions>,
9765    {
9766        self.process_options = std::option::Option::Some(v.into());
9767        self
9768    }
9769
9770    /// Sets or clears the value of [process_options][crate::model::ProcessRequest::process_options].
9771    ///
9772    /// # Example
9773    /// ```ignore,no_run
9774    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9775    /// use google_cloud_documentai_v1::model::ProcessOptions;
9776    /// let x = ProcessRequest::new().set_or_clear_process_options(Some(ProcessOptions::default()/* use setters */));
9777    /// let x = ProcessRequest::new().set_or_clear_process_options(None::<ProcessOptions>);
9778    /// ```
9779    pub fn set_or_clear_process_options<T>(mut self, v: std::option::Option<T>) -> Self
9780    where
9781        T: std::convert::Into<crate::model::ProcessOptions>,
9782    {
9783        self.process_options = v.map(|x| x.into());
9784        self
9785    }
9786
9787    /// Sets the value of [labels][crate::model::ProcessRequest::labels].
9788    ///
9789    /// # Example
9790    /// ```ignore,no_run
9791    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9792    /// let x = ProcessRequest::new().set_labels([
9793    ///     ("key0", "abc"),
9794    ///     ("key1", "xyz"),
9795    /// ]);
9796    /// ```
9797    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9798    where
9799        T: std::iter::IntoIterator<Item = (K, V)>,
9800        K: std::convert::Into<std::string::String>,
9801        V: std::convert::Into<std::string::String>,
9802    {
9803        use std::iter::Iterator;
9804        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9805        self
9806    }
9807
9808    /// Sets the value of [imageless_mode][crate::model::ProcessRequest::imageless_mode].
9809    ///
9810    /// # Example
9811    /// ```ignore,no_run
9812    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9813    /// let x = ProcessRequest::new().set_imageless_mode(true);
9814    /// ```
9815    pub fn set_imageless_mode<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9816        self.imageless_mode = v.into();
9817        self
9818    }
9819
9820    /// Sets the value of [source][crate::model::ProcessRequest::source].
9821    ///
9822    /// Note that all the setters affecting `source` are mutually
9823    /// exclusive.
9824    ///
9825    /// # Example
9826    /// ```ignore,no_run
9827    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9828    /// use google_cloud_documentai_v1::model::Document;
9829    /// let x = ProcessRequest::new().set_source(Some(
9830    ///     google_cloud_documentai_v1::model::process_request::Source::InlineDocument(Document::default().into())));
9831    /// ```
9832    pub fn set_source<
9833        T: std::convert::Into<std::option::Option<crate::model::process_request::Source>>,
9834    >(
9835        mut self,
9836        v: T,
9837    ) -> Self {
9838        self.source = v.into();
9839        self
9840    }
9841
9842    /// The value of [source][crate::model::ProcessRequest::source]
9843    /// if it holds a `InlineDocument`, `None` if the field is not set or
9844    /// holds a different branch.
9845    pub fn inline_document(&self) -> std::option::Option<&std::boxed::Box<crate::model::Document>> {
9846        #[allow(unreachable_patterns)]
9847        self.source.as_ref().and_then(|v| match v {
9848            crate::model::process_request::Source::InlineDocument(v) => {
9849                std::option::Option::Some(v)
9850            }
9851            _ => std::option::Option::None,
9852        })
9853    }
9854
9855    /// Sets the value of [source][crate::model::ProcessRequest::source]
9856    /// to hold a `InlineDocument`.
9857    ///
9858    /// Note that all the setters affecting `source` are
9859    /// mutually exclusive.
9860    ///
9861    /// # Example
9862    /// ```ignore,no_run
9863    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9864    /// use google_cloud_documentai_v1::model::Document;
9865    /// let x = ProcessRequest::new().set_inline_document(Document::default()/* use setters */);
9866    /// assert!(x.inline_document().is_some());
9867    /// assert!(x.raw_document().is_none());
9868    /// assert!(x.gcs_document().is_none());
9869    /// ```
9870    pub fn set_inline_document<T: std::convert::Into<std::boxed::Box<crate::model::Document>>>(
9871        mut self,
9872        v: T,
9873    ) -> Self {
9874        self.source = std::option::Option::Some(
9875            crate::model::process_request::Source::InlineDocument(v.into()),
9876        );
9877        self
9878    }
9879
9880    /// The value of [source][crate::model::ProcessRequest::source]
9881    /// if it holds a `RawDocument`, `None` if the field is not set or
9882    /// holds a different branch.
9883    pub fn raw_document(&self) -> std::option::Option<&std::boxed::Box<crate::model::RawDocument>> {
9884        #[allow(unreachable_patterns)]
9885        self.source.as_ref().and_then(|v| match v {
9886            crate::model::process_request::Source::RawDocument(v) => std::option::Option::Some(v),
9887            _ => std::option::Option::None,
9888        })
9889    }
9890
9891    /// Sets the value of [source][crate::model::ProcessRequest::source]
9892    /// to hold a `RawDocument`.
9893    ///
9894    /// Note that all the setters affecting `source` are
9895    /// mutually exclusive.
9896    ///
9897    /// # Example
9898    /// ```ignore,no_run
9899    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9900    /// use google_cloud_documentai_v1::model::RawDocument;
9901    /// let x = ProcessRequest::new().set_raw_document(RawDocument::default()/* use setters */);
9902    /// assert!(x.raw_document().is_some());
9903    /// assert!(x.inline_document().is_none());
9904    /// assert!(x.gcs_document().is_none());
9905    /// ```
9906    pub fn set_raw_document<T: std::convert::Into<std::boxed::Box<crate::model::RawDocument>>>(
9907        mut self,
9908        v: T,
9909    ) -> Self {
9910        self.source =
9911            std::option::Option::Some(crate::model::process_request::Source::RawDocument(v.into()));
9912        self
9913    }
9914
9915    /// The value of [source][crate::model::ProcessRequest::source]
9916    /// if it holds a `GcsDocument`, `None` if the field is not set or
9917    /// holds a different branch.
9918    pub fn gcs_document(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsDocument>> {
9919        #[allow(unreachable_patterns)]
9920        self.source.as_ref().and_then(|v| match v {
9921            crate::model::process_request::Source::GcsDocument(v) => std::option::Option::Some(v),
9922            _ => std::option::Option::None,
9923        })
9924    }
9925
9926    /// Sets the value of [source][crate::model::ProcessRequest::source]
9927    /// to hold a `GcsDocument`.
9928    ///
9929    /// Note that all the setters affecting `source` are
9930    /// mutually exclusive.
9931    ///
9932    /// # Example
9933    /// ```ignore,no_run
9934    /// # use google_cloud_documentai_v1::model::ProcessRequest;
9935    /// use google_cloud_documentai_v1::model::GcsDocument;
9936    /// let x = ProcessRequest::new().set_gcs_document(GcsDocument::default()/* use setters */);
9937    /// assert!(x.gcs_document().is_some());
9938    /// assert!(x.inline_document().is_none());
9939    /// assert!(x.raw_document().is_none());
9940    /// ```
9941    pub fn set_gcs_document<T: std::convert::Into<std::boxed::Box<crate::model::GcsDocument>>>(
9942        mut self,
9943        v: T,
9944    ) -> Self {
9945        self.source =
9946            std::option::Option::Some(crate::model::process_request::Source::GcsDocument(v.into()));
9947        self
9948    }
9949}
9950
9951impl wkt::message::Message for ProcessRequest {
9952    fn typename() -> &'static str {
9953        "type.googleapis.com/google.cloud.documentai.v1.ProcessRequest"
9954    }
9955}
9956
9957/// Defines additional types related to [ProcessRequest].
9958pub mod process_request {
9959    #[allow(unused_imports)]
9960    use super::*;
9961
9962    /// The document payload.
9963    #[derive(Clone, Debug, PartialEq)]
9964    #[non_exhaustive]
9965    pub enum Source {
9966        /// An inline document proto.
9967        InlineDocument(std::boxed::Box<crate::model::Document>),
9968        /// A raw document content (bytes).
9969        RawDocument(std::boxed::Box<crate::model::RawDocument>),
9970        /// A raw document on Google Cloud Storage.
9971        GcsDocument(std::boxed::Box<crate::model::GcsDocument>),
9972    }
9973}
9974
9975/// The status of human review on a processed document.
9976#[derive(Clone, Default, PartialEq)]
9977#[non_exhaustive]
9978pub struct HumanReviewStatus {
9979    /// The state of human review on the processing request.
9980    pub state: crate::model::human_review_status::State,
9981
9982    /// A message providing more details about the human review state.
9983    pub state_message: std::string::String,
9984
9985    /// The name of the operation triggered by the processed document. This field
9986    /// is populated only when the
9987    /// [state][google.cloud.documentai.v1.HumanReviewStatus.state] is
9988    /// `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as
9989    /// the long-running operation returned by
9990    /// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument].
9991    ///
9992    /// [google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]: crate::client::DocumentProcessorService::review_document
9993    /// [google.cloud.documentai.v1.HumanReviewStatus.state]: crate::model::HumanReviewStatus::state
9994    pub human_review_operation: std::string::String,
9995
9996    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9997}
9998
9999impl HumanReviewStatus {
10000    pub fn new() -> Self {
10001        std::default::Default::default()
10002    }
10003
10004    /// Sets the value of [state][crate::model::HumanReviewStatus::state].
10005    ///
10006    /// # Example
10007    /// ```ignore,no_run
10008    /// # use google_cloud_documentai_v1::model::HumanReviewStatus;
10009    /// use google_cloud_documentai_v1::model::human_review_status::State;
10010    /// let x0 = HumanReviewStatus::new().set_state(State::Skipped);
10011    /// let x1 = HumanReviewStatus::new().set_state(State::ValidationPassed);
10012    /// let x2 = HumanReviewStatus::new().set_state(State::InProgress);
10013    /// ```
10014    pub fn set_state<T: std::convert::Into<crate::model::human_review_status::State>>(
10015        mut self,
10016        v: T,
10017    ) -> Self {
10018        self.state = v.into();
10019        self
10020    }
10021
10022    /// Sets the value of [state_message][crate::model::HumanReviewStatus::state_message].
10023    ///
10024    /// # Example
10025    /// ```ignore,no_run
10026    /// # use google_cloud_documentai_v1::model::HumanReviewStatus;
10027    /// let x = HumanReviewStatus::new().set_state_message("example");
10028    /// ```
10029    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10030        self.state_message = v.into();
10031        self
10032    }
10033
10034    /// Sets the value of [human_review_operation][crate::model::HumanReviewStatus::human_review_operation].
10035    ///
10036    /// # Example
10037    /// ```ignore,no_run
10038    /// # use google_cloud_documentai_v1::model::HumanReviewStatus;
10039    /// let x = HumanReviewStatus::new().set_human_review_operation("example");
10040    /// ```
10041    pub fn set_human_review_operation<T: std::convert::Into<std::string::String>>(
10042        mut self,
10043        v: T,
10044    ) -> Self {
10045        self.human_review_operation = v.into();
10046        self
10047    }
10048}
10049
10050impl wkt::message::Message for HumanReviewStatus {
10051    fn typename() -> &'static str {
10052        "type.googleapis.com/google.cloud.documentai.v1.HumanReviewStatus"
10053    }
10054}
10055
10056/// Defines additional types related to [HumanReviewStatus].
10057pub mod human_review_status {
10058    #[allow(unused_imports)]
10059    use super::*;
10060
10061    /// The final state of human review on a processed document.
10062    ///
10063    /// # Working with unknown values
10064    ///
10065    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10066    /// additional enum variants at any time. Adding new variants is not considered
10067    /// a breaking change. Applications should write their code in anticipation of:
10068    ///
10069    /// - New values appearing in future releases of the client library, **and**
10070    /// - New values received dynamically, without application changes.
10071    ///
10072    /// Please consult the [Working with enums] section in the user guide for some
10073    /// guidelines.
10074    ///
10075    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10076    #[derive(Clone, Debug, PartialEq)]
10077    #[non_exhaustive]
10078    pub enum State {
10079        /// Human review state is unspecified. Most likely due to an internal error.
10080        Unspecified,
10081        /// Human review is skipped for the document. This can happen because human
10082        /// review isn't enabled on the processor or the processing request has
10083        /// been set to skip this document.
10084        Skipped,
10085        /// Human review validation is triggered and passed, so no review is needed.
10086        ValidationPassed,
10087        /// Human review validation is triggered and the document is under review.
10088        InProgress,
10089        /// Some error happened during triggering human review, see the
10090        /// [state_message][google.cloud.documentai.v1.HumanReviewStatus.state_message]
10091        /// for details.
10092        ///
10093        /// [google.cloud.documentai.v1.HumanReviewStatus.state_message]: crate::model::HumanReviewStatus::state_message
10094        Error,
10095        /// If set, the enum was initialized with an unknown value.
10096        ///
10097        /// Applications can examine the value using [State::value] or
10098        /// [State::name].
10099        UnknownValue(state::UnknownValue),
10100    }
10101
10102    #[doc(hidden)]
10103    pub mod state {
10104        #[allow(unused_imports)]
10105        use super::*;
10106        #[derive(Clone, Debug, PartialEq)]
10107        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10108    }
10109
10110    impl State {
10111        /// Gets the enum value.
10112        ///
10113        /// Returns `None` if the enum contains an unknown value deserialized from
10114        /// the string representation of enums.
10115        pub fn value(&self) -> std::option::Option<i32> {
10116            match self {
10117                Self::Unspecified => std::option::Option::Some(0),
10118                Self::Skipped => std::option::Option::Some(1),
10119                Self::ValidationPassed => std::option::Option::Some(2),
10120                Self::InProgress => std::option::Option::Some(3),
10121                Self::Error => std::option::Option::Some(4),
10122                Self::UnknownValue(u) => u.0.value(),
10123            }
10124        }
10125
10126        /// Gets the enum value as a string.
10127        ///
10128        /// Returns `None` if the enum contains an unknown value deserialized from
10129        /// the integer representation of enums.
10130        pub fn name(&self) -> std::option::Option<&str> {
10131            match self {
10132                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10133                Self::Skipped => std::option::Option::Some("SKIPPED"),
10134                Self::ValidationPassed => std::option::Option::Some("VALIDATION_PASSED"),
10135                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
10136                Self::Error => std::option::Option::Some("ERROR"),
10137                Self::UnknownValue(u) => u.0.name(),
10138            }
10139        }
10140    }
10141
10142    impl std::default::Default for State {
10143        fn default() -> Self {
10144            use std::convert::From;
10145            Self::from(0)
10146        }
10147    }
10148
10149    impl std::fmt::Display for State {
10150        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10151            wkt::internal::display_enum(f, self.name(), self.value())
10152        }
10153    }
10154
10155    impl std::convert::From<i32> for State {
10156        fn from(value: i32) -> Self {
10157            match value {
10158                0 => Self::Unspecified,
10159                1 => Self::Skipped,
10160                2 => Self::ValidationPassed,
10161                3 => Self::InProgress,
10162                4 => Self::Error,
10163                _ => Self::UnknownValue(state::UnknownValue(
10164                    wkt::internal::UnknownEnumValue::Integer(value),
10165                )),
10166            }
10167        }
10168    }
10169
10170    impl std::convert::From<&str> for State {
10171        fn from(value: &str) -> Self {
10172            use std::string::ToString;
10173            match value {
10174                "STATE_UNSPECIFIED" => Self::Unspecified,
10175                "SKIPPED" => Self::Skipped,
10176                "VALIDATION_PASSED" => Self::ValidationPassed,
10177                "IN_PROGRESS" => Self::InProgress,
10178                "ERROR" => Self::Error,
10179                _ => Self::UnknownValue(state::UnknownValue(
10180                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10181                )),
10182            }
10183        }
10184    }
10185
10186    impl serde::ser::Serialize for State {
10187        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10188        where
10189            S: serde::Serializer,
10190        {
10191            match self {
10192                Self::Unspecified => serializer.serialize_i32(0),
10193                Self::Skipped => serializer.serialize_i32(1),
10194                Self::ValidationPassed => serializer.serialize_i32(2),
10195                Self::InProgress => serializer.serialize_i32(3),
10196                Self::Error => serializer.serialize_i32(4),
10197                Self::UnknownValue(u) => u.0.serialize(serializer),
10198            }
10199        }
10200    }
10201
10202    impl<'de> serde::de::Deserialize<'de> for State {
10203        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10204        where
10205            D: serde::Deserializer<'de>,
10206        {
10207            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10208                ".google.cloud.documentai.v1.HumanReviewStatus.State",
10209            ))
10210        }
10211    }
10212}
10213
10214/// Response message for the
10215/// [ProcessDocument][google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]
10216/// method.
10217///
10218/// [google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument]: crate::client::DocumentProcessorService::process_document
10219#[derive(Clone, Default, PartialEq)]
10220#[non_exhaustive]
10221pub struct ProcessResponse {
10222    /// The document payload, will populate fields based on the processor's
10223    /// behavior.
10224    pub document: std::option::Option<crate::model::Document>,
10225
10226    /// The status of human review on the processed document.
10227    pub human_review_status: std::option::Option<crate::model::HumanReviewStatus>,
10228
10229    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10230}
10231
10232impl ProcessResponse {
10233    pub fn new() -> Self {
10234        std::default::Default::default()
10235    }
10236
10237    /// Sets the value of [document][crate::model::ProcessResponse::document].
10238    ///
10239    /// # Example
10240    /// ```ignore,no_run
10241    /// # use google_cloud_documentai_v1::model::ProcessResponse;
10242    /// use google_cloud_documentai_v1::model::Document;
10243    /// let x = ProcessResponse::new().set_document(Document::default()/* use setters */);
10244    /// ```
10245    pub fn set_document<T>(mut self, v: T) -> Self
10246    where
10247        T: std::convert::Into<crate::model::Document>,
10248    {
10249        self.document = std::option::Option::Some(v.into());
10250        self
10251    }
10252
10253    /// Sets or clears the value of [document][crate::model::ProcessResponse::document].
10254    ///
10255    /// # Example
10256    /// ```ignore,no_run
10257    /// # use google_cloud_documentai_v1::model::ProcessResponse;
10258    /// use google_cloud_documentai_v1::model::Document;
10259    /// let x = ProcessResponse::new().set_or_clear_document(Some(Document::default()/* use setters */));
10260    /// let x = ProcessResponse::new().set_or_clear_document(None::<Document>);
10261    /// ```
10262    pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
10263    where
10264        T: std::convert::Into<crate::model::Document>,
10265    {
10266        self.document = v.map(|x| x.into());
10267        self
10268    }
10269
10270    /// Sets the value of [human_review_status][crate::model::ProcessResponse::human_review_status].
10271    ///
10272    /// # Example
10273    /// ```ignore,no_run
10274    /// # use google_cloud_documentai_v1::model::ProcessResponse;
10275    /// use google_cloud_documentai_v1::model::HumanReviewStatus;
10276    /// let x = ProcessResponse::new().set_human_review_status(HumanReviewStatus::default()/* use setters */);
10277    /// ```
10278    pub fn set_human_review_status<T>(mut self, v: T) -> Self
10279    where
10280        T: std::convert::Into<crate::model::HumanReviewStatus>,
10281    {
10282        self.human_review_status = std::option::Option::Some(v.into());
10283        self
10284    }
10285
10286    /// Sets or clears the value of [human_review_status][crate::model::ProcessResponse::human_review_status].
10287    ///
10288    /// # Example
10289    /// ```ignore,no_run
10290    /// # use google_cloud_documentai_v1::model::ProcessResponse;
10291    /// use google_cloud_documentai_v1::model::HumanReviewStatus;
10292    /// let x = ProcessResponse::new().set_or_clear_human_review_status(Some(HumanReviewStatus::default()/* use setters */));
10293    /// let x = ProcessResponse::new().set_or_clear_human_review_status(None::<HumanReviewStatus>);
10294    /// ```
10295    pub fn set_or_clear_human_review_status<T>(mut self, v: std::option::Option<T>) -> Self
10296    where
10297        T: std::convert::Into<crate::model::HumanReviewStatus>,
10298    {
10299        self.human_review_status = v.map(|x| x.into());
10300        self
10301    }
10302}
10303
10304impl wkt::message::Message for ProcessResponse {
10305    fn typename() -> &'static str {
10306        "type.googleapis.com/google.cloud.documentai.v1.ProcessResponse"
10307    }
10308}
10309
10310/// Request message for
10311/// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
10312///
10313/// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: crate::client::DocumentProcessorService::batch_process_documents
10314#[derive(Clone, Default, PartialEq)]
10315#[non_exhaustive]
10316pub struct BatchProcessRequest {
10317    /// Required. The resource name of
10318    /// [Processor][google.cloud.documentai.v1.Processor] or
10319    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
10320    /// Format: `projects/{project}/locations/{location}/processors/{processor}`,
10321    /// or
10322    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
10323    ///
10324    /// [google.cloud.documentai.v1.Processor]: crate::model::Processor
10325    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
10326    pub name: std::string::String,
10327
10328    /// The input documents for the
10329    /// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
10330    /// method.
10331    ///
10332    /// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: crate::client::DocumentProcessorService::batch_process_documents
10333    pub input_documents: std::option::Option<crate::model::BatchDocumentsInputConfig>,
10334
10335    /// The output configuration for the
10336    /// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]
10337    /// method.
10338    ///
10339    /// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: crate::client::DocumentProcessorService::batch_process_documents
10340    pub document_output_config: std::option::Option<crate::model::DocumentOutputConfig>,
10341
10342    /// Whether human review should be skipped for this request. Default to
10343    /// `false`.
10344    pub skip_human_review: bool,
10345
10346    /// Inference-time options for the process API
10347    pub process_options: std::option::Option<crate::model::ProcessOptions>,
10348
10349    /// Optional. The labels with user-defined metadata for the request.
10350    ///
10351    /// Label keys and values can be no longer than 63 characters
10352    /// (Unicode codepoints) and can only contain lowercase letters, numeric
10353    /// characters, underscores, and dashes. International characters are allowed.
10354    /// Label values are optional. Label keys must start with a letter.
10355    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10356
10357    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10358}
10359
10360impl BatchProcessRequest {
10361    pub fn new() -> Self {
10362        std::default::Default::default()
10363    }
10364
10365    /// Sets the value of [name][crate::model::BatchProcessRequest::name].
10366    ///
10367    /// # Example
10368    /// ```ignore,no_run
10369    /// # use google_cloud_documentai_v1::model::BatchProcessRequest;
10370    /// let x = BatchProcessRequest::new().set_name("example");
10371    /// ```
10372    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10373        self.name = v.into();
10374        self
10375    }
10376
10377    /// Sets the value of [input_documents][crate::model::BatchProcessRequest::input_documents].
10378    ///
10379    /// # Example
10380    /// ```ignore,no_run
10381    /// # use google_cloud_documentai_v1::model::BatchProcessRequest;
10382    /// use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
10383    /// let x = BatchProcessRequest::new().set_input_documents(BatchDocumentsInputConfig::default()/* use setters */);
10384    /// ```
10385    pub fn set_input_documents<T>(mut self, v: T) -> Self
10386    where
10387        T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
10388    {
10389        self.input_documents = std::option::Option::Some(v.into());
10390        self
10391    }
10392
10393    /// Sets or clears the value of [input_documents][crate::model::BatchProcessRequest::input_documents].
10394    ///
10395    /// # Example
10396    /// ```ignore,no_run
10397    /// # use google_cloud_documentai_v1::model::BatchProcessRequest;
10398    /// use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
10399    /// let x = BatchProcessRequest::new().set_or_clear_input_documents(Some(BatchDocumentsInputConfig::default()/* use setters */));
10400    /// let x = BatchProcessRequest::new().set_or_clear_input_documents(None::<BatchDocumentsInputConfig>);
10401    /// ```
10402    pub fn set_or_clear_input_documents<T>(mut self, v: std::option::Option<T>) -> Self
10403    where
10404        T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
10405    {
10406        self.input_documents = v.map(|x| x.into());
10407        self
10408    }
10409
10410    /// Sets the value of [document_output_config][crate::model::BatchProcessRequest::document_output_config].
10411    ///
10412    /// # Example
10413    /// ```ignore,no_run
10414    /// # use google_cloud_documentai_v1::model::BatchProcessRequest;
10415    /// use google_cloud_documentai_v1::model::DocumentOutputConfig;
10416    /// let x = BatchProcessRequest::new().set_document_output_config(DocumentOutputConfig::default()/* use setters */);
10417    /// ```
10418    pub fn set_document_output_config<T>(mut self, v: T) -> Self
10419    where
10420        T: std::convert::Into<crate::model::DocumentOutputConfig>,
10421    {
10422        self.document_output_config = std::option::Option::Some(v.into());
10423        self
10424    }
10425
10426    /// Sets or clears the value of [document_output_config][crate::model::BatchProcessRequest::document_output_config].
10427    ///
10428    /// # Example
10429    /// ```ignore,no_run
10430    /// # use google_cloud_documentai_v1::model::BatchProcessRequest;
10431    /// use google_cloud_documentai_v1::model::DocumentOutputConfig;
10432    /// let x = BatchProcessRequest::new().set_or_clear_document_output_config(Some(DocumentOutputConfig::default()/* use setters */));
10433    /// let x = BatchProcessRequest::new().set_or_clear_document_output_config(None::<DocumentOutputConfig>);
10434    /// ```
10435    pub fn set_or_clear_document_output_config<T>(mut self, v: std::option::Option<T>) -> Self
10436    where
10437        T: std::convert::Into<crate::model::DocumentOutputConfig>,
10438    {
10439        self.document_output_config = v.map(|x| x.into());
10440        self
10441    }
10442
10443    /// Sets the value of [skip_human_review][crate::model::BatchProcessRequest::skip_human_review].
10444    ///
10445    /// # Example
10446    /// ```ignore,no_run
10447    /// # use google_cloud_documentai_v1::model::BatchProcessRequest;
10448    /// let x = BatchProcessRequest::new().set_skip_human_review(true);
10449    /// ```
10450    pub fn set_skip_human_review<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10451        self.skip_human_review = v.into();
10452        self
10453    }
10454
10455    /// Sets the value of [process_options][crate::model::BatchProcessRequest::process_options].
10456    ///
10457    /// # Example
10458    /// ```ignore,no_run
10459    /// # use google_cloud_documentai_v1::model::BatchProcessRequest;
10460    /// use google_cloud_documentai_v1::model::ProcessOptions;
10461    /// let x = BatchProcessRequest::new().set_process_options(ProcessOptions::default()/* use setters */);
10462    /// ```
10463    pub fn set_process_options<T>(mut self, v: T) -> Self
10464    where
10465        T: std::convert::Into<crate::model::ProcessOptions>,
10466    {
10467        self.process_options = std::option::Option::Some(v.into());
10468        self
10469    }
10470
10471    /// Sets or clears the value of [process_options][crate::model::BatchProcessRequest::process_options].
10472    ///
10473    /// # Example
10474    /// ```ignore,no_run
10475    /// # use google_cloud_documentai_v1::model::BatchProcessRequest;
10476    /// use google_cloud_documentai_v1::model::ProcessOptions;
10477    /// let x = BatchProcessRequest::new().set_or_clear_process_options(Some(ProcessOptions::default()/* use setters */));
10478    /// let x = BatchProcessRequest::new().set_or_clear_process_options(None::<ProcessOptions>);
10479    /// ```
10480    pub fn set_or_clear_process_options<T>(mut self, v: std::option::Option<T>) -> Self
10481    where
10482        T: std::convert::Into<crate::model::ProcessOptions>,
10483    {
10484        self.process_options = v.map(|x| x.into());
10485        self
10486    }
10487
10488    /// Sets the value of [labels][crate::model::BatchProcessRequest::labels].
10489    ///
10490    /// # Example
10491    /// ```ignore,no_run
10492    /// # use google_cloud_documentai_v1::model::BatchProcessRequest;
10493    /// let x = BatchProcessRequest::new().set_labels([
10494    ///     ("key0", "abc"),
10495    ///     ("key1", "xyz"),
10496    /// ]);
10497    /// ```
10498    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10499    where
10500        T: std::iter::IntoIterator<Item = (K, V)>,
10501        K: std::convert::Into<std::string::String>,
10502        V: std::convert::Into<std::string::String>,
10503    {
10504        use std::iter::Iterator;
10505        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10506        self
10507    }
10508}
10509
10510impl wkt::message::Message for BatchProcessRequest {
10511    fn typename() -> &'static str {
10512        "type.googleapis.com/google.cloud.documentai.v1.BatchProcessRequest"
10513    }
10514}
10515
10516/// Response message for
10517/// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
10518///
10519/// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: crate::client::DocumentProcessorService::batch_process_documents
10520#[derive(Clone, Default, PartialEq)]
10521#[non_exhaustive]
10522pub struct BatchProcessResponse {
10523    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10524}
10525
10526impl BatchProcessResponse {
10527    pub fn new() -> Self {
10528        std::default::Default::default()
10529    }
10530}
10531
10532impl wkt::message::Message for BatchProcessResponse {
10533    fn typename() -> &'static str {
10534        "type.googleapis.com/google.cloud.documentai.v1.BatchProcessResponse"
10535    }
10536}
10537
10538/// The long-running operation metadata for
10539/// [BatchProcessDocuments][google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments].
10540///
10541/// [google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments]: crate::client::DocumentProcessorService::batch_process_documents
10542#[derive(Clone, Default, PartialEq)]
10543#[non_exhaustive]
10544pub struct BatchProcessMetadata {
10545    /// The state of the current batch processing.
10546    pub state: crate::model::batch_process_metadata::State,
10547
10548    /// A message providing more details about the current state of processing.
10549    /// For example, the error message if the operation is failed.
10550    pub state_message: std::string::String,
10551
10552    /// The creation time of the operation.
10553    pub create_time: std::option::Option<wkt::Timestamp>,
10554
10555    /// The last update time of the operation.
10556    pub update_time: std::option::Option<wkt::Timestamp>,
10557
10558    /// The list of response details of each document.
10559    pub individual_process_statuses:
10560        std::vec::Vec<crate::model::batch_process_metadata::IndividualProcessStatus>,
10561
10562    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10563}
10564
10565impl BatchProcessMetadata {
10566    pub fn new() -> Self {
10567        std::default::Default::default()
10568    }
10569
10570    /// Sets the value of [state][crate::model::BatchProcessMetadata::state].
10571    ///
10572    /// # Example
10573    /// ```ignore,no_run
10574    /// # use google_cloud_documentai_v1::model::BatchProcessMetadata;
10575    /// use google_cloud_documentai_v1::model::batch_process_metadata::State;
10576    /// let x0 = BatchProcessMetadata::new().set_state(State::Waiting);
10577    /// let x1 = BatchProcessMetadata::new().set_state(State::Running);
10578    /// let x2 = BatchProcessMetadata::new().set_state(State::Succeeded);
10579    /// ```
10580    pub fn set_state<T: std::convert::Into<crate::model::batch_process_metadata::State>>(
10581        mut self,
10582        v: T,
10583    ) -> Self {
10584        self.state = v.into();
10585        self
10586    }
10587
10588    /// Sets the value of [state_message][crate::model::BatchProcessMetadata::state_message].
10589    ///
10590    /// # Example
10591    /// ```ignore,no_run
10592    /// # use google_cloud_documentai_v1::model::BatchProcessMetadata;
10593    /// let x = BatchProcessMetadata::new().set_state_message("example");
10594    /// ```
10595    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10596        self.state_message = v.into();
10597        self
10598    }
10599
10600    /// Sets the value of [create_time][crate::model::BatchProcessMetadata::create_time].
10601    ///
10602    /// # Example
10603    /// ```ignore,no_run
10604    /// # use google_cloud_documentai_v1::model::BatchProcessMetadata;
10605    /// use wkt::Timestamp;
10606    /// let x = BatchProcessMetadata::new().set_create_time(Timestamp::default()/* use setters */);
10607    /// ```
10608    pub fn set_create_time<T>(mut self, v: T) -> Self
10609    where
10610        T: std::convert::Into<wkt::Timestamp>,
10611    {
10612        self.create_time = std::option::Option::Some(v.into());
10613        self
10614    }
10615
10616    /// Sets or clears the value of [create_time][crate::model::BatchProcessMetadata::create_time].
10617    ///
10618    /// # Example
10619    /// ```ignore,no_run
10620    /// # use google_cloud_documentai_v1::model::BatchProcessMetadata;
10621    /// use wkt::Timestamp;
10622    /// let x = BatchProcessMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10623    /// let x = BatchProcessMetadata::new().set_or_clear_create_time(None::<Timestamp>);
10624    /// ```
10625    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10626    where
10627        T: std::convert::Into<wkt::Timestamp>,
10628    {
10629        self.create_time = v.map(|x| x.into());
10630        self
10631    }
10632
10633    /// Sets the value of [update_time][crate::model::BatchProcessMetadata::update_time].
10634    ///
10635    /// # Example
10636    /// ```ignore,no_run
10637    /// # use google_cloud_documentai_v1::model::BatchProcessMetadata;
10638    /// use wkt::Timestamp;
10639    /// let x = BatchProcessMetadata::new().set_update_time(Timestamp::default()/* use setters */);
10640    /// ```
10641    pub fn set_update_time<T>(mut self, v: T) -> Self
10642    where
10643        T: std::convert::Into<wkt::Timestamp>,
10644    {
10645        self.update_time = std::option::Option::Some(v.into());
10646        self
10647    }
10648
10649    /// Sets or clears the value of [update_time][crate::model::BatchProcessMetadata::update_time].
10650    ///
10651    /// # Example
10652    /// ```ignore,no_run
10653    /// # use google_cloud_documentai_v1::model::BatchProcessMetadata;
10654    /// use wkt::Timestamp;
10655    /// let x = BatchProcessMetadata::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10656    /// let x = BatchProcessMetadata::new().set_or_clear_update_time(None::<Timestamp>);
10657    /// ```
10658    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10659    where
10660        T: std::convert::Into<wkt::Timestamp>,
10661    {
10662        self.update_time = v.map(|x| x.into());
10663        self
10664    }
10665
10666    /// Sets the value of [individual_process_statuses][crate::model::BatchProcessMetadata::individual_process_statuses].
10667    ///
10668    /// # Example
10669    /// ```ignore,no_run
10670    /// # use google_cloud_documentai_v1::model::BatchProcessMetadata;
10671    /// use google_cloud_documentai_v1::model::batch_process_metadata::IndividualProcessStatus;
10672    /// let x = BatchProcessMetadata::new()
10673    ///     .set_individual_process_statuses([
10674    ///         IndividualProcessStatus::default()/* use setters */,
10675    ///         IndividualProcessStatus::default()/* use (different) setters */,
10676    ///     ]);
10677    /// ```
10678    pub fn set_individual_process_statuses<T, V>(mut self, v: T) -> Self
10679    where
10680        T: std::iter::IntoIterator<Item = V>,
10681        V: std::convert::Into<crate::model::batch_process_metadata::IndividualProcessStatus>,
10682    {
10683        use std::iter::Iterator;
10684        self.individual_process_statuses = v.into_iter().map(|i| i.into()).collect();
10685        self
10686    }
10687}
10688
10689impl wkt::message::Message for BatchProcessMetadata {
10690    fn typename() -> &'static str {
10691        "type.googleapis.com/google.cloud.documentai.v1.BatchProcessMetadata"
10692    }
10693}
10694
10695/// Defines additional types related to [BatchProcessMetadata].
10696pub mod batch_process_metadata {
10697    #[allow(unused_imports)]
10698    use super::*;
10699
10700    /// The status of a each individual document in the batch process.
10701    #[derive(Clone, Default, PartialEq)]
10702    #[non_exhaustive]
10703    pub struct IndividualProcessStatus {
10704        /// The source of the document, same as the
10705        /// [input_gcs_source][google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
10706        /// field in the request when the batch process started.
10707        ///
10708        /// [google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]: crate::model::batch_process_metadata::IndividualProcessStatus::input_gcs_source
10709        pub input_gcs_source: std::string::String,
10710
10711        /// The status processing the document.
10712        pub status: std::option::Option<google_cloud_rpc::model::Status>,
10713
10714        /// The Cloud Storage output destination (in the request as
10715        /// [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
10716        /// of the processed document if it was successful, otherwise empty.
10717        ///
10718        /// [google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.gcs_uri]: crate::model::document_output_config::GcsOutputConfig::gcs_uri
10719        pub output_gcs_destination: std::string::String,
10720
10721        /// The status of human review on the processed document.
10722        pub human_review_status: std::option::Option<crate::model::HumanReviewStatus>,
10723
10724        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10725    }
10726
10727    impl IndividualProcessStatus {
10728        pub fn new() -> Self {
10729            std::default::Default::default()
10730        }
10731
10732        /// Sets the value of [input_gcs_source][crate::model::batch_process_metadata::IndividualProcessStatus::input_gcs_source].
10733        ///
10734        /// # Example
10735        /// ```ignore,no_run
10736        /// # use google_cloud_documentai_v1::model::batch_process_metadata::IndividualProcessStatus;
10737        /// let x = IndividualProcessStatus::new().set_input_gcs_source("example");
10738        /// ```
10739        pub fn set_input_gcs_source<T: std::convert::Into<std::string::String>>(
10740            mut self,
10741            v: T,
10742        ) -> Self {
10743            self.input_gcs_source = v.into();
10744            self
10745        }
10746
10747        /// Sets the value of [status][crate::model::batch_process_metadata::IndividualProcessStatus::status].
10748        ///
10749        /// # Example
10750        /// ```ignore,no_run
10751        /// # use google_cloud_documentai_v1::model::batch_process_metadata::IndividualProcessStatus;
10752        /// use google_cloud_rpc::model::Status;
10753        /// let x = IndividualProcessStatus::new().set_status(Status::default()/* use setters */);
10754        /// ```
10755        pub fn set_status<T>(mut self, v: T) -> Self
10756        where
10757            T: std::convert::Into<google_cloud_rpc::model::Status>,
10758        {
10759            self.status = std::option::Option::Some(v.into());
10760            self
10761        }
10762
10763        /// Sets or clears the value of [status][crate::model::batch_process_metadata::IndividualProcessStatus::status].
10764        ///
10765        /// # Example
10766        /// ```ignore,no_run
10767        /// # use google_cloud_documentai_v1::model::batch_process_metadata::IndividualProcessStatus;
10768        /// use google_cloud_rpc::model::Status;
10769        /// let x = IndividualProcessStatus::new().set_or_clear_status(Some(Status::default()/* use setters */));
10770        /// let x = IndividualProcessStatus::new().set_or_clear_status(None::<Status>);
10771        /// ```
10772        pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
10773        where
10774            T: std::convert::Into<google_cloud_rpc::model::Status>,
10775        {
10776            self.status = v.map(|x| x.into());
10777            self
10778        }
10779
10780        /// Sets the value of [output_gcs_destination][crate::model::batch_process_metadata::IndividualProcessStatus::output_gcs_destination].
10781        ///
10782        /// # Example
10783        /// ```ignore,no_run
10784        /// # use google_cloud_documentai_v1::model::batch_process_metadata::IndividualProcessStatus;
10785        /// let x = IndividualProcessStatus::new().set_output_gcs_destination("example");
10786        /// ```
10787        pub fn set_output_gcs_destination<T: std::convert::Into<std::string::String>>(
10788            mut self,
10789            v: T,
10790        ) -> Self {
10791            self.output_gcs_destination = v.into();
10792            self
10793        }
10794
10795        /// Sets the value of [human_review_status][crate::model::batch_process_metadata::IndividualProcessStatus::human_review_status].
10796        ///
10797        /// # Example
10798        /// ```ignore,no_run
10799        /// # use google_cloud_documentai_v1::model::batch_process_metadata::IndividualProcessStatus;
10800        /// use google_cloud_documentai_v1::model::HumanReviewStatus;
10801        /// let x = IndividualProcessStatus::new().set_human_review_status(HumanReviewStatus::default()/* use setters */);
10802        /// ```
10803        pub fn set_human_review_status<T>(mut self, v: T) -> Self
10804        where
10805            T: std::convert::Into<crate::model::HumanReviewStatus>,
10806        {
10807            self.human_review_status = std::option::Option::Some(v.into());
10808            self
10809        }
10810
10811        /// Sets or clears the value of [human_review_status][crate::model::batch_process_metadata::IndividualProcessStatus::human_review_status].
10812        ///
10813        /// # Example
10814        /// ```ignore,no_run
10815        /// # use google_cloud_documentai_v1::model::batch_process_metadata::IndividualProcessStatus;
10816        /// use google_cloud_documentai_v1::model::HumanReviewStatus;
10817        /// let x = IndividualProcessStatus::new().set_or_clear_human_review_status(Some(HumanReviewStatus::default()/* use setters */));
10818        /// let x = IndividualProcessStatus::new().set_or_clear_human_review_status(None::<HumanReviewStatus>);
10819        /// ```
10820        pub fn set_or_clear_human_review_status<T>(mut self, v: std::option::Option<T>) -> Self
10821        where
10822            T: std::convert::Into<crate::model::HumanReviewStatus>,
10823        {
10824            self.human_review_status = v.map(|x| x.into());
10825            self
10826        }
10827    }
10828
10829    impl wkt::message::Message for IndividualProcessStatus {
10830        fn typename() -> &'static str {
10831            "type.googleapis.com/google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus"
10832        }
10833    }
10834
10835    /// Possible states of the batch processing operation.
10836    ///
10837    /// # Working with unknown values
10838    ///
10839    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10840    /// additional enum variants at any time. Adding new variants is not considered
10841    /// a breaking change. Applications should write their code in anticipation of:
10842    ///
10843    /// - New values appearing in future releases of the client library, **and**
10844    /// - New values received dynamically, without application changes.
10845    ///
10846    /// Please consult the [Working with enums] section in the user guide for some
10847    /// guidelines.
10848    ///
10849    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10850    #[derive(Clone, Debug, PartialEq)]
10851    #[non_exhaustive]
10852    pub enum State {
10853        /// The default value. This value is used if the state is omitted.
10854        Unspecified,
10855        /// Request operation is waiting for scheduling.
10856        Waiting,
10857        /// Request is being processed.
10858        Running,
10859        /// The batch processing completed successfully.
10860        Succeeded,
10861        /// The batch processing was being cancelled.
10862        Cancelling,
10863        /// The batch processing was cancelled.
10864        Cancelled,
10865        /// The batch processing has failed.
10866        Failed,
10867        /// If set, the enum was initialized with an unknown value.
10868        ///
10869        /// Applications can examine the value using [State::value] or
10870        /// [State::name].
10871        UnknownValue(state::UnknownValue),
10872    }
10873
10874    #[doc(hidden)]
10875    pub mod state {
10876        #[allow(unused_imports)]
10877        use super::*;
10878        #[derive(Clone, Debug, PartialEq)]
10879        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10880    }
10881
10882    impl State {
10883        /// Gets the enum value.
10884        ///
10885        /// Returns `None` if the enum contains an unknown value deserialized from
10886        /// the string representation of enums.
10887        pub fn value(&self) -> std::option::Option<i32> {
10888            match self {
10889                Self::Unspecified => std::option::Option::Some(0),
10890                Self::Waiting => std::option::Option::Some(1),
10891                Self::Running => std::option::Option::Some(2),
10892                Self::Succeeded => std::option::Option::Some(3),
10893                Self::Cancelling => std::option::Option::Some(4),
10894                Self::Cancelled => std::option::Option::Some(5),
10895                Self::Failed => std::option::Option::Some(6),
10896                Self::UnknownValue(u) => u.0.value(),
10897            }
10898        }
10899
10900        /// Gets the enum value as a string.
10901        ///
10902        /// Returns `None` if the enum contains an unknown value deserialized from
10903        /// the integer representation of enums.
10904        pub fn name(&self) -> std::option::Option<&str> {
10905            match self {
10906                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10907                Self::Waiting => std::option::Option::Some("WAITING"),
10908                Self::Running => std::option::Option::Some("RUNNING"),
10909                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10910                Self::Cancelling => std::option::Option::Some("CANCELLING"),
10911                Self::Cancelled => std::option::Option::Some("CANCELLED"),
10912                Self::Failed => std::option::Option::Some("FAILED"),
10913                Self::UnknownValue(u) => u.0.name(),
10914            }
10915        }
10916    }
10917
10918    impl std::default::Default for State {
10919        fn default() -> Self {
10920            use std::convert::From;
10921            Self::from(0)
10922        }
10923    }
10924
10925    impl std::fmt::Display for State {
10926        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10927            wkt::internal::display_enum(f, self.name(), self.value())
10928        }
10929    }
10930
10931    impl std::convert::From<i32> for State {
10932        fn from(value: i32) -> Self {
10933            match value {
10934                0 => Self::Unspecified,
10935                1 => Self::Waiting,
10936                2 => Self::Running,
10937                3 => Self::Succeeded,
10938                4 => Self::Cancelling,
10939                5 => Self::Cancelled,
10940                6 => Self::Failed,
10941                _ => Self::UnknownValue(state::UnknownValue(
10942                    wkt::internal::UnknownEnumValue::Integer(value),
10943                )),
10944            }
10945        }
10946    }
10947
10948    impl std::convert::From<&str> for State {
10949        fn from(value: &str) -> Self {
10950            use std::string::ToString;
10951            match value {
10952                "STATE_UNSPECIFIED" => Self::Unspecified,
10953                "WAITING" => Self::Waiting,
10954                "RUNNING" => Self::Running,
10955                "SUCCEEDED" => Self::Succeeded,
10956                "CANCELLING" => Self::Cancelling,
10957                "CANCELLED" => Self::Cancelled,
10958                "FAILED" => Self::Failed,
10959                _ => Self::UnknownValue(state::UnknownValue(
10960                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10961                )),
10962            }
10963        }
10964    }
10965
10966    impl serde::ser::Serialize for State {
10967        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10968        where
10969            S: serde::Serializer,
10970        {
10971            match self {
10972                Self::Unspecified => serializer.serialize_i32(0),
10973                Self::Waiting => serializer.serialize_i32(1),
10974                Self::Running => serializer.serialize_i32(2),
10975                Self::Succeeded => serializer.serialize_i32(3),
10976                Self::Cancelling => serializer.serialize_i32(4),
10977                Self::Cancelled => serializer.serialize_i32(5),
10978                Self::Failed => serializer.serialize_i32(6),
10979                Self::UnknownValue(u) => u.0.serialize(serializer),
10980            }
10981        }
10982    }
10983
10984    impl<'de> serde::de::Deserialize<'de> for State {
10985        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10986        where
10987            D: serde::Deserializer<'de>,
10988        {
10989            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10990                ".google.cloud.documentai.v1.BatchProcessMetadata.State",
10991            ))
10992        }
10993    }
10994}
10995
10996/// Request message for the
10997/// [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]
10998/// method. Some processor types may require the project be added to an
10999/// allowlist.
11000///
11001/// [google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]: crate::client::DocumentProcessorService::fetch_processor_types
11002#[derive(Clone, Default, PartialEq)]
11003#[non_exhaustive]
11004pub struct FetchProcessorTypesRequest {
11005    /// Required. The location of processor types to list.
11006    /// Format: `projects/{project}/locations/{location}`.
11007    pub parent: std::string::String,
11008
11009    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11010}
11011
11012impl FetchProcessorTypesRequest {
11013    pub fn new() -> Self {
11014        std::default::Default::default()
11015    }
11016
11017    /// Sets the value of [parent][crate::model::FetchProcessorTypesRequest::parent].
11018    ///
11019    /// # Example
11020    /// ```ignore,no_run
11021    /// # use google_cloud_documentai_v1::model::FetchProcessorTypesRequest;
11022    /// let x = FetchProcessorTypesRequest::new().set_parent("example");
11023    /// ```
11024    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11025        self.parent = v.into();
11026        self
11027    }
11028}
11029
11030impl wkt::message::Message for FetchProcessorTypesRequest {
11031    fn typename() -> &'static str {
11032        "type.googleapis.com/google.cloud.documentai.v1.FetchProcessorTypesRequest"
11033    }
11034}
11035
11036/// Response message for the
11037/// [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]
11038/// method.
11039///
11040/// [google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]: crate::client::DocumentProcessorService::fetch_processor_types
11041#[derive(Clone, Default, PartialEq)]
11042#[non_exhaustive]
11043pub struct FetchProcessorTypesResponse {
11044    /// The list of processor types.
11045    pub processor_types: std::vec::Vec<crate::model::ProcessorType>,
11046
11047    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11048}
11049
11050impl FetchProcessorTypesResponse {
11051    pub fn new() -> Self {
11052        std::default::Default::default()
11053    }
11054
11055    /// Sets the value of [processor_types][crate::model::FetchProcessorTypesResponse::processor_types].
11056    ///
11057    /// # Example
11058    /// ```ignore,no_run
11059    /// # use google_cloud_documentai_v1::model::FetchProcessorTypesResponse;
11060    /// use google_cloud_documentai_v1::model::ProcessorType;
11061    /// let x = FetchProcessorTypesResponse::new()
11062    ///     .set_processor_types([
11063    ///         ProcessorType::default()/* use setters */,
11064    ///         ProcessorType::default()/* use (different) setters */,
11065    ///     ]);
11066    /// ```
11067    pub fn set_processor_types<T, V>(mut self, v: T) -> Self
11068    where
11069        T: std::iter::IntoIterator<Item = V>,
11070        V: std::convert::Into<crate::model::ProcessorType>,
11071    {
11072        use std::iter::Iterator;
11073        self.processor_types = v.into_iter().map(|i| i.into()).collect();
11074        self
11075    }
11076}
11077
11078impl wkt::message::Message for FetchProcessorTypesResponse {
11079    fn typename() -> &'static str {
11080        "type.googleapis.com/google.cloud.documentai.v1.FetchProcessorTypesResponse"
11081    }
11082}
11083
11084/// Request message for the
11085/// [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
11086/// method. Some processor types may require the project be added to an
11087/// allowlist.
11088///
11089/// [google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]: crate::client::DocumentProcessorService::list_processor_types
11090#[derive(Clone, Default, PartialEq)]
11091#[non_exhaustive]
11092pub struct ListProcessorTypesRequest {
11093    /// Required. The location of processor types to list.
11094    /// Format: `projects/{project}/locations/{location}`.
11095    pub parent: std::string::String,
11096
11097    /// The maximum number of processor types to return.
11098    /// If unspecified, at most `100` processor types will be returned.
11099    /// The maximum value is `500`. Values above `500` will be coerced to `500`.
11100    pub page_size: i32,
11101
11102    /// Used to retrieve the next page of results, empty if at the end of the list.
11103    pub page_token: std::string::String,
11104
11105    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11106}
11107
11108impl ListProcessorTypesRequest {
11109    pub fn new() -> Self {
11110        std::default::Default::default()
11111    }
11112
11113    /// Sets the value of [parent][crate::model::ListProcessorTypesRequest::parent].
11114    ///
11115    /// # Example
11116    /// ```ignore,no_run
11117    /// # use google_cloud_documentai_v1::model::ListProcessorTypesRequest;
11118    /// let x = ListProcessorTypesRequest::new().set_parent("example");
11119    /// ```
11120    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11121        self.parent = v.into();
11122        self
11123    }
11124
11125    /// Sets the value of [page_size][crate::model::ListProcessorTypesRequest::page_size].
11126    ///
11127    /// # Example
11128    /// ```ignore,no_run
11129    /// # use google_cloud_documentai_v1::model::ListProcessorTypesRequest;
11130    /// let x = ListProcessorTypesRequest::new().set_page_size(42);
11131    /// ```
11132    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11133        self.page_size = v.into();
11134        self
11135    }
11136
11137    /// Sets the value of [page_token][crate::model::ListProcessorTypesRequest::page_token].
11138    ///
11139    /// # Example
11140    /// ```ignore,no_run
11141    /// # use google_cloud_documentai_v1::model::ListProcessorTypesRequest;
11142    /// let x = ListProcessorTypesRequest::new().set_page_token("example");
11143    /// ```
11144    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11145        self.page_token = v.into();
11146        self
11147    }
11148}
11149
11150impl wkt::message::Message for ListProcessorTypesRequest {
11151    fn typename() -> &'static str {
11152        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorTypesRequest"
11153    }
11154}
11155
11156/// Response message for the
11157/// [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]
11158/// method.
11159///
11160/// [google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes]: crate::client::DocumentProcessorService::list_processor_types
11161#[derive(Clone, Default, PartialEq)]
11162#[non_exhaustive]
11163pub struct ListProcessorTypesResponse {
11164    /// The processor types.
11165    pub processor_types: std::vec::Vec<crate::model::ProcessorType>,
11166
11167    /// Points to the next page, otherwise empty.
11168    pub next_page_token: std::string::String,
11169
11170    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11171}
11172
11173impl ListProcessorTypesResponse {
11174    pub fn new() -> Self {
11175        std::default::Default::default()
11176    }
11177
11178    /// Sets the value of [processor_types][crate::model::ListProcessorTypesResponse::processor_types].
11179    ///
11180    /// # Example
11181    /// ```ignore,no_run
11182    /// # use google_cloud_documentai_v1::model::ListProcessorTypesResponse;
11183    /// use google_cloud_documentai_v1::model::ProcessorType;
11184    /// let x = ListProcessorTypesResponse::new()
11185    ///     .set_processor_types([
11186    ///         ProcessorType::default()/* use setters */,
11187    ///         ProcessorType::default()/* use (different) setters */,
11188    ///     ]);
11189    /// ```
11190    pub fn set_processor_types<T, V>(mut self, v: T) -> Self
11191    where
11192        T: std::iter::IntoIterator<Item = V>,
11193        V: std::convert::Into<crate::model::ProcessorType>,
11194    {
11195        use std::iter::Iterator;
11196        self.processor_types = v.into_iter().map(|i| i.into()).collect();
11197        self
11198    }
11199
11200    /// Sets the value of [next_page_token][crate::model::ListProcessorTypesResponse::next_page_token].
11201    ///
11202    /// # Example
11203    /// ```ignore,no_run
11204    /// # use google_cloud_documentai_v1::model::ListProcessorTypesResponse;
11205    /// let x = ListProcessorTypesResponse::new().set_next_page_token("example");
11206    /// ```
11207    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11208        self.next_page_token = v.into();
11209        self
11210    }
11211}
11212
11213impl wkt::message::Message for ListProcessorTypesResponse {
11214    fn typename() -> &'static str {
11215        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorTypesResponse"
11216    }
11217}
11218
11219#[doc(hidden)]
11220impl google_cloud_gax::paginator::internal::PageableResponse for ListProcessorTypesResponse {
11221    type PageItem = crate::model::ProcessorType;
11222
11223    fn items(self) -> std::vec::Vec<Self::PageItem> {
11224        self.processor_types
11225    }
11226
11227    fn next_page_token(&self) -> std::string::String {
11228        use std::clone::Clone;
11229        self.next_page_token.clone()
11230    }
11231}
11232
11233/// Request message for list all processors belongs to a project.
11234#[derive(Clone, Default, PartialEq)]
11235#[non_exhaustive]
11236pub struct ListProcessorsRequest {
11237    /// Required. The parent (project and location) which owns this collection of
11238    /// Processors. Format: `projects/{project}/locations/{location}`
11239    pub parent: std::string::String,
11240
11241    /// The maximum number of processors to return.
11242    /// If unspecified, at most `50` processors will be returned.
11243    /// The maximum value is `100`. Values above `100` will be coerced to `100`.
11244    pub page_size: i32,
11245
11246    /// We will return the processors sorted by creation time. The page token
11247    /// will point to the next processor.
11248    pub page_token: std::string::String,
11249
11250    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11251}
11252
11253impl ListProcessorsRequest {
11254    pub fn new() -> Self {
11255        std::default::Default::default()
11256    }
11257
11258    /// Sets the value of [parent][crate::model::ListProcessorsRequest::parent].
11259    ///
11260    /// # Example
11261    /// ```ignore,no_run
11262    /// # use google_cloud_documentai_v1::model::ListProcessorsRequest;
11263    /// let x = ListProcessorsRequest::new().set_parent("example");
11264    /// ```
11265    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11266        self.parent = v.into();
11267        self
11268    }
11269
11270    /// Sets the value of [page_size][crate::model::ListProcessorsRequest::page_size].
11271    ///
11272    /// # Example
11273    /// ```ignore,no_run
11274    /// # use google_cloud_documentai_v1::model::ListProcessorsRequest;
11275    /// let x = ListProcessorsRequest::new().set_page_size(42);
11276    /// ```
11277    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11278        self.page_size = v.into();
11279        self
11280    }
11281
11282    /// Sets the value of [page_token][crate::model::ListProcessorsRequest::page_token].
11283    ///
11284    /// # Example
11285    /// ```ignore,no_run
11286    /// # use google_cloud_documentai_v1::model::ListProcessorsRequest;
11287    /// let x = ListProcessorsRequest::new().set_page_token("example");
11288    /// ```
11289    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11290        self.page_token = v.into();
11291        self
11292    }
11293}
11294
11295impl wkt::message::Message for ListProcessorsRequest {
11296    fn typename() -> &'static str {
11297        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorsRequest"
11298    }
11299}
11300
11301/// Response message for the
11302/// [ListProcessors][google.cloud.documentai.v1.DocumentProcessorService.ListProcessors]
11303/// method.
11304///
11305/// [google.cloud.documentai.v1.DocumentProcessorService.ListProcessors]: crate::client::DocumentProcessorService::list_processors
11306#[derive(Clone, Default, PartialEq)]
11307#[non_exhaustive]
11308pub struct ListProcessorsResponse {
11309    /// The list of processors.
11310    pub processors: std::vec::Vec<crate::model::Processor>,
11311
11312    /// Points to the next processor, otherwise empty.
11313    pub next_page_token: std::string::String,
11314
11315    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11316}
11317
11318impl ListProcessorsResponse {
11319    pub fn new() -> Self {
11320        std::default::Default::default()
11321    }
11322
11323    /// Sets the value of [processors][crate::model::ListProcessorsResponse::processors].
11324    ///
11325    /// # Example
11326    /// ```ignore,no_run
11327    /// # use google_cloud_documentai_v1::model::ListProcessorsResponse;
11328    /// use google_cloud_documentai_v1::model::Processor;
11329    /// let x = ListProcessorsResponse::new()
11330    ///     .set_processors([
11331    ///         Processor::default()/* use setters */,
11332    ///         Processor::default()/* use (different) setters */,
11333    ///     ]);
11334    /// ```
11335    pub fn set_processors<T, V>(mut self, v: T) -> Self
11336    where
11337        T: std::iter::IntoIterator<Item = V>,
11338        V: std::convert::Into<crate::model::Processor>,
11339    {
11340        use std::iter::Iterator;
11341        self.processors = v.into_iter().map(|i| i.into()).collect();
11342        self
11343    }
11344
11345    /// Sets the value of [next_page_token][crate::model::ListProcessorsResponse::next_page_token].
11346    ///
11347    /// # Example
11348    /// ```ignore,no_run
11349    /// # use google_cloud_documentai_v1::model::ListProcessorsResponse;
11350    /// let x = ListProcessorsResponse::new().set_next_page_token("example");
11351    /// ```
11352    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11353        self.next_page_token = v.into();
11354        self
11355    }
11356}
11357
11358impl wkt::message::Message for ListProcessorsResponse {
11359    fn typename() -> &'static str {
11360        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorsResponse"
11361    }
11362}
11363
11364#[doc(hidden)]
11365impl google_cloud_gax::paginator::internal::PageableResponse for ListProcessorsResponse {
11366    type PageItem = crate::model::Processor;
11367
11368    fn items(self) -> std::vec::Vec<Self::PageItem> {
11369        self.processors
11370    }
11371
11372    fn next_page_token(&self) -> std::string::String {
11373        use std::clone::Clone;
11374        self.next_page_token.clone()
11375    }
11376}
11377
11378/// Request message for the
11379/// [GetProcessorType][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType]
11380/// method.
11381///
11382/// [google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType]: crate::client::DocumentProcessorService::get_processor_type
11383#[derive(Clone, Default, PartialEq)]
11384#[non_exhaustive]
11385pub struct GetProcessorTypeRequest {
11386    /// Required. The processor type resource name.
11387    pub name: std::string::String,
11388
11389    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11390}
11391
11392impl GetProcessorTypeRequest {
11393    pub fn new() -> Self {
11394        std::default::Default::default()
11395    }
11396
11397    /// Sets the value of [name][crate::model::GetProcessorTypeRequest::name].
11398    ///
11399    /// # Example
11400    /// ```ignore,no_run
11401    /// # use google_cloud_documentai_v1::model::GetProcessorTypeRequest;
11402    /// let x = GetProcessorTypeRequest::new().set_name("example");
11403    /// ```
11404    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11405        self.name = v.into();
11406        self
11407    }
11408}
11409
11410impl wkt::message::Message for GetProcessorTypeRequest {
11411    fn typename() -> &'static str {
11412        "type.googleapis.com/google.cloud.documentai.v1.GetProcessorTypeRequest"
11413    }
11414}
11415
11416/// Request message for the
11417/// [GetProcessor][google.cloud.documentai.v1.DocumentProcessorService.GetProcessor]
11418/// method.
11419///
11420/// [google.cloud.documentai.v1.DocumentProcessorService.GetProcessor]: crate::client::DocumentProcessorService::get_processor
11421#[derive(Clone, Default, PartialEq)]
11422#[non_exhaustive]
11423pub struct GetProcessorRequest {
11424    /// Required. The processor resource name.
11425    pub name: std::string::String,
11426
11427    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11428}
11429
11430impl GetProcessorRequest {
11431    pub fn new() -> Self {
11432        std::default::Default::default()
11433    }
11434
11435    /// Sets the value of [name][crate::model::GetProcessorRequest::name].
11436    ///
11437    /// # Example
11438    /// ```ignore,no_run
11439    /// # use google_cloud_documentai_v1::model::GetProcessorRequest;
11440    /// let x = GetProcessorRequest::new().set_name("example");
11441    /// ```
11442    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11443        self.name = v.into();
11444        self
11445    }
11446}
11447
11448impl wkt::message::Message for GetProcessorRequest {
11449    fn typename() -> &'static str {
11450        "type.googleapis.com/google.cloud.documentai.v1.GetProcessorRequest"
11451    }
11452}
11453
11454/// Request message for the
11455/// [GetProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion]
11456/// method.
11457///
11458/// [google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion]: crate::client::DocumentProcessorService::get_processor_version
11459#[derive(Clone, Default, PartialEq)]
11460#[non_exhaustive]
11461pub struct GetProcessorVersionRequest {
11462    /// Required. The processor resource name.
11463    pub name: std::string::String,
11464
11465    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11466}
11467
11468impl GetProcessorVersionRequest {
11469    pub fn new() -> Self {
11470        std::default::Default::default()
11471    }
11472
11473    /// Sets the value of [name][crate::model::GetProcessorVersionRequest::name].
11474    ///
11475    /// # Example
11476    /// ```ignore,no_run
11477    /// # use google_cloud_documentai_v1::model::GetProcessorVersionRequest;
11478    /// let x = GetProcessorVersionRequest::new().set_name("example");
11479    /// ```
11480    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11481        self.name = v.into();
11482        self
11483    }
11484}
11485
11486impl wkt::message::Message for GetProcessorVersionRequest {
11487    fn typename() -> &'static str {
11488        "type.googleapis.com/google.cloud.documentai.v1.GetProcessorVersionRequest"
11489    }
11490}
11491
11492/// Request message for list all processor versions belongs to a processor.
11493#[derive(Clone, Default, PartialEq)]
11494#[non_exhaustive]
11495pub struct ListProcessorVersionsRequest {
11496    /// Required. The parent (project, location and processor) to list all
11497    /// versions. Format:
11498    /// `projects/{project}/locations/{location}/processors/{processor}`
11499    pub parent: std::string::String,
11500
11501    /// The maximum number of processor versions to return.
11502    /// If unspecified, at most `10` processor versions will be returned.
11503    /// The maximum value is `20`. Values above `20` will be coerced to `20`.
11504    pub page_size: i32,
11505
11506    /// We will return the processor versions sorted by creation time. The page
11507    /// token will point to the next processor version.
11508    pub page_token: std::string::String,
11509
11510    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11511}
11512
11513impl ListProcessorVersionsRequest {
11514    pub fn new() -> Self {
11515        std::default::Default::default()
11516    }
11517
11518    /// Sets the value of [parent][crate::model::ListProcessorVersionsRequest::parent].
11519    ///
11520    /// # Example
11521    /// ```ignore,no_run
11522    /// # use google_cloud_documentai_v1::model::ListProcessorVersionsRequest;
11523    /// let x = ListProcessorVersionsRequest::new().set_parent("example");
11524    /// ```
11525    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11526        self.parent = v.into();
11527        self
11528    }
11529
11530    /// Sets the value of [page_size][crate::model::ListProcessorVersionsRequest::page_size].
11531    ///
11532    /// # Example
11533    /// ```ignore,no_run
11534    /// # use google_cloud_documentai_v1::model::ListProcessorVersionsRequest;
11535    /// let x = ListProcessorVersionsRequest::new().set_page_size(42);
11536    /// ```
11537    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11538        self.page_size = v.into();
11539        self
11540    }
11541
11542    /// Sets the value of [page_token][crate::model::ListProcessorVersionsRequest::page_token].
11543    ///
11544    /// # Example
11545    /// ```ignore,no_run
11546    /// # use google_cloud_documentai_v1::model::ListProcessorVersionsRequest;
11547    /// let x = ListProcessorVersionsRequest::new().set_page_token("example");
11548    /// ```
11549    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11550        self.page_token = v.into();
11551        self
11552    }
11553}
11554
11555impl wkt::message::Message for ListProcessorVersionsRequest {
11556    fn typename() -> &'static str {
11557        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorVersionsRequest"
11558    }
11559}
11560
11561/// Response message for the
11562/// [ListProcessorVersions][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions]
11563/// method.
11564///
11565/// [google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions]: crate::client::DocumentProcessorService::list_processor_versions
11566#[derive(Clone, Default, PartialEq)]
11567#[non_exhaustive]
11568pub struct ListProcessorVersionsResponse {
11569    /// The list of processors.
11570    pub processor_versions: std::vec::Vec<crate::model::ProcessorVersion>,
11571
11572    /// Points to the next processor, otherwise empty.
11573    pub next_page_token: std::string::String,
11574
11575    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11576}
11577
11578impl ListProcessorVersionsResponse {
11579    pub fn new() -> Self {
11580        std::default::Default::default()
11581    }
11582
11583    /// Sets the value of [processor_versions][crate::model::ListProcessorVersionsResponse::processor_versions].
11584    ///
11585    /// # Example
11586    /// ```ignore,no_run
11587    /// # use google_cloud_documentai_v1::model::ListProcessorVersionsResponse;
11588    /// use google_cloud_documentai_v1::model::ProcessorVersion;
11589    /// let x = ListProcessorVersionsResponse::new()
11590    ///     .set_processor_versions([
11591    ///         ProcessorVersion::default()/* use setters */,
11592    ///         ProcessorVersion::default()/* use (different) setters */,
11593    ///     ]);
11594    /// ```
11595    pub fn set_processor_versions<T, V>(mut self, v: T) -> Self
11596    where
11597        T: std::iter::IntoIterator<Item = V>,
11598        V: std::convert::Into<crate::model::ProcessorVersion>,
11599    {
11600        use std::iter::Iterator;
11601        self.processor_versions = v.into_iter().map(|i| i.into()).collect();
11602        self
11603    }
11604
11605    /// Sets the value of [next_page_token][crate::model::ListProcessorVersionsResponse::next_page_token].
11606    ///
11607    /// # Example
11608    /// ```ignore,no_run
11609    /// # use google_cloud_documentai_v1::model::ListProcessorVersionsResponse;
11610    /// let x = ListProcessorVersionsResponse::new().set_next_page_token("example");
11611    /// ```
11612    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11613        self.next_page_token = v.into();
11614        self
11615    }
11616}
11617
11618impl wkt::message::Message for ListProcessorVersionsResponse {
11619    fn typename() -> &'static str {
11620        "type.googleapis.com/google.cloud.documentai.v1.ListProcessorVersionsResponse"
11621    }
11622}
11623
11624#[doc(hidden)]
11625impl google_cloud_gax::paginator::internal::PageableResponse for ListProcessorVersionsResponse {
11626    type PageItem = crate::model::ProcessorVersion;
11627
11628    fn items(self) -> std::vec::Vec<Self::PageItem> {
11629        self.processor_versions
11630    }
11631
11632    fn next_page_token(&self) -> std::string::String {
11633        use std::clone::Clone;
11634        self.next_page_token.clone()
11635    }
11636}
11637
11638/// Request message for the
11639/// [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]
11640/// method.
11641///
11642/// [google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]: crate::client::DocumentProcessorService::delete_processor_version
11643#[derive(Clone, Default, PartialEq)]
11644#[non_exhaustive]
11645pub struct DeleteProcessorVersionRequest {
11646    /// Required. The processor version resource name to be deleted.
11647    pub name: std::string::String,
11648
11649    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11650}
11651
11652impl DeleteProcessorVersionRequest {
11653    pub fn new() -> Self {
11654        std::default::Default::default()
11655    }
11656
11657    /// Sets the value of [name][crate::model::DeleteProcessorVersionRequest::name].
11658    ///
11659    /// # Example
11660    /// ```ignore,no_run
11661    /// # use google_cloud_documentai_v1::model::DeleteProcessorVersionRequest;
11662    /// let x = DeleteProcessorVersionRequest::new().set_name("example");
11663    /// ```
11664    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11665        self.name = v.into();
11666        self
11667    }
11668}
11669
11670impl wkt::message::Message for DeleteProcessorVersionRequest {
11671    fn typename() -> &'static str {
11672        "type.googleapis.com/google.cloud.documentai.v1.DeleteProcessorVersionRequest"
11673    }
11674}
11675
11676/// The long-running operation metadata for the
11677/// [DeleteProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]
11678/// method.
11679///
11680/// [google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion]: crate::client::DocumentProcessorService::delete_processor_version
11681#[derive(Clone, Default, PartialEq)]
11682#[non_exhaustive]
11683pub struct DeleteProcessorVersionMetadata {
11684    /// The basic metadata of the long-running operation.
11685    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
11686
11687    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11688}
11689
11690impl DeleteProcessorVersionMetadata {
11691    pub fn new() -> Self {
11692        std::default::Default::default()
11693    }
11694
11695    /// Sets the value of [common_metadata][crate::model::DeleteProcessorVersionMetadata::common_metadata].
11696    ///
11697    /// # Example
11698    /// ```ignore,no_run
11699    /// # use google_cloud_documentai_v1::model::DeleteProcessorVersionMetadata;
11700    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
11701    /// let x = DeleteProcessorVersionMetadata::new().set_common_metadata(CommonOperationMetadata::default()/* use setters */);
11702    /// ```
11703    pub fn set_common_metadata<T>(mut self, v: T) -> Self
11704    where
11705        T: std::convert::Into<crate::model::CommonOperationMetadata>,
11706    {
11707        self.common_metadata = std::option::Option::Some(v.into());
11708        self
11709    }
11710
11711    /// Sets or clears the value of [common_metadata][crate::model::DeleteProcessorVersionMetadata::common_metadata].
11712    ///
11713    /// # Example
11714    /// ```ignore,no_run
11715    /// # use google_cloud_documentai_v1::model::DeleteProcessorVersionMetadata;
11716    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
11717    /// let x = DeleteProcessorVersionMetadata::new().set_or_clear_common_metadata(Some(CommonOperationMetadata::default()/* use setters */));
11718    /// let x = DeleteProcessorVersionMetadata::new().set_or_clear_common_metadata(None::<CommonOperationMetadata>);
11719    /// ```
11720    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
11721    where
11722        T: std::convert::Into<crate::model::CommonOperationMetadata>,
11723    {
11724        self.common_metadata = v.map(|x| x.into());
11725        self
11726    }
11727}
11728
11729impl wkt::message::Message for DeleteProcessorVersionMetadata {
11730    fn typename() -> &'static str {
11731        "type.googleapis.com/google.cloud.documentai.v1.DeleteProcessorVersionMetadata"
11732    }
11733}
11734
11735/// Request message for the
11736/// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
11737/// method.
11738///
11739/// [google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]: crate::client::DocumentProcessorService::deploy_processor_version
11740#[derive(Clone, Default, PartialEq)]
11741#[non_exhaustive]
11742pub struct DeployProcessorVersionRequest {
11743    /// Required. The processor version resource name to be deployed.
11744    pub name: std::string::String,
11745
11746    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11747}
11748
11749impl DeployProcessorVersionRequest {
11750    pub fn new() -> Self {
11751        std::default::Default::default()
11752    }
11753
11754    /// Sets the value of [name][crate::model::DeployProcessorVersionRequest::name].
11755    ///
11756    /// # Example
11757    /// ```ignore,no_run
11758    /// # use google_cloud_documentai_v1::model::DeployProcessorVersionRequest;
11759    /// let x = DeployProcessorVersionRequest::new().set_name("example");
11760    /// ```
11761    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11762        self.name = v.into();
11763        self
11764    }
11765}
11766
11767impl wkt::message::Message for DeployProcessorVersionRequest {
11768    fn typename() -> &'static str {
11769        "type.googleapis.com/google.cloud.documentai.v1.DeployProcessorVersionRequest"
11770    }
11771}
11772
11773/// Response message for the
11774/// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
11775/// method.
11776///
11777/// [google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]: crate::client::DocumentProcessorService::deploy_processor_version
11778#[derive(Clone, Default, PartialEq)]
11779#[non_exhaustive]
11780pub struct DeployProcessorVersionResponse {
11781    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11782}
11783
11784impl DeployProcessorVersionResponse {
11785    pub fn new() -> Self {
11786        std::default::Default::default()
11787    }
11788}
11789
11790impl wkt::message::Message for DeployProcessorVersionResponse {
11791    fn typename() -> &'static str {
11792        "type.googleapis.com/google.cloud.documentai.v1.DeployProcessorVersionResponse"
11793    }
11794}
11795
11796/// The long-running operation metadata for the
11797/// [DeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]
11798/// method.
11799///
11800/// [google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion]: crate::client::DocumentProcessorService::deploy_processor_version
11801#[derive(Clone, Default, PartialEq)]
11802#[non_exhaustive]
11803pub struct DeployProcessorVersionMetadata {
11804    /// The basic metadata of the long-running operation.
11805    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
11806
11807    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11808}
11809
11810impl DeployProcessorVersionMetadata {
11811    pub fn new() -> Self {
11812        std::default::Default::default()
11813    }
11814
11815    /// Sets the value of [common_metadata][crate::model::DeployProcessorVersionMetadata::common_metadata].
11816    ///
11817    /// # Example
11818    /// ```ignore,no_run
11819    /// # use google_cloud_documentai_v1::model::DeployProcessorVersionMetadata;
11820    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
11821    /// let x = DeployProcessorVersionMetadata::new().set_common_metadata(CommonOperationMetadata::default()/* use setters */);
11822    /// ```
11823    pub fn set_common_metadata<T>(mut self, v: T) -> Self
11824    where
11825        T: std::convert::Into<crate::model::CommonOperationMetadata>,
11826    {
11827        self.common_metadata = std::option::Option::Some(v.into());
11828        self
11829    }
11830
11831    /// Sets or clears the value of [common_metadata][crate::model::DeployProcessorVersionMetadata::common_metadata].
11832    ///
11833    /// # Example
11834    /// ```ignore,no_run
11835    /// # use google_cloud_documentai_v1::model::DeployProcessorVersionMetadata;
11836    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
11837    /// let x = DeployProcessorVersionMetadata::new().set_or_clear_common_metadata(Some(CommonOperationMetadata::default()/* use setters */));
11838    /// let x = DeployProcessorVersionMetadata::new().set_or_clear_common_metadata(None::<CommonOperationMetadata>);
11839    /// ```
11840    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
11841    where
11842        T: std::convert::Into<crate::model::CommonOperationMetadata>,
11843    {
11844        self.common_metadata = v.map(|x| x.into());
11845        self
11846    }
11847}
11848
11849impl wkt::message::Message for DeployProcessorVersionMetadata {
11850    fn typename() -> &'static str {
11851        "type.googleapis.com/google.cloud.documentai.v1.DeployProcessorVersionMetadata"
11852    }
11853}
11854
11855/// Request message for the
11856/// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]
11857/// method.
11858///
11859/// [google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]: crate::client::DocumentProcessorService::undeploy_processor_version
11860#[derive(Clone, Default, PartialEq)]
11861#[non_exhaustive]
11862pub struct UndeployProcessorVersionRequest {
11863    /// Required. The processor version resource name to be undeployed.
11864    pub name: std::string::String,
11865
11866    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11867}
11868
11869impl UndeployProcessorVersionRequest {
11870    pub fn new() -> Self {
11871        std::default::Default::default()
11872    }
11873
11874    /// Sets the value of [name][crate::model::UndeployProcessorVersionRequest::name].
11875    ///
11876    /// # Example
11877    /// ```ignore,no_run
11878    /// # use google_cloud_documentai_v1::model::UndeployProcessorVersionRequest;
11879    /// let x = UndeployProcessorVersionRequest::new().set_name("example");
11880    /// ```
11881    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11882        self.name = v.into();
11883        self
11884    }
11885}
11886
11887impl wkt::message::Message for UndeployProcessorVersionRequest {
11888    fn typename() -> &'static str {
11889        "type.googleapis.com/google.cloud.documentai.v1.UndeployProcessorVersionRequest"
11890    }
11891}
11892
11893/// Response message for the
11894/// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]
11895/// method.
11896///
11897/// [google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]: crate::client::DocumentProcessorService::undeploy_processor_version
11898#[derive(Clone, Default, PartialEq)]
11899#[non_exhaustive]
11900pub struct UndeployProcessorVersionResponse {
11901    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11902}
11903
11904impl UndeployProcessorVersionResponse {
11905    pub fn new() -> Self {
11906        std::default::Default::default()
11907    }
11908}
11909
11910impl wkt::message::Message for UndeployProcessorVersionResponse {
11911    fn typename() -> &'static str {
11912        "type.googleapis.com/google.cloud.documentai.v1.UndeployProcessorVersionResponse"
11913    }
11914}
11915
11916/// The long-running operation metadata for the
11917/// [UndeployProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]
11918/// method.
11919///
11920/// [google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion]: crate::client::DocumentProcessorService::undeploy_processor_version
11921#[derive(Clone, Default, PartialEq)]
11922#[non_exhaustive]
11923pub struct UndeployProcessorVersionMetadata {
11924    /// The basic metadata of the long-running operation.
11925    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
11926
11927    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11928}
11929
11930impl UndeployProcessorVersionMetadata {
11931    pub fn new() -> Self {
11932        std::default::Default::default()
11933    }
11934
11935    /// Sets the value of [common_metadata][crate::model::UndeployProcessorVersionMetadata::common_metadata].
11936    ///
11937    /// # Example
11938    /// ```ignore,no_run
11939    /// # use google_cloud_documentai_v1::model::UndeployProcessorVersionMetadata;
11940    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
11941    /// let x = UndeployProcessorVersionMetadata::new().set_common_metadata(CommonOperationMetadata::default()/* use setters */);
11942    /// ```
11943    pub fn set_common_metadata<T>(mut self, v: T) -> Self
11944    where
11945        T: std::convert::Into<crate::model::CommonOperationMetadata>,
11946    {
11947        self.common_metadata = std::option::Option::Some(v.into());
11948        self
11949    }
11950
11951    /// Sets or clears the value of [common_metadata][crate::model::UndeployProcessorVersionMetadata::common_metadata].
11952    ///
11953    /// # Example
11954    /// ```ignore,no_run
11955    /// # use google_cloud_documentai_v1::model::UndeployProcessorVersionMetadata;
11956    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
11957    /// let x = UndeployProcessorVersionMetadata::new().set_or_clear_common_metadata(Some(CommonOperationMetadata::default()/* use setters */));
11958    /// let x = UndeployProcessorVersionMetadata::new().set_or_clear_common_metadata(None::<CommonOperationMetadata>);
11959    /// ```
11960    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
11961    where
11962        T: std::convert::Into<crate::model::CommonOperationMetadata>,
11963    {
11964        self.common_metadata = v.map(|x| x.into());
11965        self
11966    }
11967}
11968
11969impl wkt::message::Message for UndeployProcessorVersionMetadata {
11970    fn typename() -> &'static str {
11971        "type.googleapis.com/google.cloud.documentai.v1.UndeployProcessorVersionMetadata"
11972    }
11973}
11974
11975/// Request message for the
11976/// [CreateProcessor][google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor]
11977/// method. Notice this request is sent to a regionalized backend service. If the
11978/// [ProcessorType][google.cloud.documentai.v1.ProcessorType] isn't available in
11979/// that region, the creation fails.
11980///
11981/// [google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor]: crate::client::DocumentProcessorService::create_processor
11982/// [google.cloud.documentai.v1.ProcessorType]: crate::model::ProcessorType
11983#[derive(Clone, Default, PartialEq)]
11984#[non_exhaustive]
11985pub struct CreateProcessorRequest {
11986    /// Required. The parent (project and location) under which to create the
11987    /// processor. Format: `projects/{project}/locations/{location}`
11988    pub parent: std::string::String,
11989
11990    /// Required. The processor to be created, requires
11991    /// [Processor.type][google.cloud.documentai.v1.Processor.type] and
11992    /// [Processor.display_name][google.cloud.documentai.v1.Processor.display_name]
11993    /// to be set. Also, the
11994    /// [Processor.kms_key_name][google.cloud.documentai.v1.Processor.kms_key_name]
11995    /// field must be set if the processor is under CMEK.
11996    ///
11997    /// [google.cloud.documentai.v1.Processor.display_name]: crate::model::Processor::display_name
11998    /// [google.cloud.documentai.v1.Processor.kms_key_name]: crate::model::Processor::kms_key_name
11999    /// [google.cloud.documentai.v1.Processor.type]: crate::model::Processor::type
12000    pub processor: std::option::Option<crate::model::Processor>,
12001
12002    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12003}
12004
12005impl CreateProcessorRequest {
12006    pub fn new() -> Self {
12007        std::default::Default::default()
12008    }
12009
12010    /// Sets the value of [parent][crate::model::CreateProcessorRequest::parent].
12011    ///
12012    /// # Example
12013    /// ```ignore,no_run
12014    /// # use google_cloud_documentai_v1::model::CreateProcessorRequest;
12015    /// let x = CreateProcessorRequest::new().set_parent("example");
12016    /// ```
12017    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12018        self.parent = v.into();
12019        self
12020    }
12021
12022    /// Sets the value of [processor][crate::model::CreateProcessorRequest::processor].
12023    ///
12024    /// # Example
12025    /// ```ignore,no_run
12026    /// # use google_cloud_documentai_v1::model::CreateProcessorRequest;
12027    /// use google_cloud_documentai_v1::model::Processor;
12028    /// let x = CreateProcessorRequest::new().set_processor(Processor::default()/* use setters */);
12029    /// ```
12030    pub fn set_processor<T>(mut self, v: T) -> Self
12031    where
12032        T: std::convert::Into<crate::model::Processor>,
12033    {
12034        self.processor = std::option::Option::Some(v.into());
12035        self
12036    }
12037
12038    /// Sets or clears the value of [processor][crate::model::CreateProcessorRequest::processor].
12039    ///
12040    /// # Example
12041    /// ```ignore,no_run
12042    /// # use google_cloud_documentai_v1::model::CreateProcessorRequest;
12043    /// use google_cloud_documentai_v1::model::Processor;
12044    /// let x = CreateProcessorRequest::new().set_or_clear_processor(Some(Processor::default()/* use setters */));
12045    /// let x = CreateProcessorRequest::new().set_or_clear_processor(None::<Processor>);
12046    /// ```
12047    pub fn set_or_clear_processor<T>(mut self, v: std::option::Option<T>) -> Self
12048    where
12049        T: std::convert::Into<crate::model::Processor>,
12050    {
12051        self.processor = v.map(|x| x.into());
12052        self
12053    }
12054}
12055
12056impl wkt::message::Message for CreateProcessorRequest {
12057    fn typename() -> &'static str {
12058        "type.googleapis.com/google.cloud.documentai.v1.CreateProcessorRequest"
12059    }
12060}
12061
12062/// Request message for the
12063/// [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]
12064/// method.
12065///
12066/// [google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]: crate::client::DocumentProcessorService::delete_processor
12067#[derive(Clone, Default, PartialEq)]
12068#[non_exhaustive]
12069pub struct DeleteProcessorRequest {
12070    /// Required. The processor resource name to be deleted.
12071    pub name: std::string::String,
12072
12073    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12074}
12075
12076impl DeleteProcessorRequest {
12077    pub fn new() -> Self {
12078        std::default::Default::default()
12079    }
12080
12081    /// Sets the value of [name][crate::model::DeleteProcessorRequest::name].
12082    ///
12083    /// # Example
12084    /// ```ignore,no_run
12085    /// # use google_cloud_documentai_v1::model::DeleteProcessorRequest;
12086    /// let x = DeleteProcessorRequest::new().set_name("example");
12087    /// ```
12088    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12089        self.name = v.into();
12090        self
12091    }
12092}
12093
12094impl wkt::message::Message for DeleteProcessorRequest {
12095    fn typename() -> &'static str {
12096        "type.googleapis.com/google.cloud.documentai.v1.DeleteProcessorRequest"
12097    }
12098}
12099
12100/// The long-running operation metadata for the
12101/// [DeleteProcessor][google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]
12102/// method.
12103///
12104/// [google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor]: crate::client::DocumentProcessorService::delete_processor
12105#[derive(Clone, Default, PartialEq)]
12106#[non_exhaustive]
12107pub struct DeleteProcessorMetadata {
12108    /// The basic metadata of the long-running operation.
12109    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
12110
12111    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12112}
12113
12114impl DeleteProcessorMetadata {
12115    pub fn new() -> Self {
12116        std::default::Default::default()
12117    }
12118
12119    /// Sets the value of [common_metadata][crate::model::DeleteProcessorMetadata::common_metadata].
12120    ///
12121    /// # Example
12122    /// ```ignore,no_run
12123    /// # use google_cloud_documentai_v1::model::DeleteProcessorMetadata;
12124    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
12125    /// let x = DeleteProcessorMetadata::new().set_common_metadata(CommonOperationMetadata::default()/* use setters */);
12126    /// ```
12127    pub fn set_common_metadata<T>(mut self, v: T) -> Self
12128    where
12129        T: std::convert::Into<crate::model::CommonOperationMetadata>,
12130    {
12131        self.common_metadata = std::option::Option::Some(v.into());
12132        self
12133    }
12134
12135    /// Sets or clears the value of [common_metadata][crate::model::DeleteProcessorMetadata::common_metadata].
12136    ///
12137    /// # Example
12138    /// ```ignore,no_run
12139    /// # use google_cloud_documentai_v1::model::DeleteProcessorMetadata;
12140    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
12141    /// let x = DeleteProcessorMetadata::new().set_or_clear_common_metadata(Some(CommonOperationMetadata::default()/* use setters */));
12142    /// let x = DeleteProcessorMetadata::new().set_or_clear_common_metadata(None::<CommonOperationMetadata>);
12143    /// ```
12144    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12145    where
12146        T: std::convert::Into<crate::model::CommonOperationMetadata>,
12147    {
12148        self.common_metadata = v.map(|x| x.into());
12149        self
12150    }
12151}
12152
12153impl wkt::message::Message for DeleteProcessorMetadata {
12154    fn typename() -> &'static str {
12155        "type.googleapis.com/google.cloud.documentai.v1.DeleteProcessorMetadata"
12156    }
12157}
12158
12159/// Request message for the
12160/// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]
12161/// method.
12162///
12163/// [google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]: crate::client::DocumentProcessorService::enable_processor
12164#[derive(Clone, Default, PartialEq)]
12165#[non_exhaustive]
12166pub struct EnableProcessorRequest {
12167    /// Required. The processor resource name to be enabled.
12168    pub name: std::string::String,
12169
12170    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12171}
12172
12173impl EnableProcessorRequest {
12174    pub fn new() -> Self {
12175        std::default::Default::default()
12176    }
12177
12178    /// Sets the value of [name][crate::model::EnableProcessorRequest::name].
12179    ///
12180    /// # Example
12181    /// ```ignore,no_run
12182    /// # use google_cloud_documentai_v1::model::EnableProcessorRequest;
12183    /// let x = EnableProcessorRequest::new().set_name("example");
12184    /// ```
12185    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12186        self.name = v.into();
12187        self
12188    }
12189}
12190
12191impl wkt::message::Message for EnableProcessorRequest {
12192    fn typename() -> &'static str {
12193        "type.googleapis.com/google.cloud.documentai.v1.EnableProcessorRequest"
12194    }
12195}
12196
12197/// Response message for the
12198/// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]
12199/// method. Intentionally empty proto for adding fields in future.
12200///
12201/// [google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]: crate::client::DocumentProcessorService::enable_processor
12202#[derive(Clone, Default, PartialEq)]
12203#[non_exhaustive]
12204pub struct EnableProcessorResponse {
12205    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12206}
12207
12208impl EnableProcessorResponse {
12209    pub fn new() -> Self {
12210        std::default::Default::default()
12211    }
12212}
12213
12214impl wkt::message::Message for EnableProcessorResponse {
12215    fn typename() -> &'static str {
12216        "type.googleapis.com/google.cloud.documentai.v1.EnableProcessorResponse"
12217    }
12218}
12219
12220/// The long-running operation metadata for the
12221/// [EnableProcessor][google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]
12222/// method.
12223///
12224/// [google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor]: crate::client::DocumentProcessorService::enable_processor
12225#[derive(Clone, Default, PartialEq)]
12226#[non_exhaustive]
12227pub struct EnableProcessorMetadata {
12228    /// The basic metadata of the long-running operation.
12229    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
12230
12231    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12232}
12233
12234impl EnableProcessorMetadata {
12235    pub fn new() -> Self {
12236        std::default::Default::default()
12237    }
12238
12239    /// Sets the value of [common_metadata][crate::model::EnableProcessorMetadata::common_metadata].
12240    ///
12241    /// # Example
12242    /// ```ignore,no_run
12243    /// # use google_cloud_documentai_v1::model::EnableProcessorMetadata;
12244    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
12245    /// let x = EnableProcessorMetadata::new().set_common_metadata(CommonOperationMetadata::default()/* use setters */);
12246    /// ```
12247    pub fn set_common_metadata<T>(mut self, v: T) -> Self
12248    where
12249        T: std::convert::Into<crate::model::CommonOperationMetadata>,
12250    {
12251        self.common_metadata = std::option::Option::Some(v.into());
12252        self
12253    }
12254
12255    /// Sets or clears the value of [common_metadata][crate::model::EnableProcessorMetadata::common_metadata].
12256    ///
12257    /// # Example
12258    /// ```ignore,no_run
12259    /// # use google_cloud_documentai_v1::model::EnableProcessorMetadata;
12260    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
12261    /// let x = EnableProcessorMetadata::new().set_or_clear_common_metadata(Some(CommonOperationMetadata::default()/* use setters */));
12262    /// let x = EnableProcessorMetadata::new().set_or_clear_common_metadata(None::<CommonOperationMetadata>);
12263    /// ```
12264    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12265    where
12266        T: std::convert::Into<crate::model::CommonOperationMetadata>,
12267    {
12268        self.common_metadata = v.map(|x| x.into());
12269        self
12270    }
12271}
12272
12273impl wkt::message::Message for EnableProcessorMetadata {
12274    fn typename() -> &'static str {
12275        "type.googleapis.com/google.cloud.documentai.v1.EnableProcessorMetadata"
12276    }
12277}
12278
12279/// Request message for the
12280/// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
12281/// method.
12282///
12283/// [google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]: crate::client::DocumentProcessorService::disable_processor
12284#[derive(Clone, Default, PartialEq)]
12285#[non_exhaustive]
12286pub struct DisableProcessorRequest {
12287    /// Required. The processor resource name to be disabled.
12288    pub name: std::string::String,
12289
12290    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12291}
12292
12293impl DisableProcessorRequest {
12294    pub fn new() -> Self {
12295        std::default::Default::default()
12296    }
12297
12298    /// Sets the value of [name][crate::model::DisableProcessorRequest::name].
12299    ///
12300    /// # Example
12301    /// ```ignore,no_run
12302    /// # use google_cloud_documentai_v1::model::DisableProcessorRequest;
12303    /// let x = DisableProcessorRequest::new().set_name("example");
12304    /// ```
12305    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12306        self.name = v.into();
12307        self
12308    }
12309}
12310
12311impl wkt::message::Message for DisableProcessorRequest {
12312    fn typename() -> &'static str {
12313        "type.googleapis.com/google.cloud.documentai.v1.DisableProcessorRequest"
12314    }
12315}
12316
12317/// Response message for the
12318/// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
12319/// method. Intentionally empty proto for adding fields in future.
12320///
12321/// [google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]: crate::client::DocumentProcessorService::disable_processor
12322#[derive(Clone, Default, PartialEq)]
12323#[non_exhaustive]
12324pub struct DisableProcessorResponse {
12325    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12326}
12327
12328impl DisableProcessorResponse {
12329    pub fn new() -> Self {
12330        std::default::Default::default()
12331    }
12332}
12333
12334impl wkt::message::Message for DisableProcessorResponse {
12335    fn typename() -> &'static str {
12336        "type.googleapis.com/google.cloud.documentai.v1.DisableProcessorResponse"
12337    }
12338}
12339
12340/// The long-running operation metadata for the
12341/// [DisableProcessor][google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]
12342/// method.
12343///
12344/// [google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor]: crate::client::DocumentProcessorService::disable_processor
12345#[derive(Clone, Default, PartialEq)]
12346#[non_exhaustive]
12347pub struct DisableProcessorMetadata {
12348    /// The basic metadata of the long-running operation.
12349    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
12350
12351    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12352}
12353
12354impl DisableProcessorMetadata {
12355    pub fn new() -> Self {
12356        std::default::Default::default()
12357    }
12358
12359    /// Sets the value of [common_metadata][crate::model::DisableProcessorMetadata::common_metadata].
12360    ///
12361    /// # Example
12362    /// ```ignore,no_run
12363    /// # use google_cloud_documentai_v1::model::DisableProcessorMetadata;
12364    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
12365    /// let x = DisableProcessorMetadata::new().set_common_metadata(CommonOperationMetadata::default()/* use setters */);
12366    /// ```
12367    pub fn set_common_metadata<T>(mut self, v: T) -> Self
12368    where
12369        T: std::convert::Into<crate::model::CommonOperationMetadata>,
12370    {
12371        self.common_metadata = std::option::Option::Some(v.into());
12372        self
12373    }
12374
12375    /// Sets or clears the value of [common_metadata][crate::model::DisableProcessorMetadata::common_metadata].
12376    ///
12377    /// # Example
12378    /// ```ignore,no_run
12379    /// # use google_cloud_documentai_v1::model::DisableProcessorMetadata;
12380    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
12381    /// let x = DisableProcessorMetadata::new().set_or_clear_common_metadata(Some(CommonOperationMetadata::default()/* use setters */));
12382    /// let x = DisableProcessorMetadata::new().set_or_clear_common_metadata(None::<CommonOperationMetadata>);
12383    /// ```
12384    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12385    where
12386        T: std::convert::Into<crate::model::CommonOperationMetadata>,
12387    {
12388        self.common_metadata = v.map(|x| x.into());
12389        self
12390    }
12391}
12392
12393impl wkt::message::Message for DisableProcessorMetadata {
12394    fn typename() -> &'static str {
12395        "type.googleapis.com/google.cloud.documentai.v1.DisableProcessorMetadata"
12396    }
12397}
12398
12399/// Request message for the
12400/// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]
12401/// method.
12402///
12403/// [google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]: crate::client::DocumentProcessorService::set_default_processor_version
12404#[derive(Clone, Default, PartialEq)]
12405#[non_exhaustive]
12406pub struct SetDefaultProcessorVersionRequest {
12407    /// Required. The resource name of the
12408    /// [Processor][google.cloud.documentai.v1.Processor] to change default
12409    /// version.
12410    ///
12411    /// [google.cloud.documentai.v1.Processor]: crate::model::Processor
12412    pub processor: std::string::String,
12413
12414    /// Required. The resource name of child
12415    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to use as
12416    /// default. Format:
12417    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
12418    ///
12419    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
12420    pub default_processor_version: std::string::String,
12421
12422    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12423}
12424
12425impl SetDefaultProcessorVersionRequest {
12426    pub fn new() -> Self {
12427        std::default::Default::default()
12428    }
12429
12430    /// Sets the value of [processor][crate::model::SetDefaultProcessorVersionRequest::processor].
12431    ///
12432    /// # Example
12433    /// ```ignore,no_run
12434    /// # use google_cloud_documentai_v1::model::SetDefaultProcessorVersionRequest;
12435    /// let x = SetDefaultProcessorVersionRequest::new().set_processor("example");
12436    /// ```
12437    pub fn set_processor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12438        self.processor = v.into();
12439        self
12440    }
12441
12442    /// Sets the value of [default_processor_version][crate::model::SetDefaultProcessorVersionRequest::default_processor_version].
12443    ///
12444    /// # Example
12445    /// ```ignore,no_run
12446    /// # use google_cloud_documentai_v1::model::SetDefaultProcessorVersionRequest;
12447    /// let x = SetDefaultProcessorVersionRequest::new().set_default_processor_version("example");
12448    /// ```
12449    pub fn set_default_processor_version<T: std::convert::Into<std::string::String>>(
12450        mut self,
12451        v: T,
12452    ) -> Self {
12453        self.default_processor_version = v.into();
12454        self
12455    }
12456}
12457
12458impl wkt::message::Message for SetDefaultProcessorVersionRequest {
12459    fn typename() -> &'static str {
12460        "type.googleapis.com/google.cloud.documentai.v1.SetDefaultProcessorVersionRequest"
12461    }
12462}
12463
12464/// Response message for the
12465/// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]
12466/// method.
12467///
12468/// [google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]: crate::client::DocumentProcessorService::set_default_processor_version
12469#[derive(Clone, Default, PartialEq)]
12470#[non_exhaustive]
12471pub struct SetDefaultProcessorVersionResponse {
12472    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12473}
12474
12475impl SetDefaultProcessorVersionResponse {
12476    pub fn new() -> Self {
12477        std::default::Default::default()
12478    }
12479}
12480
12481impl wkt::message::Message for SetDefaultProcessorVersionResponse {
12482    fn typename() -> &'static str {
12483        "type.googleapis.com/google.cloud.documentai.v1.SetDefaultProcessorVersionResponse"
12484    }
12485}
12486
12487/// The long-running operation metadata for the
12488/// [SetDefaultProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]
12489/// method.
12490///
12491/// [google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion]: crate::client::DocumentProcessorService::set_default_processor_version
12492#[derive(Clone, Default, PartialEq)]
12493#[non_exhaustive]
12494pub struct SetDefaultProcessorVersionMetadata {
12495    /// The basic metadata of the long-running operation.
12496    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
12497
12498    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12499}
12500
12501impl SetDefaultProcessorVersionMetadata {
12502    pub fn new() -> Self {
12503        std::default::Default::default()
12504    }
12505
12506    /// Sets the value of [common_metadata][crate::model::SetDefaultProcessorVersionMetadata::common_metadata].
12507    ///
12508    /// # Example
12509    /// ```ignore,no_run
12510    /// # use google_cloud_documentai_v1::model::SetDefaultProcessorVersionMetadata;
12511    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
12512    /// let x = SetDefaultProcessorVersionMetadata::new().set_common_metadata(CommonOperationMetadata::default()/* use setters */);
12513    /// ```
12514    pub fn set_common_metadata<T>(mut self, v: T) -> Self
12515    where
12516        T: std::convert::Into<crate::model::CommonOperationMetadata>,
12517    {
12518        self.common_metadata = std::option::Option::Some(v.into());
12519        self
12520    }
12521
12522    /// Sets or clears the value of [common_metadata][crate::model::SetDefaultProcessorVersionMetadata::common_metadata].
12523    ///
12524    /// # Example
12525    /// ```ignore,no_run
12526    /// # use google_cloud_documentai_v1::model::SetDefaultProcessorVersionMetadata;
12527    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
12528    /// let x = SetDefaultProcessorVersionMetadata::new().set_or_clear_common_metadata(Some(CommonOperationMetadata::default()/* use setters */));
12529    /// let x = SetDefaultProcessorVersionMetadata::new().set_or_clear_common_metadata(None::<CommonOperationMetadata>);
12530    /// ```
12531    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12532    where
12533        T: std::convert::Into<crate::model::CommonOperationMetadata>,
12534    {
12535        self.common_metadata = v.map(|x| x.into());
12536        self
12537    }
12538}
12539
12540impl wkt::message::Message for SetDefaultProcessorVersionMetadata {
12541    fn typename() -> &'static str {
12542        "type.googleapis.com/google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata"
12543    }
12544}
12545
12546/// Request message for the
12547/// [TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion]
12548/// method.
12549///
12550/// [google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion]: crate::client::DocumentProcessorService::train_processor_version
12551#[derive(Clone, Default, PartialEq)]
12552#[non_exhaustive]
12553pub struct TrainProcessorVersionRequest {
12554    /// Required. The parent (project, location and processor) to create the new
12555    /// version for. Format:
12556    /// `projects/{project}/locations/{location}/processors/{processor}`.
12557    pub parent: std::string::String,
12558
12559    /// Required. The processor version to be created.
12560    pub processor_version: std::option::Option<crate::model::ProcessorVersion>,
12561
12562    /// Optional. The schema the processor version will be trained with.
12563    pub document_schema: std::option::Option<crate::model::DocumentSchema>,
12564
12565    /// Optional. The input data used to train the
12566    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
12567    ///
12568    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
12569    pub input_data: std::option::Option<crate::model::train_processor_version_request::InputData>,
12570
12571    /// Optional. The processor version to use as a base for training. This
12572    /// processor version must be a child of `parent`. Format:
12573    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
12574    pub base_processor_version: std::string::String,
12575
12576    pub processor_flags:
12577        std::option::Option<crate::model::train_processor_version_request::ProcessorFlags>,
12578
12579    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12580}
12581
12582impl TrainProcessorVersionRequest {
12583    pub fn new() -> Self {
12584        std::default::Default::default()
12585    }
12586
12587    /// Sets the value of [parent][crate::model::TrainProcessorVersionRequest::parent].
12588    ///
12589    /// # Example
12590    /// ```ignore,no_run
12591    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12592    /// let x = TrainProcessorVersionRequest::new().set_parent("example");
12593    /// ```
12594    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12595        self.parent = v.into();
12596        self
12597    }
12598
12599    /// Sets the value of [processor_version][crate::model::TrainProcessorVersionRequest::processor_version].
12600    ///
12601    /// # Example
12602    /// ```ignore,no_run
12603    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12604    /// use google_cloud_documentai_v1::model::ProcessorVersion;
12605    /// let x = TrainProcessorVersionRequest::new().set_processor_version(ProcessorVersion::default()/* use setters */);
12606    /// ```
12607    pub fn set_processor_version<T>(mut self, v: T) -> Self
12608    where
12609        T: std::convert::Into<crate::model::ProcessorVersion>,
12610    {
12611        self.processor_version = std::option::Option::Some(v.into());
12612        self
12613    }
12614
12615    /// Sets or clears the value of [processor_version][crate::model::TrainProcessorVersionRequest::processor_version].
12616    ///
12617    /// # Example
12618    /// ```ignore,no_run
12619    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12620    /// use google_cloud_documentai_v1::model::ProcessorVersion;
12621    /// let x = TrainProcessorVersionRequest::new().set_or_clear_processor_version(Some(ProcessorVersion::default()/* use setters */));
12622    /// let x = TrainProcessorVersionRequest::new().set_or_clear_processor_version(None::<ProcessorVersion>);
12623    /// ```
12624    pub fn set_or_clear_processor_version<T>(mut self, v: std::option::Option<T>) -> Self
12625    where
12626        T: std::convert::Into<crate::model::ProcessorVersion>,
12627    {
12628        self.processor_version = v.map(|x| x.into());
12629        self
12630    }
12631
12632    /// Sets the value of [document_schema][crate::model::TrainProcessorVersionRequest::document_schema].
12633    ///
12634    /// # Example
12635    /// ```ignore,no_run
12636    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12637    /// use google_cloud_documentai_v1::model::DocumentSchema;
12638    /// let x = TrainProcessorVersionRequest::new().set_document_schema(DocumentSchema::default()/* use setters */);
12639    /// ```
12640    pub fn set_document_schema<T>(mut self, v: T) -> Self
12641    where
12642        T: std::convert::Into<crate::model::DocumentSchema>,
12643    {
12644        self.document_schema = std::option::Option::Some(v.into());
12645        self
12646    }
12647
12648    /// Sets or clears the value of [document_schema][crate::model::TrainProcessorVersionRequest::document_schema].
12649    ///
12650    /// # Example
12651    /// ```ignore,no_run
12652    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12653    /// use google_cloud_documentai_v1::model::DocumentSchema;
12654    /// let x = TrainProcessorVersionRequest::new().set_or_clear_document_schema(Some(DocumentSchema::default()/* use setters */));
12655    /// let x = TrainProcessorVersionRequest::new().set_or_clear_document_schema(None::<DocumentSchema>);
12656    /// ```
12657    pub fn set_or_clear_document_schema<T>(mut self, v: std::option::Option<T>) -> Self
12658    where
12659        T: std::convert::Into<crate::model::DocumentSchema>,
12660    {
12661        self.document_schema = v.map(|x| x.into());
12662        self
12663    }
12664
12665    /// Sets the value of [input_data][crate::model::TrainProcessorVersionRequest::input_data].
12666    ///
12667    /// # Example
12668    /// ```ignore,no_run
12669    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12670    /// use google_cloud_documentai_v1::model::train_processor_version_request::InputData;
12671    /// let x = TrainProcessorVersionRequest::new().set_input_data(InputData::default()/* use setters */);
12672    /// ```
12673    pub fn set_input_data<T>(mut self, v: T) -> Self
12674    where
12675        T: std::convert::Into<crate::model::train_processor_version_request::InputData>,
12676    {
12677        self.input_data = std::option::Option::Some(v.into());
12678        self
12679    }
12680
12681    /// Sets or clears the value of [input_data][crate::model::TrainProcessorVersionRequest::input_data].
12682    ///
12683    /// # Example
12684    /// ```ignore,no_run
12685    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12686    /// use google_cloud_documentai_v1::model::train_processor_version_request::InputData;
12687    /// let x = TrainProcessorVersionRequest::new().set_or_clear_input_data(Some(InputData::default()/* use setters */));
12688    /// let x = TrainProcessorVersionRequest::new().set_or_clear_input_data(None::<InputData>);
12689    /// ```
12690    pub fn set_or_clear_input_data<T>(mut self, v: std::option::Option<T>) -> Self
12691    where
12692        T: std::convert::Into<crate::model::train_processor_version_request::InputData>,
12693    {
12694        self.input_data = v.map(|x| x.into());
12695        self
12696    }
12697
12698    /// Sets the value of [base_processor_version][crate::model::TrainProcessorVersionRequest::base_processor_version].
12699    ///
12700    /// # Example
12701    /// ```ignore,no_run
12702    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12703    /// let x = TrainProcessorVersionRequest::new().set_base_processor_version("example");
12704    /// ```
12705    pub fn set_base_processor_version<T: std::convert::Into<std::string::String>>(
12706        mut self,
12707        v: T,
12708    ) -> Self {
12709        self.base_processor_version = v.into();
12710        self
12711    }
12712
12713    /// Sets the value of [processor_flags][crate::model::TrainProcessorVersionRequest::processor_flags].
12714    ///
12715    /// Note that all the setters affecting `processor_flags` are mutually
12716    /// exclusive.
12717    ///
12718    /// # Example
12719    /// ```ignore,no_run
12720    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12721    /// use google_cloud_documentai_v1::model::train_processor_version_request::CustomDocumentExtractionOptions;
12722    /// let x = TrainProcessorVersionRequest::new().set_processor_flags(Some(
12723    ///     google_cloud_documentai_v1::model::train_processor_version_request::ProcessorFlags::CustomDocumentExtractionOptions(CustomDocumentExtractionOptions::default().into())));
12724    /// ```
12725    pub fn set_processor_flags<
12726        T: std::convert::Into<
12727                std::option::Option<crate::model::train_processor_version_request::ProcessorFlags>,
12728            >,
12729    >(
12730        mut self,
12731        v: T,
12732    ) -> Self {
12733        self.processor_flags = v.into();
12734        self
12735    }
12736
12737    /// The value of [processor_flags][crate::model::TrainProcessorVersionRequest::processor_flags]
12738    /// if it holds a `CustomDocumentExtractionOptions`, `None` if the field is not set or
12739    /// holds a different branch.
12740    pub fn custom_document_extraction_options(
12741        &self,
12742    ) -> std::option::Option<
12743        &std::boxed::Box<
12744            crate::model::train_processor_version_request::CustomDocumentExtractionOptions,
12745        >,
12746    > {
12747        #[allow(unreachable_patterns)]
12748        self.processor_flags.as_ref().and_then(|v| match v {
12749            crate::model::train_processor_version_request::ProcessorFlags::CustomDocumentExtractionOptions(v) => std::option::Option::Some(v),
12750            _ => std::option::Option::None,
12751        })
12752    }
12753
12754    /// Sets the value of [processor_flags][crate::model::TrainProcessorVersionRequest::processor_flags]
12755    /// to hold a `CustomDocumentExtractionOptions`.
12756    ///
12757    /// Note that all the setters affecting `processor_flags` are
12758    /// mutually exclusive.
12759    ///
12760    /// # Example
12761    /// ```ignore,no_run
12762    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12763    /// use google_cloud_documentai_v1::model::train_processor_version_request::CustomDocumentExtractionOptions;
12764    /// let x = TrainProcessorVersionRequest::new().set_custom_document_extraction_options(CustomDocumentExtractionOptions::default()/* use setters */);
12765    /// assert!(x.custom_document_extraction_options().is_some());
12766    /// assert!(x.foundation_model_tuning_options().is_none());
12767    /// ```
12768    pub fn set_custom_document_extraction_options<
12769        T: std::convert::Into<
12770                std::boxed::Box<
12771                    crate::model::train_processor_version_request::CustomDocumentExtractionOptions,
12772                >,
12773            >,
12774    >(
12775        mut self,
12776        v: T,
12777    ) -> Self {
12778        self.processor_flags = std::option::Option::Some(
12779            crate::model::train_processor_version_request::ProcessorFlags::CustomDocumentExtractionOptions(
12780                v.into()
12781            )
12782        );
12783        self
12784    }
12785
12786    /// The value of [processor_flags][crate::model::TrainProcessorVersionRequest::processor_flags]
12787    /// if it holds a `FoundationModelTuningOptions`, `None` if the field is not set or
12788    /// holds a different branch.
12789    pub fn foundation_model_tuning_options(
12790        &self,
12791    ) -> std::option::Option<
12792        &std::boxed::Box<
12793            crate::model::train_processor_version_request::FoundationModelTuningOptions,
12794        >,
12795    > {
12796        #[allow(unreachable_patterns)]
12797        self.processor_flags.as_ref().and_then(|v| match v {
12798            crate::model::train_processor_version_request::ProcessorFlags::FoundationModelTuningOptions(v) => std::option::Option::Some(v),
12799            _ => std::option::Option::None,
12800        })
12801    }
12802
12803    /// Sets the value of [processor_flags][crate::model::TrainProcessorVersionRequest::processor_flags]
12804    /// to hold a `FoundationModelTuningOptions`.
12805    ///
12806    /// Note that all the setters affecting `processor_flags` are
12807    /// mutually exclusive.
12808    ///
12809    /// # Example
12810    /// ```ignore,no_run
12811    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionRequest;
12812    /// use google_cloud_documentai_v1::model::train_processor_version_request::FoundationModelTuningOptions;
12813    /// let x = TrainProcessorVersionRequest::new().set_foundation_model_tuning_options(FoundationModelTuningOptions::default()/* use setters */);
12814    /// assert!(x.foundation_model_tuning_options().is_some());
12815    /// assert!(x.custom_document_extraction_options().is_none());
12816    /// ```
12817    pub fn set_foundation_model_tuning_options<
12818        T: std::convert::Into<
12819                std::boxed::Box<
12820                    crate::model::train_processor_version_request::FoundationModelTuningOptions,
12821                >,
12822            >,
12823    >(
12824        mut self,
12825        v: T,
12826    ) -> Self {
12827        self.processor_flags = std::option::Option::Some(
12828            crate::model::train_processor_version_request::ProcessorFlags::FoundationModelTuningOptions(
12829                v.into()
12830            )
12831        );
12832        self
12833    }
12834}
12835
12836impl wkt::message::Message for TrainProcessorVersionRequest {
12837    fn typename() -> &'static str {
12838        "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionRequest"
12839    }
12840}
12841
12842/// Defines additional types related to [TrainProcessorVersionRequest].
12843pub mod train_processor_version_request {
12844    #[allow(unused_imports)]
12845    use super::*;
12846
12847    /// The input data used to train a new
12848    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
12849    ///
12850    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
12851    #[derive(Clone, Default, PartialEq)]
12852    #[non_exhaustive]
12853    pub struct InputData {
12854        /// The documents used for training the new version.
12855        pub training_documents: std::option::Option<crate::model::BatchDocumentsInputConfig>,
12856
12857        /// The documents used for testing the trained version.
12858        pub test_documents: std::option::Option<crate::model::BatchDocumentsInputConfig>,
12859
12860        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12861    }
12862
12863    impl InputData {
12864        pub fn new() -> Self {
12865            std::default::Default::default()
12866        }
12867
12868        /// Sets the value of [training_documents][crate::model::train_processor_version_request::InputData::training_documents].
12869        ///
12870        /// # Example
12871        /// ```ignore,no_run
12872        /// # use google_cloud_documentai_v1::model::train_processor_version_request::InputData;
12873        /// use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
12874        /// let x = InputData::new().set_training_documents(BatchDocumentsInputConfig::default()/* use setters */);
12875        /// ```
12876        pub fn set_training_documents<T>(mut self, v: T) -> Self
12877        where
12878            T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
12879        {
12880            self.training_documents = std::option::Option::Some(v.into());
12881            self
12882        }
12883
12884        /// Sets or clears the value of [training_documents][crate::model::train_processor_version_request::InputData::training_documents].
12885        ///
12886        /// # Example
12887        /// ```ignore,no_run
12888        /// # use google_cloud_documentai_v1::model::train_processor_version_request::InputData;
12889        /// use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
12890        /// let x = InputData::new().set_or_clear_training_documents(Some(BatchDocumentsInputConfig::default()/* use setters */));
12891        /// let x = InputData::new().set_or_clear_training_documents(None::<BatchDocumentsInputConfig>);
12892        /// ```
12893        pub fn set_or_clear_training_documents<T>(mut self, v: std::option::Option<T>) -> Self
12894        where
12895            T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
12896        {
12897            self.training_documents = v.map(|x| x.into());
12898            self
12899        }
12900
12901        /// Sets the value of [test_documents][crate::model::train_processor_version_request::InputData::test_documents].
12902        ///
12903        /// # Example
12904        /// ```ignore,no_run
12905        /// # use google_cloud_documentai_v1::model::train_processor_version_request::InputData;
12906        /// use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
12907        /// let x = InputData::new().set_test_documents(BatchDocumentsInputConfig::default()/* use setters */);
12908        /// ```
12909        pub fn set_test_documents<T>(mut self, v: T) -> Self
12910        where
12911            T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
12912        {
12913            self.test_documents = std::option::Option::Some(v.into());
12914            self
12915        }
12916
12917        /// Sets or clears the value of [test_documents][crate::model::train_processor_version_request::InputData::test_documents].
12918        ///
12919        /// # Example
12920        /// ```ignore,no_run
12921        /// # use google_cloud_documentai_v1::model::train_processor_version_request::InputData;
12922        /// use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
12923        /// let x = InputData::new().set_or_clear_test_documents(Some(BatchDocumentsInputConfig::default()/* use setters */));
12924        /// let x = InputData::new().set_or_clear_test_documents(None::<BatchDocumentsInputConfig>);
12925        /// ```
12926        pub fn set_or_clear_test_documents<T>(mut self, v: std::option::Option<T>) -> Self
12927        where
12928            T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
12929        {
12930            self.test_documents = v.map(|x| x.into());
12931            self
12932        }
12933    }
12934
12935    impl wkt::message::Message for InputData {
12936        fn typename() -> &'static str {
12937            "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData"
12938        }
12939    }
12940
12941    /// Options to control the training of the Custom Document Extraction (CDE)
12942    /// Processor.
12943    #[derive(Clone, Default, PartialEq)]
12944    #[non_exhaustive]
12945    pub struct CustomDocumentExtractionOptions {
12946
12947        /// Optional. Training method to use for CDE training.
12948        pub training_method: crate::model::train_processor_version_request::custom_document_extraction_options::TrainingMethod,
12949
12950        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12951    }
12952
12953    impl CustomDocumentExtractionOptions {
12954        pub fn new() -> Self {
12955            std::default::Default::default()
12956        }
12957
12958        /// Sets the value of [training_method][crate::model::train_processor_version_request::CustomDocumentExtractionOptions::training_method].
12959        ///
12960        /// # Example
12961        /// ```ignore,no_run
12962        /// # use google_cloud_documentai_v1::model::train_processor_version_request::CustomDocumentExtractionOptions;
12963        /// use google_cloud_documentai_v1::model::train_processor_version_request::custom_document_extraction_options::TrainingMethod;
12964        /// let x0 = CustomDocumentExtractionOptions::new().set_training_method(TrainingMethod::ModelBased);
12965        /// let x1 = CustomDocumentExtractionOptions::new().set_training_method(TrainingMethod::TemplateBased);
12966        /// ```
12967        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{
12968            self.training_method = v.into();
12969            self
12970        }
12971    }
12972
12973    impl wkt::message::Message for CustomDocumentExtractionOptions {
12974        fn typename() -> &'static str {
12975            "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions"
12976        }
12977    }
12978
12979    /// Defines additional types related to [CustomDocumentExtractionOptions].
12980    pub mod custom_document_extraction_options {
12981        #[allow(unused_imports)]
12982        use super::*;
12983
12984        /// Training Method for CDE. `TRAINING_METHOD_UNSPECIFIED` will fall back to
12985        /// `MODEL_BASED`.
12986        ///
12987        /// # Working with unknown values
12988        ///
12989        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12990        /// additional enum variants at any time. Adding new variants is not considered
12991        /// a breaking change. Applications should write their code in anticipation of:
12992        ///
12993        /// - New values appearing in future releases of the client library, **and**
12994        /// - New values received dynamically, without application changes.
12995        ///
12996        /// Please consult the [Working with enums] section in the user guide for some
12997        /// guidelines.
12998        ///
12999        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13000        #[derive(Clone, Debug, PartialEq)]
13001        #[non_exhaustive]
13002        pub enum TrainingMethod {
13003            Unspecified,
13004            ModelBased,
13005            TemplateBased,
13006            /// If set, the enum was initialized with an unknown value.
13007            ///
13008            /// Applications can examine the value using [TrainingMethod::value] or
13009            /// [TrainingMethod::name].
13010            UnknownValue(training_method::UnknownValue),
13011        }
13012
13013        #[doc(hidden)]
13014        pub mod training_method {
13015            #[allow(unused_imports)]
13016            use super::*;
13017            #[derive(Clone, Debug, PartialEq)]
13018            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13019        }
13020
13021        impl TrainingMethod {
13022            /// Gets the enum value.
13023            ///
13024            /// Returns `None` if the enum contains an unknown value deserialized from
13025            /// the string representation of enums.
13026            pub fn value(&self) -> std::option::Option<i32> {
13027                match self {
13028                    Self::Unspecified => std::option::Option::Some(0),
13029                    Self::ModelBased => std::option::Option::Some(1),
13030                    Self::TemplateBased => std::option::Option::Some(2),
13031                    Self::UnknownValue(u) => u.0.value(),
13032                }
13033            }
13034
13035            /// Gets the enum value as a string.
13036            ///
13037            /// Returns `None` if the enum contains an unknown value deserialized from
13038            /// the integer representation of enums.
13039            pub fn name(&self) -> std::option::Option<&str> {
13040                match self {
13041                    Self::Unspecified => std::option::Option::Some("TRAINING_METHOD_UNSPECIFIED"),
13042                    Self::ModelBased => std::option::Option::Some("MODEL_BASED"),
13043                    Self::TemplateBased => std::option::Option::Some("TEMPLATE_BASED"),
13044                    Self::UnknownValue(u) => u.0.name(),
13045                }
13046            }
13047        }
13048
13049        impl std::default::Default for TrainingMethod {
13050            fn default() -> Self {
13051                use std::convert::From;
13052                Self::from(0)
13053            }
13054        }
13055
13056        impl std::fmt::Display for TrainingMethod {
13057            fn fmt(
13058                &self,
13059                f: &mut std::fmt::Formatter<'_>,
13060            ) -> std::result::Result<(), std::fmt::Error> {
13061                wkt::internal::display_enum(f, self.name(), self.value())
13062            }
13063        }
13064
13065        impl std::convert::From<i32> for TrainingMethod {
13066            fn from(value: i32) -> Self {
13067                match value {
13068                    0 => Self::Unspecified,
13069                    1 => Self::ModelBased,
13070                    2 => Self::TemplateBased,
13071                    _ => Self::UnknownValue(training_method::UnknownValue(
13072                        wkt::internal::UnknownEnumValue::Integer(value),
13073                    )),
13074                }
13075            }
13076        }
13077
13078        impl std::convert::From<&str> for TrainingMethod {
13079            fn from(value: &str) -> Self {
13080                use std::string::ToString;
13081                match value {
13082                    "TRAINING_METHOD_UNSPECIFIED" => Self::Unspecified,
13083                    "MODEL_BASED" => Self::ModelBased,
13084                    "TEMPLATE_BASED" => Self::TemplateBased,
13085                    _ => Self::UnknownValue(training_method::UnknownValue(
13086                        wkt::internal::UnknownEnumValue::String(value.to_string()),
13087                    )),
13088                }
13089            }
13090        }
13091
13092        impl serde::ser::Serialize for TrainingMethod {
13093            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13094            where
13095                S: serde::Serializer,
13096            {
13097                match self {
13098                    Self::Unspecified => serializer.serialize_i32(0),
13099                    Self::ModelBased => serializer.serialize_i32(1),
13100                    Self::TemplateBased => serializer.serialize_i32(2),
13101                    Self::UnknownValue(u) => u.0.serialize(serializer),
13102                }
13103            }
13104        }
13105
13106        impl<'de> serde::de::Deserialize<'de> for TrainingMethod {
13107            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13108            where
13109                D: serde::Deserializer<'de>,
13110            {
13111                deserializer.deserialize_any(wkt::internal::EnumVisitor::<TrainingMethod>::new(
13112                    ".google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod"))
13113            }
13114        }
13115    }
13116
13117    /// Options to control foundation model tuning of the processor.
13118    #[derive(Clone, Default, PartialEq)]
13119    #[non_exhaustive]
13120    pub struct FoundationModelTuningOptions {
13121        /// Optional. The number of steps to run for model tuning. Valid values are
13122        /// between 1 and 400. If not provided, recommended steps will be used.
13123        pub train_steps: i32,
13124
13125        /// Optional. The multiplier to apply to the recommended learning rate. Valid
13126        /// values are between 0.1 and 10. If not provided, recommended learning rate
13127        /// will be used.
13128        pub learning_rate_multiplier: f32,
13129
13130        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13131    }
13132
13133    impl FoundationModelTuningOptions {
13134        pub fn new() -> Self {
13135            std::default::Default::default()
13136        }
13137
13138        /// Sets the value of [train_steps][crate::model::train_processor_version_request::FoundationModelTuningOptions::train_steps].
13139        ///
13140        /// # Example
13141        /// ```ignore,no_run
13142        /// # use google_cloud_documentai_v1::model::train_processor_version_request::FoundationModelTuningOptions;
13143        /// let x = FoundationModelTuningOptions::new().set_train_steps(42);
13144        /// ```
13145        pub fn set_train_steps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13146            self.train_steps = v.into();
13147            self
13148        }
13149
13150        /// Sets the value of [learning_rate_multiplier][crate::model::train_processor_version_request::FoundationModelTuningOptions::learning_rate_multiplier].
13151        ///
13152        /// # Example
13153        /// ```ignore,no_run
13154        /// # use google_cloud_documentai_v1::model::train_processor_version_request::FoundationModelTuningOptions;
13155        /// let x = FoundationModelTuningOptions::new().set_learning_rate_multiplier(42.0);
13156        /// ```
13157        pub fn set_learning_rate_multiplier<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
13158            self.learning_rate_multiplier = v.into();
13159            self
13160        }
13161    }
13162
13163    impl wkt::message::Message for FoundationModelTuningOptions {
13164        fn typename() -> &'static str {
13165            "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions"
13166        }
13167    }
13168
13169    #[derive(Clone, Debug, PartialEq)]
13170    #[non_exhaustive]
13171    pub enum ProcessorFlags {
13172        /// Options to control Custom Document Extraction (CDE) Processor.
13173        CustomDocumentExtractionOptions(
13174            std::boxed::Box<
13175                crate::model::train_processor_version_request::CustomDocumentExtractionOptions,
13176            >,
13177        ),
13178        /// Options to control foundation model tuning of a processor.
13179        FoundationModelTuningOptions(
13180            std::boxed::Box<
13181                crate::model::train_processor_version_request::FoundationModelTuningOptions,
13182            >,
13183        ),
13184    }
13185}
13186
13187/// The response for
13188/// [TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion].
13189///
13190/// [google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion]: crate::client::DocumentProcessorService::train_processor_version
13191#[derive(Clone, Default, PartialEq)]
13192#[non_exhaustive]
13193pub struct TrainProcessorVersionResponse {
13194    /// The resource name of the processor version produced by training.
13195    pub processor_version: std::string::String,
13196
13197    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13198}
13199
13200impl TrainProcessorVersionResponse {
13201    pub fn new() -> Self {
13202        std::default::Default::default()
13203    }
13204
13205    /// Sets the value of [processor_version][crate::model::TrainProcessorVersionResponse::processor_version].
13206    ///
13207    /// # Example
13208    /// ```ignore,no_run
13209    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionResponse;
13210    /// let x = TrainProcessorVersionResponse::new().set_processor_version("example");
13211    /// ```
13212    pub fn set_processor_version<T: std::convert::Into<std::string::String>>(
13213        mut self,
13214        v: T,
13215    ) -> Self {
13216        self.processor_version = v.into();
13217        self
13218    }
13219}
13220
13221impl wkt::message::Message for TrainProcessorVersionResponse {
13222    fn typename() -> &'static str {
13223        "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionResponse"
13224    }
13225}
13226
13227/// The metadata that represents a processor version being created.
13228#[derive(Clone, Default, PartialEq)]
13229#[non_exhaustive]
13230pub struct TrainProcessorVersionMetadata {
13231    /// The basic metadata of the long-running operation.
13232    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
13233
13234    /// The training dataset validation information.
13235    pub training_dataset_validation:
13236        std::option::Option<crate::model::train_processor_version_metadata::DatasetValidation>,
13237
13238    /// The test dataset validation information.
13239    pub test_dataset_validation:
13240        std::option::Option<crate::model::train_processor_version_metadata::DatasetValidation>,
13241
13242    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13243}
13244
13245impl TrainProcessorVersionMetadata {
13246    pub fn new() -> Self {
13247        std::default::Default::default()
13248    }
13249
13250    /// Sets the value of [common_metadata][crate::model::TrainProcessorVersionMetadata::common_metadata].
13251    ///
13252    /// # Example
13253    /// ```ignore,no_run
13254    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionMetadata;
13255    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
13256    /// let x = TrainProcessorVersionMetadata::new().set_common_metadata(CommonOperationMetadata::default()/* use setters */);
13257    /// ```
13258    pub fn set_common_metadata<T>(mut self, v: T) -> Self
13259    where
13260        T: std::convert::Into<crate::model::CommonOperationMetadata>,
13261    {
13262        self.common_metadata = std::option::Option::Some(v.into());
13263        self
13264    }
13265
13266    /// Sets or clears the value of [common_metadata][crate::model::TrainProcessorVersionMetadata::common_metadata].
13267    ///
13268    /// # Example
13269    /// ```ignore,no_run
13270    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionMetadata;
13271    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
13272    /// let x = TrainProcessorVersionMetadata::new().set_or_clear_common_metadata(Some(CommonOperationMetadata::default()/* use setters */));
13273    /// let x = TrainProcessorVersionMetadata::new().set_or_clear_common_metadata(None::<CommonOperationMetadata>);
13274    /// ```
13275    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
13276    where
13277        T: std::convert::Into<crate::model::CommonOperationMetadata>,
13278    {
13279        self.common_metadata = v.map(|x| x.into());
13280        self
13281    }
13282
13283    /// Sets the value of [training_dataset_validation][crate::model::TrainProcessorVersionMetadata::training_dataset_validation].
13284    ///
13285    /// # Example
13286    /// ```ignore,no_run
13287    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionMetadata;
13288    /// use google_cloud_documentai_v1::model::train_processor_version_metadata::DatasetValidation;
13289    /// let x = TrainProcessorVersionMetadata::new().set_training_dataset_validation(DatasetValidation::default()/* use setters */);
13290    /// ```
13291    pub fn set_training_dataset_validation<T>(mut self, v: T) -> Self
13292    where
13293        T: std::convert::Into<crate::model::train_processor_version_metadata::DatasetValidation>,
13294    {
13295        self.training_dataset_validation = std::option::Option::Some(v.into());
13296        self
13297    }
13298
13299    /// Sets or clears the value of [training_dataset_validation][crate::model::TrainProcessorVersionMetadata::training_dataset_validation].
13300    ///
13301    /// # Example
13302    /// ```ignore,no_run
13303    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionMetadata;
13304    /// use google_cloud_documentai_v1::model::train_processor_version_metadata::DatasetValidation;
13305    /// let x = TrainProcessorVersionMetadata::new().set_or_clear_training_dataset_validation(Some(DatasetValidation::default()/* use setters */));
13306    /// let x = TrainProcessorVersionMetadata::new().set_or_clear_training_dataset_validation(None::<DatasetValidation>);
13307    /// ```
13308    pub fn set_or_clear_training_dataset_validation<T>(mut self, v: std::option::Option<T>) -> Self
13309    where
13310        T: std::convert::Into<crate::model::train_processor_version_metadata::DatasetValidation>,
13311    {
13312        self.training_dataset_validation = v.map(|x| x.into());
13313        self
13314    }
13315
13316    /// Sets the value of [test_dataset_validation][crate::model::TrainProcessorVersionMetadata::test_dataset_validation].
13317    ///
13318    /// # Example
13319    /// ```ignore,no_run
13320    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionMetadata;
13321    /// use google_cloud_documentai_v1::model::train_processor_version_metadata::DatasetValidation;
13322    /// let x = TrainProcessorVersionMetadata::new().set_test_dataset_validation(DatasetValidation::default()/* use setters */);
13323    /// ```
13324    pub fn set_test_dataset_validation<T>(mut self, v: T) -> Self
13325    where
13326        T: std::convert::Into<crate::model::train_processor_version_metadata::DatasetValidation>,
13327    {
13328        self.test_dataset_validation = std::option::Option::Some(v.into());
13329        self
13330    }
13331
13332    /// Sets or clears the value of [test_dataset_validation][crate::model::TrainProcessorVersionMetadata::test_dataset_validation].
13333    ///
13334    /// # Example
13335    /// ```ignore,no_run
13336    /// # use google_cloud_documentai_v1::model::TrainProcessorVersionMetadata;
13337    /// use google_cloud_documentai_v1::model::train_processor_version_metadata::DatasetValidation;
13338    /// let x = TrainProcessorVersionMetadata::new().set_or_clear_test_dataset_validation(Some(DatasetValidation::default()/* use setters */));
13339    /// let x = TrainProcessorVersionMetadata::new().set_or_clear_test_dataset_validation(None::<DatasetValidation>);
13340    /// ```
13341    pub fn set_or_clear_test_dataset_validation<T>(mut self, v: std::option::Option<T>) -> Self
13342    where
13343        T: std::convert::Into<crate::model::train_processor_version_metadata::DatasetValidation>,
13344    {
13345        self.test_dataset_validation = v.map(|x| x.into());
13346        self
13347    }
13348}
13349
13350impl wkt::message::Message for TrainProcessorVersionMetadata {
13351    fn typename() -> &'static str {
13352        "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionMetadata"
13353    }
13354}
13355
13356/// Defines additional types related to [TrainProcessorVersionMetadata].
13357pub mod train_processor_version_metadata {
13358    #[allow(unused_imports)]
13359    use super::*;
13360
13361    /// The dataset validation information.
13362    /// This includes any and all errors with documents and the dataset.
13363    #[derive(Clone, Default, PartialEq)]
13364    #[non_exhaustive]
13365    pub struct DatasetValidation {
13366        /// The total number of document errors.
13367        pub document_error_count: i32,
13368
13369        /// The total number of dataset errors.
13370        pub dataset_error_count: i32,
13371
13372        /// Error information pertaining to specific documents. A maximum of 10
13373        /// document errors will be returned.
13374        /// Any document with errors will not be used throughout training.
13375        pub document_errors: std::vec::Vec<google_cloud_rpc::model::Status>,
13376
13377        /// Error information for the dataset as a whole. A maximum of 10 dataset
13378        /// errors will be returned.
13379        /// A single dataset error is terminal for training.
13380        pub dataset_errors: std::vec::Vec<google_cloud_rpc::model::Status>,
13381
13382        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13383    }
13384
13385    impl DatasetValidation {
13386        pub fn new() -> Self {
13387            std::default::Default::default()
13388        }
13389
13390        /// Sets the value of [document_error_count][crate::model::train_processor_version_metadata::DatasetValidation::document_error_count].
13391        ///
13392        /// # Example
13393        /// ```ignore,no_run
13394        /// # use google_cloud_documentai_v1::model::train_processor_version_metadata::DatasetValidation;
13395        /// let x = DatasetValidation::new().set_document_error_count(42);
13396        /// ```
13397        pub fn set_document_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13398            self.document_error_count = v.into();
13399            self
13400        }
13401
13402        /// Sets the value of [dataset_error_count][crate::model::train_processor_version_metadata::DatasetValidation::dataset_error_count].
13403        ///
13404        /// # Example
13405        /// ```ignore,no_run
13406        /// # use google_cloud_documentai_v1::model::train_processor_version_metadata::DatasetValidation;
13407        /// let x = DatasetValidation::new().set_dataset_error_count(42);
13408        /// ```
13409        pub fn set_dataset_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13410            self.dataset_error_count = v.into();
13411            self
13412        }
13413
13414        /// Sets the value of [document_errors][crate::model::train_processor_version_metadata::DatasetValidation::document_errors].
13415        ///
13416        /// # Example
13417        /// ```ignore,no_run
13418        /// # use google_cloud_documentai_v1::model::train_processor_version_metadata::DatasetValidation;
13419        /// use google_cloud_rpc::model::Status;
13420        /// let x = DatasetValidation::new()
13421        ///     .set_document_errors([
13422        ///         Status::default()/* use setters */,
13423        ///         Status::default()/* use (different) setters */,
13424        ///     ]);
13425        /// ```
13426        pub fn set_document_errors<T, V>(mut self, v: T) -> Self
13427        where
13428            T: std::iter::IntoIterator<Item = V>,
13429            V: std::convert::Into<google_cloud_rpc::model::Status>,
13430        {
13431            use std::iter::Iterator;
13432            self.document_errors = v.into_iter().map(|i| i.into()).collect();
13433            self
13434        }
13435
13436        /// Sets the value of [dataset_errors][crate::model::train_processor_version_metadata::DatasetValidation::dataset_errors].
13437        ///
13438        /// # Example
13439        /// ```ignore,no_run
13440        /// # use google_cloud_documentai_v1::model::train_processor_version_metadata::DatasetValidation;
13441        /// use google_cloud_rpc::model::Status;
13442        /// let x = DatasetValidation::new()
13443        ///     .set_dataset_errors([
13444        ///         Status::default()/* use setters */,
13445        ///         Status::default()/* use (different) setters */,
13446        ///     ]);
13447        /// ```
13448        pub fn set_dataset_errors<T, V>(mut self, v: T) -> Self
13449        where
13450            T: std::iter::IntoIterator<Item = V>,
13451            V: std::convert::Into<google_cloud_rpc::model::Status>,
13452        {
13453            use std::iter::Iterator;
13454            self.dataset_errors = v.into_iter().map(|i| i.into()).collect();
13455            self
13456        }
13457    }
13458
13459    impl wkt::message::Message for DatasetValidation {
13460        fn typename() -> &'static str {
13461            "type.googleapis.com/google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation"
13462        }
13463    }
13464}
13465
13466/// Request message for the
13467/// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]
13468/// method.
13469///
13470/// [google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]: crate::client::DocumentProcessorService::review_document
13471#[derive(Clone, Default, PartialEq)]
13472#[non_exhaustive]
13473pub struct ReviewDocumentRequest {
13474    /// Required. The resource name of the
13475    /// [HumanReviewConfig][google.cloud.documentai.v1.HumanReviewConfig] that the
13476    /// document will be reviewed with.
13477    pub human_review_config: std::string::String,
13478
13479    /// Whether the validation should be performed on the ad-hoc review request.
13480    pub enable_schema_validation: bool,
13481
13482    /// The priority of the human review task.
13483    pub priority: crate::model::review_document_request::Priority,
13484
13485    /// The document schema of the human review task.
13486    pub document_schema: std::option::Option<crate::model::DocumentSchema>,
13487
13488    /// The document payload.
13489    pub source: std::option::Option<crate::model::review_document_request::Source>,
13490
13491    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13492}
13493
13494impl ReviewDocumentRequest {
13495    pub fn new() -> Self {
13496        std::default::Default::default()
13497    }
13498
13499    /// Sets the value of [human_review_config][crate::model::ReviewDocumentRequest::human_review_config].
13500    ///
13501    /// # Example
13502    /// ```ignore,no_run
13503    /// # use google_cloud_documentai_v1::model::ReviewDocumentRequest;
13504    /// let x = ReviewDocumentRequest::new().set_human_review_config("example");
13505    /// ```
13506    pub fn set_human_review_config<T: std::convert::Into<std::string::String>>(
13507        mut self,
13508        v: T,
13509    ) -> Self {
13510        self.human_review_config = v.into();
13511        self
13512    }
13513
13514    /// Sets the value of [enable_schema_validation][crate::model::ReviewDocumentRequest::enable_schema_validation].
13515    ///
13516    /// # Example
13517    /// ```ignore,no_run
13518    /// # use google_cloud_documentai_v1::model::ReviewDocumentRequest;
13519    /// let x = ReviewDocumentRequest::new().set_enable_schema_validation(true);
13520    /// ```
13521    pub fn set_enable_schema_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13522        self.enable_schema_validation = v.into();
13523        self
13524    }
13525
13526    /// Sets the value of [priority][crate::model::ReviewDocumentRequest::priority].
13527    ///
13528    /// # Example
13529    /// ```ignore,no_run
13530    /// # use google_cloud_documentai_v1::model::ReviewDocumentRequest;
13531    /// use google_cloud_documentai_v1::model::review_document_request::Priority;
13532    /// let x0 = ReviewDocumentRequest::new().set_priority(Priority::Urgent);
13533    /// ```
13534    pub fn set_priority<T: std::convert::Into<crate::model::review_document_request::Priority>>(
13535        mut self,
13536        v: T,
13537    ) -> Self {
13538        self.priority = v.into();
13539        self
13540    }
13541
13542    /// Sets the value of [document_schema][crate::model::ReviewDocumentRequest::document_schema].
13543    ///
13544    /// # Example
13545    /// ```ignore,no_run
13546    /// # use google_cloud_documentai_v1::model::ReviewDocumentRequest;
13547    /// use google_cloud_documentai_v1::model::DocumentSchema;
13548    /// let x = ReviewDocumentRequest::new().set_document_schema(DocumentSchema::default()/* use setters */);
13549    /// ```
13550    pub fn set_document_schema<T>(mut self, v: T) -> Self
13551    where
13552        T: std::convert::Into<crate::model::DocumentSchema>,
13553    {
13554        self.document_schema = std::option::Option::Some(v.into());
13555        self
13556    }
13557
13558    /// Sets or clears the value of [document_schema][crate::model::ReviewDocumentRequest::document_schema].
13559    ///
13560    /// # Example
13561    /// ```ignore,no_run
13562    /// # use google_cloud_documentai_v1::model::ReviewDocumentRequest;
13563    /// use google_cloud_documentai_v1::model::DocumentSchema;
13564    /// let x = ReviewDocumentRequest::new().set_or_clear_document_schema(Some(DocumentSchema::default()/* use setters */));
13565    /// let x = ReviewDocumentRequest::new().set_or_clear_document_schema(None::<DocumentSchema>);
13566    /// ```
13567    pub fn set_or_clear_document_schema<T>(mut self, v: std::option::Option<T>) -> Self
13568    where
13569        T: std::convert::Into<crate::model::DocumentSchema>,
13570    {
13571        self.document_schema = v.map(|x| x.into());
13572        self
13573    }
13574
13575    /// Sets the value of [source][crate::model::ReviewDocumentRequest::source].
13576    ///
13577    /// Note that all the setters affecting `source` are mutually
13578    /// exclusive.
13579    ///
13580    /// # Example
13581    /// ```ignore,no_run
13582    /// # use google_cloud_documentai_v1::model::ReviewDocumentRequest;
13583    /// use google_cloud_documentai_v1::model::Document;
13584    /// let x = ReviewDocumentRequest::new().set_source(Some(
13585    ///     google_cloud_documentai_v1::model::review_document_request::Source::InlineDocument(Document::default().into())));
13586    /// ```
13587    pub fn set_source<
13588        T: std::convert::Into<std::option::Option<crate::model::review_document_request::Source>>,
13589    >(
13590        mut self,
13591        v: T,
13592    ) -> Self {
13593        self.source = v.into();
13594        self
13595    }
13596
13597    /// The value of [source][crate::model::ReviewDocumentRequest::source]
13598    /// if it holds a `InlineDocument`, `None` if the field is not set or
13599    /// holds a different branch.
13600    pub fn inline_document(&self) -> std::option::Option<&std::boxed::Box<crate::model::Document>> {
13601        #[allow(unreachable_patterns)]
13602        self.source.as_ref().and_then(|v| match v {
13603            crate::model::review_document_request::Source::InlineDocument(v) => {
13604                std::option::Option::Some(v)
13605            }
13606            _ => std::option::Option::None,
13607        })
13608    }
13609
13610    /// Sets the value of [source][crate::model::ReviewDocumentRequest::source]
13611    /// to hold a `InlineDocument`.
13612    ///
13613    /// Note that all the setters affecting `source` are
13614    /// mutually exclusive.
13615    ///
13616    /// # Example
13617    /// ```ignore,no_run
13618    /// # use google_cloud_documentai_v1::model::ReviewDocumentRequest;
13619    /// use google_cloud_documentai_v1::model::Document;
13620    /// let x = ReviewDocumentRequest::new().set_inline_document(Document::default()/* use setters */);
13621    /// assert!(x.inline_document().is_some());
13622    /// ```
13623    pub fn set_inline_document<T: std::convert::Into<std::boxed::Box<crate::model::Document>>>(
13624        mut self,
13625        v: T,
13626    ) -> Self {
13627        self.source = std::option::Option::Some(
13628            crate::model::review_document_request::Source::InlineDocument(v.into()),
13629        );
13630        self
13631    }
13632}
13633
13634impl wkt::message::Message for ReviewDocumentRequest {
13635    fn typename() -> &'static str {
13636        "type.googleapis.com/google.cloud.documentai.v1.ReviewDocumentRequest"
13637    }
13638}
13639
13640/// Defines additional types related to [ReviewDocumentRequest].
13641pub mod review_document_request {
13642    #[allow(unused_imports)]
13643    use super::*;
13644
13645    /// The priority level of the human review task.
13646    ///
13647    /// # Working with unknown values
13648    ///
13649    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13650    /// additional enum variants at any time. Adding new variants is not considered
13651    /// a breaking change. Applications should write their code in anticipation of:
13652    ///
13653    /// - New values appearing in future releases of the client library, **and**
13654    /// - New values received dynamically, without application changes.
13655    ///
13656    /// Please consult the [Working with enums] section in the user guide for some
13657    /// guidelines.
13658    ///
13659    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13660    #[derive(Clone, Debug, PartialEq)]
13661    #[non_exhaustive]
13662    pub enum Priority {
13663        /// The default priority level.
13664        Default,
13665        /// The urgent priority level. The labeling manager should allocate labeler
13666        /// resource to the urgent task queue to respect this priority level.
13667        Urgent,
13668        /// If set, the enum was initialized with an unknown value.
13669        ///
13670        /// Applications can examine the value using [Priority::value] or
13671        /// [Priority::name].
13672        UnknownValue(priority::UnknownValue),
13673    }
13674
13675    #[doc(hidden)]
13676    pub mod priority {
13677        #[allow(unused_imports)]
13678        use super::*;
13679        #[derive(Clone, Debug, PartialEq)]
13680        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13681    }
13682
13683    impl Priority {
13684        /// Gets the enum value.
13685        ///
13686        /// Returns `None` if the enum contains an unknown value deserialized from
13687        /// the string representation of enums.
13688        pub fn value(&self) -> std::option::Option<i32> {
13689            match self {
13690                Self::Default => std::option::Option::Some(0),
13691                Self::Urgent => std::option::Option::Some(1),
13692                Self::UnknownValue(u) => u.0.value(),
13693            }
13694        }
13695
13696        /// Gets the enum value as a string.
13697        ///
13698        /// Returns `None` if the enum contains an unknown value deserialized from
13699        /// the integer representation of enums.
13700        pub fn name(&self) -> std::option::Option<&str> {
13701            match self {
13702                Self::Default => std::option::Option::Some("DEFAULT"),
13703                Self::Urgent => std::option::Option::Some("URGENT"),
13704                Self::UnknownValue(u) => u.0.name(),
13705            }
13706        }
13707    }
13708
13709    impl std::default::Default for Priority {
13710        fn default() -> Self {
13711            use std::convert::From;
13712            Self::from(0)
13713        }
13714    }
13715
13716    impl std::fmt::Display for Priority {
13717        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13718            wkt::internal::display_enum(f, self.name(), self.value())
13719        }
13720    }
13721
13722    impl std::convert::From<i32> for Priority {
13723        fn from(value: i32) -> Self {
13724            match value {
13725                0 => Self::Default,
13726                1 => Self::Urgent,
13727                _ => Self::UnknownValue(priority::UnknownValue(
13728                    wkt::internal::UnknownEnumValue::Integer(value),
13729                )),
13730            }
13731        }
13732    }
13733
13734    impl std::convert::From<&str> for Priority {
13735        fn from(value: &str) -> Self {
13736            use std::string::ToString;
13737            match value {
13738                "DEFAULT" => Self::Default,
13739                "URGENT" => Self::Urgent,
13740                _ => Self::UnknownValue(priority::UnknownValue(
13741                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13742                )),
13743            }
13744        }
13745    }
13746
13747    impl serde::ser::Serialize for Priority {
13748        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13749        where
13750            S: serde::Serializer,
13751        {
13752            match self {
13753                Self::Default => serializer.serialize_i32(0),
13754                Self::Urgent => serializer.serialize_i32(1),
13755                Self::UnknownValue(u) => u.0.serialize(serializer),
13756            }
13757        }
13758    }
13759
13760    impl<'de> serde::de::Deserialize<'de> for Priority {
13761        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13762        where
13763            D: serde::Deserializer<'de>,
13764        {
13765            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Priority>::new(
13766                ".google.cloud.documentai.v1.ReviewDocumentRequest.Priority",
13767            ))
13768        }
13769    }
13770
13771    /// The document payload.
13772    #[derive(Clone, Debug, PartialEq)]
13773    #[non_exhaustive]
13774    pub enum Source {
13775        /// An inline document proto.
13776        InlineDocument(std::boxed::Box<crate::model::Document>),
13777    }
13778}
13779
13780/// Response message for the
13781/// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]
13782/// method.
13783///
13784/// [google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]: crate::client::DocumentProcessorService::review_document
13785#[derive(Clone, Default, PartialEq)]
13786#[non_exhaustive]
13787pub struct ReviewDocumentResponse {
13788    /// The Cloud Storage uri for the human reviewed document if the review is
13789    /// succeeded.
13790    pub gcs_destination: std::string::String,
13791
13792    /// The state of the review operation.
13793    pub state: crate::model::review_document_response::State,
13794
13795    /// The reason why the review is rejected by reviewer.
13796    pub rejection_reason: std::string::String,
13797
13798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13799}
13800
13801impl ReviewDocumentResponse {
13802    pub fn new() -> Self {
13803        std::default::Default::default()
13804    }
13805
13806    /// Sets the value of [gcs_destination][crate::model::ReviewDocumentResponse::gcs_destination].
13807    ///
13808    /// # Example
13809    /// ```ignore,no_run
13810    /// # use google_cloud_documentai_v1::model::ReviewDocumentResponse;
13811    /// let x = ReviewDocumentResponse::new().set_gcs_destination("example");
13812    /// ```
13813    pub fn set_gcs_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13814        self.gcs_destination = v.into();
13815        self
13816    }
13817
13818    /// Sets the value of [state][crate::model::ReviewDocumentResponse::state].
13819    ///
13820    /// # Example
13821    /// ```ignore,no_run
13822    /// # use google_cloud_documentai_v1::model::ReviewDocumentResponse;
13823    /// use google_cloud_documentai_v1::model::review_document_response::State;
13824    /// let x0 = ReviewDocumentResponse::new().set_state(State::Rejected);
13825    /// let x1 = ReviewDocumentResponse::new().set_state(State::Succeeded);
13826    /// ```
13827    pub fn set_state<T: std::convert::Into<crate::model::review_document_response::State>>(
13828        mut self,
13829        v: T,
13830    ) -> Self {
13831        self.state = v.into();
13832        self
13833    }
13834
13835    /// Sets the value of [rejection_reason][crate::model::ReviewDocumentResponse::rejection_reason].
13836    ///
13837    /// # Example
13838    /// ```ignore,no_run
13839    /// # use google_cloud_documentai_v1::model::ReviewDocumentResponse;
13840    /// let x = ReviewDocumentResponse::new().set_rejection_reason("example");
13841    /// ```
13842    pub fn set_rejection_reason<T: std::convert::Into<std::string::String>>(
13843        mut self,
13844        v: T,
13845    ) -> Self {
13846        self.rejection_reason = v.into();
13847        self
13848    }
13849}
13850
13851impl wkt::message::Message for ReviewDocumentResponse {
13852    fn typename() -> &'static str {
13853        "type.googleapis.com/google.cloud.documentai.v1.ReviewDocumentResponse"
13854    }
13855}
13856
13857/// Defines additional types related to [ReviewDocumentResponse].
13858pub mod review_document_response {
13859    #[allow(unused_imports)]
13860    use super::*;
13861
13862    /// Possible states of the review operation.
13863    ///
13864    /// # Working with unknown values
13865    ///
13866    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13867    /// additional enum variants at any time. Adding new variants is not considered
13868    /// a breaking change. Applications should write their code in anticipation of:
13869    ///
13870    /// - New values appearing in future releases of the client library, **and**
13871    /// - New values received dynamically, without application changes.
13872    ///
13873    /// Please consult the [Working with enums] section in the user guide for some
13874    /// guidelines.
13875    ///
13876    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13877    #[derive(Clone, Debug, PartialEq)]
13878    #[non_exhaustive]
13879    pub enum State {
13880        /// The default value. This value is used if the state is omitted.
13881        Unspecified,
13882        /// The review operation is rejected by the reviewer.
13883        Rejected,
13884        /// The review operation is succeeded.
13885        Succeeded,
13886        /// If set, the enum was initialized with an unknown value.
13887        ///
13888        /// Applications can examine the value using [State::value] or
13889        /// [State::name].
13890        UnknownValue(state::UnknownValue),
13891    }
13892
13893    #[doc(hidden)]
13894    pub mod state {
13895        #[allow(unused_imports)]
13896        use super::*;
13897        #[derive(Clone, Debug, PartialEq)]
13898        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13899    }
13900
13901    impl State {
13902        /// Gets the enum value.
13903        ///
13904        /// Returns `None` if the enum contains an unknown value deserialized from
13905        /// the string representation of enums.
13906        pub fn value(&self) -> std::option::Option<i32> {
13907            match self {
13908                Self::Unspecified => std::option::Option::Some(0),
13909                Self::Rejected => std::option::Option::Some(1),
13910                Self::Succeeded => std::option::Option::Some(2),
13911                Self::UnknownValue(u) => u.0.value(),
13912            }
13913        }
13914
13915        /// Gets the enum value as a string.
13916        ///
13917        /// Returns `None` if the enum contains an unknown value deserialized from
13918        /// the integer representation of enums.
13919        pub fn name(&self) -> std::option::Option<&str> {
13920            match self {
13921                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13922                Self::Rejected => std::option::Option::Some("REJECTED"),
13923                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13924                Self::UnknownValue(u) => u.0.name(),
13925            }
13926        }
13927    }
13928
13929    impl std::default::Default for State {
13930        fn default() -> Self {
13931            use std::convert::From;
13932            Self::from(0)
13933        }
13934    }
13935
13936    impl std::fmt::Display for State {
13937        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13938            wkt::internal::display_enum(f, self.name(), self.value())
13939        }
13940    }
13941
13942    impl std::convert::From<i32> for State {
13943        fn from(value: i32) -> Self {
13944            match value {
13945                0 => Self::Unspecified,
13946                1 => Self::Rejected,
13947                2 => Self::Succeeded,
13948                _ => Self::UnknownValue(state::UnknownValue(
13949                    wkt::internal::UnknownEnumValue::Integer(value),
13950                )),
13951            }
13952        }
13953    }
13954
13955    impl std::convert::From<&str> for State {
13956        fn from(value: &str) -> Self {
13957            use std::string::ToString;
13958            match value {
13959                "STATE_UNSPECIFIED" => Self::Unspecified,
13960                "REJECTED" => Self::Rejected,
13961                "SUCCEEDED" => Self::Succeeded,
13962                _ => Self::UnknownValue(state::UnknownValue(
13963                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13964                )),
13965            }
13966        }
13967    }
13968
13969    impl serde::ser::Serialize for State {
13970        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13971        where
13972            S: serde::Serializer,
13973        {
13974            match self {
13975                Self::Unspecified => serializer.serialize_i32(0),
13976                Self::Rejected => serializer.serialize_i32(1),
13977                Self::Succeeded => serializer.serialize_i32(2),
13978                Self::UnknownValue(u) => u.0.serialize(serializer),
13979            }
13980        }
13981    }
13982
13983    impl<'de> serde::de::Deserialize<'de> for State {
13984        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13985        where
13986            D: serde::Deserializer<'de>,
13987        {
13988            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13989                ".google.cloud.documentai.v1.ReviewDocumentResponse.State",
13990            ))
13991        }
13992    }
13993}
13994
13995/// The long-running operation metadata for the
13996/// [ReviewDocument][google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]
13997/// method.
13998///
13999/// [google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument]: crate::client::DocumentProcessorService::review_document
14000#[derive(Clone, Default, PartialEq)]
14001#[non_exhaustive]
14002pub struct ReviewDocumentOperationMetadata {
14003    /// The basic metadata of the long-running operation.
14004    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
14005
14006    /// The Crowd Compute question ID.
14007    pub question_id: std::string::String,
14008
14009    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14010}
14011
14012impl ReviewDocumentOperationMetadata {
14013    pub fn new() -> Self {
14014        std::default::Default::default()
14015    }
14016
14017    /// Sets the value of [common_metadata][crate::model::ReviewDocumentOperationMetadata::common_metadata].
14018    ///
14019    /// # Example
14020    /// ```ignore,no_run
14021    /// # use google_cloud_documentai_v1::model::ReviewDocumentOperationMetadata;
14022    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
14023    /// let x = ReviewDocumentOperationMetadata::new().set_common_metadata(CommonOperationMetadata::default()/* use setters */);
14024    /// ```
14025    pub fn set_common_metadata<T>(mut self, v: T) -> Self
14026    where
14027        T: std::convert::Into<crate::model::CommonOperationMetadata>,
14028    {
14029        self.common_metadata = std::option::Option::Some(v.into());
14030        self
14031    }
14032
14033    /// Sets or clears the value of [common_metadata][crate::model::ReviewDocumentOperationMetadata::common_metadata].
14034    ///
14035    /// # Example
14036    /// ```ignore,no_run
14037    /// # use google_cloud_documentai_v1::model::ReviewDocumentOperationMetadata;
14038    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
14039    /// let x = ReviewDocumentOperationMetadata::new().set_or_clear_common_metadata(Some(CommonOperationMetadata::default()/* use setters */));
14040    /// let x = ReviewDocumentOperationMetadata::new().set_or_clear_common_metadata(None::<CommonOperationMetadata>);
14041    /// ```
14042    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
14043    where
14044        T: std::convert::Into<crate::model::CommonOperationMetadata>,
14045    {
14046        self.common_metadata = v.map(|x| x.into());
14047        self
14048    }
14049
14050    /// Sets the value of [question_id][crate::model::ReviewDocumentOperationMetadata::question_id].
14051    ///
14052    /// # Example
14053    /// ```ignore,no_run
14054    /// # use google_cloud_documentai_v1::model::ReviewDocumentOperationMetadata;
14055    /// let x = ReviewDocumentOperationMetadata::new().set_question_id("example");
14056    /// ```
14057    pub fn set_question_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14058        self.question_id = v.into();
14059        self
14060    }
14061}
14062
14063impl wkt::message::Message for ReviewDocumentOperationMetadata {
14064    fn typename() -> &'static str {
14065        "type.googleapis.com/google.cloud.documentai.v1.ReviewDocumentOperationMetadata"
14066    }
14067}
14068
14069/// Evaluates the given
14070/// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] against the
14071/// supplied documents.
14072///
14073/// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
14074#[derive(Clone, Default, PartialEq)]
14075#[non_exhaustive]
14076pub struct EvaluateProcessorVersionRequest {
14077    /// Required. The resource name of the
14078    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to
14079    /// evaluate.
14080    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
14081    ///
14082    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
14083    pub processor_version: std::string::String,
14084
14085    /// Optional. The documents used in the evaluation. If unspecified, use the
14086    /// processor's dataset as evaluation input.
14087    pub evaluation_documents: std::option::Option<crate::model::BatchDocumentsInputConfig>,
14088
14089    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14090}
14091
14092impl EvaluateProcessorVersionRequest {
14093    pub fn new() -> Self {
14094        std::default::Default::default()
14095    }
14096
14097    /// Sets the value of [processor_version][crate::model::EvaluateProcessorVersionRequest::processor_version].
14098    ///
14099    /// # Example
14100    /// ```ignore,no_run
14101    /// # use google_cloud_documentai_v1::model::EvaluateProcessorVersionRequest;
14102    /// let x = EvaluateProcessorVersionRequest::new().set_processor_version("example");
14103    /// ```
14104    pub fn set_processor_version<T: std::convert::Into<std::string::String>>(
14105        mut self,
14106        v: T,
14107    ) -> Self {
14108        self.processor_version = v.into();
14109        self
14110    }
14111
14112    /// Sets the value of [evaluation_documents][crate::model::EvaluateProcessorVersionRequest::evaluation_documents].
14113    ///
14114    /// # Example
14115    /// ```ignore,no_run
14116    /// # use google_cloud_documentai_v1::model::EvaluateProcessorVersionRequest;
14117    /// use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
14118    /// let x = EvaluateProcessorVersionRequest::new().set_evaluation_documents(BatchDocumentsInputConfig::default()/* use setters */);
14119    /// ```
14120    pub fn set_evaluation_documents<T>(mut self, v: T) -> Self
14121    where
14122        T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
14123    {
14124        self.evaluation_documents = std::option::Option::Some(v.into());
14125        self
14126    }
14127
14128    /// Sets or clears the value of [evaluation_documents][crate::model::EvaluateProcessorVersionRequest::evaluation_documents].
14129    ///
14130    /// # Example
14131    /// ```ignore,no_run
14132    /// # use google_cloud_documentai_v1::model::EvaluateProcessorVersionRequest;
14133    /// use google_cloud_documentai_v1::model::BatchDocumentsInputConfig;
14134    /// let x = EvaluateProcessorVersionRequest::new().set_or_clear_evaluation_documents(Some(BatchDocumentsInputConfig::default()/* use setters */));
14135    /// let x = EvaluateProcessorVersionRequest::new().set_or_clear_evaluation_documents(None::<BatchDocumentsInputConfig>);
14136    /// ```
14137    pub fn set_or_clear_evaluation_documents<T>(mut self, v: std::option::Option<T>) -> Self
14138    where
14139        T: std::convert::Into<crate::model::BatchDocumentsInputConfig>,
14140    {
14141        self.evaluation_documents = v.map(|x| x.into());
14142        self
14143    }
14144}
14145
14146impl wkt::message::Message for EvaluateProcessorVersionRequest {
14147    fn typename() -> &'static str {
14148        "type.googleapis.com/google.cloud.documentai.v1.EvaluateProcessorVersionRequest"
14149    }
14150}
14151
14152/// Metadata of the
14153/// [EvaluateProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion]
14154/// method.
14155///
14156/// [google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion]: crate::client::DocumentProcessorService::evaluate_processor_version
14157#[derive(Clone, Default, PartialEq)]
14158#[non_exhaustive]
14159pub struct EvaluateProcessorVersionMetadata {
14160    /// The basic metadata of the long-running operation.
14161    pub common_metadata: std::option::Option<crate::model::CommonOperationMetadata>,
14162
14163    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14164}
14165
14166impl EvaluateProcessorVersionMetadata {
14167    pub fn new() -> Self {
14168        std::default::Default::default()
14169    }
14170
14171    /// Sets the value of [common_metadata][crate::model::EvaluateProcessorVersionMetadata::common_metadata].
14172    ///
14173    /// # Example
14174    /// ```ignore,no_run
14175    /// # use google_cloud_documentai_v1::model::EvaluateProcessorVersionMetadata;
14176    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
14177    /// let x = EvaluateProcessorVersionMetadata::new().set_common_metadata(CommonOperationMetadata::default()/* use setters */);
14178    /// ```
14179    pub fn set_common_metadata<T>(mut self, v: T) -> Self
14180    where
14181        T: std::convert::Into<crate::model::CommonOperationMetadata>,
14182    {
14183        self.common_metadata = std::option::Option::Some(v.into());
14184        self
14185    }
14186
14187    /// Sets or clears the value of [common_metadata][crate::model::EvaluateProcessorVersionMetadata::common_metadata].
14188    ///
14189    /// # Example
14190    /// ```ignore,no_run
14191    /// # use google_cloud_documentai_v1::model::EvaluateProcessorVersionMetadata;
14192    /// use google_cloud_documentai_v1::model::CommonOperationMetadata;
14193    /// let x = EvaluateProcessorVersionMetadata::new().set_or_clear_common_metadata(Some(CommonOperationMetadata::default()/* use setters */));
14194    /// let x = EvaluateProcessorVersionMetadata::new().set_or_clear_common_metadata(None::<CommonOperationMetadata>);
14195    /// ```
14196    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
14197    where
14198        T: std::convert::Into<crate::model::CommonOperationMetadata>,
14199    {
14200        self.common_metadata = v.map(|x| x.into());
14201        self
14202    }
14203}
14204
14205impl wkt::message::Message for EvaluateProcessorVersionMetadata {
14206    fn typename() -> &'static str {
14207        "type.googleapis.com/google.cloud.documentai.v1.EvaluateProcessorVersionMetadata"
14208    }
14209}
14210
14211/// Response of the
14212/// [EvaluateProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion]
14213/// method.
14214///
14215/// [google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion]: crate::client::DocumentProcessorService::evaluate_processor_version
14216#[derive(Clone, Default, PartialEq)]
14217#[non_exhaustive]
14218pub struct EvaluateProcessorVersionResponse {
14219    /// The resource name of the created evaluation.
14220    pub evaluation: std::string::String,
14221
14222    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14223}
14224
14225impl EvaluateProcessorVersionResponse {
14226    pub fn new() -> Self {
14227        std::default::Default::default()
14228    }
14229
14230    /// Sets the value of [evaluation][crate::model::EvaluateProcessorVersionResponse::evaluation].
14231    ///
14232    /// # Example
14233    /// ```ignore,no_run
14234    /// # use google_cloud_documentai_v1::model::EvaluateProcessorVersionResponse;
14235    /// let x = EvaluateProcessorVersionResponse::new().set_evaluation("example");
14236    /// ```
14237    pub fn set_evaluation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14238        self.evaluation = v.into();
14239        self
14240    }
14241}
14242
14243impl wkt::message::Message for EvaluateProcessorVersionResponse {
14244    fn typename() -> &'static str {
14245        "type.googleapis.com/google.cloud.documentai.v1.EvaluateProcessorVersionResponse"
14246    }
14247}
14248
14249/// Retrieves a specific Evaluation.
14250#[derive(Clone, Default, PartialEq)]
14251#[non_exhaustive]
14252pub struct GetEvaluationRequest {
14253    /// Required. The resource name of the
14254    /// [Evaluation][google.cloud.documentai.v1.Evaluation] to get.
14255    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
14256    ///
14257    /// [google.cloud.documentai.v1.Evaluation]: crate::model::Evaluation
14258    pub name: std::string::String,
14259
14260    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14261}
14262
14263impl GetEvaluationRequest {
14264    pub fn new() -> Self {
14265        std::default::Default::default()
14266    }
14267
14268    /// Sets the value of [name][crate::model::GetEvaluationRequest::name].
14269    ///
14270    /// # Example
14271    /// ```ignore,no_run
14272    /// # use google_cloud_documentai_v1::model::GetEvaluationRequest;
14273    /// let x = GetEvaluationRequest::new().set_name("example");
14274    /// ```
14275    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14276        self.name = v.into();
14277        self
14278    }
14279}
14280
14281impl wkt::message::Message for GetEvaluationRequest {
14282    fn typename() -> &'static str {
14283        "type.googleapis.com/google.cloud.documentai.v1.GetEvaluationRequest"
14284    }
14285}
14286
14287/// Retrieves a list of evaluations for a given
14288/// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion].
14289///
14290/// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
14291#[derive(Clone, Default, PartialEq)]
14292#[non_exhaustive]
14293pub struct ListEvaluationsRequest {
14294    /// Required. The resource name of the
14295    /// [ProcessorVersion][google.cloud.documentai.v1.ProcessorVersion] to list
14296    /// evaluations for.
14297    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
14298    ///
14299    /// [google.cloud.documentai.v1.ProcessorVersion]: crate::model::ProcessorVersion
14300    pub parent: std::string::String,
14301
14302    /// The standard list page size.
14303    /// If unspecified, at most `5` evaluations are returned.
14304    /// The maximum value is `100`. Values above `100` are coerced to `100`.
14305    pub page_size: i32,
14306
14307    /// A page token, received from a previous `ListEvaluations` call.
14308    /// Provide this to retrieve the subsequent page.
14309    pub page_token: std::string::String,
14310
14311    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14312}
14313
14314impl ListEvaluationsRequest {
14315    pub fn new() -> Self {
14316        std::default::Default::default()
14317    }
14318
14319    /// Sets the value of [parent][crate::model::ListEvaluationsRequest::parent].
14320    ///
14321    /// # Example
14322    /// ```ignore,no_run
14323    /// # use google_cloud_documentai_v1::model::ListEvaluationsRequest;
14324    /// let x = ListEvaluationsRequest::new().set_parent("example");
14325    /// ```
14326    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14327        self.parent = v.into();
14328        self
14329    }
14330
14331    /// Sets the value of [page_size][crate::model::ListEvaluationsRequest::page_size].
14332    ///
14333    /// # Example
14334    /// ```ignore,no_run
14335    /// # use google_cloud_documentai_v1::model::ListEvaluationsRequest;
14336    /// let x = ListEvaluationsRequest::new().set_page_size(42);
14337    /// ```
14338    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14339        self.page_size = v.into();
14340        self
14341    }
14342
14343    /// Sets the value of [page_token][crate::model::ListEvaluationsRequest::page_token].
14344    ///
14345    /// # Example
14346    /// ```ignore,no_run
14347    /// # use google_cloud_documentai_v1::model::ListEvaluationsRequest;
14348    /// let x = ListEvaluationsRequest::new().set_page_token("example");
14349    /// ```
14350    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14351        self.page_token = v.into();
14352        self
14353    }
14354}
14355
14356impl wkt::message::Message for ListEvaluationsRequest {
14357    fn typename() -> &'static str {
14358        "type.googleapis.com/google.cloud.documentai.v1.ListEvaluationsRequest"
14359    }
14360}
14361
14362/// The response from `ListEvaluations`.
14363#[derive(Clone, Default, PartialEq)]
14364#[non_exhaustive]
14365pub struct ListEvaluationsResponse {
14366    /// The evaluations requested.
14367    pub evaluations: std::vec::Vec<crate::model::Evaluation>,
14368
14369    /// A token, which can be sent as `page_token` to retrieve the next page.
14370    /// If this field is omitted, there are no subsequent pages.
14371    pub next_page_token: std::string::String,
14372
14373    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14374}
14375
14376impl ListEvaluationsResponse {
14377    pub fn new() -> Self {
14378        std::default::Default::default()
14379    }
14380
14381    /// Sets the value of [evaluations][crate::model::ListEvaluationsResponse::evaluations].
14382    ///
14383    /// # Example
14384    /// ```ignore,no_run
14385    /// # use google_cloud_documentai_v1::model::ListEvaluationsResponse;
14386    /// use google_cloud_documentai_v1::model::Evaluation;
14387    /// let x = ListEvaluationsResponse::new()
14388    ///     .set_evaluations([
14389    ///         Evaluation::default()/* use setters */,
14390    ///         Evaluation::default()/* use (different) setters */,
14391    ///     ]);
14392    /// ```
14393    pub fn set_evaluations<T, V>(mut self, v: T) -> Self
14394    where
14395        T: std::iter::IntoIterator<Item = V>,
14396        V: std::convert::Into<crate::model::Evaluation>,
14397    {
14398        use std::iter::Iterator;
14399        self.evaluations = v.into_iter().map(|i| i.into()).collect();
14400        self
14401    }
14402
14403    /// Sets the value of [next_page_token][crate::model::ListEvaluationsResponse::next_page_token].
14404    ///
14405    /// # Example
14406    /// ```ignore,no_run
14407    /// # use google_cloud_documentai_v1::model::ListEvaluationsResponse;
14408    /// let x = ListEvaluationsResponse::new().set_next_page_token("example");
14409    /// ```
14410    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14411        self.next_page_token = v.into();
14412        self
14413    }
14414}
14415
14416impl wkt::message::Message for ListEvaluationsResponse {
14417    fn typename() -> &'static str {
14418        "type.googleapis.com/google.cloud.documentai.v1.ListEvaluationsResponse"
14419    }
14420}
14421
14422#[doc(hidden)]
14423impl google_cloud_gax::paginator::internal::PageableResponse for ListEvaluationsResponse {
14424    type PageItem = crate::model::Evaluation;
14425
14426    fn items(self) -> std::vec::Vec<Self::PageItem> {
14427        self.evaluations
14428    }
14429
14430    fn next_page_token(&self) -> std::string::String {
14431        use std::clone::Clone;
14432        self.next_page_token.clone()
14433    }
14434}
14435
14436/// The schema defines the output of the processed document by a processor.
14437#[derive(Clone, Default, PartialEq)]
14438#[non_exhaustive]
14439pub struct DocumentSchema {
14440    /// Display name to show to users.
14441    pub display_name: std::string::String,
14442
14443    /// Description of the schema.
14444    pub description: std::string::String,
14445
14446    /// Entity types of the schema.
14447    pub entity_types: std::vec::Vec<crate::model::document_schema::EntityType>,
14448
14449    /// Metadata of the schema.
14450    pub metadata: std::option::Option<crate::model::document_schema::Metadata>,
14451
14452    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14453}
14454
14455impl DocumentSchema {
14456    pub fn new() -> Self {
14457        std::default::Default::default()
14458    }
14459
14460    /// Sets the value of [display_name][crate::model::DocumentSchema::display_name].
14461    ///
14462    /// # Example
14463    /// ```ignore,no_run
14464    /// # use google_cloud_documentai_v1::model::DocumentSchema;
14465    /// let x = DocumentSchema::new().set_display_name("example");
14466    /// ```
14467    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14468        self.display_name = v.into();
14469        self
14470    }
14471
14472    /// Sets the value of [description][crate::model::DocumentSchema::description].
14473    ///
14474    /// # Example
14475    /// ```ignore,no_run
14476    /// # use google_cloud_documentai_v1::model::DocumentSchema;
14477    /// let x = DocumentSchema::new().set_description("example");
14478    /// ```
14479    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14480        self.description = v.into();
14481        self
14482    }
14483
14484    /// Sets the value of [entity_types][crate::model::DocumentSchema::entity_types].
14485    ///
14486    /// # Example
14487    /// ```ignore,no_run
14488    /// # use google_cloud_documentai_v1::model::DocumentSchema;
14489    /// use google_cloud_documentai_v1::model::document_schema::EntityType;
14490    /// let x = DocumentSchema::new()
14491    ///     .set_entity_types([
14492    ///         EntityType::default()/* use setters */,
14493    ///         EntityType::default()/* use (different) setters */,
14494    ///     ]);
14495    /// ```
14496    pub fn set_entity_types<T, V>(mut self, v: T) -> Self
14497    where
14498        T: std::iter::IntoIterator<Item = V>,
14499        V: std::convert::Into<crate::model::document_schema::EntityType>,
14500    {
14501        use std::iter::Iterator;
14502        self.entity_types = v.into_iter().map(|i| i.into()).collect();
14503        self
14504    }
14505
14506    /// Sets the value of [metadata][crate::model::DocumentSchema::metadata].
14507    ///
14508    /// # Example
14509    /// ```ignore,no_run
14510    /// # use google_cloud_documentai_v1::model::DocumentSchema;
14511    /// use google_cloud_documentai_v1::model::document_schema::Metadata;
14512    /// let x = DocumentSchema::new().set_metadata(Metadata::default()/* use setters */);
14513    /// ```
14514    pub fn set_metadata<T>(mut self, v: T) -> Self
14515    where
14516        T: std::convert::Into<crate::model::document_schema::Metadata>,
14517    {
14518        self.metadata = std::option::Option::Some(v.into());
14519        self
14520    }
14521
14522    /// Sets or clears the value of [metadata][crate::model::DocumentSchema::metadata].
14523    ///
14524    /// # Example
14525    /// ```ignore,no_run
14526    /// # use google_cloud_documentai_v1::model::DocumentSchema;
14527    /// use google_cloud_documentai_v1::model::document_schema::Metadata;
14528    /// let x = DocumentSchema::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
14529    /// let x = DocumentSchema::new().set_or_clear_metadata(None::<Metadata>);
14530    /// ```
14531    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
14532    where
14533        T: std::convert::Into<crate::model::document_schema::Metadata>,
14534    {
14535        self.metadata = v.map(|x| x.into());
14536        self
14537    }
14538}
14539
14540impl wkt::message::Message for DocumentSchema {
14541    fn typename() -> &'static str {
14542        "type.googleapis.com/google.cloud.documentai.v1.DocumentSchema"
14543    }
14544}
14545
14546/// Defines additional types related to [DocumentSchema].
14547pub mod document_schema {
14548    #[allow(unused_imports)]
14549    use super::*;
14550
14551    /// EntityType is the wrapper of a label of the corresponding model with
14552    /// detailed attributes and limitations for entity-based processors. Multiple
14553    /// types can also compose a dependency tree to represent nested types.
14554    #[derive(Clone, Default, PartialEq)]
14555    #[non_exhaustive]
14556    pub struct EntityType {
14557        /// User defined name for the type.
14558        pub display_name: std::string::String,
14559
14560        /// Name of the type. It must be unique within the schema file and
14561        /// cannot be a "Common Type".  The following naming conventions are used:
14562        ///
14563        /// - Use `snake_casing`.
14564        /// - Name matching is case-sensitive.
14565        /// - Maximum 64 characters.
14566        /// - Must start with a letter.
14567        /// - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
14568        ///   compatibility internal infrastructure and tooling can handle any ascii
14569        ///   character.)
14570        /// - The `/` is sometimes used to denote a property of a type.  For example
14571        ///   `line_item/amount`.  This convention is deprecated, but will still be
14572        ///   honored for backward compatibility.
14573        pub name: std::string::String,
14574
14575        /// The entity type that this type is derived from.  For now, one and only
14576        /// one should be set.
14577        pub base_types: std::vec::Vec<std::string::String>,
14578
14579        /// Description the nested structure, or composition of an entity.
14580        pub properties: std::vec::Vec<crate::model::document_schema::entity_type::Property>,
14581
14582        pub value_source:
14583            std::option::Option<crate::model::document_schema::entity_type::ValueSource>,
14584
14585        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14586    }
14587
14588    impl EntityType {
14589        pub fn new() -> Self {
14590            std::default::Default::default()
14591        }
14592
14593        /// Sets the value of [display_name][crate::model::document_schema::EntityType::display_name].
14594        ///
14595        /// # Example
14596        /// ```ignore,no_run
14597        /// # use google_cloud_documentai_v1::model::document_schema::EntityType;
14598        /// let x = EntityType::new().set_display_name("example");
14599        /// ```
14600        pub fn set_display_name<T: std::convert::Into<std::string::String>>(
14601            mut self,
14602            v: T,
14603        ) -> Self {
14604            self.display_name = v.into();
14605            self
14606        }
14607
14608        /// Sets the value of [name][crate::model::document_schema::EntityType::name].
14609        ///
14610        /// # Example
14611        /// ```ignore,no_run
14612        /// # use google_cloud_documentai_v1::model::document_schema::EntityType;
14613        /// let x = EntityType::new().set_name("example");
14614        /// ```
14615        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14616            self.name = v.into();
14617            self
14618        }
14619
14620        /// Sets the value of [base_types][crate::model::document_schema::EntityType::base_types].
14621        ///
14622        /// # Example
14623        /// ```ignore,no_run
14624        /// # use google_cloud_documentai_v1::model::document_schema::EntityType;
14625        /// let x = EntityType::new().set_base_types(["a", "b", "c"]);
14626        /// ```
14627        pub fn set_base_types<T, V>(mut self, v: T) -> Self
14628        where
14629            T: std::iter::IntoIterator<Item = V>,
14630            V: std::convert::Into<std::string::String>,
14631        {
14632            use std::iter::Iterator;
14633            self.base_types = v.into_iter().map(|i| i.into()).collect();
14634            self
14635        }
14636
14637        /// Sets the value of [properties][crate::model::document_schema::EntityType::properties].
14638        ///
14639        /// # Example
14640        /// ```ignore,no_run
14641        /// # use google_cloud_documentai_v1::model::document_schema::EntityType;
14642        /// use google_cloud_documentai_v1::model::document_schema::entity_type::Property;
14643        /// let x = EntityType::new()
14644        ///     .set_properties([
14645        ///         Property::default()/* use setters */,
14646        ///         Property::default()/* use (different) setters */,
14647        ///     ]);
14648        /// ```
14649        pub fn set_properties<T, V>(mut self, v: T) -> Self
14650        where
14651            T: std::iter::IntoIterator<Item = V>,
14652            V: std::convert::Into<crate::model::document_schema::entity_type::Property>,
14653        {
14654            use std::iter::Iterator;
14655            self.properties = v.into_iter().map(|i| i.into()).collect();
14656            self
14657        }
14658
14659        /// Sets the value of [value_source][crate::model::document_schema::EntityType::value_source].
14660        ///
14661        /// Note that all the setters affecting `value_source` are mutually
14662        /// exclusive.
14663        ///
14664        /// # Example
14665        /// ```ignore,no_run
14666        /// # use google_cloud_documentai_v1::model::document_schema::EntityType;
14667        /// use google_cloud_documentai_v1::model::document_schema::entity_type::EnumValues;
14668        /// let x = EntityType::new().set_value_source(Some(
14669        ///     google_cloud_documentai_v1::model::document_schema::entity_type::ValueSource::EnumValues(EnumValues::default().into())));
14670        /// ```
14671        pub fn set_value_source<
14672            T: std::convert::Into<
14673                    std::option::Option<crate::model::document_schema::entity_type::ValueSource>,
14674                >,
14675        >(
14676            mut self,
14677            v: T,
14678        ) -> Self {
14679            self.value_source = v.into();
14680            self
14681        }
14682
14683        /// The value of [value_source][crate::model::document_schema::EntityType::value_source]
14684        /// if it holds a `EnumValues`, `None` if the field is not set or
14685        /// holds a different branch.
14686        pub fn enum_values(
14687            &self,
14688        ) -> std::option::Option<
14689            &std::boxed::Box<crate::model::document_schema::entity_type::EnumValues>,
14690        > {
14691            #[allow(unreachable_patterns)]
14692            self.value_source.as_ref().and_then(|v| match v {
14693                crate::model::document_schema::entity_type::ValueSource::EnumValues(v) => {
14694                    std::option::Option::Some(v)
14695                }
14696                _ => std::option::Option::None,
14697            })
14698        }
14699
14700        /// Sets the value of [value_source][crate::model::document_schema::EntityType::value_source]
14701        /// to hold a `EnumValues`.
14702        ///
14703        /// Note that all the setters affecting `value_source` are
14704        /// mutually exclusive.
14705        ///
14706        /// # Example
14707        /// ```ignore,no_run
14708        /// # use google_cloud_documentai_v1::model::document_schema::EntityType;
14709        /// use google_cloud_documentai_v1::model::document_schema::entity_type::EnumValues;
14710        /// let x = EntityType::new().set_enum_values(EnumValues::default()/* use setters */);
14711        /// assert!(x.enum_values().is_some());
14712        /// ```
14713        pub fn set_enum_values<
14714            T: std::convert::Into<
14715                    std::boxed::Box<crate::model::document_schema::entity_type::EnumValues>,
14716                >,
14717        >(
14718            mut self,
14719            v: T,
14720        ) -> Self {
14721            self.value_source = std::option::Option::Some(
14722                crate::model::document_schema::entity_type::ValueSource::EnumValues(v.into()),
14723            );
14724            self
14725        }
14726    }
14727
14728    impl wkt::message::Message for EntityType {
14729        fn typename() -> &'static str {
14730            "type.googleapis.com/google.cloud.documentai.v1.DocumentSchema.EntityType"
14731        }
14732    }
14733
14734    /// Defines additional types related to [EntityType].
14735    pub mod entity_type {
14736        #[allow(unused_imports)]
14737        use super::*;
14738
14739        /// Defines the a list of enum values.
14740        #[derive(Clone, Default, PartialEq)]
14741        #[non_exhaustive]
14742        pub struct EnumValues {
14743            /// The individual values that this enum values type can include.
14744            pub values: std::vec::Vec<std::string::String>,
14745
14746            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14747        }
14748
14749        impl EnumValues {
14750            pub fn new() -> Self {
14751                std::default::Default::default()
14752            }
14753
14754            /// Sets the value of [values][crate::model::document_schema::entity_type::EnumValues::values].
14755            ///
14756            /// # Example
14757            /// ```ignore,no_run
14758            /// # use google_cloud_documentai_v1::model::document_schema::entity_type::EnumValues;
14759            /// let x = EnumValues::new().set_values(["a", "b", "c"]);
14760            /// ```
14761            pub fn set_values<T, V>(mut self, v: T) -> Self
14762            where
14763                T: std::iter::IntoIterator<Item = V>,
14764                V: std::convert::Into<std::string::String>,
14765            {
14766                use std::iter::Iterator;
14767                self.values = v.into_iter().map(|i| i.into()).collect();
14768                self
14769            }
14770        }
14771
14772        impl wkt::message::Message for EnumValues {
14773            fn typename() -> &'static str {
14774                "type.googleapis.com/google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues"
14775            }
14776        }
14777
14778        /// Defines properties that can be part of the entity type.
14779        #[derive(Clone, Default, PartialEq)]
14780        #[non_exhaustive]
14781        pub struct Property {
14782            /// The name of the property.  Follows the same guidelines as the
14783            /// EntityType name.
14784            pub name: std::string::String,
14785
14786            /// User defined name for the property.
14787            pub display_name: std::string::String,
14788
14789            /// A reference to the value type of the property.  This type is subject
14790            /// to the same conventions as the `Entity.base_types` field.
14791            pub value_type: std::string::String,
14792
14793            /// Occurrence type limits the number of instances an entity type appears
14794            /// in the document.
14795            pub occurrence_type:
14796                crate::model::document_schema::entity_type::property::OccurrenceType,
14797
14798            /// Specifies how the entity's value is obtained.
14799            pub method: crate::model::document_schema::entity_type::property::Method,
14800
14801            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14802        }
14803
14804        impl Property {
14805            pub fn new() -> Self {
14806                std::default::Default::default()
14807            }
14808
14809            /// Sets the value of [name][crate::model::document_schema::entity_type::Property::name].
14810            ///
14811            /// # Example
14812            /// ```ignore,no_run
14813            /// # use google_cloud_documentai_v1::model::document_schema::entity_type::Property;
14814            /// let x = Property::new().set_name("example");
14815            /// ```
14816            pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14817                self.name = v.into();
14818                self
14819            }
14820
14821            /// Sets the value of [display_name][crate::model::document_schema::entity_type::Property::display_name].
14822            ///
14823            /// # Example
14824            /// ```ignore,no_run
14825            /// # use google_cloud_documentai_v1::model::document_schema::entity_type::Property;
14826            /// let x = Property::new().set_display_name("example");
14827            /// ```
14828            pub fn set_display_name<T: std::convert::Into<std::string::String>>(
14829                mut self,
14830                v: T,
14831            ) -> Self {
14832                self.display_name = v.into();
14833                self
14834            }
14835
14836            /// Sets the value of [value_type][crate::model::document_schema::entity_type::Property::value_type].
14837            ///
14838            /// # Example
14839            /// ```ignore,no_run
14840            /// # use google_cloud_documentai_v1::model::document_schema::entity_type::Property;
14841            /// let x = Property::new().set_value_type("example");
14842            /// ```
14843            pub fn set_value_type<T: std::convert::Into<std::string::String>>(
14844                mut self,
14845                v: T,
14846            ) -> Self {
14847                self.value_type = v.into();
14848                self
14849            }
14850
14851            /// Sets the value of [occurrence_type][crate::model::document_schema::entity_type::Property::occurrence_type].
14852            ///
14853            /// # Example
14854            /// ```ignore,no_run
14855            /// # use google_cloud_documentai_v1::model::document_schema::entity_type::Property;
14856            /// use google_cloud_documentai_v1::model::document_schema::entity_type::property::OccurrenceType;
14857            /// let x0 = Property::new().set_occurrence_type(OccurrenceType::OptionalOnce);
14858            /// let x1 = Property::new().set_occurrence_type(OccurrenceType::OptionalMultiple);
14859            /// let x2 = Property::new().set_occurrence_type(OccurrenceType::RequiredOnce);
14860            /// ```
14861            pub fn set_occurrence_type<
14862                T: std::convert::Into<
14863                        crate::model::document_schema::entity_type::property::OccurrenceType,
14864                    >,
14865            >(
14866                mut self,
14867                v: T,
14868            ) -> Self {
14869                self.occurrence_type = v.into();
14870                self
14871            }
14872
14873            /// Sets the value of [method][crate::model::document_schema::entity_type::Property::method].
14874            ///
14875            /// # Example
14876            /// ```ignore,no_run
14877            /// # use google_cloud_documentai_v1::model::document_schema::entity_type::Property;
14878            /// use google_cloud_documentai_v1::model::document_schema::entity_type::property::Method;
14879            /// let x0 = Property::new().set_method(Method::Extract);
14880            /// let x1 = Property::new().set_method(Method::Derive);
14881            /// ```
14882            pub fn set_method<
14883                T: std::convert::Into<crate::model::document_schema::entity_type::property::Method>,
14884            >(
14885                mut self,
14886                v: T,
14887            ) -> Self {
14888                self.method = v.into();
14889                self
14890            }
14891        }
14892
14893        impl wkt::message::Message for Property {
14894            fn typename() -> &'static str {
14895                "type.googleapis.com/google.cloud.documentai.v1.DocumentSchema.EntityType.Property"
14896            }
14897        }
14898
14899        /// Defines additional types related to [Property].
14900        pub mod property {
14901            #[allow(unused_imports)]
14902            use super::*;
14903
14904            /// Types of occurrences of the entity type in the document.  This
14905            /// represents the number of instances, not mentions, of an entity.
14906            /// For example, a bank statement might only have one
14907            /// `account_number`, but this account number can be mentioned in several
14908            /// places on the document.  In this case, the `account_number` is
14909            /// considered a `REQUIRED_ONCE` entity type. If, on the other hand, we
14910            /// expect a bank statement to contain the status of multiple different
14911            /// accounts for the customers, the occurrence type is set to
14912            /// `REQUIRED_MULTIPLE`.
14913            ///
14914            /// # Working with unknown values
14915            ///
14916            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14917            /// additional enum variants at any time. Adding new variants is not considered
14918            /// a breaking change. Applications should write their code in anticipation of:
14919            ///
14920            /// - New values appearing in future releases of the client library, **and**
14921            /// - New values received dynamically, without application changes.
14922            ///
14923            /// Please consult the [Working with enums] section in the user guide for some
14924            /// guidelines.
14925            ///
14926            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14927            #[derive(Clone, Debug, PartialEq)]
14928            #[non_exhaustive]
14929            pub enum OccurrenceType {
14930                /// Unspecified occurrence type.
14931                Unspecified,
14932                /// There will be zero or one instance of this entity type.  The same
14933                /// entity instance may be mentioned multiple times.
14934                OptionalOnce,
14935                /// The entity type will appear zero or multiple times.
14936                OptionalMultiple,
14937                /// The entity type will only appear exactly once.  The same
14938                /// entity instance may be mentioned multiple times.
14939                RequiredOnce,
14940                /// The entity type will appear once or more times.
14941                RequiredMultiple,
14942                /// If set, the enum was initialized with an unknown value.
14943                ///
14944                /// Applications can examine the value using [OccurrenceType::value] or
14945                /// [OccurrenceType::name].
14946                UnknownValue(occurrence_type::UnknownValue),
14947            }
14948
14949            #[doc(hidden)]
14950            pub mod occurrence_type {
14951                #[allow(unused_imports)]
14952                use super::*;
14953                #[derive(Clone, Debug, PartialEq)]
14954                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14955            }
14956
14957            impl OccurrenceType {
14958                /// Gets the enum value.
14959                ///
14960                /// Returns `None` if the enum contains an unknown value deserialized from
14961                /// the string representation of enums.
14962                pub fn value(&self) -> std::option::Option<i32> {
14963                    match self {
14964                        Self::Unspecified => std::option::Option::Some(0),
14965                        Self::OptionalOnce => std::option::Option::Some(1),
14966                        Self::OptionalMultiple => std::option::Option::Some(2),
14967                        Self::RequiredOnce => std::option::Option::Some(3),
14968                        Self::RequiredMultiple => std::option::Option::Some(4),
14969                        Self::UnknownValue(u) => u.0.value(),
14970                    }
14971                }
14972
14973                /// Gets the enum value as a string.
14974                ///
14975                /// Returns `None` if the enum contains an unknown value deserialized from
14976                /// the integer representation of enums.
14977                pub fn name(&self) -> std::option::Option<&str> {
14978                    match self {
14979                        Self::Unspecified => {
14980                            std::option::Option::Some("OCCURRENCE_TYPE_UNSPECIFIED")
14981                        }
14982                        Self::OptionalOnce => std::option::Option::Some("OPTIONAL_ONCE"),
14983                        Self::OptionalMultiple => std::option::Option::Some("OPTIONAL_MULTIPLE"),
14984                        Self::RequiredOnce => std::option::Option::Some("REQUIRED_ONCE"),
14985                        Self::RequiredMultiple => std::option::Option::Some("REQUIRED_MULTIPLE"),
14986                        Self::UnknownValue(u) => u.0.name(),
14987                    }
14988                }
14989            }
14990
14991            impl std::default::Default for OccurrenceType {
14992                fn default() -> Self {
14993                    use std::convert::From;
14994                    Self::from(0)
14995                }
14996            }
14997
14998            impl std::fmt::Display for OccurrenceType {
14999                fn fmt(
15000                    &self,
15001                    f: &mut std::fmt::Formatter<'_>,
15002                ) -> std::result::Result<(), std::fmt::Error> {
15003                    wkt::internal::display_enum(f, self.name(), self.value())
15004                }
15005            }
15006
15007            impl std::convert::From<i32> for OccurrenceType {
15008                fn from(value: i32) -> Self {
15009                    match value {
15010                        0 => Self::Unspecified,
15011                        1 => Self::OptionalOnce,
15012                        2 => Self::OptionalMultiple,
15013                        3 => Self::RequiredOnce,
15014                        4 => Self::RequiredMultiple,
15015                        _ => Self::UnknownValue(occurrence_type::UnknownValue(
15016                            wkt::internal::UnknownEnumValue::Integer(value),
15017                        )),
15018                    }
15019                }
15020            }
15021
15022            impl std::convert::From<&str> for OccurrenceType {
15023                fn from(value: &str) -> Self {
15024                    use std::string::ToString;
15025                    match value {
15026                        "OCCURRENCE_TYPE_UNSPECIFIED" => Self::Unspecified,
15027                        "OPTIONAL_ONCE" => Self::OptionalOnce,
15028                        "OPTIONAL_MULTIPLE" => Self::OptionalMultiple,
15029                        "REQUIRED_ONCE" => Self::RequiredOnce,
15030                        "REQUIRED_MULTIPLE" => Self::RequiredMultiple,
15031                        _ => Self::UnknownValue(occurrence_type::UnknownValue(
15032                            wkt::internal::UnknownEnumValue::String(value.to_string()),
15033                        )),
15034                    }
15035                }
15036            }
15037
15038            impl serde::ser::Serialize for OccurrenceType {
15039                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15040                where
15041                    S: serde::Serializer,
15042                {
15043                    match self {
15044                        Self::Unspecified => serializer.serialize_i32(0),
15045                        Self::OptionalOnce => serializer.serialize_i32(1),
15046                        Self::OptionalMultiple => serializer.serialize_i32(2),
15047                        Self::RequiredOnce => serializer.serialize_i32(3),
15048                        Self::RequiredMultiple => serializer.serialize_i32(4),
15049                        Self::UnknownValue(u) => u.0.serialize(serializer),
15050                    }
15051                }
15052            }
15053
15054            impl<'de> serde::de::Deserialize<'de> for OccurrenceType {
15055                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15056                where
15057                    D: serde::Deserializer<'de>,
15058                {
15059                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<OccurrenceType>::new(
15060                        ".google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType"))
15061                }
15062            }
15063
15064            /// Specifies how the entity's value is obtained from the document.
15065            ///
15066            /// # Working with unknown values
15067            ///
15068            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15069            /// additional enum variants at any time. Adding new variants is not considered
15070            /// a breaking change. Applications should write their code in anticipation of:
15071            ///
15072            /// - New values appearing in future releases of the client library, **and**
15073            /// - New values received dynamically, without application changes.
15074            ///
15075            /// Please consult the [Working with enums] section in the user guide for some
15076            /// guidelines.
15077            ///
15078            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15079            #[derive(Clone, Debug, PartialEq)]
15080            #[non_exhaustive]
15081            pub enum Method {
15082                /// Unspecified method. It defaults to `EXTRACT`.
15083                Unspecified,
15084                /// The entity's value is directly extracted as-is from the document
15085                /// text.
15086                Extract,
15087                /// The entity's value is derived through inference and is not
15088                /// necessarily an exact text extraction from the document.
15089                Derive,
15090                /// If set, the enum was initialized with an unknown value.
15091                ///
15092                /// Applications can examine the value using [Method::value] or
15093                /// [Method::name].
15094                UnknownValue(method::UnknownValue),
15095            }
15096
15097            #[doc(hidden)]
15098            pub mod method {
15099                #[allow(unused_imports)]
15100                use super::*;
15101                #[derive(Clone, Debug, PartialEq)]
15102                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15103            }
15104
15105            impl Method {
15106                /// Gets the enum value.
15107                ///
15108                /// Returns `None` if the enum contains an unknown value deserialized from
15109                /// the string representation of enums.
15110                pub fn value(&self) -> std::option::Option<i32> {
15111                    match self {
15112                        Self::Unspecified => std::option::Option::Some(0),
15113                        Self::Extract => std::option::Option::Some(1),
15114                        Self::Derive => std::option::Option::Some(2),
15115                        Self::UnknownValue(u) => u.0.value(),
15116                    }
15117                }
15118
15119                /// Gets the enum value as a string.
15120                ///
15121                /// Returns `None` if the enum contains an unknown value deserialized from
15122                /// the integer representation of enums.
15123                pub fn name(&self) -> std::option::Option<&str> {
15124                    match self {
15125                        Self::Unspecified => std::option::Option::Some("METHOD_UNSPECIFIED"),
15126                        Self::Extract => std::option::Option::Some("EXTRACT"),
15127                        Self::Derive => std::option::Option::Some("DERIVE"),
15128                        Self::UnknownValue(u) => u.0.name(),
15129                    }
15130                }
15131            }
15132
15133            impl std::default::Default for Method {
15134                fn default() -> Self {
15135                    use std::convert::From;
15136                    Self::from(0)
15137                }
15138            }
15139
15140            impl std::fmt::Display for Method {
15141                fn fmt(
15142                    &self,
15143                    f: &mut std::fmt::Formatter<'_>,
15144                ) -> std::result::Result<(), std::fmt::Error> {
15145                    wkt::internal::display_enum(f, self.name(), self.value())
15146                }
15147            }
15148
15149            impl std::convert::From<i32> for Method {
15150                fn from(value: i32) -> Self {
15151                    match value {
15152                        0 => Self::Unspecified,
15153                        1 => Self::Extract,
15154                        2 => Self::Derive,
15155                        _ => Self::UnknownValue(method::UnknownValue(
15156                            wkt::internal::UnknownEnumValue::Integer(value),
15157                        )),
15158                    }
15159                }
15160            }
15161
15162            impl std::convert::From<&str> for Method {
15163                fn from(value: &str) -> Self {
15164                    use std::string::ToString;
15165                    match value {
15166                        "METHOD_UNSPECIFIED" => Self::Unspecified,
15167                        "EXTRACT" => Self::Extract,
15168                        "DERIVE" => Self::Derive,
15169                        _ => Self::UnknownValue(method::UnknownValue(
15170                            wkt::internal::UnknownEnumValue::String(value.to_string()),
15171                        )),
15172                    }
15173                }
15174            }
15175
15176            impl serde::ser::Serialize for Method {
15177                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15178                where
15179                    S: serde::Serializer,
15180                {
15181                    match self {
15182                        Self::Unspecified => serializer.serialize_i32(0),
15183                        Self::Extract => serializer.serialize_i32(1),
15184                        Self::Derive => serializer.serialize_i32(2),
15185                        Self::UnknownValue(u) => u.0.serialize(serializer),
15186                    }
15187                }
15188            }
15189
15190            impl<'de> serde::de::Deserialize<'de> for Method {
15191                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15192                where
15193                    D: serde::Deserializer<'de>,
15194                {
15195                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<Method>::new(
15196                        ".google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method",
15197                    ))
15198                }
15199            }
15200        }
15201
15202        #[derive(Clone, Debug, PartialEq)]
15203        #[non_exhaustive]
15204        pub enum ValueSource {
15205            /// If specified, lists all the possible values for this entity.  This
15206            /// should not be more than a handful of values.  If the number of values
15207            /// is >10 or could change frequently use the `EntityType.value_ontology`
15208            /// field and specify a list of all possible values in a value ontology
15209            /// file.
15210            EnumValues(std::boxed::Box<crate::model::document_schema::entity_type::EnumValues>),
15211        }
15212    }
15213
15214    /// Metadata for global schema behavior.
15215    #[derive(Clone, Default, PartialEq)]
15216    #[non_exhaustive]
15217    pub struct Metadata {
15218        /// If true, a `document` entity type can be applied to subdocument
15219        /// (splitting). Otherwise, it can only be applied to the entire document
15220        /// (classification).
15221        pub document_splitter: bool,
15222
15223        /// If true, on a given page, there can be multiple `document` annotations
15224        /// covering it.
15225        pub document_allow_multiple_labels: bool,
15226
15227        /// If set, all the nested entities must be prefixed with the parents.
15228        pub prefixed_naming_on_properties: bool,
15229
15230        /// If set, we will skip the naming format validation in the schema. So the
15231        /// string values in `DocumentSchema.EntityType.name` and
15232        /// `DocumentSchema.EntityType.Property.name` will not be checked.
15233        pub skip_naming_validation: bool,
15234
15235        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15236    }
15237
15238    impl Metadata {
15239        pub fn new() -> Self {
15240            std::default::Default::default()
15241        }
15242
15243        /// Sets the value of [document_splitter][crate::model::document_schema::Metadata::document_splitter].
15244        ///
15245        /// # Example
15246        /// ```ignore,no_run
15247        /// # use google_cloud_documentai_v1::model::document_schema::Metadata;
15248        /// let x = Metadata::new().set_document_splitter(true);
15249        /// ```
15250        pub fn set_document_splitter<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15251            self.document_splitter = v.into();
15252            self
15253        }
15254
15255        /// Sets the value of [document_allow_multiple_labels][crate::model::document_schema::Metadata::document_allow_multiple_labels].
15256        ///
15257        /// # Example
15258        /// ```ignore,no_run
15259        /// # use google_cloud_documentai_v1::model::document_schema::Metadata;
15260        /// let x = Metadata::new().set_document_allow_multiple_labels(true);
15261        /// ```
15262        pub fn set_document_allow_multiple_labels<T: std::convert::Into<bool>>(
15263            mut self,
15264            v: T,
15265        ) -> Self {
15266            self.document_allow_multiple_labels = v.into();
15267            self
15268        }
15269
15270        /// Sets the value of [prefixed_naming_on_properties][crate::model::document_schema::Metadata::prefixed_naming_on_properties].
15271        ///
15272        /// # Example
15273        /// ```ignore,no_run
15274        /// # use google_cloud_documentai_v1::model::document_schema::Metadata;
15275        /// let x = Metadata::new().set_prefixed_naming_on_properties(true);
15276        /// ```
15277        pub fn set_prefixed_naming_on_properties<T: std::convert::Into<bool>>(
15278            mut self,
15279            v: T,
15280        ) -> Self {
15281            self.prefixed_naming_on_properties = v.into();
15282            self
15283        }
15284
15285        /// Sets the value of [skip_naming_validation][crate::model::document_schema::Metadata::skip_naming_validation].
15286        ///
15287        /// # Example
15288        /// ```ignore,no_run
15289        /// # use google_cloud_documentai_v1::model::document_schema::Metadata;
15290        /// let x = Metadata::new().set_skip_naming_validation(true);
15291        /// ```
15292        pub fn set_skip_naming_validation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15293            self.skip_naming_validation = v.into();
15294            self
15295        }
15296    }
15297
15298    impl wkt::message::Message for Metadata {
15299        fn typename() -> &'static str {
15300            "type.googleapis.com/google.cloud.documentai.v1.DocumentSchema.Metadata"
15301        }
15302    }
15303}
15304
15305/// Gives a short summary of an evaluation, and links to the evaluation itself.
15306#[derive(Clone, Default, PartialEq)]
15307#[non_exhaustive]
15308pub struct EvaluationReference {
15309    /// The resource name of the Long Running Operation for the evaluation.
15310    pub operation: std::string::String,
15311
15312    /// The resource name of the evaluation.
15313    pub evaluation: std::string::String,
15314
15315    /// An aggregate of the statistics for the evaluation with fuzzy matching on.
15316    pub aggregate_metrics: std::option::Option<crate::model::evaluation::Metrics>,
15317
15318    /// An aggregate of the statistics for the evaluation with fuzzy matching off.
15319    pub aggregate_metrics_exact: std::option::Option<crate::model::evaluation::Metrics>,
15320
15321    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15322}
15323
15324impl EvaluationReference {
15325    pub fn new() -> Self {
15326        std::default::Default::default()
15327    }
15328
15329    /// Sets the value of [operation][crate::model::EvaluationReference::operation].
15330    ///
15331    /// # Example
15332    /// ```ignore,no_run
15333    /// # use google_cloud_documentai_v1::model::EvaluationReference;
15334    /// let x = EvaluationReference::new().set_operation("example");
15335    /// ```
15336    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15337        self.operation = v.into();
15338        self
15339    }
15340
15341    /// Sets the value of [evaluation][crate::model::EvaluationReference::evaluation].
15342    ///
15343    /// # Example
15344    /// ```ignore,no_run
15345    /// # use google_cloud_documentai_v1::model::EvaluationReference;
15346    /// let x = EvaluationReference::new().set_evaluation("example");
15347    /// ```
15348    pub fn set_evaluation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15349        self.evaluation = v.into();
15350        self
15351    }
15352
15353    /// Sets the value of [aggregate_metrics][crate::model::EvaluationReference::aggregate_metrics].
15354    ///
15355    /// # Example
15356    /// ```ignore,no_run
15357    /// # use google_cloud_documentai_v1::model::EvaluationReference;
15358    /// use google_cloud_documentai_v1::model::evaluation::Metrics;
15359    /// let x = EvaluationReference::new().set_aggregate_metrics(Metrics::default()/* use setters */);
15360    /// ```
15361    pub fn set_aggregate_metrics<T>(mut self, v: T) -> Self
15362    where
15363        T: std::convert::Into<crate::model::evaluation::Metrics>,
15364    {
15365        self.aggregate_metrics = std::option::Option::Some(v.into());
15366        self
15367    }
15368
15369    /// Sets or clears the value of [aggregate_metrics][crate::model::EvaluationReference::aggregate_metrics].
15370    ///
15371    /// # Example
15372    /// ```ignore,no_run
15373    /// # use google_cloud_documentai_v1::model::EvaluationReference;
15374    /// use google_cloud_documentai_v1::model::evaluation::Metrics;
15375    /// let x = EvaluationReference::new().set_or_clear_aggregate_metrics(Some(Metrics::default()/* use setters */));
15376    /// let x = EvaluationReference::new().set_or_clear_aggregate_metrics(None::<Metrics>);
15377    /// ```
15378    pub fn set_or_clear_aggregate_metrics<T>(mut self, v: std::option::Option<T>) -> Self
15379    where
15380        T: std::convert::Into<crate::model::evaluation::Metrics>,
15381    {
15382        self.aggregate_metrics = v.map(|x| x.into());
15383        self
15384    }
15385
15386    /// Sets the value of [aggregate_metrics_exact][crate::model::EvaluationReference::aggregate_metrics_exact].
15387    ///
15388    /// # Example
15389    /// ```ignore,no_run
15390    /// # use google_cloud_documentai_v1::model::EvaluationReference;
15391    /// use google_cloud_documentai_v1::model::evaluation::Metrics;
15392    /// let x = EvaluationReference::new().set_aggregate_metrics_exact(Metrics::default()/* use setters */);
15393    /// ```
15394    pub fn set_aggregate_metrics_exact<T>(mut self, v: T) -> Self
15395    where
15396        T: std::convert::Into<crate::model::evaluation::Metrics>,
15397    {
15398        self.aggregate_metrics_exact = std::option::Option::Some(v.into());
15399        self
15400    }
15401
15402    /// Sets or clears the value of [aggregate_metrics_exact][crate::model::EvaluationReference::aggregate_metrics_exact].
15403    ///
15404    /// # Example
15405    /// ```ignore,no_run
15406    /// # use google_cloud_documentai_v1::model::EvaluationReference;
15407    /// use google_cloud_documentai_v1::model::evaluation::Metrics;
15408    /// let x = EvaluationReference::new().set_or_clear_aggregate_metrics_exact(Some(Metrics::default()/* use setters */));
15409    /// let x = EvaluationReference::new().set_or_clear_aggregate_metrics_exact(None::<Metrics>);
15410    /// ```
15411    pub fn set_or_clear_aggregate_metrics_exact<T>(mut self, v: std::option::Option<T>) -> Self
15412    where
15413        T: std::convert::Into<crate::model::evaluation::Metrics>,
15414    {
15415        self.aggregate_metrics_exact = v.map(|x| x.into());
15416        self
15417    }
15418}
15419
15420impl wkt::message::Message for EvaluationReference {
15421    fn typename() -> &'static str {
15422        "type.googleapis.com/google.cloud.documentai.v1.EvaluationReference"
15423    }
15424}
15425
15426/// An evaluation of a ProcessorVersion's performance.
15427#[derive(Clone, Default, PartialEq)]
15428#[non_exhaustive]
15429pub struct Evaluation {
15430    /// The resource name of the evaluation.
15431    /// Format:
15432    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
15433    pub name: std::string::String,
15434
15435    /// The time that the evaluation was created.
15436    pub create_time: std::option::Option<wkt::Timestamp>,
15437
15438    /// Counters for the documents used in the evaluation.
15439    pub document_counters: std::option::Option<crate::model::evaluation::Counters>,
15440
15441    /// Metrics for all the entities in aggregate.
15442    pub all_entities_metrics: std::option::Option<crate::model::evaluation::MultiConfidenceMetrics>,
15443
15444    /// Metrics across confidence levels, for different entities.
15445    pub entity_metrics: std::collections::HashMap<
15446        std::string::String,
15447        crate::model::evaluation::MultiConfidenceMetrics,
15448    >,
15449
15450    /// The KMS key name used for encryption.
15451    pub kms_key_name: std::string::String,
15452
15453    /// The KMS key version with which data is encrypted.
15454    pub kms_key_version_name: std::string::String,
15455
15456    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15457}
15458
15459impl Evaluation {
15460    pub fn new() -> Self {
15461        std::default::Default::default()
15462    }
15463
15464    /// Sets the value of [name][crate::model::Evaluation::name].
15465    ///
15466    /// # Example
15467    /// ```ignore,no_run
15468    /// # use google_cloud_documentai_v1::model::Evaluation;
15469    /// let x = Evaluation::new().set_name("example");
15470    /// ```
15471    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15472        self.name = v.into();
15473        self
15474    }
15475
15476    /// Sets the value of [create_time][crate::model::Evaluation::create_time].
15477    ///
15478    /// # Example
15479    /// ```ignore,no_run
15480    /// # use google_cloud_documentai_v1::model::Evaluation;
15481    /// use wkt::Timestamp;
15482    /// let x = Evaluation::new().set_create_time(Timestamp::default()/* use setters */);
15483    /// ```
15484    pub fn set_create_time<T>(mut self, v: T) -> Self
15485    where
15486        T: std::convert::Into<wkt::Timestamp>,
15487    {
15488        self.create_time = std::option::Option::Some(v.into());
15489        self
15490    }
15491
15492    /// Sets or clears the value of [create_time][crate::model::Evaluation::create_time].
15493    ///
15494    /// # Example
15495    /// ```ignore,no_run
15496    /// # use google_cloud_documentai_v1::model::Evaluation;
15497    /// use wkt::Timestamp;
15498    /// let x = Evaluation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15499    /// let x = Evaluation::new().set_or_clear_create_time(None::<Timestamp>);
15500    /// ```
15501    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15502    where
15503        T: std::convert::Into<wkt::Timestamp>,
15504    {
15505        self.create_time = v.map(|x| x.into());
15506        self
15507    }
15508
15509    /// Sets the value of [document_counters][crate::model::Evaluation::document_counters].
15510    ///
15511    /// # Example
15512    /// ```ignore,no_run
15513    /// # use google_cloud_documentai_v1::model::Evaluation;
15514    /// use google_cloud_documentai_v1::model::evaluation::Counters;
15515    /// let x = Evaluation::new().set_document_counters(Counters::default()/* use setters */);
15516    /// ```
15517    pub fn set_document_counters<T>(mut self, v: T) -> Self
15518    where
15519        T: std::convert::Into<crate::model::evaluation::Counters>,
15520    {
15521        self.document_counters = std::option::Option::Some(v.into());
15522        self
15523    }
15524
15525    /// Sets or clears the value of [document_counters][crate::model::Evaluation::document_counters].
15526    ///
15527    /// # Example
15528    /// ```ignore,no_run
15529    /// # use google_cloud_documentai_v1::model::Evaluation;
15530    /// use google_cloud_documentai_v1::model::evaluation::Counters;
15531    /// let x = Evaluation::new().set_or_clear_document_counters(Some(Counters::default()/* use setters */));
15532    /// let x = Evaluation::new().set_or_clear_document_counters(None::<Counters>);
15533    /// ```
15534    pub fn set_or_clear_document_counters<T>(mut self, v: std::option::Option<T>) -> Self
15535    where
15536        T: std::convert::Into<crate::model::evaluation::Counters>,
15537    {
15538        self.document_counters = v.map(|x| x.into());
15539        self
15540    }
15541
15542    /// Sets the value of [all_entities_metrics][crate::model::Evaluation::all_entities_metrics].
15543    ///
15544    /// # Example
15545    /// ```ignore,no_run
15546    /// # use google_cloud_documentai_v1::model::Evaluation;
15547    /// use google_cloud_documentai_v1::model::evaluation::MultiConfidenceMetrics;
15548    /// let x = Evaluation::new().set_all_entities_metrics(MultiConfidenceMetrics::default()/* use setters */);
15549    /// ```
15550    pub fn set_all_entities_metrics<T>(mut self, v: T) -> Self
15551    where
15552        T: std::convert::Into<crate::model::evaluation::MultiConfidenceMetrics>,
15553    {
15554        self.all_entities_metrics = std::option::Option::Some(v.into());
15555        self
15556    }
15557
15558    /// Sets or clears the value of [all_entities_metrics][crate::model::Evaluation::all_entities_metrics].
15559    ///
15560    /// # Example
15561    /// ```ignore,no_run
15562    /// # use google_cloud_documentai_v1::model::Evaluation;
15563    /// use google_cloud_documentai_v1::model::evaluation::MultiConfidenceMetrics;
15564    /// let x = Evaluation::new().set_or_clear_all_entities_metrics(Some(MultiConfidenceMetrics::default()/* use setters */));
15565    /// let x = Evaluation::new().set_or_clear_all_entities_metrics(None::<MultiConfidenceMetrics>);
15566    /// ```
15567    pub fn set_or_clear_all_entities_metrics<T>(mut self, v: std::option::Option<T>) -> Self
15568    where
15569        T: std::convert::Into<crate::model::evaluation::MultiConfidenceMetrics>,
15570    {
15571        self.all_entities_metrics = v.map(|x| x.into());
15572        self
15573    }
15574
15575    /// Sets the value of [entity_metrics][crate::model::Evaluation::entity_metrics].
15576    ///
15577    /// # Example
15578    /// ```ignore,no_run
15579    /// # use google_cloud_documentai_v1::model::Evaluation;
15580    /// use google_cloud_documentai_v1::model::evaluation::MultiConfidenceMetrics;
15581    /// let x = Evaluation::new().set_entity_metrics([
15582    ///     ("key0", MultiConfidenceMetrics::default()/* use setters */),
15583    ///     ("key1", MultiConfidenceMetrics::default()/* use (different) setters */),
15584    /// ]);
15585    /// ```
15586    pub fn set_entity_metrics<T, K, V>(mut self, v: T) -> Self
15587    where
15588        T: std::iter::IntoIterator<Item = (K, V)>,
15589        K: std::convert::Into<std::string::String>,
15590        V: std::convert::Into<crate::model::evaluation::MultiConfidenceMetrics>,
15591    {
15592        use std::iter::Iterator;
15593        self.entity_metrics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15594        self
15595    }
15596
15597    /// Sets the value of [kms_key_name][crate::model::Evaluation::kms_key_name].
15598    ///
15599    /// # Example
15600    /// ```ignore,no_run
15601    /// # use google_cloud_documentai_v1::model::Evaluation;
15602    /// let x = Evaluation::new().set_kms_key_name("example");
15603    /// ```
15604    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15605        self.kms_key_name = v.into();
15606        self
15607    }
15608
15609    /// Sets the value of [kms_key_version_name][crate::model::Evaluation::kms_key_version_name].
15610    ///
15611    /// # Example
15612    /// ```ignore,no_run
15613    /// # use google_cloud_documentai_v1::model::Evaluation;
15614    /// let x = Evaluation::new().set_kms_key_version_name("example");
15615    /// ```
15616    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
15617        mut self,
15618        v: T,
15619    ) -> Self {
15620        self.kms_key_version_name = v.into();
15621        self
15622    }
15623}
15624
15625impl wkt::message::Message for Evaluation {
15626    fn typename() -> &'static str {
15627        "type.googleapis.com/google.cloud.documentai.v1.Evaluation"
15628    }
15629}
15630
15631/// Defines additional types related to [Evaluation].
15632pub mod evaluation {
15633    #[allow(unused_imports)]
15634    use super::*;
15635
15636    /// Evaluation counters for the documents that were used.
15637    #[derive(Clone, Default, PartialEq)]
15638    #[non_exhaustive]
15639    pub struct Counters {
15640        /// How many documents were sent for evaluation.
15641        pub input_documents_count: i32,
15642
15643        /// How many documents were not included in the evaluation as they didn't
15644        /// pass validation.
15645        pub invalid_documents_count: i32,
15646
15647        /// How many documents were not included in the evaluation as Document AI
15648        /// failed to process them.
15649        pub failed_documents_count: i32,
15650
15651        /// How many documents were used in the evaluation.
15652        pub evaluated_documents_count: i32,
15653
15654        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15655    }
15656
15657    impl Counters {
15658        pub fn new() -> Self {
15659            std::default::Default::default()
15660        }
15661
15662        /// Sets the value of [input_documents_count][crate::model::evaluation::Counters::input_documents_count].
15663        ///
15664        /// # Example
15665        /// ```ignore,no_run
15666        /// # use google_cloud_documentai_v1::model::evaluation::Counters;
15667        /// let x = Counters::new().set_input_documents_count(42);
15668        /// ```
15669        pub fn set_input_documents_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15670            self.input_documents_count = v.into();
15671            self
15672        }
15673
15674        /// Sets the value of [invalid_documents_count][crate::model::evaluation::Counters::invalid_documents_count].
15675        ///
15676        /// # Example
15677        /// ```ignore,no_run
15678        /// # use google_cloud_documentai_v1::model::evaluation::Counters;
15679        /// let x = Counters::new().set_invalid_documents_count(42);
15680        /// ```
15681        pub fn set_invalid_documents_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15682            self.invalid_documents_count = v.into();
15683            self
15684        }
15685
15686        /// Sets the value of [failed_documents_count][crate::model::evaluation::Counters::failed_documents_count].
15687        ///
15688        /// # Example
15689        /// ```ignore,no_run
15690        /// # use google_cloud_documentai_v1::model::evaluation::Counters;
15691        /// let x = Counters::new().set_failed_documents_count(42);
15692        /// ```
15693        pub fn set_failed_documents_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15694            self.failed_documents_count = v.into();
15695            self
15696        }
15697
15698        /// Sets the value of [evaluated_documents_count][crate::model::evaluation::Counters::evaluated_documents_count].
15699        ///
15700        /// # Example
15701        /// ```ignore,no_run
15702        /// # use google_cloud_documentai_v1::model::evaluation::Counters;
15703        /// let x = Counters::new().set_evaluated_documents_count(42);
15704        /// ```
15705        pub fn set_evaluated_documents_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15706            self.evaluated_documents_count = v.into();
15707            self
15708        }
15709    }
15710
15711    impl wkt::message::Message for Counters {
15712        fn typename() -> &'static str {
15713            "type.googleapis.com/google.cloud.documentai.v1.Evaluation.Counters"
15714        }
15715    }
15716
15717    /// Evaluation metrics, either in aggregate or about a specific entity.
15718    #[derive(Clone, Default, PartialEq)]
15719    #[non_exhaustive]
15720    pub struct Metrics {
15721        /// The calculated precision.
15722        pub precision: f32,
15723
15724        /// The calculated recall.
15725        pub recall: f32,
15726
15727        /// The calculated f1 score.
15728        pub f1_score: f32,
15729
15730        /// The amount of occurrences in predicted documents.
15731        pub predicted_occurrences_count: i32,
15732
15733        /// The amount of occurrences in ground truth documents.
15734        pub ground_truth_occurrences_count: i32,
15735
15736        /// The amount of documents with a predicted occurrence.
15737        pub predicted_document_count: i32,
15738
15739        /// The amount of documents with a ground truth occurrence.
15740        pub ground_truth_document_count: i32,
15741
15742        /// The amount of true positives.
15743        pub true_positives_count: i32,
15744
15745        /// The amount of false positives.
15746        pub false_positives_count: i32,
15747
15748        /// The amount of false negatives.
15749        pub false_negatives_count: i32,
15750
15751        /// The amount of documents that had an occurrence of this label.
15752        pub total_documents_count: i32,
15753
15754        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15755    }
15756
15757    impl Metrics {
15758        pub fn new() -> Self {
15759            std::default::Default::default()
15760        }
15761
15762        /// Sets the value of [precision][crate::model::evaluation::Metrics::precision].
15763        ///
15764        /// # Example
15765        /// ```ignore,no_run
15766        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15767        /// let x = Metrics::new().set_precision(42.0);
15768        /// ```
15769        pub fn set_precision<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
15770            self.precision = v.into();
15771            self
15772        }
15773
15774        /// Sets the value of [recall][crate::model::evaluation::Metrics::recall].
15775        ///
15776        /// # Example
15777        /// ```ignore,no_run
15778        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15779        /// let x = Metrics::new().set_recall(42.0);
15780        /// ```
15781        pub fn set_recall<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
15782            self.recall = v.into();
15783            self
15784        }
15785
15786        /// Sets the value of [f1_score][crate::model::evaluation::Metrics::f1_score].
15787        ///
15788        /// # Example
15789        /// ```ignore,no_run
15790        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15791        /// let x = Metrics::new().set_f1_score(42.0);
15792        /// ```
15793        pub fn set_f1_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
15794            self.f1_score = v.into();
15795            self
15796        }
15797
15798        /// Sets the value of [predicted_occurrences_count][crate::model::evaluation::Metrics::predicted_occurrences_count].
15799        ///
15800        /// # Example
15801        /// ```ignore,no_run
15802        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15803        /// let x = Metrics::new().set_predicted_occurrences_count(42);
15804        /// ```
15805        pub fn set_predicted_occurrences_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15806            self.predicted_occurrences_count = v.into();
15807            self
15808        }
15809
15810        /// Sets the value of [ground_truth_occurrences_count][crate::model::evaluation::Metrics::ground_truth_occurrences_count].
15811        ///
15812        /// # Example
15813        /// ```ignore,no_run
15814        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15815        /// let x = Metrics::new().set_ground_truth_occurrences_count(42);
15816        /// ```
15817        pub fn set_ground_truth_occurrences_count<T: std::convert::Into<i32>>(
15818            mut self,
15819            v: T,
15820        ) -> Self {
15821            self.ground_truth_occurrences_count = v.into();
15822            self
15823        }
15824
15825        /// Sets the value of [predicted_document_count][crate::model::evaluation::Metrics::predicted_document_count].
15826        ///
15827        /// # Example
15828        /// ```ignore,no_run
15829        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15830        /// let x = Metrics::new().set_predicted_document_count(42);
15831        /// ```
15832        pub fn set_predicted_document_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15833            self.predicted_document_count = v.into();
15834            self
15835        }
15836
15837        /// Sets the value of [ground_truth_document_count][crate::model::evaluation::Metrics::ground_truth_document_count].
15838        ///
15839        /// # Example
15840        /// ```ignore,no_run
15841        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15842        /// let x = Metrics::new().set_ground_truth_document_count(42);
15843        /// ```
15844        pub fn set_ground_truth_document_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15845            self.ground_truth_document_count = v.into();
15846            self
15847        }
15848
15849        /// Sets the value of [true_positives_count][crate::model::evaluation::Metrics::true_positives_count].
15850        ///
15851        /// # Example
15852        /// ```ignore,no_run
15853        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15854        /// let x = Metrics::new().set_true_positives_count(42);
15855        /// ```
15856        pub fn set_true_positives_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15857            self.true_positives_count = v.into();
15858            self
15859        }
15860
15861        /// Sets the value of [false_positives_count][crate::model::evaluation::Metrics::false_positives_count].
15862        ///
15863        /// # Example
15864        /// ```ignore,no_run
15865        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15866        /// let x = Metrics::new().set_false_positives_count(42);
15867        /// ```
15868        pub fn set_false_positives_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15869            self.false_positives_count = v.into();
15870            self
15871        }
15872
15873        /// Sets the value of [false_negatives_count][crate::model::evaluation::Metrics::false_negatives_count].
15874        ///
15875        /// # Example
15876        /// ```ignore,no_run
15877        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15878        /// let x = Metrics::new().set_false_negatives_count(42);
15879        /// ```
15880        pub fn set_false_negatives_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15881            self.false_negatives_count = v.into();
15882            self
15883        }
15884
15885        /// Sets the value of [total_documents_count][crate::model::evaluation::Metrics::total_documents_count].
15886        ///
15887        /// # Example
15888        /// ```ignore,no_run
15889        /// # use google_cloud_documentai_v1::model::evaluation::Metrics;
15890        /// let x = Metrics::new().set_total_documents_count(42);
15891        /// ```
15892        pub fn set_total_documents_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15893            self.total_documents_count = v.into();
15894            self
15895        }
15896    }
15897
15898    impl wkt::message::Message for Metrics {
15899        fn typename() -> &'static str {
15900            "type.googleapis.com/google.cloud.documentai.v1.Evaluation.Metrics"
15901        }
15902    }
15903
15904    /// Evaluations metrics, at a specific confidence level.
15905    #[derive(Clone, Default, PartialEq)]
15906    #[non_exhaustive]
15907    pub struct ConfidenceLevelMetrics {
15908        /// The confidence level.
15909        pub confidence_level: f32,
15910
15911        /// The metrics at the specific confidence level.
15912        pub metrics: std::option::Option<crate::model::evaluation::Metrics>,
15913
15914        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15915    }
15916
15917    impl ConfidenceLevelMetrics {
15918        pub fn new() -> Self {
15919            std::default::Default::default()
15920        }
15921
15922        /// Sets the value of [confidence_level][crate::model::evaluation::ConfidenceLevelMetrics::confidence_level].
15923        ///
15924        /// # Example
15925        /// ```ignore,no_run
15926        /// # use google_cloud_documentai_v1::model::evaluation::ConfidenceLevelMetrics;
15927        /// let x = ConfidenceLevelMetrics::new().set_confidence_level(42.0);
15928        /// ```
15929        pub fn set_confidence_level<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
15930            self.confidence_level = v.into();
15931            self
15932        }
15933
15934        /// Sets the value of [metrics][crate::model::evaluation::ConfidenceLevelMetrics::metrics].
15935        ///
15936        /// # Example
15937        /// ```ignore,no_run
15938        /// # use google_cloud_documentai_v1::model::evaluation::ConfidenceLevelMetrics;
15939        /// use google_cloud_documentai_v1::model::evaluation::Metrics;
15940        /// let x = ConfidenceLevelMetrics::new().set_metrics(Metrics::default()/* use setters */);
15941        /// ```
15942        pub fn set_metrics<T>(mut self, v: T) -> Self
15943        where
15944            T: std::convert::Into<crate::model::evaluation::Metrics>,
15945        {
15946            self.metrics = std::option::Option::Some(v.into());
15947            self
15948        }
15949
15950        /// Sets or clears the value of [metrics][crate::model::evaluation::ConfidenceLevelMetrics::metrics].
15951        ///
15952        /// # Example
15953        /// ```ignore,no_run
15954        /// # use google_cloud_documentai_v1::model::evaluation::ConfidenceLevelMetrics;
15955        /// use google_cloud_documentai_v1::model::evaluation::Metrics;
15956        /// let x = ConfidenceLevelMetrics::new().set_or_clear_metrics(Some(Metrics::default()/* use setters */));
15957        /// let x = ConfidenceLevelMetrics::new().set_or_clear_metrics(None::<Metrics>);
15958        /// ```
15959        pub fn set_or_clear_metrics<T>(mut self, v: std::option::Option<T>) -> Self
15960        where
15961            T: std::convert::Into<crate::model::evaluation::Metrics>,
15962        {
15963            self.metrics = v.map(|x| x.into());
15964            self
15965        }
15966    }
15967
15968    impl wkt::message::Message for ConfidenceLevelMetrics {
15969        fn typename() -> &'static str {
15970            "type.googleapis.com/google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics"
15971        }
15972    }
15973
15974    /// Metrics across multiple confidence levels.
15975    #[derive(Clone, Default, PartialEq)]
15976    #[non_exhaustive]
15977    pub struct MultiConfidenceMetrics {
15978        /// Metrics across confidence levels with fuzzy matching enabled.
15979        pub confidence_level_metrics:
15980            std::vec::Vec<crate::model::evaluation::ConfidenceLevelMetrics>,
15981
15982        /// Metrics across confidence levels with only exact matching.
15983        pub confidence_level_metrics_exact:
15984            std::vec::Vec<crate::model::evaluation::ConfidenceLevelMetrics>,
15985
15986        /// The calculated area under the precision recall curve (AUPRC), computed by
15987        /// integrating over all confidence thresholds.
15988        pub auprc: f32,
15989
15990        /// The Estimated Calibration Error (ECE) of the confidence of the predicted
15991        /// entities.
15992        pub estimated_calibration_error: f32,
15993
15994        /// The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching
15995        /// only.
15996        pub auprc_exact: f32,
15997
15998        /// The ECE for the predicted entities with fuzzy matching disabled, i.e.,
15999        /// exact matching only.
16000        pub estimated_calibration_error_exact: f32,
16001
16002        /// The metrics type for the label.
16003        pub metrics_type: crate::model::evaluation::multi_confidence_metrics::MetricsType,
16004
16005        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16006    }
16007
16008    impl MultiConfidenceMetrics {
16009        pub fn new() -> Self {
16010            std::default::Default::default()
16011        }
16012
16013        /// Sets the value of [confidence_level_metrics][crate::model::evaluation::MultiConfidenceMetrics::confidence_level_metrics].
16014        ///
16015        /// # Example
16016        /// ```ignore,no_run
16017        /// # use google_cloud_documentai_v1::model::evaluation::MultiConfidenceMetrics;
16018        /// use google_cloud_documentai_v1::model::evaluation::ConfidenceLevelMetrics;
16019        /// let x = MultiConfidenceMetrics::new()
16020        ///     .set_confidence_level_metrics([
16021        ///         ConfidenceLevelMetrics::default()/* use setters */,
16022        ///         ConfidenceLevelMetrics::default()/* use (different) setters */,
16023        ///     ]);
16024        /// ```
16025        pub fn set_confidence_level_metrics<T, V>(mut self, v: T) -> Self
16026        where
16027            T: std::iter::IntoIterator<Item = V>,
16028            V: std::convert::Into<crate::model::evaluation::ConfidenceLevelMetrics>,
16029        {
16030            use std::iter::Iterator;
16031            self.confidence_level_metrics = v.into_iter().map(|i| i.into()).collect();
16032            self
16033        }
16034
16035        /// Sets the value of [confidence_level_metrics_exact][crate::model::evaluation::MultiConfidenceMetrics::confidence_level_metrics_exact].
16036        ///
16037        /// # Example
16038        /// ```ignore,no_run
16039        /// # use google_cloud_documentai_v1::model::evaluation::MultiConfidenceMetrics;
16040        /// use google_cloud_documentai_v1::model::evaluation::ConfidenceLevelMetrics;
16041        /// let x = MultiConfidenceMetrics::new()
16042        ///     .set_confidence_level_metrics_exact([
16043        ///         ConfidenceLevelMetrics::default()/* use setters */,
16044        ///         ConfidenceLevelMetrics::default()/* use (different) setters */,
16045        ///     ]);
16046        /// ```
16047        pub fn set_confidence_level_metrics_exact<T, V>(mut self, v: T) -> Self
16048        where
16049            T: std::iter::IntoIterator<Item = V>,
16050            V: std::convert::Into<crate::model::evaluation::ConfidenceLevelMetrics>,
16051        {
16052            use std::iter::Iterator;
16053            self.confidence_level_metrics_exact = v.into_iter().map(|i| i.into()).collect();
16054            self
16055        }
16056
16057        /// Sets the value of [auprc][crate::model::evaluation::MultiConfidenceMetrics::auprc].
16058        ///
16059        /// # Example
16060        /// ```ignore,no_run
16061        /// # use google_cloud_documentai_v1::model::evaluation::MultiConfidenceMetrics;
16062        /// let x = MultiConfidenceMetrics::new().set_auprc(42.0);
16063        /// ```
16064        pub fn set_auprc<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
16065            self.auprc = v.into();
16066            self
16067        }
16068
16069        /// Sets the value of [estimated_calibration_error][crate::model::evaluation::MultiConfidenceMetrics::estimated_calibration_error].
16070        ///
16071        /// # Example
16072        /// ```ignore,no_run
16073        /// # use google_cloud_documentai_v1::model::evaluation::MultiConfidenceMetrics;
16074        /// let x = MultiConfidenceMetrics::new().set_estimated_calibration_error(42.0);
16075        /// ```
16076        pub fn set_estimated_calibration_error<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
16077            self.estimated_calibration_error = v.into();
16078            self
16079        }
16080
16081        /// Sets the value of [auprc_exact][crate::model::evaluation::MultiConfidenceMetrics::auprc_exact].
16082        ///
16083        /// # Example
16084        /// ```ignore,no_run
16085        /// # use google_cloud_documentai_v1::model::evaluation::MultiConfidenceMetrics;
16086        /// let x = MultiConfidenceMetrics::new().set_auprc_exact(42.0);
16087        /// ```
16088        pub fn set_auprc_exact<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
16089            self.auprc_exact = v.into();
16090            self
16091        }
16092
16093        /// Sets the value of [estimated_calibration_error_exact][crate::model::evaluation::MultiConfidenceMetrics::estimated_calibration_error_exact].
16094        ///
16095        /// # Example
16096        /// ```ignore,no_run
16097        /// # use google_cloud_documentai_v1::model::evaluation::MultiConfidenceMetrics;
16098        /// let x = MultiConfidenceMetrics::new().set_estimated_calibration_error_exact(42.0);
16099        /// ```
16100        pub fn set_estimated_calibration_error_exact<T: std::convert::Into<f32>>(
16101            mut self,
16102            v: T,
16103        ) -> Self {
16104            self.estimated_calibration_error_exact = v.into();
16105            self
16106        }
16107
16108        /// Sets the value of [metrics_type][crate::model::evaluation::MultiConfidenceMetrics::metrics_type].
16109        ///
16110        /// # Example
16111        /// ```ignore,no_run
16112        /// # use google_cloud_documentai_v1::model::evaluation::MultiConfidenceMetrics;
16113        /// use google_cloud_documentai_v1::model::evaluation::multi_confidence_metrics::MetricsType;
16114        /// let x0 = MultiConfidenceMetrics::new().set_metrics_type(MetricsType::Aggregate);
16115        /// ```
16116        pub fn set_metrics_type<
16117            T: std::convert::Into<crate::model::evaluation::multi_confidence_metrics::MetricsType>,
16118        >(
16119            mut self,
16120            v: T,
16121        ) -> Self {
16122            self.metrics_type = v.into();
16123            self
16124        }
16125    }
16126
16127    impl wkt::message::Message for MultiConfidenceMetrics {
16128        fn typename() -> &'static str {
16129            "type.googleapis.com/google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics"
16130        }
16131    }
16132
16133    /// Defines additional types related to [MultiConfidenceMetrics].
16134    pub mod multi_confidence_metrics {
16135        #[allow(unused_imports)]
16136        use super::*;
16137
16138        /// A type that determines how metrics should be interpreted.
16139        ///
16140        /// # Working with unknown values
16141        ///
16142        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16143        /// additional enum variants at any time. Adding new variants is not considered
16144        /// a breaking change. Applications should write their code in anticipation of:
16145        ///
16146        /// - New values appearing in future releases of the client library, **and**
16147        /// - New values received dynamically, without application changes.
16148        ///
16149        /// Please consult the [Working with enums] section in the user guide for some
16150        /// guidelines.
16151        ///
16152        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16153        #[derive(Clone, Debug, PartialEq)]
16154        #[non_exhaustive]
16155        pub enum MetricsType {
16156            /// The metrics type is unspecified. By default, metrics without a
16157            /// particular specification are for leaf entity types (i.e., top-level
16158            /// entity types without child types, or child types which are not
16159            /// parent types themselves).
16160            Unspecified,
16161            /// Indicates whether metrics for this particular label type represent an
16162            /// aggregate of metrics for other types instead of being based on actual
16163            /// TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf)
16164            /// entity types are an aggregate of metrics for their children.
16165            Aggregate,
16166            /// If set, the enum was initialized with an unknown value.
16167            ///
16168            /// Applications can examine the value using [MetricsType::value] or
16169            /// [MetricsType::name].
16170            UnknownValue(metrics_type::UnknownValue),
16171        }
16172
16173        #[doc(hidden)]
16174        pub mod metrics_type {
16175            #[allow(unused_imports)]
16176            use super::*;
16177            #[derive(Clone, Debug, PartialEq)]
16178            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16179        }
16180
16181        impl MetricsType {
16182            /// Gets the enum value.
16183            ///
16184            /// Returns `None` if the enum contains an unknown value deserialized from
16185            /// the string representation of enums.
16186            pub fn value(&self) -> std::option::Option<i32> {
16187                match self {
16188                    Self::Unspecified => std::option::Option::Some(0),
16189                    Self::Aggregate => std::option::Option::Some(1),
16190                    Self::UnknownValue(u) => u.0.value(),
16191                }
16192            }
16193
16194            /// Gets the enum value as a string.
16195            ///
16196            /// Returns `None` if the enum contains an unknown value deserialized from
16197            /// the integer representation of enums.
16198            pub fn name(&self) -> std::option::Option<&str> {
16199                match self {
16200                    Self::Unspecified => std::option::Option::Some("METRICS_TYPE_UNSPECIFIED"),
16201                    Self::Aggregate => std::option::Option::Some("AGGREGATE"),
16202                    Self::UnknownValue(u) => u.0.name(),
16203                }
16204            }
16205        }
16206
16207        impl std::default::Default for MetricsType {
16208            fn default() -> Self {
16209                use std::convert::From;
16210                Self::from(0)
16211            }
16212        }
16213
16214        impl std::fmt::Display for MetricsType {
16215            fn fmt(
16216                &self,
16217                f: &mut std::fmt::Formatter<'_>,
16218            ) -> std::result::Result<(), std::fmt::Error> {
16219                wkt::internal::display_enum(f, self.name(), self.value())
16220            }
16221        }
16222
16223        impl std::convert::From<i32> for MetricsType {
16224            fn from(value: i32) -> Self {
16225                match value {
16226                    0 => Self::Unspecified,
16227                    1 => Self::Aggregate,
16228                    _ => Self::UnknownValue(metrics_type::UnknownValue(
16229                        wkt::internal::UnknownEnumValue::Integer(value),
16230                    )),
16231                }
16232            }
16233        }
16234
16235        impl std::convert::From<&str> for MetricsType {
16236            fn from(value: &str) -> Self {
16237                use std::string::ToString;
16238                match value {
16239                    "METRICS_TYPE_UNSPECIFIED" => Self::Unspecified,
16240                    "AGGREGATE" => Self::Aggregate,
16241                    _ => Self::UnknownValue(metrics_type::UnknownValue(
16242                        wkt::internal::UnknownEnumValue::String(value.to_string()),
16243                    )),
16244                }
16245            }
16246        }
16247
16248        impl serde::ser::Serialize for MetricsType {
16249            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16250            where
16251                S: serde::Serializer,
16252            {
16253                match self {
16254                    Self::Unspecified => serializer.serialize_i32(0),
16255                    Self::Aggregate => serializer.serialize_i32(1),
16256                    Self::UnknownValue(u) => u.0.serialize(serializer),
16257                }
16258            }
16259        }
16260
16261        impl<'de> serde::de::Deserialize<'de> for MetricsType {
16262            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16263            where
16264                D: serde::Deserializer<'de>,
16265            {
16266                deserializer.deserialize_any(wkt::internal::EnumVisitor::<MetricsType>::new(
16267                    ".google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType",
16268                ))
16269            }
16270        }
16271    }
16272}
16273
16274/// A vertex represents a 2D point in the image.
16275/// NOTE: the vertex coordinates are in the same scale as the original image.
16276#[derive(Clone, Default, PartialEq)]
16277#[non_exhaustive]
16278pub struct Vertex {
16279    /// X coordinate.
16280    pub x: i32,
16281
16282    /// Y coordinate (starts from the top of the image).
16283    pub y: i32,
16284
16285    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16286}
16287
16288impl Vertex {
16289    pub fn new() -> Self {
16290        std::default::Default::default()
16291    }
16292
16293    /// Sets the value of [x][crate::model::Vertex::x].
16294    ///
16295    /// # Example
16296    /// ```ignore,no_run
16297    /// # use google_cloud_documentai_v1::model::Vertex;
16298    /// let x = Vertex::new().set_x(42);
16299    /// ```
16300    pub fn set_x<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16301        self.x = v.into();
16302        self
16303    }
16304
16305    /// Sets the value of [y][crate::model::Vertex::y].
16306    ///
16307    /// # Example
16308    /// ```ignore,no_run
16309    /// # use google_cloud_documentai_v1::model::Vertex;
16310    /// let x = Vertex::new().set_y(42);
16311    /// ```
16312    pub fn set_y<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16313        self.y = v.into();
16314        self
16315    }
16316}
16317
16318impl wkt::message::Message for Vertex {
16319    fn typename() -> &'static str {
16320        "type.googleapis.com/google.cloud.documentai.v1.Vertex"
16321    }
16322}
16323
16324/// A vertex represents a 2D point in the image.
16325/// NOTE: the normalized vertex coordinates are relative to the original image
16326/// and range from 0 to 1.
16327#[derive(Clone, Default, PartialEq)]
16328#[non_exhaustive]
16329pub struct NormalizedVertex {
16330    /// X coordinate.
16331    pub x: f32,
16332
16333    /// Y coordinate (starts from the top of the image).
16334    pub y: f32,
16335
16336    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16337}
16338
16339impl NormalizedVertex {
16340    pub fn new() -> Self {
16341        std::default::Default::default()
16342    }
16343
16344    /// Sets the value of [x][crate::model::NormalizedVertex::x].
16345    ///
16346    /// # Example
16347    /// ```ignore,no_run
16348    /// # use google_cloud_documentai_v1::model::NormalizedVertex;
16349    /// let x = NormalizedVertex::new().set_x(42.0);
16350    /// ```
16351    pub fn set_x<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
16352        self.x = v.into();
16353        self
16354    }
16355
16356    /// Sets the value of [y][crate::model::NormalizedVertex::y].
16357    ///
16358    /// # Example
16359    /// ```ignore,no_run
16360    /// # use google_cloud_documentai_v1::model::NormalizedVertex;
16361    /// let x = NormalizedVertex::new().set_y(42.0);
16362    /// ```
16363    pub fn set_y<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
16364        self.y = v.into();
16365        self
16366    }
16367}
16368
16369impl wkt::message::Message for NormalizedVertex {
16370    fn typename() -> &'static str {
16371        "type.googleapis.com/google.cloud.documentai.v1.NormalizedVertex"
16372    }
16373}
16374
16375/// A bounding polygon for the detected image annotation.
16376#[derive(Clone, Default, PartialEq)]
16377#[non_exhaustive]
16378pub struct BoundingPoly {
16379    /// The bounding polygon vertices.
16380    pub vertices: std::vec::Vec<crate::model::Vertex>,
16381
16382    /// The bounding polygon normalized vertices.
16383    pub normalized_vertices: std::vec::Vec<crate::model::NormalizedVertex>,
16384
16385    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16386}
16387
16388impl BoundingPoly {
16389    pub fn new() -> Self {
16390        std::default::Default::default()
16391    }
16392
16393    /// Sets the value of [vertices][crate::model::BoundingPoly::vertices].
16394    ///
16395    /// # Example
16396    /// ```ignore,no_run
16397    /// # use google_cloud_documentai_v1::model::BoundingPoly;
16398    /// use google_cloud_documentai_v1::model::Vertex;
16399    /// let x = BoundingPoly::new()
16400    ///     .set_vertices([
16401    ///         Vertex::default()/* use setters */,
16402    ///         Vertex::default()/* use (different) setters */,
16403    ///     ]);
16404    /// ```
16405    pub fn set_vertices<T, V>(mut self, v: T) -> Self
16406    where
16407        T: std::iter::IntoIterator<Item = V>,
16408        V: std::convert::Into<crate::model::Vertex>,
16409    {
16410        use std::iter::Iterator;
16411        self.vertices = v.into_iter().map(|i| i.into()).collect();
16412        self
16413    }
16414
16415    /// Sets the value of [normalized_vertices][crate::model::BoundingPoly::normalized_vertices].
16416    ///
16417    /// # Example
16418    /// ```ignore,no_run
16419    /// # use google_cloud_documentai_v1::model::BoundingPoly;
16420    /// use google_cloud_documentai_v1::model::NormalizedVertex;
16421    /// let x = BoundingPoly::new()
16422    ///     .set_normalized_vertices([
16423    ///         NormalizedVertex::default()/* use setters */,
16424    ///         NormalizedVertex::default()/* use (different) setters */,
16425    ///     ]);
16426    /// ```
16427    pub fn set_normalized_vertices<T, V>(mut self, v: T) -> Self
16428    where
16429        T: std::iter::IntoIterator<Item = V>,
16430        V: std::convert::Into<crate::model::NormalizedVertex>,
16431    {
16432        use std::iter::Iterator;
16433        self.normalized_vertices = v.into_iter().map(|i| i.into()).collect();
16434        self
16435    }
16436}
16437
16438impl wkt::message::Message for BoundingPoly {
16439    fn typename() -> &'static str {
16440        "type.googleapis.com/google.cloud.documentai.v1.BoundingPoly"
16441    }
16442}
16443
16444/// The common metadata for long running operations.
16445#[derive(Clone, Default, PartialEq)]
16446#[non_exhaustive]
16447pub struct CommonOperationMetadata {
16448    /// The state of the operation.
16449    pub state: crate::model::common_operation_metadata::State,
16450
16451    /// A message providing more details about the current state of processing.
16452    pub state_message: std::string::String,
16453
16454    /// A related resource to this operation.
16455    pub resource: std::string::String,
16456
16457    /// The creation time of the operation.
16458    pub create_time: std::option::Option<wkt::Timestamp>,
16459
16460    /// The last update time of the operation.
16461    pub update_time: std::option::Option<wkt::Timestamp>,
16462
16463    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16464}
16465
16466impl CommonOperationMetadata {
16467    pub fn new() -> Self {
16468        std::default::Default::default()
16469    }
16470
16471    /// Sets the value of [state][crate::model::CommonOperationMetadata::state].
16472    ///
16473    /// # Example
16474    /// ```ignore,no_run
16475    /// # use google_cloud_documentai_v1::model::CommonOperationMetadata;
16476    /// use google_cloud_documentai_v1::model::common_operation_metadata::State;
16477    /// let x0 = CommonOperationMetadata::new().set_state(State::Running);
16478    /// let x1 = CommonOperationMetadata::new().set_state(State::Cancelling);
16479    /// let x2 = CommonOperationMetadata::new().set_state(State::Succeeded);
16480    /// ```
16481    pub fn set_state<T: std::convert::Into<crate::model::common_operation_metadata::State>>(
16482        mut self,
16483        v: T,
16484    ) -> Self {
16485        self.state = v.into();
16486        self
16487    }
16488
16489    /// Sets the value of [state_message][crate::model::CommonOperationMetadata::state_message].
16490    ///
16491    /// # Example
16492    /// ```ignore,no_run
16493    /// # use google_cloud_documentai_v1::model::CommonOperationMetadata;
16494    /// let x = CommonOperationMetadata::new().set_state_message("example");
16495    /// ```
16496    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16497        self.state_message = v.into();
16498        self
16499    }
16500
16501    /// Sets the value of [resource][crate::model::CommonOperationMetadata::resource].
16502    ///
16503    /// # Example
16504    /// ```ignore,no_run
16505    /// # use google_cloud_documentai_v1::model::CommonOperationMetadata;
16506    /// let x = CommonOperationMetadata::new().set_resource("example");
16507    /// ```
16508    pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16509        self.resource = v.into();
16510        self
16511    }
16512
16513    /// Sets the value of [create_time][crate::model::CommonOperationMetadata::create_time].
16514    ///
16515    /// # Example
16516    /// ```ignore,no_run
16517    /// # use google_cloud_documentai_v1::model::CommonOperationMetadata;
16518    /// use wkt::Timestamp;
16519    /// let x = CommonOperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
16520    /// ```
16521    pub fn set_create_time<T>(mut self, v: T) -> Self
16522    where
16523        T: std::convert::Into<wkt::Timestamp>,
16524    {
16525        self.create_time = std::option::Option::Some(v.into());
16526        self
16527    }
16528
16529    /// Sets or clears the value of [create_time][crate::model::CommonOperationMetadata::create_time].
16530    ///
16531    /// # Example
16532    /// ```ignore,no_run
16533    /// # use google_cloud_documentai_v1::model::CommonOperationMetadata;
16534    /// use wkt::Timestamp;
16535    /// let x = CommonOperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16536    /// let x = CommonOperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
16537    /// ```
16538    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16539    where
16540        T: std::convert::Into<wkt::Timestamp>,
16541    {
16542        self.create_time = v.map(|x| x.into());
16543        self
16544    }
16545
16546    /// Sets the value of [update_time][crate::model::CommonOperationMetadata::update_time].
16547    ///
16548    /// # Example
16549    /// ```ignore,no_run
16550    /// # use google_cloud_documentai_v1::model::CommonOperationMetadata;
16551    /// use wkt::Timestamp;
16552    /// let x = CommonOperationMetadata::new().set_update_time(Timestamp::default()/* use setters */);
16553    /// ```
16554    pub fn set_update_time<T>(mut self, v: T) -> Self
16555    where
16556        T: std::convert::Into<wkt::Timestamp>,
16557    {
16558        self.update_time = std::option::Option::Some(v.into());
16559        self
16560    }
16561
16562    /// Sets or clears the value of [update_time][crate::model::CommonOperationMetadata::update_time].
16563    ///
16564    /// # Example
16565    /// ```ignore,no_run
16566    /// # use google_cloud_documentai_v1::model::CommonOperationMetadata;
16567    /// use wkt::Timestamp;
16568    /// let x = CommonOperationMetadata::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16569    /// let x = CommonOperationMetadata::new().set_or_clear_update_time(None::<Timestamp>);
16570    /// ```
16571    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16572    where
16573        T: std::convert::Into<wkt::Timestamp>,
16574    {
16575        self.update_time = v.map(|x| x.into());
16576        self
16577    }
16578}
16579
16580impl wkt::message::Message for CommonOperationMetadata {
16581    fn typename() -> &'static str {
16582        "type.googleapis.com/google.cloud.documentai.v1.CommonOperationMetadata"
16583    }
16584}
16585
16586/// Defines additional types related to [CommonOperationMetadata].
16587pub mod common_operation_metadata {
16588    #[allow(unused_imports)]
16589    use super::*;
16590
16591    /// State of the longrunning operation.
16592    ///
16593    /// # Working with unknown values
16594    ///
16595    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16596    /// additional enum variants at any time. Adding new variants is not considered
16597    /// a breaking change. Applications should write their code in anticipation of:
16598    ///
16599    /// - New values appearing in future releases of the client library, **and**
16600    /// - New values received dynamically, without application changes.
16601    ///
16602    /// Please consult the [Working with enums] section in the user guide for some
16603    /// guidelines.
16604    ///
16605    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16606    #[derive(Clone, Debug, PartialEq)]
16607    #[non_exhaustive]
16608    pub enum State {
16609        /// Unspecified state.
16610        Unspecified,
16611        /// Operation is still running.
16612        Running,
16613        /// Operation is being cancelled.
16614        Cancelling,
16615        /// Operation succeeded.
16616        Succeeded,
16617        /// Operation failed.
16618        Failed,
16619        /// Operation is cancelled.
16620        Cancelled,
16621        /// If set, the enum was initialized with an unknown value.
16622        ///
16623        /// Applications can examine the value using [State::value] or
16624        /// [State::name].
16625        UnknownValue(state::UnknownValue),
16626    }
16627
16628    #[doc(hidden)]
16629    pub mod state {
16630        #[allow(unused_imports)]
16631        use super::*;
16632        #[derive(Clone, Debug, PartialEq)]
16633        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16634    }
16635
16636    impl State {
16637        /// Gets the enum value.
16638        ///
16639        /// Returns `None` if the enum contains an unknown value deserialized from
16640        /// the string representation of enums.
16641        pub fn value(&self) -> std::option::Option<i32> {
16642            match self {
16643                Self::Unspecified => std::option::Option::Some(0),
16644                Self::Running => std::option::Option::Some(1),
16645                Self::Cancelling => std::option::Option::Some(2),
16646                Self::Succeeded => std::option::Option::Some(3),
16647                Self::Failed => std::option::Option::Some(4),
16648                Self::Cancelled => std::option::Option::Some(5),
16649                Self::UnknownValue(u) => u.0.value(),
16650            }
16651        }
16652
16653        /// Gets the enum value as a string.
16654        ///
16655        /// Returns `None` if the enum contains an unknown value deserialized from
16656        /// the integer representation of enums.
16657        pub fn name(&self) -> std::option::Option<&str> {
16658            match self {
16659                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16660                Self::Running => std::option::Option::Some("RUNNING"),
16661                Self::Cancelling => std::option::Option::Some("CANCELLING"),
16662                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
16663                Self::Failed => std::option::Option::Some("FAILED"),
16664                Self::Cancelled => std::option::Option::Some("CANCELLED"),
16665                Self::UnknownValue(u) => u.0.name(),
16666            }
16667        }
16668    }
16669
16670    impl std::default::Default for State {
16671        fn default() -> Self {
16672            use std::convert::From;
16673            Self::from(0)
16674        }
16675    }
16676
16677    impl std::fmt::Display for State {
16678        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16679            wkt::internal::display_enum(f, self.name(), self.value())
16680        }
16681    }
16682
16683    impl std::convert::From<i32> for State {
16684        fn from(value: i32) -> Self {
16685            match value {
16686                0 => Self::Unspecified,
16687                1 => Self::Running,
16688                2 => Self::Cancelling,
16689                3 => Self::Succeeded,
16690                4 => Self::Failed,
16691                5 => Self::Cancelled,
16692                _ => Self::UnknownValue(state::UnknownValue(
16693                    wkt::internal::UnknownEnumValue::Integer(value),
16694                )),
16695            }
16696        }
16697    }
16698
16699    impl std::convert::From<&str> for State {
16700        fn from(value: &str) -> Self {
16701            use std::string::ToString;
16702            match value {
16703                "STATE_UNSPECIFIED" => Self::Unspecified,
16704                "RUNNING" => Self::Running,
16705                "CANCELLING" => Self::Cancelling,
16706                "SUCCEEDED" => Self::Succeeded,
16707                "FAILED" => Self::Failed,
16708                "CANCELLED" => Self::Cancelled,
16709                _ => Self::UnknownValue(state::UnknownValue(
16710                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16711                )),
16712            }
16713        }
16714    }
16715
16716    impl serde::ser::Serialize for State {
16717        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16718        where
16719            S: serde::Serializer,
16720        {
16721            match self {
16722                Self::Unspecified => serializer.serialize_i32(0),
16723                Self::Running => serializer.serialize_i32(1),
16724                Self::Cancelling => serializer.serialize_i32(2),
16725                Self::Succeeded => serializer.serialize_i32(3),
16726                Self::Failed => serializer.serialize_i32(4),
16727                Self::Cancelled => serializer.serialize_i32(5),
16728                Self::UnknownValue(u) => u.0.serialize(serializer),
16729            }
16730        }
16731    }
16732
16733    impl<'de> serde::de::Deserialize<'de> for State {
16734        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16735        where
16736            D: serde::Deserializer<'de>,
16737        {
16738            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16739                ".google.cloud.documentai.v1.CommonOperationMetadata.State",
16740            ))
16741        }
16742    }
16743}
16744
16745/// A processor version is an implementation of a processor. Each processor
16746/// can have multiple versions, pretrained by Google internally or uptrained
16747/// by the customer. A processor can only have one default version at a time.
16748/// Its document-processing behavior is defined by that version.
16749#[derive(Clone, Default, PartialEq)]
16750#[non_exhaustive]
16751pub struct ProcessorVersion {
16752    /// Identifier. The resource name of the processor version.
16753    /// Format:
16754    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
16755    pub name: std::string::String,
16756
16757    /// The display name of the processor version.
16758    pub display_name: std::string::String,
16759
16760    /// Output only. The schema of the processor version. Describes the output.
16761    pub document_schema: std::option::Option<crate::model::DocumentSchema>,
16762
16763    /// Output only. The state of the processor version.
16764    pub state: crate::model::processor_version::State,
16765
16766    /// Output only. The time the processor version was created.
16767    pub create_time: std::option::Option<wkt::Timestamp>,
16768
16769    /// Output only. The most recently invoked evaluation for the processor
16770    /// version.
16771    pub latest_evaluation: std::option::Option<crate::model::EvaluationReference>,
16772
16773    /// Output only. The KMS key name used for encryption.
16774    pub kms_key_name: std::string::String,
16775
16776    /// Output only. The KMS key version with which data is encrypted.
16777    pub kms_key_version_name: std::string::String,
16778
16779    /// Output only. Denotes that this `ProcessorVersion` is managed by Google.
16780    pub google_managed: bool,
16781
16782    /// Output only. If set, information about the eventual deprecation of this
16783    /// version.
16784    pub deprecation_info: std::option::Option<crate::model::processor_version::DeprecationInfo>,
16785
16786    /// Output only. The model type of this processor version.
16787    pub model_type: crate::model::processor_version::ModelType,
16788
16789    /// Output only. Reserved for future use.
16790    pub satisfies_pzs: bool,
16791
16792    /// Output only. Reserved for future use.
16793    pub satisfies_pzi: bool,
16794
16795    /// Output only. Information about Generative AI model-based processor
16796    /// versions.
16797    pub gen_ai_model_info: std::option::Option<crate::model::processor_version::GenAiModelInfo>,
16798
16799    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16800}
16801
16802impl ProcessorVersion {
16803    pub fn new() -> Self {
16804        std::default::Default::default()
16805    }
16806
16807    /// Sets the value of [name][crate::model::ProcessorVersion::name].
16808    ///
16809    /// # Example
16810    /// ```ignore,no_run
16811    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16812    /// let x = ProcessorVersion::new().set_name("example");
16813    /// ```
16814    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16815        self.name = v.into();
16816        self
16817    }
16818
16819    /// Sets the value of [display_name][crate::model::ProcessorVersion::display_name].
16820    ///
16821    /// # Example
16822    /// ```ignore,no_run
16823    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16824    /// let x = ProcessorVersion::new().set_display_name("example");
16825    /// ```
16826    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16827        self.display_name = v.into();
16828        self
16829    }
16830
16831    /// Sets the value of [document_schema][crate::model::ProcessorVersion::document_schema].
16832    ///
16833    /// # Example
16834    /// ```ignore,no_run
16835    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16836    /// use google_cloud_documentai_v1::model::DocumentSchema;
16837    /// let x = ProcessorVersion::new().set_document_schema(DocumentSchema::default()/* use setters */);
16838    /// ```
16839    pub fn set_document_schema<T>(mut self, v: T) -> Self
16840    where
16841        T: std::convert::Into<crate::model::DocumentSchema>,
16842    {
16843        self.document_schema = std::option::Option::Some(v.into());
16844        self
16845    }
16846
16847    /// Sets or clears the value of [document_schema][crate::model::ProcessorVersion::document_schema].
16848    ///
16849    /// # Example
16850    /// ```ignore,no_run
16851    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16852    /// use google_cloud_documentai_v1::model::DocumentSchema;
16853    /// let x = ProcessorVersion::new().set_or_clear_document_schema(Some(DocumentSchema::default()/* use setters */));
16854    /// let x = ProcessorVersion::new().set_or_clear_document_schema(None::<DocumentSchema>);
16855    /// ```
16856    pub fn set_or_clear_document_schema<T>(mut self, v: std::option::Option<T>) -> Self
16857    where
16858        T: std::convert::Into<crate::model::DocumentSchema>,
16859    {
16860        self.document_schema = v.map(|x| x.into());
16861        self
16862    }
16863
16864    /// Sets the value of [state][crate::model::ProcessorVersion::state].
16865    ///
16866    /// # Example
16867    /// ```ignore,no_run
16868    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16869    /// use google_cloud_documentai_v1::model::processor_version::State;
16870    /// let x0 = ProcessorVersion::new().set_state(State::Deployed);
16871    /// let x1 = ProcessorVersion::new().set_state(State::Deploying);
16872    /// let x2 = ProcessorVersion::new().set_state(State::Undeployed);
16873    /// ```
16874    pub fn set_state<T: std::convert::Into<crate::model::processor_version::State>>(
16875        mut self,
16876        v: T,
16877    ) -> Self {
16878        self.state = v.into();
16879        self
16880    }
16881
16882    /// Sets the value of [create_time][crate::model::ProcessorVersion::create_time].
16883    ///
16884    /// # Example
16885    /// ```ignore,no_run
16886    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16887    /// use wkt::Timestamp;
16888    /// let x = ProcessorVersion::new().set_create_time(Timestamp::default()/* use setters */);
16889    /// ```
16890    pub fn set_create_time<T>(mut self, v: T) -> Self
16891    where
16892        T: std::convert::Into<wkt::Timestamp>,
16893    {
16894        self.create_time = std::option::Option::Some(v.into());
16895        self
16896    }
16897
16898    /// Sets or clears the value of [create_time][crate::model::ProcessorVersion::create_time].
16899    ///
16900    /// # Example
16901    /// ```ignore,no_run
16902    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16903    /// use wkt::Timestamp;
16904    /// let x = ProcessorVersion::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16905    /// let x = ProcessorVersion::new().set_or_clear_create_time(None::<Timestamp>);
16906    /// ```
16907    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16908    where
16909        T: std::convert::Into<wkt::Timestamp>,
16910    {
16911        self.create_time = v.map(|x| x.into());
16912        self
16913    }
16914
16915    /// Sets the value of [latest_evaluation][crate::model::ProcessorVersion::latest_evaluation].
16916    ///
16917    /// # Example
16918    /// ```ignore,no_run
16919    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16920    /// use google_cloud_documentai_v1::model::EvaluationReference;
16921    /// let x = ProcessorVersion::new().set_latest_evaluation(EvaluationReference::default()/* use setters */);
16922    /// ```
16923    pub fn set_latest_evaluation<T>(mut self, v: T) -> Self
16924    where
16925        T: std::convert::Into<crate::model::EvaluationReference>,
16926    {
16927        self.latest_evaluation = std::option::Option::Some(v.into());
16928        self
16929    }
16930
16931    /// Sets or clears the value of [latest_evaluation][crate::model::ProcessorVersion::latest_evaluation].
16932    ///
16933    /// # Example
16934    /// ```ignore,no_run
16935    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16936    /// use google_cloud_documentai_v1::model::EvaluationReference;
16937    /// let x = ProcessorVersion::new().set_or_clear_latest_evaluation(Some(EvaluationReference::default()/* use setters */));
16938    /// let x = ProcessorVersion::new().set_or_clear_latest_evaluation(None::<EvaluationReference>);
16939    /// ```
16940    pub fn set_or_clear_latest_evaluation<T>(mut self, v: std::option::Option<T>) -> Self
16941    where
16942        T: std::convert::Into<crate::model::EvaluationReference>,
16943    {
16944        self.latest_evaluation = v.map(|x| x.into());
16945        self
16946    }
16947
16948    /// Sets the value of [kms_key_name][crate::model::ProcessorVersion::kms_key_name].
16949    ///
16950    /// # Example
16951    /// ```ignore,no_run
16952    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16953    /// let x = ProcessorVersion::new().set_kms_key_name("example");
16954    /// ```
16955    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16956        self.kms_key_name = v.into();
16957        self
16958    }
16959
16960    /// Sets the value of [kms_key_version_name][crate::model::ProcessorVersion::kms_key_version_name].
16961    ///
16962    /// # Example
16963    /// ```ignore,no_run
16964    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16965    /// let x = ProcessorVersion::new().set_kms_key_version_name("example");
16966    /// ```
16967    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
16968        mut self,
16969        v: T,
16970    ) -> Self {
16971        self.kms_key_version_name = v.into();
16972        self
16973    }
16974
16975    /// Sets the value of [google_managed][crate::model::ProcessorVersion::google_managed].
16976    ///
16977    /// # Example
16978    /// ```ignore,no_run
16979    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16980    /// let x = ProcessorVersion::new().set_google_managed(true);
16981    /// ```
16982    pub fn set_google_managed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16983        self.google_managed = v.into();
16984        self
16985    }
16986
16987    /// Sets the value of [deprecation_info][crate::model::ProcessorVersion::deprecation_info].
16988    ///
16989    /// # Example
16990    /// ```ignore,no_run
16991    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
16992    /// use google_cloud_documentai_v1::model::processor_version::DeprecationInfo;
16993    /// let x = ProcessorVersion::new().set_deprecation_info(DeprecationInfo::default()/* use setters */);
16994    /// ```
16995    pub fn set_deprecation_info<T>(mut self, v: T) -> Self
16996    where
16997        T: std::convert::Into<crate::model::processor_version::DeprecationInfo>,
16998    {
16999        self.deprecation_info = std::option::Option::Some(v.into());
17000        self
17001    }
17002
17003    /// Sets or clears the value of [deprecation_info][crate::model::ProcessorVersion::deprecation_info].
17004    ///
17005    /// # Example
17006    /// ```ignore,no_run
17007    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
17008    /// use google_cloud_documentai_v1::model::processor_version::DeprecationInfo;
17009    /// let x = ProcessorVersion::new().set_or_clear_deprecation_info(Some(DeprecationInfo::default()/* use setters */));
17010    /// let x = ProcessorVersion::new().set_or_clear_deprecation_info(None::<DeprecationInfo>);
17011    /// ```
17012    pub fn set_or_clear_deprecation_info<T>(mut self, v: std::option::Option<T>) -> Self
17013    where
17014        T: std::convert::Into<crate::model::processor_version::DeprecationInfo>,
17015    {
17016        self.deprecation_info = v.map(|x| x.into());
17017        self
17018    }
17019
17020    /// Sets the value of [model_type][crate::model::ProcessorVersion::model_type].
17021    ///
17022    /// # Example
17023    /// ```ignore,no_run
17024    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
17025    /// use google_cloud_documentai_v1::model::processor_version::ModelType;
17026    /// let x0 = ProcessorVersion::new().set_model_type(ModelType::Generative);
17027    /// let x1 = ProcessorVersion::new().set_model_type(ModelType::Custom);
17028    /// ```
17029    pub fn set_model_type<T: std::convert::Into<crate::model::processor_version::ModelType>>(
17030        mut self,
17031        v: T,
17032    ) -> Self {
17033        self.model_type = v.into();
17034        self
17035    }
17036
17037    /// Sets the value of [satisfies_pzs][crate::model::ProcessorVersion::satisfies_pzs].
17038    ///
17039    /// # Example
17040    /// ```ignore,no_run
17041    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
17042    /// let x = ProcessorVersion::new().set_satisfies_pzs(true);
17043    /// ```
17044    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17045        self.satisfies_pzs = v.into();
17046        self
17047    }
17048
17049    /// Sets the value of [satisfies_pzi][crate::model::ProcessorVersion::satisfies_pzi].
17050    ///
17051    /// # Example
17052    /// ```ignore,no_run
17053    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
17054    /// let x = ProcessorVersion::new().set_satisfies_pzi(true);
17055    /// ```
17056    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17057        self.satisfies_pzi = v.into();
17058        self
17059    }
17060
17061    /// Sets the value of [gen_ai_model_info][crate::model::ProcessorVersion::gen_ai_model_info].
17062    ///
17063    /// # Example
17064    /// ```ignore,no_run
17065    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
17066    /// use google_cloud_documentai_v1::model::processor_version::GenAiModelInfo;
17067    /// let x = ProcessorVersion::new().set_gen_ai_model_info(GenAiModelInfo::default()/* use setters */);
17068    /// ```
17069    pub fn set_gen_ai_model_info<T>(mut self, v: T) -> Self
17070    where
17071        T: std::convert::Into<crate::model::processor_version::GenAiModelInfo>,
17072    {
17073        self.gen_ai_model_info = std::option::Option::Some(v.into());
17074        self
17075    }
17076
17077    /// Sets or clears the value of [gen_ai_model_info][crate::model::ProcessorVersion::gen_ai_model_info].
17078    ///
17079    /// # Example
17080    /// ```ignore,no_run
17081    /// # use google_cloud_documentai_v1::model::ProcessorVersion;
17082    /// use google_cloud_documentai_v1::model::processor_version::GenAiModelInfo;
17083    /// let x = ProcessorVersion::new().set_or_clear_gen_ai_model_info(Some(GenAiModelInfo::default()/* use setters */));
17084    /// let x = ProcessorVersion::new().set_or_clear_gen_ai_model_info(None::<GenAiModelInfo>);
17085    /// ```
17086    pub fn set_or_clear_gen_ai_model_info<T>(mut self, v: std::option::Option<T>) -> Self
17087    where
17088        T: std::convert::Into<crate::model::processor_version::GenAiModelInfo>,
17089    {
17090        self.gen_ai_model_info = v.map(|x| x.into());
17091        self
17092    }
17093}
17094
17095impl wkt::message::Message for ProcessorVersion {
17096    fn typename() -> &'static str {
17097        "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersion"
17098    }
17099}
17100
17101/// Defines additional types related to [ProcessorVersion].
17102pub mod processor_version {
17103    #[allow(unused_imports)]
17104    use super::*;
17105
17106    /// Information about the upcoming deprecation of this processor version.
17107    #[derive(Clone, Default, PartialEq)]
17108    #[non_exhaustive]
17109    pub struct DeprecationInfo {
17110        /// The time at which this processor version will be deprecated.
17111        pub deprecation_time: std::option::Option<wkt::Timestamp>,
17112
17113        /// If set, the processor version that will be used as a replacement.
17114        pub replacement_processor_version: std::string::String,
17115
17116        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17117    }
17118
17119    impl DeprecationInfo {
17120        pub fn new() -> Self {
17121            std::default::Default::default()
17122        }
17123
17124        /// Sets the value of [deprecation_time][crate::model::processor_version::DeprecationInfo::deprecation_time].
17125        ///
17126        /// # Example
17127        /// ```ignore,no_run
17128        /// # use google_cloud_documentai_v1::model::processor_version::DeprecationInfo;
17129        /// use wkt::Timestamp;
17130        /// let x = DeprecationInfo::new().set_deprecation_time(Timestamp::default()/* use setters */);
17131        /// ```
17132        pub fn set_deprecation_time<T>(mut self, v: T) -> Self
17133        where
17134            T: std::convert::Into<wkt::Timestamp>,
17135        {
17136            self.deprecation_time = std::option::Option::Some(v.into());
17137            self
17138        }
17139
17140        /// Sets or clears the value of [deprecation_time][crate::model::processor_version::DeprecationInfo::deprecation_time].
17141        ///
17142        /// # Example
17143        /// ```ignore,no_run
17144        /// # use google_cloud_documentai_v1::model::processor_version::DeprecationInfo;
17145        /// use wkt::Timestamp;
17146        /// let x = DeprecationInfo::new().set_or_clear_deprecation_time(Some(Timestamp::default()/* use setters */));
17147        /// let x = DeprecationInfo::new().set_or_clear_deprecation_time(None::<Timestamp>);
17148        /// ```
17149        pub fn set_or_clear_deprecation_time<T>(mut self, v: std::option::Option<T>) -> Self
17150        where
17151            T: std::convert::Into<wkt::Timestamp>,
17152        {
17153            self.deprecation_time = v.map(|x| x.into());
17154            self
17155        }
17156
17157        /// Sets the value of [replacement_processor_version][crate::model::processor_version::DeprecationInfo::replacement_processor_version].
17158        ///
17159        /// # Example
17160        /// ```ignore,no_run
17161        /// # use google_cloud_documentai_v1::model::processor_version::DeprecationInfo;
17162        /// let x = DeprecationInfo::new().set_replacement_processor_version("example");
17163        /// ```
17164        pub fn set_replacement_processor_version<T: std::convert::Into<std::string::String>>(
17165            mut self,
17166            v: T,
17167        ) -> Self {
17168            self.replacement_processor_version = v.into();
17169            self
17170        }
17171    }
17172
17173    impl wkt::message::Message for DeprecationInfo {
17174        fn typename() -> &'static str {
17175            "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo"
17176        }
17177    }
17178
17179    /// Information about Generative AI model-based processor versions.
17180    #[derive(Clone, Default, PartialEq)]
17181    #[non_exhaustive]
17182    pub struct GenAiModelInfo {
17183        /// The processor version is either a pretrained Google-managed foundation
17184        /// model or a custom Generative AI model created by the user.
17185        pub model_info:
17186            std::option::Option<crate::model::processor_version::gen_ai_model_info::ModelInfo>,
17187
17188        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17189    }
17190
17191    impl GenAiModelInfo {
17192        pub fn new() -> Self {
17193            std::default::Default::default()
17194        }
17195
17196        /// Sets the value of [model_info][crate::model::processor_version::GenAiModelInfo::model_info].
17197        ///
17198        /// Note that all the setters affecting `model_info` are mutually
17199        /// exclusive.
17200        ///
17201        /// # Example
17202        /// ```ignore,no_run
17203        /// # use google_cloud_documentai_v1::model::processor_version::GenAiModelInfo;
17204        /// use google_cloud_documentai_v1::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo;
17205        /// let x = GenAiModelInfo::new().set_model_info(Some(
17206        ///     google_cloud_documentai_v1::model::processor_version::gen_ai_model_info::ModelInfo::FoundationGenAiModelInfo(FoundationGenAiModelInfo::default().into())));
17207        /// ```
17208        pub fn set_model_info<
17209            T: std::convert::Into<
17210                    std::option::Option<
17211                        crate::model::processor_version::gen_ai_model_info::ModelInfo,
17212                    >,
17213                >,
17214        >(
17215            mut self,
17216            v: T,
17217        ) -> Self {
17218            self.model_info = v.into();
17219            self
17220        }
17221
17222        /// The value of [model_info][crate::model::processor_version::GenAiModelInfo::model_info]
17223        /// if it holds a `FoundationGenAiModelInfo`, `None` if the field is not set or
17224        /// holds a different branch.
17225        pub fn foundation_gen_ai_model_info(
17226            &self,
17227        ) -> std::option::Option<
17228            &std::boxed::Box<
17229                crate::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo,
17230            >,
17231        > {
17232            #[allow(unreachable_patterns)]
17233            self.model_info.as_ref().and_then(|v| match v {
17234                crate::model::processor_version::gen_ai_model_info::ModelInfo::FoundationGenAiModelInfo(v) => std::option::Option::Some(v),
17235                _ => std::option::Option::None,
17236            })
17237        }
17238
17239        /// Sets the value of [model_info][crate::model::processor_version::GenAiModelInfo::model_info]
17240        /// to hold a `FoundationGenAiModelInfo`.
17241        ///
17242        /// Note that all the setters affecting `model_info` are
17243        /// mutually exclusive.
17244        ///
17245        /// # Example
17246        /// ```ignore,no_run
17247        /// # use google_cloud_documentai_v1::model::processor_version::GenAiModelInfo;
17248        /// use google_cloud_documentai_v1::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo;
17249        /// let x = GenAiModelInfo::new().set_foundation_gen_ai_model_info(FoundationGenAiModelInfo::default()/* use setters */);
17250        /// assert!(x.foundation_gen_ai_model_info().is_some());
17251        /// assert!(x.custom_gen_ai_model_info().is_none());
17252        /// ```
17253        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{
17254            self.model_info = std::option::Option::Some(
17255                crate::model::processor_version::gen_ai_model_info::ModelInfo::FoundationGenAiModelInfo(
17256                    v.into()
17257                )
17258            );
17259            self
17260        }
17261
17262        /// The value of [model_info][crate::model::processor_version::GenAiModelInfo::model_info]
17263        /// if it holds a `CustomGenAiModelInfo`, `None` if the field is not set or
17264        /// holds a different branch.
17265        pub fn custom_gen_ai_model_info(
17266            &self,
17267        ) -> std::option::Option<
17268            &std::boxed::Box<
17269                crate::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo,
17270            >,
17271        > {
17272            #[allow(unreachable_patterns)]
17273            self.model_info.as_ref().and_then(|v| match v {
17274                crate::model::processor_version::gen_ai_model_info::ModelInfo::CustomGenAiModelInfo(v) => std::option::Option::Some(v),
17275                _ => std::option::Option::None,
17276            })
17277        }
17278
17279        /// Sets the value of [model_info][crate::model::processor_version::GenAiModelInfo::model_info]
17280        /// to hold a `CustomGenAiModelInfo`.
17281        ///
17282        /// Note that all the setters affecting `model_info` are
17283        /// mutually exclusive.
17284        ///
17285        /// # Example
17286        /// ```ignore,no_run
17287        /// # use google_cloud_documentai_v1::model::processor_version::GenAiModelInfo;
17288        /// use google_cloud_documentai_v1::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo;
17289        /// let x = GenAiModelInfo::new().set_custom_gen_ai_model_info(CustomGenAiModelInfo::default()/* use setters */);
17290        /// assert!(x.custom_gen_ai_model_info().is_some());
17291        /// assert!(x.foundation_gen_ai_model_info().is_none());
17292        /// ```
17293        pub fn set_custom_gen_ai_model_info<
17294            T: std::convert::Into<
17295                    std::boxed::Box<
17296                        crate::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo,
17297                    >,
17298                >,
17299        >(
17300            mut self,
17301            v: T,
17302        ) -> Self {
17303            self.model_info = std::option::Option::Some(
17304                crate::model::processor_version::gen_ai_model_info::ModelInfo::CustomGenAiModelInfo(
17305                    v.into(),
17306                ),
17307            );
17308            self
17309        }
17310    }
17311
17312    impl wkt::message::Message for GenAiModelInfo {
17313        fn typename() -> &'static str {
17314            "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo"
17315        }
17316    }
17317
17318    /// Defines additional types related to [GenAiModelInfo].
17319    pub mod gen_ai_model_info {
17320        #[allow(unused_imports)]
17321        use super::*;
17322
17323        /// Information for a pretrained Google-managed foundation model.
17324        #[derive(Clone, Default, PartialEq)]
17325        #[non_exhaustive]
17326        pub struct FoundationGenAiModelInfo {
17327            /// Whether finetuning is allowed for this base processor version.
17328            pub finetuning_allowed: bool,
17329
17330            /// The minimum number of labeled documents in the training dataset
17331            /// required for finetuning.
17332            pub min_train_labeled_documents: i32,
17333
17334            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17335        }
17336
17337        impl FoundationGenAiModelInfo {
17338            pub fn new() -> Self {
17339                std::default::Default::default()
17340            }
17341
17342            /// Sets the value of [finetuning_allowed][crate::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo::finetuning_allowed].
17343            ///
17344            /// # Example
17345            /// ```ignore,no_run
17346            /// # use google_cloud_documentai_v1::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo;
17347            /// let x = FoundationGenAiModelInfo::new().set_finetuning_allowed(true);
17348            /// ```
17349            pub fn set_finetuning_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17350                self.finetuning_allowed = v.into();
17351                self
17352            }
17353
17354            /// Sets the value of [min_train_labeled_documents][crate::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo::min_train_labeled_documents].
17355            ///
17356            /// # Example
17357            /// ```ignore,no_run
17358            /// # use google_cloud_documentai_v1::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo;
17359            /// let x = FoundationGenAiModelInfo::new().set_min_train_labeled_documents(42);
17360            /// ```
17361            pub fn set_min_train_labeled_documents<T: std::convert::Into<i32>>(
17362                mut self,
17363                v: T,
17364            ) -> Self {
17365                self.min_train_labeled_documents = v.into();
17366                self
17367            }
17368        }
17369
17370        impl wkt::message::Message for FoundationGenAiModelInfo {
17371            fn typename() -> &'static str {
17372                "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo"
17373            }
17374        }
17375
17376        /// Information for a custom Generative AI model created by the user. These
17377        /// are created with `Create New Version` in either the `Call foundation
17378        /// model` or `Fine tuning` tabs.
17379        #[derive(Clone, Default, PartialEq)]
17380        #[non_exhaustive]
17381        pub struct CustomGenAiModelInfo {
17382
17383            /// The type of custom model created by the user.
17384            pub custom_model_type: crate::model::processor_version::gen_ai_model_info::custom_gen_ai_model_info::CustomModelType,
17385
17386            /// The base processor version ID for the custom model.
17387            pub base_processor_version_id: std::string::String,
17388
17389            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17390        }
17391
17392        impl CustomGenAiModelInfo {
17393            pub fn new() -> Self {
17394                std::default::Default::default()
17395            }
17396
17397            /// Sets the value of [custom_model_type][crate::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo::custom_model_type].
17398            ///
17399            /// # Example
17400            /// ```ignore,no_run
17401            /// # use google_cloud_documentai_v1::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo;
17402            /// use google_cloud_documentai_v1::model::processor_version::gen_ai_model_info::custom_gen_ai_model_info::CustomModelType;
17403            /// let x0 = CustomGenAiModelInfo::new().set_custom_model_type(CustomModelType::VersionedFoundation);
17404            /// let x1 = CustomGenAiModelInfo::new().set_custom_model_type(CustomModelType::FineTuned);
17405            /// ```
17406            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{
17407                self.custom_model_type = v.into();
17408                self
17409            }
17410
17411            /// Sets the value of [base_processor_version_id][crate::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo::base_processor_version_id].
17412            ///
17413            /// # Example
17414            /// ```ignore,no_run
17415            /// # use google_cloud_documentai_v1::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo;
17416            /// let x = CustomGenAiModelInfo::new().set_base_processor_version_id("example");
17417            /// ```
17418            pub fn set_base_processor_version_id<T: std::convert::Into<std::string::String>>(
17419                mut self,
17420                v: T,
17421            ) -> Self {
17422                self.base_processor_version_id = v.into();
17423                self
17424            }
17425        }
17426
17427        impl wkt::message::Message for CustomGenAiModelInfo {
17428            fn typename() -> &'static str {
17429                "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo"
17430            }
17431        }
17432
17433        /// Defines additional types related to [CustomGenAiModelInfo].
17434        pub mod custom_gen_ai_model_info {
17435            #[allow(unused_imports)]
17436            use super::*;
17437
17438            /// The type of custom model created by the user.
17439            ///
17440            /// # Working with unknown values
17441            ///
17442            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17443            /// additional enum variants at any time. Adding new variants is not considered
17444            /// a breaking change. Applications should write their code in anticipation of:
17445            ///
17446            /// - New values appearing in future releases of the client library, **and**
17447            /// - New values received dynamically, without application changes.
17448            ///
17449            /// Please consult the [Working with enums] section in the user guide for some
17450            /// guidelines.
17451            ///
17452            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17453            #[derive(Clone, Debug, PartialEq)]
17454            #[non_exhaustive]
17455            pub enum CustomModelType {
17456                /// The model type is unspecified.
17457                Unspecified,
17458                /// The model is a versioned foundation model.
17459                VersionedFoundation,
17460                /// The model is a finetuned foundation model.
17461                FineTuned,
17462                /// If set, the enum was initialized with an unknown value.
17463                ///
17464                /// Applications can examine the value using [CustomModelType::value] or
17465                /// [CustomModelType::name].
17466                UnknownValue(custom_model_type::UnknownValue),
17467            }
17468
17469            #[doc(hidden)]
17470            pub mod custom_model_type {
17471                #[allow(unused_imports)]
17472                use super::*;
17473                #[derive(Clone, Debug, PartialEq)]
17474                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17475            }
17476
17477            impl CustomModelType {
17478                /// Gets the enum value.
17479                ///
17480                /// Returns `None` if the enum contains an unknown value deserialized from
17481                /// the string representation of enums.
17482                pub fn value(&self) -> std::option::Option<i32> {
17483                    match self {
17484                        Self::Unspecified => std::option::Option::Some(0),
17485                        Self::VersionedFoundation => std::option::Option::Some(1),
17486                        Self::FineTuned => std::option::Option::Some(2),
17487                        Self::UnknownValue(u) => u.0.value(),
17488                    }
17489                }
17490
17491                /// Gets the enum value as a string.
17492                ///
17493                /// Returns `None` if the enum contains an unknown value deserialized from
17494                /// the integer representation of enums.
17495                pub fn name(&self) -> std::option::Option<&str> {
17496                    match self {
17497                        Self::Unspecified => {
17498                            std::option::Option::Some("CUSTOM_MODEL_TYPE_UNSPECIFIED")
17499                        }
17500                        Self::VersionedFoundation => {
17501                            std::option::Option::Some("VERSIONED_FOUNDATION")
17502                        }
17503                        Self::FineTuned => std::option::Option::Some("FINE_TUNED"),
17504                        Self::UnknownValue(u) => u.0.name(),
17505                    }
17506                }
17507            }
17508
17509            impl std::default::Default for CustomModelType {
17510                fn default() -> Self {
17511                    use std::convert::From;
17512                    Self::from(0)
17513                }
17514            }
17515
17516            impl std::fmt::Display for CustomModelType {
17517                fn fmt(
17518                    &self,
17519                    f: &mut std::fmt::Formatter<'_>,
17520                ) -> std::result::Result<(), std::fmt::Error> {
17521                    wkt::internal::display_enum(f, self.name(), self.value())
17522                }
17523            }
17524
17525            impl std::convert::From<i32> for CustomModelType {
17526                fn from(value: i32) -> Self {
17527                    match value {
17528                        0 => Self::Unspecified,
17529                        1 => Self::VersionedFoundation,
17530                        2 => Self::FineTuned,
17531                        _ => Self::UnknownValue(custom_model_type::UnknownValue(
17532                            wkt::internal::UnknownEnumValue::Integer(value),
17533                        )),
17534                    }
17535                }
17536            }
17537
17538            impl std::convert::From<&str> for CustomModelType {
17539                fn from(value: &str) -> Self {
17540                    use std::string::ToString;
17541                    match value {
17542                        "CUSTOM_MODEL_TYPE_UNSPECIFIED" => Self::Unspecified,
17543                        "VERSIONED_FOUNDATION" => Self::VersionedFoundation,
17544                        "FINE_TUNED" => Self::FineTuned,
17545                        _ => Self::UnknownValue(custom_model_type::UnknownValue(
17546                            wkt::internal::UnknownEnumValue::String(value.to_string()),
17547                        )),
17548                    }
17549                }
17550            }
17551
17552            impl serde::ser::Serialize for CustomModelType {
17553                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17554                where
17555                    S: serde::Serializer,
17556                {
17557                    match self {
17558                        Self::Unspecified => serializer.serialize_i32(0),
17559                        Self::VersionedFoundation => serializer.serialize_i32(1),
17560                        Self::FineTuned => serializer.serialize_i32(2),
17561                        Self::UnknownValue(u) => u.0.serialize(serializer),
17562                    }
17563                }
17564            }
17565
17566            impl<'de> serde::de::Deserialize<'de> for CustomModelType {
17567                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17568                where
17569                    D: serde::Deserializer<'de>,
17570                {
17571                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<CustomModelType>::new(
17572                        ".google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType"))
17573                }
17574            }
17575        }
17576
17577        /// The processor version is either a pretrained Google-managed foundation
17578        /// model or a custom Generative AI model created by the user.
17579        #[derive(Clone, Debug, PartialEq)]
17580        #[non_exhaustive]
17581        pub enum ModelInfo {
17582            /// Information for a pretrained Google-managed foundation model.
17583            FoundationGenAiModelInfo(
17584                std::boxed::Box<
17585                    crate::model::processor_version::gen_ai_model_info::FoundationGenAiModelInfo,
17586                >,
17587            ),
17588            /// Information for a custom Generative AI model created by the user.
17589            CustomGenAiModelInfo(
17590                std::boxed::Box<
17591                    crate::model::processor_version::gen_ai_model_info::CustomGenAiModelInfo,
17592                >,
17593            ),
17594        }
17595    }
17596
17597    /// The possible states of the processor version.
17598    ///
17599    /// # Working with unknown values
17600    ///
17601    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17602    /// additional enum variants at any time. Adding new variants is not considered
17603    /// a breaking change. Applications should write their code in anticipation of:
17604    ///
17605    /// - New values appearing in future releases of the client library, **and**
17606    /// - New values received dynamically, without application changes.
17607    ///
17608    /// Please consult the [Working with enums] section in the user guide for some
17609    /// guidelines.
17610    ///
17611    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17612    #[derive(Clone, Debug, PartialEq)]
17613    #[non_exhaustive]
17614    pub enum State {
17615        /// The processor version is in an unspecified state.
17616        Unspecified,
17617        /// The processor version is deployed and can be used for processing.
17618        Deployed,
17619        /// The processor version is being deployed.
17620        Deploying,
17621        /// The processor version is not deployed and cannot be used for processing.
17622        Undeployed,
17623        /// The processor version is being undeployed.
17624        Undeploying,
17625        /// The processor version is being created.
17626        Creating,
17627        /// The processor version is being deleted.
17628        Deleting,
17629        /// The processor version failed and is in an indeterminate state.
17630        Failed,
17631        /// The processor version is being imported.
17632        Importing,
17633        /// If set, the enum was initialized with an unknown value.
17634        ///
17635        /// Applications can examine the value using [State::value] or
17636        /// [State::name].
17637        UnknownValue(state::UnknownValue),
17638    }
17639
17640    #[doc(hidden)]
17641    pub mod state {
17642        #[allow(unused_imports)]
17643        use super::*;
17644        #[derive(Clone, Debug, PartialEq)]
17645        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17646    }
17647
17648    impl State {
17649        /// Gets the enum value.
17650        ///
17651        /// Returns `None` if the enum contains an unknown value deserialized from
17652        /// the string representation of enums.
17653        pub fn value(&self) -> std::option::Option<i32> {
17654            match self {
17655                Self::Unspecified => std::option::Option::Some(0),
17656                Self::Deployed => std::option::Option::Some(1),
17657                Self::Deploying => std::option::Option::Some(2),
17658                Self::Undeployed => std::option::Option::Some(3),
17659                Self::Undeploying => std::option::Option::Some(4),
17660                Self::Creating => std::option::Option::Some(5),
17661                Self::Deleting => std::option::Option::Some(6),
17662                Self::Failed => std::option::Option::Some(7),
17663                Self::Importing => std::option::Option::Some(8),
17664                Self::UnknownValue(u) => u.0.value(),
17665            }
17666        }
17667
17668        /// Gets the enum value as a string.
17669        ///
17670        /// Returns `None` if the enum contains an unknown value deserialized from
17671        /// the integer representation of enums.
17672        pub fn name(&self) -> std::option::Option<&str> {
17673            match self {
17674                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17675                Self::Deployed => std::option::Option::Some("DEPLOYED"),
17676                Self::Deploying => std::option::Option::Some("DEPLOYING"),
17677                Self::Undeployed => std::option::Option::Some("UNDEPLOYED"),
17678                Self::Undeploying => std::option::Option::Some("UNDEPLOYING"),
17679                Self::Creating => std::option::Option::Some("CREATING"),
17680                Self::Deleting => std::option::Option::Some("DELETING"),
17681                Self::Failed => std::option::Option::Some("FAILED"),
17682                Self::Importing => std::option::Option::Some("IMPORTING"),
17683                Self::UnknownValue(u) => u.0.name(),
17684            }
17685        }
17686    }
17687
17688    impl std::default::Default for State {
17689        fn default() -> Self {
17690            use std::convert::From;
17691            Self::from(0)
17692        }
17693    }
17694
17695    impl std::fmt::Display for State {
17696        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17697            wkt::internal::display_enum(f, self.name(), self.value())
17698        }
17699    }
17700
17701    impl std::convert::From<i32> for State {
17702        fn from(value: i32) -> Self {
17703            match value {
17704                0 => Self::Unspecified,
17705                1 => Self::Deployed,
17706                2 => Self::Deploying,
17707                3 => Self::Undeployed,
17708                4 => Self::Undeploying,
17709                5 => Self::Creating,
17710                6 => Self::Deleting,
17711                7 => Self::Failed,
17712                8 => Self::Importing,
17713                _ => Self::UnknownValue(state::UnknownValue(
17714                    wkt::internal::UnknownEnumValue::Integer(value),
17715                )),
17716            }
17717        }
17718    }
17719
17720    impl std::convert::From<&str> for State {
17721        fn from(value: &str) -> Self {
17722            use std::string::ToString;
17723            match value {
17724                "STATE_UNSPECIFIED" => Self::Unspecified,
17725                "DEPLOYED" => Self::Deployed,
17726                "DEPLOYING" => Self::Deploying,
17727                "UNDEPLOYED" => Self::Undeployed,
17728                "UNDEPLOYING" => Self::Undeploying,
17729                "CREATING" => Self::Creating,
17730                "DELETING" => Self::Deleting,
17731                "FAILED" => Self::Failed,
17732                "IMPORTING" => Self::Importing,
17733                _ => Self::UnknownValue(state::UnknownValue(
17734                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17735                )),
17736            }
17737        }
17738    }
17739
17740    impl serde::ser::Serialize for State {
17741        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17742        where
17743            S: serde::Serializer,
17744        {
17745            match self {
17746                Self::Unspecified => serializer.serialize_i32(0),
17747                Self::Deployed => serializer.serialize_i32(1),
17748                Self::Deploying => serializer.serialize_i32(2),
17749                Self::Undeployed => serializer.serialize_i32(3),
17750                Self::Undeploying => serializer.serialize_i32(4),
17751                Self::Creating => serializer.serialize_i32(5),
17752                Self::Deleting => serializer.serialize_i32(6),
17753                Self::Failed => serializer.serialize_i32(7),
17754                Self::Importing => serializer.serialize_i32(8),
17755                Self::UnknownValue(u) => u.0.serialize(serializer),
17756            }
17757        }
17758    }
17759
17760    impl<'de> serde::de::Deserialize<'de> for State {
17761        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17762        where
17763            D: serde::Deserializer<'de>,
17764        {
17765            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17766                ".google.cloud.documentai.v1.ProcessorVersion.State",
17767            ))
17768        }
17769    }
17770
17771    /// The possible model types of the processor version.
17772    ///
17773    /// # Working with unknown values
17774    ///
17775    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17776    /// additional enum variants at any time. Adding new variants is not considered
17777    /// a breaking change. Applications should write their code in anticipation of:
17778    ///
17779    /// - New values appearing in future releases of the client library, **and**
17780    /// - New values received dynamically, without application changes.
17781    ///
17782    /// Please consult the [Working with enums] section in the user guide for some
17783    /// guidelines.
17784    ///
17785    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17786    #[derive(Clone, Debug, PartialEq)]
17787    #[non_exhaustive]
17788    pub enum ModelType {
17789        /// The processor version has unspecified model type.
17790        Unspecified,
17791        /// The processor version has generative model type.
17792        Generative,
17793        /// The processor version has custom model type.
17794        Custom,
17795        /// If set, the enum was initialized with an unknown value.
17796        ///
17797        /// Applications can examine the value using [ModelType::value] or
17798        /// [ModelType::name].
17799        UnknownValue(model_type::UnknownValue),
17800    }
17801
17802    #[doc(hidden)]
17803    pub mod model_type {
17804        #[allow(unused_imports)]
17805        use super::*;
17806        #[derive(Clone, Debug, PartialEq)]
17807        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17808    }
17809
17810    impl ModelType {
17811        /// Gets the enum value.
17812        ///
17813        /// Returns `None` if the enum contains an unknown value deserialized from
17814        /// the string representation of enums.
17815        pub fn value(&self) -> std::option::Option<i32> {
17816            match self {
17817                Self::Unspecified => std::option::Option::Some(0),
17818                Self::Generative => std::option::Option::Some(1),
17819                Self::Custom => std::option::Option::Some(2),
17820                Self::UnknownValue(u) => u.0.value(),
17821            }
17822        }
17823
17824        /// Gets the enum value as a string.
17825        ///
17826        /// Returns `None` if the enum contains an unknown value deserialized from
17827        /// the integer representation of enums.
17828        pub fn name(&self) -> std::option::Option<&str> {
17829            match self {
17830                Self::Unspecified => std::option::Option::Some("MODEL_TYPE_UNSPECIFIED"),
17831                Self::Generative => std::option::Option::Some("MODEL_TYPE_GENERATIVE"),
17832                Self::Custom => std::option::Option::Some("MODEL_TYPE_CUSTOM"),
17833                Self::UnknownValue(u) => u.0.name(),
17834            }
17835        }
17836    }
17837
17838    impl std::default::Default for ModelType {
17839        fn default() -> Self {
17840            use std::convert::From;
17841            Self::from(0)
17842        }
17843    }
17844
17845    impl std::fmt::Display for ModelType {
17846        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17847            wkt::internal::display_enum(f, self.name(), self.value())
17848        }
17849    }
17850
17851    impl std::convert::From<i32> for ModelType {
17852        fn from(value: i32) -> Self {
17853            match value {
17854                0 => Self::Unspecified,
17855                1 => Self::Generative,
17856                2 => Self::Custom,
17857                _ => Self::UnknownValue(model_type::UnknownValue(
17858                    wkt::internal::UnknownEnumValue::Integer(value),
17859                )),
17860            }
17861        }
17862    }
17863
17864    impl std::convert::From<&str> for ModelType {
17865        fn from(value: &str) -> Self {
17866            use std::string::ToString;
17867            match value {
17868                "MODEL_TYPE_UNSPECIFIED" => Self::Unspecified,
17869                "MODEL_TYPE_GENERATIVE" => Self::Generative,
17870                "MODEL_TYPE_CUSTOM" => Self::Custom,
17871                _ => Self::UnknownValue(model_type::UnknownValue(
17872                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17873                )),
17874            }
17875        }
17876    }
17877
17878    impl serde::ser::Serialize for ModelType {
17879        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17880        where
17881            S: serde::Serializer,
17882        {
17883            match self {
17884                Self::Unspecified => serializer.serialize_i32(0),
17885                Self::Generative => serializer.serialize_i32(1),
17886                Self::Custom => serializer.serialize_i32(2),
17887                Self::UnknownValue(u) => u.0.serialize(serializer),
17888            }
17889        }
17890    }
17891
17892    impl<'de> serde::de::Deserialize<'de> for ModelType {
17893        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17894        where
17895            D: serde::Deserializer<'de>,
17896        {
17897            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ModelType>::new(
17898                ".google.cloud.documentai.v1.ProcessorVersion.ModelType",
17899            ))
17900        }
17901    }
17902}
17903
17904/// Contains the alias and the aliased resource name of processor version.
17905#[derive(Clone, Default, PartialEq)]
17906#[non_exhaustive]
17907pub struct ProcessorVersionAlias {
17908    /// The alias in the form of `processor_version` resource name.
17909    pub alias: std::string::String,
17910
17911    /// The resource name of aliased processor version.
17912    pub processor_version: std::string::String,
17913
17914    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17915}
17916
17917impl ProcessorVersionAlias {
17918    pub fn new() -> Self {
17919        std::default::Default::default()
17920    }
17921
17922    /// Sets the value of [alias][crate::model::ProcessorVersionAlias::alias].
17923    ///
17924    /// # Example
17925    /// ```ignore,no_run
17926    /// # use google_cloud_documentai_v1::model::ProcessorVersionAlias;
17927    /// let x = ProcessorVersionAlias::new().set_alias("example");
17928    /// ```
17929    pub fn set_alias<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17930        self.alias = v.into();
17931        self
17932    }
17933
17934    /// Sets the value of [processor_version][crate::model::ProcessorVersionAlias::processor_version].
17935    ///
17936    /// # Example
17937    /// ```ignore,no_run
17938    /// # use google_cloud_documentai_v1::model::ProcessorVersionAlias;
17939    /// let x = ProcessorVersionAlias::new().set_processor_version("example");
17940    /// ```
17941    pub fn set_processor_version<T: std::convert::Into<std::string::String>>(
17942        mut self,
17943        v: T,
17944    ) -> Self {
17945        self.processor_version = v.into();
17946        self
17947    }
17948}
17949
17950impl wkt::message::Message for ProcessorVersionAlias {
17951    fn typename() -> &'static str {
17952        "type.googleapis.com/google.cloud.documentai.v1.ProcessorVersionAlias"
17953    }
17954}
17955
17956/// The first-class citizen for Document AI. Each processor defines how to
17957/// extract structural information from a document.
17958#[derive(Clone, Default, PartialEq)]
17959#[non_exhaustive]
17960pub struct Processor {
17961    /// Output only. Immutable. The resource name of the processor.
17962    /// Format: `projects/{project}/locations/{location}/processors/{processor}`
17963    pub name: std::string::String,
17964
17965    /// The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`.
17966    /// To get a list of processor types, see
17967    /// [FetchProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes].
17968    ///
17969    /// [google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes]: crate::client::DocumentProcessorService::fetch_processor_types
17970    pub r#type: std::string::String,
17971
17972    /// The display name of the processor.
17973    pub display_name: std::string::String,
17974
17975    /// Output only. The state of the processor.
17976    pub state: crate::model::processor::State,
17977
17978    /// The default processor version.
17979    pub default_processor_version: std::string::String,
17980
17981    /// Output only. The processor version aliases.
17982    pub processor_version_aliases: std::vec::Vec<crate::model::ProcessorVersionAlias>,
17983
17984    /// Output only. Immutable. The http endpoint that can be called to invoke
17985    /// processing.
17986    pub process_endpoint: std::string::String,
17987
17988    /// Output only. The time the processor was created.
17989    pub create_time: std::option::Option<wkt::Timestamp>,
17990
17991    /// The [KMS key](https://cloud.google.com/security-key-management) used for
17992    /// encryption and decryption in CMEK scenarios.
17993    pub kms_key_name: std::string::String,
17994
17995    /// Output only. Reserved for future use.
17996    pub satisfies_pzs: bool,
17997
17998    /// Output only. Reserved for future use.
17999    pub satisfies_pzi: bool,
18000
18001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18002}
18003
18004impl Processor {
18005    pub fn new() -> Self {
18006        std::default::Default::default()
18007    }
18008
18009    /// Sets the value of [name][crate::model::Processor::name].
18010    ///
18011    /// # Example
18012    /// ```ignore,no_run
18013    /// # use google_cloud_documentai_v1::model::Processor;
18014    /// let x = Processor::new().set_name("example");
18015    /// ```
18016    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18017        self.name = v.into();
18018        self
18019    }
18020
18021    /// Sets the value of [r#type][crate::model::Processor::type].
18022    ///
18023    /// # Example
18024    /// ```ignore,no_run
18025    /// # use google_cloud_documentai_v1::model::Processor;
18026    /// let x = Processor::new().set_type("example");
18027    /// ```
18028    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18029        self.r#type = v.into();
18030        self
18031    }
18032
18033    /// Sets the value of [display_name][crate::model::Processor::display_name].
18034    ///
18035    /// # Example
18036    /// ```ignore,no_run
18037    /// # use google_cloud_documentai_v1::model::Processor;
18038    /// let x = Processor::new().set_display_name("example");
18039    /// ```
18040    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18041        self.display_name = v.into();
18042        self
18043    }
18044
18045    /// Sets the value of [state][crate::model::Processor::state].
18046    ///
18047    /// # Example
18048    /// ```ignore,no_run
18049    /// # use google_cloud_documentai_v1::model::Processor;
18050    /// use google_cloud_documentai_v1::model::processor::State;
18051    /// let x0 = Processor::new().set_state(State::Enabled);
18052    /// let x1 = Processor::new().set_state(State::Disabled);
18053    /// let x2 = Processor::new().set_state(State::Enabling);
18054    /// ```
18055    pub fn set_state<T: std::convert::Into<crate::model::processor::State>>(
18056        mut self,
18057        v: T,
18058    ) -> Self {
18059        self.state = v.into();
18060        self
18061    }
18062
18063    /// Sets the value of [default_processor_version][crate::model::Processor::default_processor_version].
18064    ///
18065    /// # Example
18066    /// ```ignore,no_run
18067    /// # use google_cloud_documentai_v1::model::Processor;
18068    /// let x = Processor::new().set_default_processor_version("example");
18069    /// ```
18070    pub fn set_default_processor_version<T: std::convert::Into<std::string::String>>(
18071        mut self,
18072        v: T,
18073    ) -> Self {
18074        self.default_processor_version = v.into();
18075        self
18076    }
18077
18078    /// Sets the value of [processor_version_aliases][crate::model::Processor::processor_version_aliases].
18079    ///
18080    /// # Example
18081    /// ```ignore,no_run
18082    /// # use google_cloud_documentai_v1::model::Processor;
18083    /// use google_cloud_documentai_v1::model::ProcessorVersionAlias;
18084    /// let x = Processor::new()
18085    ///     .set_processor_version_aliases([
18086    ///         ProcessorVersionAlias::default()/* use setters */,
18087    ///         ProcessorVersionAlias::default()/* use (different) setters */,
18088    ///     ]);
18089    /// ```
18090    pub fn set_processor_version_aliases<T, V>(mut self, v: T) -> Self
18091    where
18092        T: std::iter::IntoIterator<Item = V>,
18093        V: std::convert::Into<crate::model::ProcessorVersionAlias>,
18094    {
18095        use std::iter::Iterator;
18096        self.processor_version_aliases = v.into_iter().map(|i| i.into()).collect();
18097        self
18098    }
18099
18100    /// Sets the value of [process_endpoint][crate::model::Processor::process_endpoint].
18101    ///
18102    /// # Example
18103    /// ```ignore,no_run
18104    /// # use google_cloud_documentai_v1::model::Processor;
18105    /// let x = Processor::new().set_process_endpoint("example");
18106    /// ```
18107    pub fn set_process_endpoint<T: std::convert::Into<std::string::String>>(
18108        mut self,
18109        v: T,
18110    ) -> Self {
18111        self.process_endpoint = v.into();
18112        self
18113    }
18114
18115    /// Sets the value of [create_time][crate::model::Processor::create_time].
18116    ///
18117    /// # Example
18118    /// ```ignore,no_run
18119    /// # use google_cloud_documentai_v1::model::Processor;
18120    /// use wkt::Timestamp;
18121    /// let x = Processor::new().set_create_time(Timestamp::default()/* use setters */);
18122    /// ```
18123    pub fn set_create_time<T>(mut self, v: T) -> Self
18124    where
18125        T: std::convert::Into<wkt::Timestamp>,
18126    {
18127        self.create_time = std::option::Option::Some(v.into());
18128        self
18129    }
18130
18131    /// Sets or clears the value of [create_time][crate::model::Processor::create_time].
18132    ///
18133    /// # Example
18134    /// ```ignore,no_run
18135    /// # use google_cloud_documentai_v1::model::Processor;
18136    /// use wkt::Timestamp;
18137    /// let x = Processor::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18138    /// let x = Processor::new().set_or_clear_create_time(None::<Timestamp>);
18139    /// ```
18140    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18141    where
18142        T: std::convert::Into<wkt::Timestamp>,
18143    {
18144        self.create_time = v.map(|x| x.into());
18145        self
18146    }
18147
18148    /// Sets the value of [kms_key_name][crate::model::Processor::kms_key_name].
18149    ///
18150    /// # Example
18151    /// ```ignore,no_run
18152    /// # use google_cloud_documentai_v1::model::Processor;
18153    /// let x = Processor::new().set_kms_key_name("example");
18154    /// ```
18155    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18156        self.kms_key_name = v.into();
18157        self
18158    }
18159
18160    /// Sets the value of [satisfies_pzs][crate::model::Processor::satisfies_pzs].
18161    ///
18162    /// # Example
18163    /// ```ignore,no_run
18164    /// # use google_cloud_documentai_v1::model::Processor;
18165    /// let x = Processor::new().set_satisfies_pzs(true);
18166    /// ```
18167    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18168        self.satisfies_pzs = v.into();
18169        self
18170    }
18171
18172    /// Sets the value of [satisfies_pzi][crate::model::Processor::satisfies_pzi].
18173    ///
18174    /// # Example
18175    /// ```ignore,no_run
18176    /// # use google_cloud_documentai_v1::model::Processor;
18177    /// let x = Processor::new().set_satisfies_pzi(true);
18178    /// ```
18179    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18180        self.satisfies_pzi = v.into();
18181        self
18182    }
18183}
18184
18185impl wkt::message::Message for Processor {
18186    fn typename() -> &'static str {
18187        "type.googleapis.com/google.cloud.documentai.v1.Processor"
18188    }
18189}
18190
18191/// Defines additional types related to [Processor].
18192pub mod processor {
18193    #[allow(unused_imports)]
18194    use super::*;
18195
18196    /// The possible states of the processor.
18197    ///
18198    /// # Working with unknown values
18199    ///
18200    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18201    /// additional enum variants at any time. Adding new variants is not considered
18202    /// a breaking change. Applications should write their code in anticipation of:
18203    ///
18204    /// - New values appearing in future releases of the client library, **and**
18205    /// - New values received dynamically, without application changes.
18206    ///
18207    /// Please consult the [Working with enums] section in the user guide for some
18208    /// guidelines.
18209    ///
18210    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18211    #[derive(Clone, Debug, PartialEq)]
18212    #[non_exhaustive]
18213    pub enum State {
18214        /// The processor is in an unspecified state.
18215        Unspecified,
18216        /// The processor is enabled, i.e., has an enabled version which can
18217        /// currently serve processing requests and all the feature dependencies have
18218        /// been successfully initialized.
18219        Enabled,
18220        /// The processor is disabled.
18221        Disabled,
18222        /// The processor is being enabled, will become `ENABLED` if successful.
18223        Enabling,
18224        /// The processor is being disabled, will become `DISABLED` if successful.
18225        Disabling,
18226        /// The processor is being created, will become either `ENABLED` (for
18227        /// successful creation) or `FAILED` (for failed ones).
18228        /// Once a processor is in this state, it can then be used for document
18229        /// processing, but the feature dependencies of the processor might not be
18230        /// fully created yet.
18231        Creating,
18232        /// The processor failed during creation or initialization of feature
18233        /// dependencies. The user should delete the processor and recreate one as
18234        /// all the functionalities of the processor are disabled.
18235        Failed,
18236        /// The processor is being deleted, will be removed if successful.
18237        Deleting,
18238        /// If set, the enum was initialized with an unknown value.
18239        ///
18240        /// Applications can examine the value using [State::value] or
18241        /// [State::name].
18242        UnknownValue(state::UnknownValue),
18243    }
18244
18245    #[doc(hidden)]
18246    pub mod state {
18247        #[allow(unused_imports)]
18248        use super::*;
18249        #[derive(Clone, Debug, PartialEq)]
18250        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18251    }
18252
18253    impl State {
18254        /// Gets the enum value.
18255        ///
18256        /// Returns `None` if the enum contains an unknown value deserialized from
18257        /// the string representation of enums.
18258        pub fn value(&self) -> std::option::Option<i32> {
18259            match self {
18260                Self::Unspecified => std::option::Option::Some(0),
18261                Self::Enabled => std::option::Option::Some(1),
18262                Self::Disabled => std::option::Option::Some(2),
18263                Self::Enabling => std::option::Option::Some(3),
18264                Self::Disabling => std::option::Option::Some(4),
18265                Self::Creating => std::option::Option::Some(5),
18266                Self::Failed => std::option::Option::Some(6),
18267                Self::Deleting => std::option::Option::Some(7),
18268                Self::UnknownValue(u) => u.0.value(),
18269            }
18270        }
18271
18272        /// Gets the enum value as a string.
18273        ///
18274        /// Returns `None` if the enum contains an unknown value deserialized from
18275        /// the integer representation of enums.
18276        pub fn name(&self) -> std::option::Option<&str> {
18277            match self {
18278                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18279                Self::Enabled => std::option::Option::Some("ENABLED"),
18280                Self::Disabled => std::option::Option::Some("DISABLED"),
18281                Self::Enabling => std::option::Option::Some("ENABLING"),
18282                Self::Disabling => std::option::Option::Some("DISABLING"),
18283                Self::Creating => std::option::Option::Some("CREATING"),
18284                Self::Failed => std::option::Option::Some("FAILED"),
18285                Self::Deleting => std::option::Option::Some("DELETING"),
18286                Self::UnknownValue(u) => u.0.name(),
18287            }
18288        }
18289    }
18290
18291    impl std::default::Default for State {
18292        fn default() -> Self {
18293            use std::convert::From;
18294            Self::from(0)
18295        }
18296    }
18297
18298    impl std::fmt::Display for State {
18299        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18300            wkt::internal::display_enum(f, self.name(), self.value())
18301        }
18302    }
18303
18304    impl std::convert::From<i32> for State {
18305        fn from(value: i32) -> Self {
18306            match value {
18307                0 => Self::Unspecified,
18308                1 => Self::Enabled,
18309                2 => Self::Disabled,
18310                3 => Self::Enabling,
18311                4 => Self::Disabling,
18312                5 => Self::Creating,
18313                6 => Self::Failed,
18314                7 => Self::Deleting,
18315                _ => Self::UnknownValue(state::UnknownValue(
18316                    wkt::internal::UnknownEnumValue::Integer(value),
18317                )),
18318            }
18319        }
18320    }
18321
18322    impl std::convert::From<&str> for State {
18323        fn from(value: &str) -> Self {
18324            use std::string::ToString;
18325            match value {
18326                "STATE_UNSPECIFIED" => Self::Unspecified,
18327                "ENABLED" => Self::Enabled,
18328                "DISABLED" => Self::Disabled,
18329                "ENABLING" => Self::Enabling,
18330                "DISABLING" => Self::Disabling,
18331                "CREATING" => Self::Creating,
18332                "FAILED" => Self::Failed,
18333                "DELETING" => Self::Deleting,
18334                _ => Self::UnknownValue(state::UnknownValue(
18335                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18336                )),
18337            }
18338        }
18339    }
18340
18341    impl serde::ser::Serialize for State {
18342        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18343        where
18344            S: serde::Serializer,
18345        {
18346            match self {
18347                Self::Unspecified => serializer.serialize_i32(0),
18348                Self::Enabled => serializer.serialize_i32(1),
18349                Self::Disabled => serializer.serialize_i32(2),
18350                Self::Enabling => serializer.serialize_i32(3),
18351                Self::Disabling => serializer.serialize_i32(4),
18352                Self::Creating => serializer.serialize_i32(5),
18353                Self::Failed => serializer.serialize_i32(6),
18354                Self::Deleting => serializer.serialize_i32(7),
18355                Self::UnknownValue(u) => u.0.serialize(serializer),
18356            }
18357        }
18358    }
18359
18360    impl<'de> serde::de::Deserialize<'de> for State {
18361        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18362        where
18363            D: serde::Deserializer<'de>,
18364        {
18365            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18366                ".google.cloud.documentai.v1.Processor.State",
18367            ))
18368        }
18369    }
18370}
18371
18372/// A processor type is responsible for performing a certain document
18373/// understanding task on a certain type of document.
18374#[derive(Clone, Default, PartialEq)]
18375#[non_exhaustive]
18376pub struct ProcessorType {
18377    /// The resource name of the processor type.
18378    /// Format: `projects/{project}/processorTypes/{processor_type}`
18379    pub name: std::string::String,
18380
18381    /// The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`.
18382    pub r#type: std::string::String,
18383
18384    /// The processor category, used by UI to group processor types.
18385    pub category: std::string::String,
18386
18387    /// The locations in which this processor is available.
18388    pub available_locations: std::vec::Vec<crate::model::processor_type::LocationInfo>,
18389
18390    /// Whether the processor type allows creation. If true, users can create a
18391    /// processor of this processor type. Otherwise, users need to request access.
18392    pub allow_creation: bool,
18393
18394    /// Launch stage of the processor type
18395    pub launch_stage: google_cloud_api::model::LaunchStage,
18396
18397    /// A set of Cloud Storage URIs of sample documents for this processor.
18398    pub sample_document_uris: std::vec::Vec<std::string::String>,
18399
18400    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18401}
18402
18403impl ProcessorType {
18404    pub fn new() -> Self {
18405        std::default::Default::default()
18406    }
18407
18408    /// Sets the value of [name][crate::model::ProcessorType::name].
18409    ///
18410    /// # Example
18411    /// ```ignore,no_run
18412    /// # use google_cloud_documentai_v1::model::ProcessorType;
18413    /// let x = ProcessorType::new().set_name("example");
18414    /// ```
18415    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18416        self.name = v.into();
18417        self
18418    }
18419
18420    /// Sets the value of [r#type][crate::model::ProcessorType::type].
18421    ///
18422    /// # Example
18423    /// ```ignore,no_run
18424    /// # use google_cloud_documentai_v1::model::ProcessorType;
18425    /// let x = ProcessorType::new().set_type("example");
18426    /// ```
18427    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18428        self.r#type = v.into();
18429        self
18430    }
18431
18432    /// Sets the value of [category][crate::model::ProcessorType::category].
18433    ///
18434    /// # Example
18435    /// ```ignore,no_run
18436    /// # use google_cloud_documentai_v1::model::ProcessorType;
18437    /// let x = ProcessorType::new().set_category("example");
18438    /// ```
18439    pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18440        self.category = v.into();
18441        self
18442    }
18443
18444    /// Sets the value of [available_locations][crate::model::ProcessorType::available_locations].
18445    ///
18446    /// # Example
18447    /// ```ignore,no_run
18448    /// # use google_cloud_documentai_v1::model::ProcessorType;
18449    /// use google_cloud_documentai_v1::model::processor_type::LocationInfo;
18450    /// let x = ProcessorType::new()
18451    ///     .set_available_locations([
18452    ///         LocationInfo::default()/* use setters */,
18453    ///         LocationInfo::default()/* use (different) setters */,
18454    ///     ]);
18455    /// ```
18456    pub fn set_available_locations<T, V>(mut self, v: T) -> Self
18457    where
18458        T: std::iter::IntoIterator<Item = V>,
18459        V: std::convert::Into<crate::model::processor_type::LocationInfo>,
18460    {
18461        use std::iter::Iterator;
18462        self.available_locations = v.into_iter().map(|i| i.into()).collect();
18463        self
18464    }
18465
18466    /// Sets the value of [allow_creation][crate::model::ProcessorType::allow_creation].
18467    ///
18468    /// # Example
18469    /// ```ignore,no_run
18470    /// # use google_cloud_documentai_v1::model::ProcessorType;
18471    /// let x = ProcessorType::new().set_allow_creation(true);
18472    /// ```
18473    pub fn set_allow_creation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18474        self.allow_creation = v.into();
18475        self
18476    }
18477
18478    /// Sets the value of [launch_stage][crate::model::ProcessorType::launch_stage].
18479    ///
18480    /// # Example
18481    /// ```ignore,no_run
18482    /// # use google_cloud_documentai_v1::model::ProcessorType;
18483    /// use google_cloud_api::model::LaunchStage;
18484    /// let x0 = ProcessorType::new().set_launch_stage(LaunchStage::Unimplemented);
18485    /// let x1 = ProcessorType::new().set_launch_stage(LaunchStage::Prelaunch);
18486    /// let x2 = ProcessorType::new().set_launch_stage(LaunchStage::EarlyAccess);
18487    /// ```
18488    pub fn set_launch_stage<T: std::convert::Into<google_cloud_api::model::LaunchStage>>(
18489        mut self,
18490        v: T,
18491    ) -> Self {
18492        self.launch_stage = v.into();
18493        self
18494    }
18495
18496    /// Sets the value of [sample_document_uris][crate::model::ProcessorType::sample_document_uris].
18497    ///
18498    /// # Example
18499    /// ```ignore,no_run
18500    /// # use google_cloud_documentai_v1::model::ProcessorType;
18501    /// let x = ProcessorType::new().set_sample_document_uris(["a", "b", "c"]);
18502    /// ```
18503    pub fn set_sample_document_uris<T, V>(mut self, v: T) -> Self
18504    where
18505        T: std::iter::IntoIterator<Item = V>,
18506        V: std::convert::Into<std::string::String>,
18507    {
18508        use std::iter::Iterator;
18509        self.sample_document_uris = v.into_iter().map(|i| i.into()).collect();
18510        self
18511    }
18512}
18513
18514impl wkt::message::Message for ProcessorType {
18515    fn typename() -> &'static str {
18516        "type.googleapis.com/google.cloud.documentai.v1.ProcessorType"
18517    }
18518}
18519
18520/// Defines additional types related to [ProcessorType].
18521pub mod processor_type {
18522    #[allow(unused_imports)]
18523    use super::*;
18524
18525    /// The location information about where the processor is available.
18526    #[derive(Clone, Default, PartialEq)]
18527    #[non_exhaustive]
18528    pub struct LocationInfo {
18529        /// The location ID. For supported locations, refer to [regional and
18530        /// multi-regional support](/document-ai/docs/regions).
18531        pub location_id: std::string::String,
18532
18533        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18534    }
18535
18536    impl LocationInfo {
18537        pub fn new() -> Self {
18538            std::default::Default::default()
18539        }
18540
18541        /// Sets the value of [location_id][crate::model::processor_type::LocationInfo::location_id].
18542        ///
18543        /// # Example
18544        /// ```ignore,no_run
18545        /// # use google_cloud_documentai_v1::model::processor_type::LocationInfo;
18546        /// let x = LocationInfo::new().set_location_id("example");
18547        /// ```
18548        pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18549            self.location_id = v.into();
18550            self
18551        }
18552    }
18553
18554    impl wkt::message::Message for LocationInfo {
18555        fn typename() -> &'static str {
18556            "type.googleapis.com/google.cloud.documentai.v1.ProcessorType.LocationInfo"
18557        }
18558    }
18559}