1#![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 gax;
23extern crate gaxi;
24extern crate gtype;
25extern crate lazy_static;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate rpc;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct Vertex {
46 pub x: i32,
48
49 pub y: i32,
51
52 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
53}
54
55impl Vertex {
56 pub fn new() -> Self {
57 std::default::Default::default()
58 }
59
60 pub fn set_x<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
62 self.x = v.into();
63 self
64 }
65
66 pub fn set_y<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
68 self.y = v.into();
69 self
70 }
71}
72
73impl wkt::message::Message for Vertex {
74 fn typename() -> &'static str {
75 "type.googleapis.com/google.cloud.vision.v1.Vertex"
76 }
77}
78
79#[derive(Clone, Default, PartialEq)]
83#[non_exhaustive]
84pub struct NormalizedVertex {
85 pub x: f32,
87
88 pub y: f32,
90
91 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
92}
93
94impl NormalizedVertex {
95 pub fn new() -> Self {
96 std::default::Default::default()
97 }
98
99 pub fn set_x<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
101 self.x = v.into();
102 self
103 }
104
105 pub fn set_y<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
107 self.y = v.into();
108 self
109 }
110}
111
112impl wkt::message::Message for NormalizedVertex {
113 fn typename() -> &'static str {
114 "type.googleapis.com/google.cloud.vision.v1.NormalizedVertex"
115 }
116}
117
118#[derive(Clone, Default, PartialEq)]
120#[non_exhaustive]
121pub struct BoundingPoly {
122 pub vertices: std::vec::Vec<crate::model::Vertex>,
124
125 pub normalized_vertices: std::vec::Vec<crate::model::NormalizedVertex>,
127
128 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
129}
130
131impl BoundingPoly {
132 pub fn new() -> Self {
133 std::default::Default::default()
134 }
135
136 pub fn set_vertices<T, V>(mut self, v: T) -> Self
138 where
139 T: std::iter::IntoIterator<Item = V>,
140 V: std::convert::Into<crate::model::Vertex>,
141 {
142 use std::iter::Iterator;
143 self.vertices = v.into_iter().map(|i| i.into()).collect();
144 self
145 }
146
147 pub fn set_normalized_vertices<T, V>(mut self, v: T) -> Self
149 where
150 T: std::iter::IntoIterator<Item = V>,
151 V: std::convert::Into<crate::model::NormalizedVertex>,
152 {
153 use std::iter::Iterator;
154 self.normalized_vertices = v.into_iter().map(|i| i.into()).collect();
155 self
156 }
157}
158
159impl wkt::message::Message for BoundingPoly {
160 fn typename() -> &'static str {
161 "type.googleapis.com/google.cloud.vision.v1.BoundingPoly"
162 }
163}
164
165#[derive(Clone, Default, PartialEq)]
169#[non_exhaustive]
170pub struct Position {
171 pub x: f32,
173
174 pub y: f32,
176
177 pub z: f32,
179
180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
181}
182
183impl Position {
184 pub fn new() -> Self {
185 std::default::Default::default()
186 }
187
188 pub fn set_x<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
190 self.x = v.into();
191 self
192 }
193
194 pub fn set_y<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
196 self.y = v.into();
197 self
198 }
199
200 pub fn set_z<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
202 self.z = v.into();
203 self
204 }
205}
206
207impl wkt::message::Message for Position {
208 fn typename() -> &'static str {
209 "type.googleapis.com/google.cloud.vision.v1.Position"
210 }
211}
212
213#[derive(Clone, Default, PartialEq)]
217#[non_exhaustive]
218pub struct Feature {
219 pub r#type: crate::model::feature::Type,
221
222 pub max_results: i32,
225
226 pub model: std::string::String,
231
232 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
233}
234
235impl Feature {
236 pub fn new() -> Self {
237 std::default::Default::default()
238 }
239
240 pub fn set_type<T: std::convert::Into<crate::model::feature::Type>>(mut self, v: T) -> Self {
242 self.r#type = v.into();
243 self
244 }
245
246 pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
248 self.max_results = v.into();
249 self
250 }
251
252 pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
254 self.model = v.into();
255 self
256 }
257}
258
259impl wkt::message::Message for Feature {
260 fn typename() -> &'static str {
261 "type.googleapis.com/google.cloud.vision.v1.Feature"
262 }
263}
264
265pub mod feature {
267 #[allow(unused_imports)]
268 use super::*;
269
270 #[derive(Clone, Debug, PartialEq)]
286 #[non_exhaustive]
287 pub enum Type {
288 Unspecified,
290 FaceDetection,
292 LandmarkDetection,
294 LogoDetection,
296 LabelDetection,
298 TextDetection,
302 DocumentTextDetection,
305 SafeSearchDetection,
308 ImageProperties,
311 CropHints,
313 WebDetection,
315 ProductSearch,
317 ObjectLocalization,
319 UnknownValue(r#type::UnknownValue),
324 }
325
326 #[doc(hidden)]
327 pub mod r#type {
328 #[allow(unused_imports)]
329 use super::*;
330 #[derive(Clone, Debug, PartialEq)]
331 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
332 }
333
334 impl Type {
335 pub fn value(&self) -> std::option::Option<i32> {
340 match self {
341 Self::Unspecified => std::option::Option::Some(0),
342 Self::FaceDetection => std::option::Option::Some(1),
343 Self::LandmarkDetection => std::option::Option::Some(2),
344 Self::LogoDetection => std::option::Option::Some(3),
345 Self::LabelDetection => std::option::Option::Some(4),
346 Self::TextDetection => std::option::Option::Some(5),
347 Self::DocumentTextDetection => std::option::Option::Some(11),
348 Self::SafeSearchDetection => std::option::Option::Some(6),
349 Self::ImageProperties => std::option::Option::Some(7),
350 Self::CropHints => std::option::Option::Some(9),
351 Self::WebDetection => std::option::Option::Some(10),
352 Self::ProductSearch => std::option::Option::Some(12),
353 Self::ObjectLocalization => std::option::Option::Some(19),
354 Self::UnknownValue(u) => u.0.value(),
355 }
356 }
357
358 pub fn name(&self) -> std::option::Option<&str> {
363 match self {
364 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
365 Self::FaceDetection => std::option::Option::Some("FACE_DETECTION"),
366 Self::LandmarkDetection => std::option::Option::Some("LANDMARK_DETECTION"),
367 Self::LogoDetection => std::option::Option::Some("LOGO_DETECTION"),
368 Self::LabelDetection => std::option::Option::Some("LABEL_DETECTION"),
369 Self::TextDetection => std::option::Option::Some("TEXT_DETECTION"),
370 Self::DocumentTextDetection => std::option::Option::Some("DOCUMENT_TEXT_DETECTION"),
371 Self::SafeSearchDetection => std::option::Option::Some("SAFE_SEARCH_DETECTION"),
372 Self::ImageProperties => std::option::Option::Some("IMAGE_PROPERTIES"),
373 Self::CropHints => std::option::Option::Some("CROP_HINTS"),
374 Self::WebDetection => std::option::Option::Some("WEB_DETECTION"),
375 Self::ProductSearch => std::option::Option::Some("PRODUCT_SEARCH"),
376 Self::ObjectLocalization => std::option::Option::Some("OBJECT_LOCALIZATION"),
377 Self::UnknownValue(u) => u.0.name(),
378 }
379 }
380 }
381
382 impl std::default::Default for Type {
383 fn default() -> Self {
384 use std::convert::From;
385 Self::from(0)
386 }
387 }
388
389 impl std::fmt::Display for Type {
390 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
391 wkt::internal::display_enum(f, self.name(), self.value())
392 }
393 }
394
395 impl std::convert::From<i32> for Type {
396 fn from(value: i32) -> Self {
397 match value {
398 0 => Self::Unspecified,
399 1 => Self::FaceDetection,
400 2 => Self::LandmarkDetection,
401 3 => Self::LogoDetection,
402 4 => Self::LabelDetection,
403 5 => Self::TextDetection,
404 6 => Self::SafeSearchDetection,
405 7 => Self::ImageProperties,
406 9 => Self::CropHints,
407 10 => Self::WebDetection,
408 11 => Self::DocumentTextDetection,
409 12 => Self::ProductSearch,
410 19 => Self::ObjectLocalization,
411 _ => Self::UnknownValue(r#type::UnknownValue(
412 wkt::internal::UnknownEnumValue::Integer(value),
413 )),
414 }
415 }
416 }
417
418 impl std::convert::From<&str> for Type {
419 fn from(value: &str) -> Self {
420 use std::string::ToString;
421 match value {
422 "TYPE_UNSPECIFIED" => Self::Unspecified,
423 "FACE_DETECTION" => Self::FaceDetection,
424 "LANDMARK_DETECTION" => Self::LandmarkDetection,
425 "LOGO_DETECTION" => Self::LogoDetection,
426 "LABEL_DETECTION" => Self::LabelDetection,
427 "TEXT_DETECTION" => Self::TextDetection,
428 "DOCUMENT_TEXT_DETECTION" => Self::DocumentTextDetection,
429 "SAFE_SEARCH_DETECTION" => Self::SafeSearchDetection,
430 "IMAGE_PROPERTIES" => Self::ImageProperties,
431 "CROP_HINTS" => Self::CropHints,
432 "WEB_DETECTION" => Self::WebDetection,
433 "PRODUCT_SEARCH" => Self::ProductSearch,
434 "OBJECT_LOCALIZATION" => Self::ObjectLocalization,
435 _ => Self::UnknownValue(r#type::UnknownValue(
436 wkt::internal::UnknownEnumValue::String(value.to_string()),
437 )),
438 }
439 }
440 }
441
442 impl serde::ser::Serialize for Type {
443 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
444 where
445 S: serde::Serializer,
446 {
447 match self {
448 Self::Unspecified => serializer.serialize_i32(0),
449 Self::FaceDetection => serializer.serialize_i32(1),
450 Self::LandmarkDetection => serializer.serialize_i32(2),
451 Self::LogoDetection => serializer.serialize_i32(3),
452 Self::LabelDetection => serializer.serialize_i32(4),
453 Self::TextDetection => serializer.serialize_i32(5),
454 Self::DocumentTextDetection => serializer.serialize_i32(11),
455 Self::SafeSearchDetection => serializer.serialize_i32(6),
456 Self::ImageProperties => serializer.serialize_i32(7),
457 Self::CropHints => serializer.serialize_i32(9),
458 Self::WebDetection => serializer.serialize_i32(10),
459 Self::ProductSearch => serializer.serialize_i32(12),
460 Self::ObjectLocalization => serializer.serialize_i32(19),
461 Self::UnknownValue(u) => u.0.serialize(serializer),
462 }
463 }
464 }
465
466 impl<'de> serde::de::Deserialize<'de> for Type {
467 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
468 where
469 D: serde::Deserializer<'de>,
470 {
471 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
472 ".google.cloud.vision.v1.Feature.Type",
473 ))
474 }
475 }
476}
477
478#[derive(Clone, Default, PartialEq)]
480#[non_exhaustive]
481pub struct ImageSource {
482 pub gcs_image_uri: std::string::String,
489
490 pub image_uri: std::string::String,
509
510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
511}
512
513impl ImageSource {
514 pub fn new() -> Self {
515 std::default::Default::default()
516 }
517
518 pub fn set_gcs_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
520 self.gcs_image_uri = v.into();
521 self
522 }
523
524 pub fn set_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
526 self.image_uri = v.into();
527 self
528 }
529}
530
531impl wkt::message::Message for ImageSource {
532 fn typename() -> &'static str {
533 "type.googleapis.com/google.cloud.vision.v1.ImageSource"
534 }
535}
536
537#[derive(Clone, Default, PartialEq)]
539#[non_exhaustive]
540pub struct Image {
541 pub content: ::bytes::Bytes,
548
549 pub source: std::option::Option<crate::model::ImageSource>,
553
554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
555}
556
557impl Image {
558 pub fn new() -> Self {
559 std::default::Default::default()
560 }
561
562 pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
564 self.content = v.into();
565 self
566 }
567
568 pub fn set_source<T>(mut self, v: T) -> Self
570 where
571 T: std::convert::Into<crate::model::ImageSource>,
572 {
573 self.source = std::option::Option::Some(v.into());
574 self
575 }
576
577 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
579 where
580 T: std::convert::Into<crate::model::ImageSource>,
581 {
582 self.source = v.map(|x| x.into());
583 self
584 }
585}
586
587impl wkt::message::Message for Image {
588 fn typename() -> &'static str {
589 "type.googleapis.com/google.cloud.vision.v1.Image"
590 }
591}
592
593#[derive(Clone, Default, PartialEq)]
595#[non_exhaustive]
596pub struct FaceAnnotation {
597 pub bounding_poly: std::option::Option<crate::model::BoundingPoly>,
605
606 pub fd_bounding_poly: std::option::Option<crate::model::BoundingPoly>,
613
614 pub landmarks: std::vec::Vec<crate::model::face_annotation::Landmark>,
616
617 pub roll_angle: f32,
621
622 pub pan_angle: f32,
626
627 pub tilt_angle: f32,
630
631 pub detection_confidence: f32,
633
634 pub landmarking_confidence: f32,
636
637 pub joy_likelihood: crate::model::Likelihood,
639
640 pub sorrow_likelihood: crate::model::Likelihood,
642
643 pub anger_likelihood: crate::model::Likelihood,
645
646 pub surprise_likelihood: crate::model::Likelihood,
648
649 pub under_exposed_likelihood: crate::model::Likelihood,
651
652 pub blurred_likelihood: crate::model::Likelihood,
654
655 pub headwear_likelihood: crate::model::Likelihood,
657
658 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
659}
660
661impl FaceAnnotation {
662 pub fn new() -> Self {
663 std::default::Default::default()
664 }
665
666 pub fn set_bounding_poly<T>(mut self, v: T) -> Self
668 where
669 T: std::convert::Into<crate::model::BoundingPoly>,
670 {
671 self.bounding_poly = std::option::Option::Some(v.into());
672 self
673 }
674
675 pub fn set_or_clear_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
677 where
678 T: std::convert::Into<crate::model::BoundingPoly>,
679 {
680 self.bounding_poly = v.map(|x| x.into());
681 self
682 }
683
684 pub fn set_fd_bounding_poly<T>(mut self, v: T) -> Self
686 where
687 T: std::convert::Into<crate::model::BoundingPoly>,
688 {
689 self.fd_bounding_poly = std::option::Option::Some(v.into());
690 self
691 }
692
693 pub fn set_or_clear_fd_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
695 where
696 T: std::convert::Into<crate::model::BoundingPoly>,
697 {
698 self.fd_bounding_poly = v.map(|x| x.into());
699 self
700 }
701
702 pub fn set_landmarks<T, V>(mut self, v: T) -> Self
704 where
705 T: std::iter::IntoIterator<Item = V>,
706 V: std::convert::Into<crate::model::face_annotation::Landmark>,
707 {
708 use std::iter::Iterator;
709 self.landmarks = v.into_iter().map(|i| i.into()).collect();
710 self
711 }
712
713 pub fn set_roll_angle<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
715 self.roll_angle = v.into();
716 self
717 }
718
719 pub fn set_pan_angle<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
721 self.pan_angle = v.into();
722 self
723 }
724
725 pub fn set_tilt_angle<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
727 self.tilt_angle = v.into();
728 self
729 }
730
731 pub fn set_detection_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
733 self.detection_confidence = v.into();
734 self
735 }
736
737 pub fn set_landmarking_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
739 self.landmarking_confidence = v.into();
740 self
741 }
742
743 pub fn set_joy_likelihood<T: std::convert::Into<crate::model::Likelihood>>(
745 mut self,
746 v: T,
747 ) -> Self {
748 self.joy_likelihood = v.into();
749 self
750 }
751
752 pub fn set_sorrow_likelihood<T: std::convert::Into<crate::model::Likelihood>>(
754 mut self,
755 v: T,
756 ) -> Self {
757 self.sorrow_likelihood = v.into();
758 self
759 }
760
761 pub fn set_anger_likelihood<T: std::convert::Into<crate::model::Likelihood>>(
763 mut self,
764 v: T,
765 ) -> Self {
766 self.anger_likelihood = v.into();
767 self
768 }
769
770 pub fn set_surprise_likelihood<T: std::convert::Into<crate::model::Likelihood>>(
772 mut self,
773 v: T,
774 ) -> Self {
775 self.surprise_likelihood = v.into();
776 self
777 }
778
779 pub fn set_under_exposed_likelihood<T: std::convert::Into<crate::model::Likelihood>>(
781 mut self,
782 v: T,
783 ) -> Self {
784 self.under_exposed_likelihood = v.into();
785 self
786 }
787
788 pub fn set_blurred_likelihood<T: std::convert::Into<crate::model::Likelihood>>(
790 mut self,
791 v: T,
792 ) -> Self {
793 self.blurred_likelihood = v.into();
794 self
795 }
796
797 pub fn set_headwear_likelihood<T: std::convert::Into<crate::model::Likelihood>>(
799 mut self,
800 v: T,
801 ) -> Self {
802 self.headwear_likelihood = v.into();
803 self
804 }
805}
806
807impl wkt::message::Message for FaceAnnotation {
808 fn typename() -> &'static str {
809 "type.googleapis.com/google.cloud.vision.v1.FaceAnnotation"
810 }
811}
812
813pub mod face_annotation {
815 #[allow(unused_imports)]
816 use super::*;
817
818 #[derive(Clone, Default, PartialEq)]
820 #[non_exhaustive]
821 pub struct Landmark {
822 pub r#type: crate::model::face_annotation::landmark::Type,
824
825 pub position: std::option::Option<crate::model::Position>,
827
828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
829 }
830
831 impl Landmark {
832 pub fn new() -> Self {
833 std::default::Default::default()
834 }
835
836 pub fn set_type<T: std::convert::Into<crate::model::face_annotation::landmark::Type>>(
838 mut self,
839 v: T,
840 ) -> Self {
841 self.r#type = v.into();
842 self
843 }
844
845 pub fn set_position<T>(mut self, v: T) -> Self
847 where
848 T: std::convert::Into<crate::model::Position>,
849 {
850 self.position = std::option::Option::Some(v.into());
851 self
852 }
853
854 pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
856 where
857 T: std::convert::Into<crate::model::Position>,
858 {
859 self.position = v.map(|x| x.into());
860 self
861 }
862 }
863
864 impl wkt::message::Message for Landmark {
865 fn typename() -> &'static str {
866 "type.googleapis.com/google.cloud.vision.v1.FaceAnnotation.Landmark"
867 }
868 }
869
870 pub mod landmark {
872 #[allow(unused_imports)]
873 use super::*;
874
875 #[derive(Clone, Debug, PartialEq)]
894 #[non_exhaustive]
895 pub enum Type {
896 UnknownLandmark,
898 LeftEye,
900 RightEye,
902 LeftOfLeftEyebrow,
904 RightOfLeftEyebrow,
906 LeftOfRightEyebrow,
908 RightOfRightEyebrow,
910 MidpointBetweenEyes,
912 NoseTip,
914 UpperLip,
916 LowerLip,
918 MouthLeft,
920 MouthRight,
922 MouthCenter,
924 NoseBottomRight,
926 NoseBottomLeft,
928 NoseBottomCenter,
930 LeftEyeTopBoundary,
932 LeftEyeRightCorner,
934 LeftEyeBottomBoundary,
936 LeftEyeLeftCorner,
938 RightEyeTopBoundary,
940 RightEyeRightCorner,
942 RightEyeBottomBoundary,
944 RightEyeLeftCorner,
946 LeftEyebrowUpperMidpoint,
948 RightEyebrowUpperMidpoint,
950 LeftEarTragion,
952 RightEarTragion,
954 LeftEyePupil,
956 RightEyePupil,
958 ForeheadGlabella,
960 ChinGnathion,
962 ChinLeftGonion,
964 ChinRightGonion,
966 LeftCheekCenter,
968 RightCheekCenter,
970 UnknownValue(r#type::UnknownValue),
975 }
976
977 #[doc(hidden)]
978 pub mod r#type {
979 #[allow(unused_imports)]
980 use super::*;
981 #[derive(Clone, Debug, PartialEq)]
982 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
983 }
984
985 impl Type {
986 pub fn value(&self) -> std::option::Option<i32> {
991 match self {
992 Self::UnknownLandmark => std::option::Option::Some(0),
993 Self::LeftEye => std::option::Option::Some(1),
994 Self::RightEye => std::option::Option::Some(2),
995 Self::LeftOfLeftEyebrow => std::option::Option::Some(3),
996 Self::RightOfLeftEyebrow => std::option::Option::Some(4),
997 Self::LeftOfRightEyebrow => std::option::Option::Some(5),
998 Self::RightOfRightEyebrow => std::option::Option::Some(6),
999 Self::MidpointBetweenEyes => std::option::Option::Some(7),
1000 Self::NoseTip => std::option::Option::Some(8),
1001 Self::UpperLip => std::option::Option::Some(9),
1002 Self::LowerLip => std::option::Option::Some(10),
1003 Self::MouthLeft => std::option::Option::Some(11),
1004 Self::MouthRight => std::option::Option::Some(12),
1005 Self::MouthCenter => std::option::Option::Some(13),
1006 Self::NoseBottomRight => std::option::Option::Some(14),
1007 Self::NoseBottomLeft => std::option::Option::Some(15),
1008 Self::NoseBottomCenter => std::option::Option::Some(16),
1009 Self::LeftEyeTopBoundary => std::option::Option::Some(17),
1010 Self::LeftEyeRightCorner => std::option::Option::Some(18),
1011 Self::LeftEyeBottomBoundary => std::option::Option::Some(19),
1012 Self::LeftEyeLeftCorner => std::option::Option::Some(20),
1013 Self::RightEyeTopBoundary => std::option::Option::Some(21),
1014 Self::RightEyeRightCorner => std::option::Option::Some(22),
1015 Self::RightEyeBottomBoundary => std::option::Option::Some(23),
1016 Self::RightEyeLeftCorner => std::option::Option::Some(24),
1017 Self::LeftEyebrowUpperMidpoint => std::option::Option::Some(25),
1018 Self::RightEyebrowUpperMidpoint => std::option::Option::Some(26),
1019 Self::LeftEarTragion => std::option::Option::Some(27),
1020 Self::RightEarTragion => std::option::Option::Some(28),
1021 Self::LeftEyePupil => std::option::Option::Some(29),
1022 Self::RightEyePupil => std::option::Option::Some(30),
1023 Self::ForeheadGlabella => std::option::Option::Some(31),
1024 Self::ChinGnathion => std::option::Option::Some(32),
1025 Self::ChinLeftGonion => std::option::Option::Some(33),
1026 Self::ChinRightGonion => std::option::Option::Some(34),
1027 Self::LeftCheekCenter => std::option::Option::Some(35),
1028 Self::RightCheekCenter => std::option::Option::Some(36),
1029 Self::UnknownValue(u) => u.0.value(),
1030 }
1031 }
1032
1033 pub fn name(&self) -> std::option::Option<&str> {
1038 match self {
1039 Self::UnknownLandmark => std::option::Option::Some("UNKNOWN_LANDMARK"),
1040 Self::LeftEye => std::option::Option::Some("LEFT_EYE"),
1041 Self::RightEye => std::option::Option::Some("RIGHT_EYE"),
1042 Self::LeftOfLeftEyebrow => std::option::Option::Some("LEFT_OF_LEFT_EYEBROW"),
1043 Self::RightOfLeftEyebrow => std::option::Option::Some("RIGHT_OF_LEFT_EYEBROW"),
1044 Self::LeftOfRightEyebrow => std::option::Option::Some("LEFT_OF_RIGHT_EYEBROW"),
1045 Self::RightOfRightEyebrow => {
1046 std::option::Option::Some("RIGHT_OF_RIGHT_EYEBROW")
1047 }
1048 Self::MidpointBetweenEyes => std::option::Option::Some("MIDPOINT_BETWEEN_EYES"),
1049 Self::NoseTip => std::option::Option::Some("NOSE_TIP"),
1050 Self::UpperLip => std::option::Option::Some("UPPER_LIP"),
1051 Self::LowerLip => std::option::Option::Some("LOWER_LIP"),
1052 Self::MouthLeft => std::option::Option::Some("MOUTH_LEFT"),
1053 Self::MouthRight => std::option::Option::Some("MOUTH_RIGHT"),
1054 Self::MouthCenter => std::option::Option::Some("MOUTH_CENTER"),
1055 Self::NoseBottomRight => std::option::Option::Some("NOSE_BOTTOM_RIGHT"),
1056 Self::NoseBottomLeft => std::option::Option::Some("NOSE_BOTTOM_LEFT"),
1057 Self::NoseBottomCenter => std::option::Option::Some("NOSE_BOTTOM_CENTER"),
1058 Self::LeftEyeTopBoundary => std::option::Option::Some("LEFT_EYE_TOP_BOUNDARY"),
1059 Self::LeftEyeRightCorner => std::option::Option::Some("LEFT_EYE_RIGHT_CORNER"),
1060 Self::LeftEyeBottomBoundary => {
1061 std::option::Option::Some("LEFT_EYE_BOTTOM_BOUNDARY")
1062 }
1063 Self::LeftEyeLeftCorner => std::option::Option::Some("LEFT_EYE_LEFT_CORNER"),
1064 Self::RightEyeTopBoundary => {
1065 std::option::Option::Some("RIGHT_EYE_TOP_BOUNDARY")
1066 }
1067 Self::RightEyeRightCorner => {
1068 std::option::Option::Some("RIGHT_EYE_RIGHT_CORNER")
1069 }
1070 Self::RightEyeBottomBoundary => {
1071 std::option::Option::Some("RIGHT_EYE_BOTTOM_BOUNDARY")
1072 }
1073 Self::RightEyeLeftCorner => std::option::Option::Some("RIGHT_EYE_LEFT_CORNER"),
1074 Self::LeftEyebrowUpperMidpoint => {
1075 std::option::Option::Some("LEFT_EYEBROW_UPPER_MIDPOINT")
1076 }
1077 Self::RightEyebrowUpperMidpoint => {
1078 std::option::Option::Some("RIGHT_EYEBROW_UPPER_MIDPOINT")
1079 }
1080 Self::LeftEarTragion => std::option::Option::Some("LEFT_EAR_TRAGION"),
1081 Self::RightEarTragion => std::option::Option::Some("RIGHT_EAR_TRAGION"),
1082 Self::LeftEyePupil => std::option::Option::Some("LEFT_EYE_PUPIL"),
1083 Self::RightEyePupil => std::option::Option::Some("RIGHT_EYE_PUPIL"),
1084 Self::ForeheadGlabella => std::option::Option::Some("FOREHEAD_GLABELLA"),
1085 Self::ChinGnathion => std::option::Option::Some("CHIN_GNATHION"),
1086 Self::ChinLeftGonion => std::option::Option::Some("CHIN_LEFT_GONION"),
1087 Self::ChinRightGonion => std::option::Option::Some("CHIN_RIGHT_GONION"),
1088 Self::LeftCheekCenter => std::option::Option::Some("LEFT_CHEEK_CENTER"),
1089 Self::RightCheekCenter => std::option::Option::Some("RIGHT_CHEEK_CENTER"),
1090 Self::UnknownValue(u) => u.0.name(),
1091 }
1092 }
1093 }
1094
1095 impl std::default::Default for Type {
1096 fn default() -> Self {
1097 use std::convert::From;
1098 Self::from(0)
1099 }
1100 }
1101
1102 impl std::fmt::Display for Type {
1103 fn fmt(
1104 &self,
1105 f: &mut std::fmt::Formatter<'_>,
1106 ) -> std::result::Result<(), std::fmt::Error> {
1107 wkt::internal::display_enum(f, self.name(), self.value())
1108 }
1109 }
1110
1111 impl std::convert::From<i32> for Type {
1112 fn from(value: i32) -> Self {
1113 match value {
1114 0 => Self::UnknownLandmark,
1115 1 => Self::LeftEye,
1116 2 => Self::RightEye,
1117 3 => Self::LeftOfLeftEyebrow,
1118 4 => Self::RightOfLeftEyebrow,
1119 5 => Self::LeftOfRightEyebrow,
1120 6 => Self::RightOfRightEyebrow,
1121 7 => Self::MidpointBetweenEyes,
1122 8 => Self::NoseTip,
1123 9 => Self::UpperLip,
1124 10 => Self::LowerLip,
1125 11 => Self::MouthLeft,
1126 12 => Self::MouthRight,
1127 13 => Self::MouthCenter,
1128 14 => Self::NoseBottomRight,
1129 15 => Self::NoseBottomLeft,
1130 16 => Self::NoseBottomCenter,
1131 17 => Self::LeftEyeTopBoundary,
1132 18 => Self::LeftEyeRightCorner,
1133 19 => Self::LeftEyeBottomBoundary,
1134 20 => Self::LeftEyeLeftCorner,
1135 21 => Self::RightEyeTopBoundary,
1136 22 => Self::RightEyeRightCorner,
1137 23 => Self::RightEyeBottomBoundary,
1138 24 => Self::RightEyeLeftCorner,
1139 25 => Self::LeftEyebrowUpperMidpoint,
1140 26 => Self::RightEyebrowUpperMidpoint,
1141 27 => Self::LeftEarTragion,
1142 28 => Self::RightEarTragion,
1143 29 => Self::LeftEyePupil,
1144 30 => Self::RightEyePupil,
1145 31 => Self::ForeheadGlabella,
1146 32 => Self::ChinGnathion,
1147 33 => Self::ChinLeftGonion,
1148 34 => Self::ChinRightGonion,
1149 35 => Self::LeftCheekCenter,
1150 36 => Self::RightCheekCenter,
1151 _ => Self::UnknownValue(r#type::UnknownValue(
1152 wkt::internal::UnknownEnumValue::Integer(value),
1153 )),
1154 }
1155 }
1156 }
1157
1158 impl std::convert::From<&str> for Type {
1159 fn from(value: &str) -> Self {
1160 use std::string::ToString;
1161 match value {
1162 "UNKNOWN_LANDMARK" => Self::UnknownLandmark,
1163 "LEFT_EYE" => Self::LeftEye,
1164 "RIGHT_EYE" => Self::RightEye,
1165 "LEFT_OF_LEFT_EYEBROW" => Self::LeftOfLeftEyebrow,
1166 "RIGHT_OF_LEFT_EYEBROW" => Self::RightOfLeftEyebrow,
1167 "LEFT_OF_RIGHT_EYEBROW" => Self::LeftOfRightEyebrow,
1168 "RIGHT_OF_RIGHT_EYEBROW" => Self::RightOfRightEyebrow,
1169 "MIDPOINT_BETWEEN_EYES" => Self::MidpointBetweenEyes,
1170 "NOSE_TIP" => Self::NoseTip,
1171 "UPPER_LIP" => Self::UpperLip,
1172 "LOWER_LIP" => Self::LowerLip,
1173 "MOUTH_LEFT" => Self::MouthLeft,
1174 "MOUTH_RIGHT" => Self::MouthRight,
1175 "MOUTH_CENTER" => Self::MouthCenter,
1176 "NOSE_BOTTOM_RIGHT" => Self::NoseBottomRight,
1177 "NOSE_BOTTOM_LEFT" => Self::NoseBottomLeft,
1178 "NOSE_BOTTOM_CENTER" => Self::NoseBottomCenter,
1179 "LEFT_EYE_TOP_BOUNDARY" => Self::LeftEyeTopBoundary,
1180 "LEFT_EYE_RIGHT_CORNER" => Self::LeftEyeRightCorner,
1181 "LEFT_EYE_BOTTOM_BOUNDARY" => Self::LeftEyeBottomBoundary,
1182 "LEFT_EYE_LEFT_CORNER" => Self::LeftEyeLeftCorner,
1183 "RIGHT_EYE_TOP_BOUNDARY" => Self::RightEyeTopBoundary,
1184 "RIGHT_EYE_RIGHT_CORNER" => Self::RightEyeRightCorner,
1185 "RIGHT_EYE_BOTTOM_BOUNDARY" => Self::RightEyeBottomBoundary,
1186 "RIGHT_EYE_LEFT_CORNER" => Self::RightEyeLeftCorner,
1187 "LEFT_EYEBROW_UPPER_MIDPOINT" => Self::LeftEyebrowUpperMidpoint,
1188 "RIGHT_EYEBROW_UPPER_MIDPOINT" => Self::RightEyebrowUpperMidpoint,
1189 "LEFT_EAR_TRAGION" => Self::LeftEarTragion,
1190 "RIGHT_EAR_TRAGION" => Self::RightEarTragion,
1191 "LEFT_EYE_PUPIL" => Self::LeftEyePupil,
1192 "RIGHT_EYE_PUPIL" => Self::RightEyePupil,
1193 "FOREHEAD_GLABELLA" => Self::ForeheadGlabella,
1194 "CHIN_GNATHION" => Self::ChinGnathion,
1195 "CHIN_LEFT_GONION" => Self::ChinLeftGonion,
1196 "CHIN_RIGHT_GONION" => Self::ChinRightGonion,
1197 "LEFT_CHEEK_CENTER" => Self::LeftCheekCenter,
1198 "RIGHT_CHEEK_CENTER" => Self::RightCheekCenter,
1199 _ => Self::UnknownValue(r#type::UnknownValue(
1200 wkt::internal::UnknownEnumValue::String(value.to_string()),
1201 )),
1202 }
1203 }
1204 }
1205
1206 impl serde::ser::Serialize for Type {
1207 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1208 where
1209 S: serde::Serializer,
1210 {
1211 match self {
1212 Self::UnknownLandmark => serializer.serialize_i32(0),
1213 Self::LeftEye => serializer.serialize_i32(1),
1214 Self::RightEye => serializer.serialize_i32(2),
1215 Self::LeftOfLeftEyebrow => serializer.serialize_i32(3),
1216 Self::RightOfLeftEyebrow => serializer.serialize_i32(4),
1217 Self::LeftOfRightEyebrow => serializer.serialize_i32(5),
1218 Self::RightOfRightEyebrow => serializer.serialize_i32(6),
1219 Self::MidpointBetweenEyes => serializer.serialize_i32(7),
1220 Self::NoseTip => serializer.serialize_i32(8),
1221 Self::UpperLip => serializer.serialize_i32(9),
1222 Self::LowerLip => serializer.serialize_i32(10),
1223 Self::MouthLeft => serializer.serialize_i32(11),
1224 Self::MouthRight => serializer.serialize_i32(12),
1225 Self::MouthCenter => serializer.serialize_i32(13),
1226 Self::NoseBottomRight => serializer.serialize_i32(14),
1227 Self::NoseBottomLeft => serializer.serialize_i32(15),
1228 Self::NoseBottomCenter => serializer.serialize_i32(16),
1229 Self::LeftEyeTopBoundary => serializer.serialize_i32(17),
1230 Self::LeftEyeRightCorner => serializer.serialize_i32(18),
1231 Self::LeftEyeBottomBoundary => serializer.serialize_i32(19),
1232 Self::LeftEyeLeftCorner => serializer.serialize_i32(20),
1233 Self::RightEyeTopBoundary => serializer.serialize_i32(21),
1234 Self::RightEyeRightCorner => serializer.serialize_i32(22),
1235 Self::RightEyeBottomBoundary => serializer.serialize_i32(23),
1236 Self::RightEyeLeftCorner => serializer.serialize_i32(24),
1237 Self::LeftEyebrowUpperMidpoint => serializer.serialize_i32(25),
1238 Self::RightEyebrowUpperMidpoint => serializer.serialize_i32(26),
1239 Self::LeftEarTragion => serializer.serialize_i32(27),
1240 Self::RightEarTragion => serializer.serialize_i32(28),
1241 Self::LeftEyePupil => serializer.serialize_i32(29),
1242 Self::RightEyePupil => serializer.serialize_i32(30),
1243 Self::ForeheadGlabella => serializer.serialize_i32(31),
1244 Self::ChinGnathion => serializer.serialize_i32(32),
1245 Self::ChinLeftGonion => serializer.serialize_i32(33),
1246 Self::ChinRightGonion => serializer.serialize_i32(34),
1247 Self::LeftCheekCenter => serializer.serialize_i32(35),
1248 Self::RightCheekCenter => serializer.serialize_i32(36),
1249 Self::UnknownValue(u) => u.0.serialize(serializer),
1250 }
1251 }
1252 }
1253
1254 impl<'de> serde::de::Deserialize<'de> for Type {
1255 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1256 where
1257 D: serde::Deserializer<'de>,
1258 {
1259 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1260 ".google.cloud.vision.v1.FaceAnnotation.Landmark.Type",
1261 ))
1262 }
1263 }
1264 }
1265}
1266
1267#[derive(Clone, Default, PartialEq)]
1269#[non_exhaustive]
1270pub struct LocationInfo {
1271 pub lat_lng: std::option::Option<gtype::model::LatLng>,
1273
1274 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1275}
1276
1277impl LocationInfo {
1278 pub fn new() -> Self {
1279 std::default::Default::default()
1280 }
1281
1282 pub fn set_lat_lng<T>(mut self, v: T) -> Self
1284 where
1285 T: std::convert::Into<gtype::model::LatLng>,
1286 {
1287 self.lat_lng = std::option::Option::Some(v.into());
1288 self
1289 }
1290
1291 pub fn set_or_clear_lat_lng<T>(mut self, v: std::option::Option<T>) -> Self
1293 where
1294 T: std::convert::Into<gtype::model::LatLng>,
1295 {
1296 self.lat_lng = v.map(|x| x.into());
1297 self
1298 }
1299}
1300
1301impl wkt::message::Message for LocationInfo {
1302 fn typename() -> &'static str {
1303 "type.googleapis.com/google.cloud.vision.v1.LocationInfo"
1304 }
1305}
1306
1307#[derive(Clone, Default, PartialEq)]
1309#[non_exhaustive]
1310pub struct Property {
1311 pub name: std::string::String,
1313
1314 pub value: std::string::String,
1316
1317 pub uint64_value: u64,
1319
1320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1321}
1322
1323impl Property {
1324 pub fn new() -> Self {
1325 std::default::Default::default()
1326 }
1327
1328 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1330 self.name = v.into();
1331 self
1332 }
1333
1334 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.value = v.into();
1337 self
1338 }
1339
1340 pub fn set_uint64_value<T: std::convert::Into<u64>>(mut self, v: T) -> Self {
1342 self.uint64_value = v.into();
1343 self
1344 }
1345}
1346
1347impl wkt::message::Message for Property {
1348 fn typename() -> &'static str {
1349 "type.googleapis.com/google.cloud.vision.v1.Property"
1350 }
1351}
1352
1353#[derive(Clone, Default, PartialEq)]
1355#[non_exhaustive]
1356pub struct EntityAnnotation {
1357 pub mid: std::string::String,
1361
1362 pub locale: std::string::String,
1365
1366 pub description: std::string::String,
1368
1369 pub score: f32,
1371
1372 #[deprecated]
1378 pub confidence: f32,
1379
1380 pub topicality: f32,
1386
1387 pub bounding_poly: std::option::Option<crate::model::BoundingPoly>,
1390
1391 pub locations: std::vec::Vec<crate::model::LocationInfo>,
1397
1398 pub properties: std::vec::Vec<crate::model::Property>,
1401
1402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1403}
1404
1405impl EntityAnnotation {
1406 pub fn new() -> Self {
1407 std::default::Default::default()
1408 }
1409
1410 pub fn set_mid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1412 self.mid = v.into();
1413 self
1414 }
1415
1416 pub fn set_locale<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1418 self.locale = v.into();
1419 self
1420 }
1421
1422 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1424 self.description = v.into();
1425 self
1426 }
1427
1428 pub fn set_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1430 self.score = v.into();
1431 self
1432 }
1433
1434 #[deprecated]
1436 pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1437 self.confidence = v.into();
1438 self
1439 }
1440
1441 pub fn set_topicality<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1443 self.topicality = v.into();
1444 self
1445 }
1446
1447 pub fn set_bounding_poly<T>(mut self, v: T) -> Self
1449 where
1450 T: std::convert::Into<crate::model::BoundingPoly>,
1451 {
1452 self.bounding_poly = std::option::Option::Some(v.into());
1453 self
1454 }
1455
1456 pub fn set_or_clear_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
1458 where
1459 T: std::convert::Into<crate::model::BoundingPoly>,
1460 {
1461 self.bounding_poly = v.map(|x| x.into());
1462 self
1463 }
1464
1465 pub fn set_locations<T, V>(mut self, v: T) -> Self
1467 where
1468 T: std::iter::IntoIterator<Item = V>,
1469 V: std::convert::Into<crate::model::LocationInfo>,
1470 {
1471 use std::iter::Iterator;
1472 self.locations = v.into_iter().map(|i| i.into()).collect();
1473 self
1474 }
1475
1476 pub fn set_properties<T, V>(mut self, v: T) -> Self
1478 where
1479 T: std::iter::IntoIterator<Item = V>,
1480 V: std::convert::Into<crate::model::Property>,
1481 {
1482 use std::iter::Iterator;
1483 self.properties = v.into_iter().map(|i| i.into()).collect();
1484 self
1485 }
1486}
1487
1488impl wkt::message::Message for EntityAnnotation {
1489 fn typename() -> &'static str {
1490 "type.googleapis.com/google.cloud.vision.v1.EntityAnnotation"
1491 }
1492}
1493
1494#[derive(Clone, Default, PartialEq)]
1496#[non_exhaustive]
1497pub struct LocalizedObjectAnnotation {
1498 pub mid: std::string::String,
1500
1501 pub language_code: std::string::String,
1505
1506 pub name: std::string::String,
1508
1509 pub score: f32,
1511
1512 pub bounding_poly: std::option::Option<crate::model::BoundingPoly>,
1514
1515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1516}
1517
1518impl LocalizedObjectAnnotation {
1519 pub fn new() -> Self {
1520 std::default::Default::default()
1521 }
1522
1523 pub fn set_mid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1525 self.mid = v.into();
1526 self
1527 }
1528
1529 pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1531 self.language_code = v.into();
1532 self
1533 }
1534
1535 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1537 self.name = v.into();
1538 self
1539 }
1540
1541 pub fn set_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1543 self.score = v.into();
1544 self
1545 }
1546
1547 pub fn set_bounding_poly<T>(mut self, v: T) -> Self
1549 where
1550 T: std::convert::Into<crate::model::BoundingPoly>,
1551 {
1552 self.bounding_poly = std::option::Option::Some(v.into());
1553 self
1554 }
1555
1556 pub fn set_or_clear_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
1558 where
1559 T: std::convert::Into<crate::model::BoundingPoly>,
1560 {
1561 self.bounding_poly = v.map(|x| x.into());
1562 self
1563 }
1564}
1565
1566impl wkt::message::Message for LocalizedObjectAnnotation {
1567 fn typename() -> &'static str {
1568 "type.googleapis.com/google.cloud.vision.v1.LocalizedObjectAnnotation"
1569 }
1570}
1571
1572#[derive(Clone, Default, PartialEq)]
1576#[non_exhaustive]
1577pub struct SafeSearchAnnotation {
1578 pub adult: crate::model::Likelihood,
1582
1583 pub spoof: crate::model::Likelihood,
1587
1588 pub medical: crate::model::Likelihood,
1590
1591 pub violence: crate::model::Likelihood,
1595
1596 pub racy: crate::model::Likelihood,
1601
1602 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1603}
1604
1605impl SafeSearchAnnotation {
1606 pub fn new() -> Self {
1607 std::default::Default::default()
1608 }
1609
1610 pub fn set_adult<T: std::convert::Into<crate::model::Likelihood>>(mut self, v: T) -> Self {
1612 self.adult = v.into();
1613 self
1614 }
1615
1616 pub fn set_spoof<T: std::convert::Into<crate::model::Likelihood>>(mut self, v: T) -> Self {
1618 self.spoof = v.into();
1619 self
1620 }
1621
1622 pub fn set_medical<T: std::convert::Into<crate::model::Likelihood>>(mut self, v: T) -> Self {
1624 self.medical = v.into();
1625 self
1626 }
1627
1628 pub fn set_violence<T: std::convert::Into<crate::model::Likelihood>>(mut self, v: T) -> Self {
1630 self.violence = v.into();
1631 self
1632 }
1633
1634 pub fn set_racy<T: std::convert::Into<crate::model::Likelihood>>(mut self, v: T) -> Self {
1636 self.racy = v.into();
1637 self
1638 }
1639}
1640
1641impl wkt::message::Message for SafeSearchAnnotation {
1642 fn typename() -> &'static str {
1643 "type.googleapis.com/google.cloud.vision.v1.SafeSearchAnnotation"
1644 }
1645}
1646
1647#[derive(Clone, Default, PartialEq)]
1649#[non_exhaustive]
1650pub struct LatLongRect {
1651 pub min_lat_lng: std::option::Option<gtype::model::LatLng>,
1653
1654 pub max_lat_lng: std::option::Option<gtype::model::LatLng>,
1656
1657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1658}
1659
1660impl LatLongRect {
1661 pub fn new() -> Self {
1662 std::default::Default::default()
1663 }
1664
1665 pub fn set_min_lat_lng<T>(mut self, v: T) -> Self
1667 where
1668 T: std::convert::Into<gtype::model::LatLng>,
1669 {
1670 self.min_lat_lng = std::option::Option::Some(v.into());
1671 self
1672 }
1673
1674 pub fn set_or_clear_min_lat_lng<T>(mut self, v: std::option::Option<T>) -> Self
1676 where
1677 T: std::convert::Into<gtype::model::LatLng>,
1678 {
1679 self.min_lat_lng = v.map(|x| x.into());
1680 self
1681 }
1682
1683 pub fn set_max_lat_lng<T>(mut self, v: T) -> Self
1685 where
1686 T: std::convert::Into<gtype::model::LatLng>,
1687 {
1688 self.max_lat_lng = std::option::Option::Some(v.into());
1689 self
1690 }
1691
1692 pub fn set_or_clear_max_lat_lng<T>(mut self, v: std::option::Option<T>) -> Self
1694 where
1695 T: std::convert::Into<gtype::model::LatLng>,
1696 {
1697 self.max_lat_lng = v.map(|x| x.into());
1698 self
1699 }
1700}
1701
1702impl wkt::message::Message for LatLongRect {
1703 fn typename() -> &'static str {
1704 "type.googleapis.com/google.cloud.vision.v1.LatLongRect"
1705 }
1706}
1707
1708#[derive(Clone, Default, PartialEq)]
1711#[non_exhaustive]
1712pub struct ColorInfo {
1713 pub color: std::option::Option<gtype::model::Color>,
1715
1716 pub score: f32,
1718
1719 pub pixel_fraction: f32,
1722
1723 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1724}
1725
1726impl ColorInfo {
1727 pub fn new() -> Self {
1728 std::default::Default::default()
1729 }
1730
1731 pub fn set_color<T>(mut self, v: T) -> Self
1733 where
1734 T: std::convert::Into<gtype::model::Color>,
1735 {
1736 self.color = std::option::Option::Some(v.into());
1737 self
1738 }
1739
1740 pub fn set_or_clear_color<T>(mut self, v: std::option::Option<T>) -> Self
1742 where
1743 T: std::convert::Into<gtype::model::Color>,
1744 {
1745 self.color = v.map(|x| x.into());
1746 self
1747 }
1748
1749 pub fn set_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1751 self.score = v.into();
1752 self
1753 }
1754
1755 pub fn set_pixel_fraction<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1757 self.pixel_fraction = v.into();
1758 self
1759 }
1760}
1761
1762impl wkt::message::Message for ColorInfo {
1763 fn typename() -> &'static str {
1764 "type.googleapis.com/google.cloud.vision.v1.ColorInfo"
1765 }
1766}
1767
1768#[derive(Clone, Default, PartialEq)]
1770#[non_exhaustive]
1771pub struct DominantColorsAnnotation {
1772 pub colors: std::vec::Vec<crate::model::ColorInfo>,
1774
1775 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1776}
1777
1778impl DominantColorsAnnotation {
1779 pub fn new() -> Self {
1780 std::default::Default::default()
1781 }
1782
1783 pub fn set_colors<T, V>(mut self, v: T) -> Self
1785 where
1786 T: std::iter::IntoIterator<Item = V>,
1787 V: std::convert::Into<crate::model::ColorInfo>,
1788 {
1789 use std::iter::Iterator;
1790 self.colors = v.into_iter().map(|i| i.into()).collect();
1791 self
1792 }
1793}
1794
1795impl wkt::message::Message for DominantColorsAnnotation {
1796 fn typename() -> &'static str {
1797 "type.googleapis.com/google.cloud.vision.v1.DominantColorsAnnotation"
1798 }
1799}
1800
1801#[derive(Clone, Default, PartialEq)]
1803#[non_exhaustive]
1804pub struct ImageProperties {
1805 pub dominant_colors: std::option::Option<crate::model::DominantColorsAnnotation>,
1807
1808 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1809}
1810
1811impl ImageProperties {
1812 pub fn new() -> Self {
1813 std::default::Default::default()
1814 }
1815
1816 pub fn set_dominant_colors<T>(mut self, v: T) -> Self
1818 where
1819 T: std::convert::Into<crate::model::DominantColorsAnnotation>,
1820 {
1821 self.dominant_colors = std::option::Option::Some(v.into());
1822 self
1823 }
1824
1825 pub fn set_or_clear_dominant_colors<T>(mut self, v: std::option::Option<T>) -> Self
1827 where
1828 T: std::convert::Into<crate::model::DominantColorsAnnotation>,
1829 {
1830 self.dominant_colors = v.map(|x| x.into());
1831 self
1832 }
1833}
1834
1835impl wkt::message::Message for ImageProperties {
1836 fn typename() -> &'static str {
1837 "type.googleapis.com/google.cloud.vision.v1.ImageProperties"
1838 }
1839}
1840
1841#[derive(Clone, Default, PartialEq)]
1843#[non_exhaustive]
1844pub struct CropHint {
1845 pub bounding_poly: std::option::Option<crate::model::BoundingPoly>,
1848
1849 pub confidence: f32,
1851
1852 pub importance_fraction: f32,
1855
1856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1857}
1858
1859impl CropHint {
1860 pub fn new() -> Self {
1861 std::default::Default::default()
1862 }
1863
1864 pub fn set_bounding_poly<T>(mut self, v: T) -> Self
1866 where
1867 T: std::convert::Into<crate::model::BoundingPoly>,
1868 {
1869 self.bounding_poly = std::option::Option::Some(v.into());
1870 self
1871 }
1872
1873 pub fn set_or_clear_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
1875 where
1876 T: std::convert::Into<crate::model::BoundingPoly>,
1877 {
1878 self.bounding_poly = v.map(|x| x.into());
1879 self
1880 }
1881
1882 pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1884 self.confidence = v.into();
1885 self
1886 }
1887
1888 pub fn set_importance_fraction<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1890 self.importance_fraction = v.into();
1891 self
1892 }
1893}
1894
1895impl wkt::message::Message for CropHint {
1896 fn typename() -> &'static str {
1897 "type.googleapis.com/google.cloud.vision.v1.CropHint"
1898 }
1899}
1900
1901#[derive(Clone, Default, PartialEq)]
1903#[non_exhaustive]
1904pub struct CropHintsAnnotation {
1905 pub crop_hints: std::vec::Vec<crate::model::CropHint>,
1907
1908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1909}
1910
1911impl CropHintsAnnotation {
1912 pub fn new() -> Self {
1913 std::default::Default::default()
1914 }
1915
1916 pub fn set_crop_hints<T, V>(mut self, v: T) -> Self
1918 where
1919 T: std::iter::IntoIterator<Item = V>,
1920 V: std::convert::Into<crate::model::CropHint>,
1921 {
1922 use std::iter::Iterator;
1923 self.crop_hints = v.into_iter().map(|i| i.into()).collect();
1924 self
1925 }
1926}
1927
1928impl wkt::message::Message for CropHintsAnnotation {
1929 fn typename() -> &'static str {
1930 "type.googleapis.com/google.cloud.vision.v1.CropHintsAnnotation"
1931 }
1932}
1933
1934#[derive(Clone, Default, PartialEq)]
1936#[non_exhaustive]
1937pub struct CropHintsParams {
1938 pub aspect_ratios: std::vec::Vec<f32>,
1945
1946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1947}
1948
1949impl CropHintsParams {
1950 pub fn new() -> Self {
1951 std::default::Default::default()
1952 }
1953
1954 pub fn set_aspect_ratios<T, V>(mut self, v: T) -> Self
1956 where
1957 T: std::iter::IntoIterator<Item = V>,
1958 V: std::convert::Into<f32>,
1959 {
1960 use std::iter::Iterator;
1961 self.aspect_ratios = v.into_iter().map(|i| i.into()).collect();
1962 self
1963 }
1964}
1965
1966impl wkt::message::Message for CropHintsParams {
1967 fn typename() -> &'static str {
1968 "type.googleapis.com/google.cloud.vision.v1.CropHintsParams"
1969 }
1970}
1971
1972#[derive(Clone, Default, PartialEq)]
1974#[non_exhaustive]
1975pub struct WebDetectionParams {
1976 #[deprecated]
1978 pub include_geo_results: bool,
1979
1980 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1981}
1982
1983impl WebDetectionParams {
1984 pub fn new() -> Self {
1985 std::default::Default::default()
1986 }
1987
1988 #[deprecated]
1990 pub fn set_include_geo_results<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1991 self.include_geo_results = v.into();
1992 self
1993 }
1994}
1995
1996impl wkt::message::Message for WebDetectionParams {
1997 fn typename() -> &'static str {
1998 "type.googleapis.com/google.cloud.vision.v1.WebDetectionParams"
1999 }
2000}
2001
2002#[derive(Clone, Default, PartialEq)]
2005#[non_exhaustive]
2006pub struct TextDetectionParams {
2007 pub enable_text_detection_confidence_score: bool,
2011
2012 pub advanced_ocr_options: std::vec::Vec<std::string::String>,
2020
2021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2022}
2023
2024impl TextDetectionParams {
2025 pub fn new() -> Self {
2026 std::default::Default::default()
2027 }
2028
2029 pub fn set_enable_text_detection_confidence_score<T: std::convert::Into<bool>>(
2031 mut self,
2032 v: T,
2033 ) -> Self {
2034 self.enable_text_detection_confidence_score = v.into();
2035 self
2036 }
2037
2038 pub fn set_advanced_ocr_options<T, V>(mut self, v: T) -> Self
2040 where
2041 T: std::iter::IntoIterator<Item = V>,
2042 V: std::convert::Into<std::string::String>,
2043 {
2044 use std::iter::Iterator;
2045 self.advanced_ocr_options = v.into_iter().map(|i| i.into()).collect();
2046 self
2047 }
2048}
2049
2050impl wkt::message::Message for TextDetectionParams {
2051 fn typename() -> &'static str {
2052 "type.googleapis.com/google.cloud.vision.v1.TextDetectionParams"
2053 }
2054}
2055
2056#[derive(Clone, Default, PartialEq)]
2058#[non_exhaustive]
2059pub struct ImageContext {
2060 pub lat_long_rect: std::option::Option<crate::model::LatLongRect>,
2062
2063 pub language_hints: std::vec::Vec<std::string::String>,
2072
2073 pub crop_hints_params: std::option::Option<crate::model::CropHintsParams>,
2075
2076 pub product_search_params: std::option::Option<crate::model::ProductSearchParams>,
2078
2079 pub web_detection_params: std::option::Option<crate::model::WebDetectionParams>,
2081
2082 pub text_detection_params: std::option::Option<crate::model::TextDetectionParams>,
2084
2085 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2086}
2087
2088impl ImageContext {
2089 pub fn new() -> Self {
2090 std::default::Default::default()
2091 }
2092
2093 pub fn set_lat_long_rect<T>(mut self, v: T) -> Self
2095 where
2096 T: std::convert::Into<crate::model::LatLongRect>,
2097 {
2098 self.lat_long_rect = std::option::Option::Some(v.into());
2099 self
2100 }
2101
2102 pub fn set_or_clear_lat_long_rect<T>(mut self, v: std::option::Option<T>) -> Self
2104 where
2105 T: std::convert::Into<crate::model::LatLongRect>,
2106 {
2107 self.lat_long_rect = v.map(|x| x.into());
2108 self
2109 }
2110
2111 pub fn set_language_hints<T, V>(mut self, v: T) -> Self
2113 where
2114 T: std::iter::IntoIterator<Item = V>,
2115 V: std::convert::Into<std::string::String>,
2116 {
2117 use std::iter::Iterator;
2118 self.language_hints = v.into_iter().map(|i| i.into()).collect();
2119 self
2120 }
2121
2122 pub fn set_crop_hints_params<T>(mut self, v: T) -> Self
2124 where
2125 T: std::convert::Into<crate::model::CropHintsParams>,
2126 {
2127 self.crop_hints_params = std::option::Option::Some(v.into());
2128 self
2129 }
2130
2131 pub fn set_or_clear_crop_hints_params<T>(mut self, v: std::option::Option<T>) -> Self
2133 where
2134 T: std::convert::Into<crate::model::CropHintsParams>,
2135 {
2136 self.crop_hints_params = v.map(|x| x.into());
2137 self
2138 }
2139
2140 pub fn set_product_search_params<T>(mut self, v: T) -> Self
2142 where
2143 T: std::convert::Into<crate::model::ProductSearchParams>,
2144 {
2145 self.product_search_params = std::option::Option::Some(v.into());
2146 self
2147 }
2148
2149 pub fn set_or_clear_product_search_params<T>(mut self, v: std::option::Option<T>) -> Self
2151 where
2152 T: std::convert::Into<crate::model::ProductSearchParams>,
2153 {
2154 self.product_search_params = v.map(|x| x.into());
2155 self
2156 }
2157
2158 pub fn set_web_detection_params<T>(mut self, v: T) -> Self
2160 where
2161 T: std::convert::Into<crate::model::WebDetectionParams>,
2162 {
2163 self.web_detection_params = std::option::Option::Some(v.into());
2164 self
2165 }
2166
2167 pub fn set_or_clear_web_detection_params<T>(mut self, v: std::option::Option<T>) -> Self
2169 where
2170 T: std::convert::Into<crate::model::WebDetectionParams>,
2171 {
2172 self.web_detection_params = v.map(|x| x.into());
2173 self
2174 }
2175
2176 pub fn set_text_detection_params<T>(mut self, v: T) -> Self
2178 where
2179 T: std::convert::Into<crate::model::TextDetectionParams>,
2180 {
2181 self.text_detection_params = std::option::Option::Some(v.into());
2182 self
2183 }
2184
2185 pub fn set_or_clear_text_detection_params<T>(mut self, v: std::option::Option<T>) -> Self
2187 where
2188 T: std::convert::Into<crate::model::TextDetectionParams>,
2189 {
2190 self.text_detection_params = v.map(|x| x.into());
2191 self
2192 }
2193}
2194
2195impl wkt::message::Message for ImageContext {
2196 fn typename() -> &'static str {
2197 "type.googleapis.com/google.cloud.vision.v1.ImageContext"
2198 }
2199}
2200
2201#[derive(Clone, Default, PartialEq)]
2204#[non_exhaustive]
2205pub struct AnnotateImageRequest {
2206 pub image: std::option::Option<crate::model::Image>,
2208
2209 pub features: std::vec::Vec<crate::model::Feature>,
2211
2212 pub image_context: std::option::Option<crate::model::ImageContext>,
2214
2215 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2216}
2217
2218impl AnnotateImageRequest {
2219 pub fn new() -> Self {
2220 std::default::Default::default()
2221 }
2222
2223 pub fn set_image<T>(mut self, v: T) -> Self
2225 where
2226 T: std::convert::Into<crate::model::Image>,
2227 {
2228 self.image = std::option::Option::Some(v.into());
2229 self
2230 }
2231
2232 pub fn set_or_clear_image<T>(mut self, v: std::option::Option<T>) -> Self
2234 where
2235 T: std::convert::Into<crate::model::Image>,
2236 {
2237 self.image = v.map(|x| x.into());
2238 self
2239 }
2240
2241 pub fn set_features<T, V>(mut self, v: T) -> Self
2243 where
2244 T: std::iter::IntoIterator<Item = V>,
2245 V: std::convert::Into<crate::model::Feature>,
2246 {
2247 use std::iter::Iterator;
2248 self.features = v.into_iter().map(|i| i.into()).collect();
2249 self
2250 }
2251
2252 pub fn set_image_context<T>(mut self, v: T) -> Self
2254 where
2255 T: std::convert::Into<crate::model::ImageContext>,
2256 {
2257 self.image_context = std::option::Option::Some(v.into());
2258 self
2259 }
2260
2261 pub fn set_or_clear_image_context<T>(mut self, v: std::option::Option<T>) -> Self
2263 where
2264 T: std::convert::Into<crate::model::ImageContext>,
2265 {
2266 self.image_context = v.map(|x| x.into());
2267 self
2268 }
2269}
2270
2271impl wkt::message::Message for AnnotateImageRequest {
2272 fn typename() -> &'static str {
2273 "type.googleapis.com/google.cloud.vision.v1.AnnotateImageRequest"
2274 }
2275}
2276
2277#[derive(Clone, Default, PartialEq)]
2280#[non_exhaustive]
2281pub struct ImageAnnotationContext {
2282 pub uri: std::string::String,
2284
2285 pub page_number: i32,
2288
2289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2290}
2291
2292impl ImageAnnotationContext {
2293 pub fn new() -> Self {
2294 std::default::Default::default()
2295 }
2296
2297 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2299 self.uri = v.into();
2300 self
2301 }
2302
2303 pub fn set_page_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2305 self.page_number = v.into();
2306 self
2307 }
2308}
2309
2310impl wkt::message::Message for ImageAnnotationContext {
2311 fn typename() -> &'static str {
2312 "type.googleapis.com/google.cloud.vision.v1.ImageAnnotationContext"
2313 }
2314}
2315
2316#[derive(Clone, Default, PartialEq)]
2318#[non_exhaustive]
2319pub struct AnnotateImageResponse {
2320 pub face_annotations: std::vec::Vec<crate::model::FaceAnnotation>,
2322
2323 pub landmark_annotations: std::vec::Vec<crate::model::EntityAnnotation>,
2325
2326 pub logo_annotations: std::vec::Vec<crate::model::EntityAnnotation>,
2328
2329 pub label_annotations: std::vec::Vec<crate::model::EntityAnnotation>,
2331
2332 pub localized_object_annotations: std::vec::Vec<crate::model::LocalizedObjectAnnotation>,
2335
2336 pub text_annotations: std::vec::Vec<crate::model::EntityAnnotation>,
2338
2339 pub full_text_annotation: std::option::Option<crate::model::TextAnnotation>,
2344
2345 pub safe_search_annotation: std::option::Option<crate::model::SafeSearchAnnotation>,
2347
2348 pub image_properties_annotation: std::option::Option<crate::model::ImageProperties>,
2350
2351 pub crop_hints_annotation: std::option::Option<crate::model::CropHintsAnnotation>,
2353
2354 pub web_detection: std::option::Option<crate::model::WebDetection>,
2356
2357 pub product_search_results: std::option::Option<crate::model::ProductSearchResults>,
2359
2360 pub error: std::option::Option<rpc::model::Status>,
2364
2365 pub context: std::option::Option<crate::model::ImageAnnotationContext>,
2368
2369 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2370}
2371
2372impl AnnotateImageResponse {
2373 pub fn new() -> Self {
2374 std::default::Default::default()
2375 }
2376
2377 pub fn set_face_annotations<T, V>(mut self, v: T) -> Self
2379 where
2380 T: std::iter::IntoIterator<Item = V>,
2381 V: std::convert::Into<crate::model::FaceAnnotation>,
2382 {
2383 use std::iter::Iterator;
2384 self.face_annotations = v.into_iter().map(|i| i.into()).collect();
2385 self
2386 }
2387
2388 pub fn set_landmark_annotations<T, V>(mut self, v: T) -> Self
2390 where
2391 T: std::iter::IntoIterator<Item = V>,
2392 V: std::convert::Into<crate::model::EntityAnnotation>,
2393 {
2394 use std::iter::Iterator;
2395 self.landmark_annotations = v.into_iter().map(|i| i.into()).collect();
2396 self
2397 }
2398
2399 pub fn set_logo_annotations<T, V>(mut self, v: T) -> Self
2401 where
2402 T: std::iter::IntoIterator<Item = V>,
2403 V: std::convert::Into<crate::model::EntityAnnotation>,
2404 {
2405 use std::iter::Iterator;
2406 self.logo_annotations = v.into_iter().map(|i| i.into()).collect();
2407 self
2408 }
2409
2410 pub fn set_label_annotations<T, V>(mut self, v: T) -> Self
2412 where
2413 T: std::iter::IntoIterator<Item = V>,
2414 V: std::convert::Into<crate::model::EntityAnnotation>,
2415 {
2416 use std::iter::Iterator;
2417 self.label_annotations = v.into_iter().map(|i| i.into()).collect();
2418 self
2419 }
2420
2421 pub fn set_localized_object_annotations<T, V>(mut self, v: T) -> Self
2423 where
2424 T: std::iter::IntoIterator<Item = V>,
2425 V: std::convert::Into<crate::model::LocalizedObjectAnnotation>,
2426 {
2427 use std::iter::Iterator;
2428 self.localized_object_annotations = v.into_iter().map(|i| i.into()).collect();
2429 self
2430 }
2431
2432 pub fn set_text_annotations<T, V>(mut self, v: T) -> Self
2434 where
2435 T: std::iter::IntoIterator<Item = V>,
2436 V: std::convert::Into<crate::model::EntityAnnotation>,
2437 {
2438 use std::iter::Iterator;
2439 self.text_annotations = v.into_iter().map(|i| i.into()).collect();
2440 self
2441 }
2442
2443 pub fn set_full_text_annotation<T>(mut self, v: T) -> Self
2445 where
2446 T: std::convert::Into<crate::model::TextAnnotation>,
2447 {
2448 self.full_text_annotation = std::option::Option::Some(v.into());
2449 self
2450 }
2451
2452 pub fn set_or_clear_full_text_annotation<T>(mut self, v: std::option::Option<T>) -> Self
2454 where
2455 T: std::convert::Into<crate::model::TextAnnotation>,
2456 {
2457 self.full_text_annotation = v.map(|x| x.into());
2458 self
2459 }
2460
2461 pub fn set_safe_search_annotation<T>(mut self, v: T) -> Self
2463 where
2464 T: std::convert::Into<crate::model::SafeSearchAnnotation>,
2465 {
2466 self.safe_search_annotation = std::option::Option::Some(v.into());
2467 self
2468 }
2469
2470 pub fn set_or_clear_safe_search_annotation<T>(mut self, v: std::option::Option<T>) -> Self
2472 where
2473 T: std::convert::Into<crate::model::SafeSearchAnnotation>,
2474 {
2475 self.safe_search_annotation = v.map(|x| x.into());
2476 self
2477 }
2478
2479 pub fn set_image_properties_annotation<T>(mut self, v: T) -> Self
2481 where
2482 T: std::convert::Into<crate::model::ImageProperties>,
2483 {
2484 self.image_properties_annotation = std::option::Option::Some(v.into());
2485 self
2486 }
2487
2488 pub fn set_or_clear_image_properties_annotation<T>(mut self, v: std::option::Option<T>) -> Self
2490 where
2491 T: std::convert::Into<crate::model::ImageProperties>,
2492 {
2493 self.image_properties_annotation = v.map(|x| x.into());
2494 self
2495 }
2496
2497 pub fn set_crop_hints_annotation<T>(mut self, v: T) -> Self
2499 where
2500 T: std::convert::Into<crate::model::CropHintsAnnotation>,
2501 {
2502 self.crop_hints_annotation = std::option::Option::Some(v.into());
2503 self
2504 }
2505
2506 pub fn set_or_clear_crop_hints_annotation<T>(mut self, v: std::option::Option<T>) -> Self
2508 where
2509 T: std::convert::Into<crate::model::CropHintsAnnotation>,
2510 {
2511 self.crop_hints_annotation = v.map(|x| x.into());
2512 self
2513 }
2514
2515 pub fn set_web_detection<T>(mut self, v: T) -> Self
2517 where
2518 T: std::convert::Into<crate::model::WebDetection>,
2519 {
2520 self.web_detection = std::option::Option::Some(v.into());
2521 self
2522 }
2523
2524 pub fn set_or_clear_web_detection<T>(mut self, v: std::option::Option<T>) -> Self
2526 where
2527 T: std::convert::Into<crate::model::WebDetection>,
2528 {
2529 self.web_detection = v.map(|x| x.into());
2530 self
2531 }
2532
2533 pub fn set_product_search_results<T>(mut self, v: T) -> Self
2535 where
2536 T: std::convert::Into<crate::model::ProductSearchResults>,
2537 {
2538 self.product_search_results = std::option::Option::Some(v.into());
2539 self
2540 }
2541
2542 pub fn set_or_clear_product_search_results<T>(mut self, v: std::option::Option<T>) -> Self
2544 where
2545 T: std::convert::Into<crate::model::ProductSearchResults>,
2546 {
2547 self.product_search_results = v.map(|x| x.into());
2548 self
2549 }
2550
2551 pub fn set_error<T>(mut self, v: T) -> Self
2553 where
2554 T: std::convert::Into<rpc::model::Status>,
2555 {
2556 self.error = std::option::Option::Some(v.into());
2557 self
2558 }
2559
2560 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2562 where
2563 T: std::convert::Into<rpc::model::Status>,
2564 {
2565 self.error = v.map(|x| x.into());
2566 self
2567 }
2568
2569 pub fn set_context<T>(mut self, v: T) -> Self
2571 where
2572 T: std::convert::Into<crate::model::ImageAnnotationContext>,
2573 {
2574 self.context = std::option::Option::Some(v.into());
2575 self
2576 }
2577
2578 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2580 where
2581 T: std::convert::Into<crate::model::ImageAnnotationContext>,
2582 {
2583 self.context = v.map(|x| x.into());
2584 self
2585 }
2586}
2587
2588impl wkt::message::Message for AnnotateImageResponse {
2589 fn typename() -> &'static str {
2590 "type.googleapis.com/google.cloud.vision.v1.AnnotateImageResponse"
2591 }
2592}
2593
2594#[derive(Clone, Default, PartialEq)]
2596#[non_exhaustive]
2597pub struct BatchAnnotateImagesRequest {
2598 pub requests: std::vec::Vec<crate::model::AnnotateImageRequest>,
2600
2601 pub parent: std::string::String,
2614
2615 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2622
2623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2624}
2625
2626impl BatchAnnotateImagesRequest {
2627 pub fn new() -> Self {
2628 std::default::Default::default()
2629 }
2630
2631 pub fn set_requests<T, V>(mut self, v: T) -> Self
2633 where
2634 T: std::iter::IntoIterator<Item = V>,
2635 V: std::convert::Into<crate::model::AnnotateImageRequest>,
2636 {
2637 use std::iter::Iterator;
2638 self.requests = v.into_iter().map(|i| i.into()).collect();
2639 self
2640 }
2641
2642 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2644 self.parent = v.into();
2645 self
2646 }
2647
2648 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2650 where
2651 T: std::iter::IntoIterator<Item = (K, V)>,
2652 K: std::convert::Into<std::string::String>,
2653 V: std::convert::Into<std::string::String>,
2654 {
2655 use std::iter::Iterator;
2656 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2657 self
2658 }
2659}
2660
2661impl wkt::message::Message for BatchAnnotateImagesRequest {
2662 fn typename() -> &'static str {
2663 "type.googleapis.com/google.cloud.vision.v1.BatchAnnotateImagesRequest"
2664 }
2665}
2666
2667#[derive(Clone, Default, PartialEq)]
2669#[non_exhaustive]
2670pub struct BatchAnnotateImagesResponse {
2671 pub responses: std::vec::Vec<crate::model::AnnotateImageResponse>,
2673
2674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2675}
2676
2677impl BatchAnnotateImagesResponse {
2678 pub fn new() -> Self {
2679 std::default::Default::default()
2680 }
2681
2682 pub fn set_responses<T, V>(mut self, v: T) -> Self
2684 where
2685 T: std::iter::IntoIterator<Item = V>,
2686 V: std::convert::Into<crate::model::AnnotateImageResponse>,
2687 {
2688 use std::iter::Iterator;
2689 self.responses = v.into_iter().map(|i| i.into()).collect();
2690 self
2691 }
2692}
2693
2694impl wkt::message::Message for BatchAnnotateImagesResponse {
2695 fn typename() -> &'static str {
2696 "type.googleapis.com/google.cloud.vision.v1.BatchAnnotateImagesResponse"
2697 }
2698}
2699
2700#[derive(Clone, Default, PartialEq)]
2702#[non_exhaustive]
2703pub struct AnnotateFileRequest {
2704 pub input_config: std::option::Option<crate::model::InputConfig>,
2706
2707 pub features: std::vec::Vec<crate::model::Feature>,
2709
2710 pub image_context: std::option::Option<crate::model::ImageContext>,
2712
2713 pub pages: std::vec::Vec<i32>,
2728
2729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2730}
2731
2732impl AnnotateFileRequest {
2733 pub fn new() -> Self {
2734 std::default::Default::default()
2735 }
2736
2737 pub fn set_input_config<T>(mut self, v: T) -> Self
2739 where
2740 T: std::convert::Into<crate::model::InputConfig>,
2741 {
2742 self.input_config = std::option::Option::Some(v.into());
2743 self
2744 }
2745
2746 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
2748 where
2749 T: std::convert::Into<crate::model::InputConfig>,
2750 {
2751 self.input_config = v.map(|x| x.into());
2752 self
2753 }
2754
2755 pub fn set_features<T, V>(mut self, v: T) -> Self
2757 where
2758 T: std::iter::IntoIterator<Item = V>,
2759 V: std::convert::Into<crate::model::Feature>,
2760 {
2761 use std::iter::Iterator;
2762 self.features = v.into_iter().map(|i| i.into()).collect();
2763 self
2764 }
2765
2766 pub fn set_image_context<T>(mut self, v: T) -> Self
2768 where
2769 T: std::convert::Into<crate::model::ImageContext>,
2770 {
2771 self.image_context = std::option::Option::Some(v.into());
2772 self
2773 }
2774
2775 pub fn set_or_clear_image_context<T>(mut self, v: std::option::Option<T>) -> Self
2777 where
2778 T: std::convert::Into<crate::model::ImageContext>,
2779 {
2780 self.image_context = v.map(|x| x.into());
2781 self
2782 }
2783
2784 pub fn set_pages<T, V>(mut self, v: T) -> Self
2786 where
2787 T: std::iter::IntoIterator<Item = V>,
2788 V: std::convert::Into<i32>,
2789 {
2790 use std::iter::Iterator;
2791 self.pages = v.into_iter().map(|i| i.into()).collect();
2792 self
2793 }
2794}
2795
2796impl wkt::message::Message for AnnotateFileRequest {
2797 fn typename() -> &'static str {
2798 "type.googleapis.com/google.cloud.vision.v1.AnnotateFileRequest"
2799 }
2800}
2801
2802#[derive(Clone, Default, PartialEq)]
2805#[non_exhaustive]
2806pub struct AnnotateFileResponse {
2807 pub input_config: std::option::Option<crate::model::InputConfig>,
2809
2810 pub responses: std::vec::Vec<crate::model::AnnotateImageResponse>,
2813
2814 pub total_pages: i32,
2816
2817 pub error: std::option::Option<rpc::model::Status>,
2820
2821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2822}
2823
2824impl AnnotateFileResponse {
2825 pub fn new() -> Self {
2826 std::default::Default::default()
2827 }
2828
2829 pub fn set_input_config<T>(mut self, v: T) -> Self
2831 where
2832 T: std::convert::Into<crate::model::InputConfig>,
2833 {
2834 self.input_config = std::option::Option::Some(v.into());
2835 self
2836 }
2837
2838 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
2840 where
2841 T: std::convert::Into<crate::model::InputConfig>,
2842 {
2843 self.input_config = v.map(|x| x.into());
2844 self
2845 }
2846
2847 pub fn set_responses<T, V>(mut self, v: T) -> Self
2849 where
2850 T: std::iter::IntoIterator<Item = V>,
2851 V: std::convert::Into<crate::model::AnnotateImageResponse>,
2852 {
2853 use std::iter::Iterator;
2854 self.responses = v.into_iter().map(|i| i.into()).collect();
2855 self
2856 }
2857
2858 pub fn set_total_pages<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2860 self.total_pages = v.into();
2861 self
2862 }
2863
2864 pub fn set_error<T>(mut self, v: T) -> Self
2866 where
2867 T: std::convert::Into<rpc::model::Status>,
2868 {
2869 self.error = std::option::Option::Some(v.into());
2870 self
2871 }
2872
2873 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2875 where
2876 T: std::convert::Into<rpc::model::Status>,
2877 {
2878 self.error = v.map(|x| x.into());
2879 self
2880 }
2881}
2882
2883impl wkt::message::Message for AnnotateFileResponse {
2884 fn typename() -> &'static str {
2885 "type.googleapis.com/google.cloud.vision.v1.AnnotateFileResponse"
2886 }
2887}
2888
2889#[derive(Clone, Default, PartialEq)]
2891#[non_exhaustive]
2892pub struct BatchAnnotateFilesRequest {
2893 pub requests: std::vec::Vec<crate::model::AnnotateFileRequest>,
2896
2897 pub parent: std::string::String,
2910
2911 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2918
2919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2920}
2921
2922impl BatchAnnotateFilesRequest {
2923 pub fn new() -> Self {
2924 std::default::Default::default()
2925 }
2926
2927 pub fn set_requests<T, V>(mut self, v: T) -> Self
2929 where
2930 T: std::iter::IntoIterator<Item = V>,
2931 V: std::convert::Into<crate::model::AnnotateFileRequest>,
2932 {
2933 use std::iter::Iterator;
2934 self.requests = v.into_iter().map(|i| i.into()).collect();
2935 self
2936 }
2937
2938 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2940 self.parent = v.into();
2941 self
2942 }
2943
2944 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2946 where
2947 T: std::iter::IntoIterator<Item = (K, V)>,
2948 K: std::convert::Into<std::string::String>,
2949 V: std::convert::Into<std::string::String>,
2950 {
2951 use std::iter::Iterator;
2952 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2953 self
2954 }
2955}
2956
2957impl wkt::message::Message for BatchAnnotateFilesRequest {
2958 fn typename() -> &'static str {
2959 "type.googleapis.com/google.cloud.vision.v1.BatchAnnotateFilesRequest"
2960 }
2961}
2962
2963#[derive(Clone, Default, PartialEq)]
2965#[non_exhaustive]
2966pub struct BatchAnnotateFilesResponse {
2967 pub responses: std::vec::Vec<crate::model::AnnotateFileResponse>,
2970
2971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2972}
2973
2974impl BatchAnnotateFilesResponse {
2975 pub fn new() -> Self {
2976 std::default::Default::default()
2977 }
2978
2979 pub fn set_responses<T, V>(mut self, v: T) -> Self
2981 where
2982 T: std::iter::IntoIterator<Item = V>,
2983 V: std::convert::Into<crate::model::AnnotateFileResponse>,
2984 {
2985 use std::iter::Iterator;
2986 self.responses = v.into_iter().map(|i| i.into()).collect();
2987 self
2988 }
2989}
2990
2991impl wkt::message::Message for BatchAnnotateFilesResponse {
2992 fn typename() -> &'static str {
2993 "type.googleapis.com/google.cloud.vision.v1.BatchAnnotateFilesResponse"
2994 }
2995}
2996
2997#[derive(Clone, Default, PartialEq)]
2999#[non_exhaustive]
3000pub struct AsyncAnnotateFileRequest {
3001 pub input_config: std::option::Option<crate::model::InputConfig>,
3003
3004 pub features: std::vec::Vec<crate::model::Feature>,
3006
3007 pub image_context: std::option::Option<crate::model::ImageContext>,
3009
3010 pub output_config: std::option::Option<crate::model::OutputConfig>,
3012
3013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3014}
3015
3016impl AsyncAnnotateFileRequest {
3017 pub fn new() -> Self {
3018 std::default::Default::default()
3019 }
3020
3021 pub fn set_input_config<T>(mut self, v: T) -> Self
3023 where
3024 T: std::convert::Into<crate::model::InputConfig>,
3025 {
3026 self.input_config = std::option::Option::Some(v.into());
3027 self
3028 }
3029
3030 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
3032 where
3033 T: std::convert::Into<crate::model::InputConfig>,
3034 {
3035 self.input_config = v.map(|x| x.into());
3036 self
3037 }
3038
3039 pub fn set_features<T, V>(mut self, v: T) -> Self
3041 where
3042 T: std::iter::IntoIterator<Item = V>,
3043 V: std::convert::Into<crate::model::Feature>,
3044 {
3045 use std::iter::Iterator;
3046 self.features = v.into_iter().map(|i| i.into()).collect();
3047 self
3048 }
3049
3050 pub fn set_image_context<T>(mut self, v: T) -> Self
3052 where
3053 T: std::convert::Into<crate::model::ImageContext>,
3054 {
3055 self.image_context = std::option::Option::Some(v.into());
3056 self
3057 }
3058
3059 pub fn set_or_clear_image_context<T>(mut self, v: std::option::Option<T>) -> Self
3061 where
3062 T: std::convert::Into<crate::model::ImageContext>,
3063 {
3064 self.image_context = v.map(|x| x.into());
3065 self
3066 }
3067
3068 pub fn set_output_config<T>(mut self, v: T) -> Self
3070 where
3071 T: std::convert::Into<crate::model::OutputConfig>,
3072 {
3073 self.output_config = std::option::Option::Some(v.into());
3074 self
3075 }
3076
3077 pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
3079 where
3080 T: std::convert::Into<crate::model::OutputConfig>,
3081 {
3082 self.output_config = v.map(|x| x.into());
3083 self
3084 }
3085}
3086
3087impl wkt::message::Message for AsyncAnnotateFileRequest {
3088 fn typename() -> &'static str {
3089 "type.googleapis.com/google.cloud.vision.v1.AsyncAnnotateFileRequest"
3090 }
3091}
3092
3093#[derive(Clone, Default, PartialEq)]
3095#[non_exhaustive]
3096pub struct AsyncAnnotateFileResponse {
3097 pub output_config: std::option::Option<crate::model::OutputConfig>,
3099
3100 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3101}
3102
3103impl AsyncAnnotateFileResponse {
3104 pub fn new() -> Self {
3105 std::default::Default::default()
3106 }
3107
3108 pub fn set_output_config<T>(mut self, v: T) -> Self
3110 where
3111 T: std::convert::Into<crate::model::OutputConfig>,
3112 {
3113 self.output_config = std::option::Option::Some(v.into());
3114 self
3115 }
3116
3117 pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
3119 where
3120 T: std::convert::Into<crate::model::OutputConfig>,
3121 {
3122 self.output_config = v.map(|x| x.into());
3123 self
3124 }
3125}
3126
3127impl wkt::message::Message for AsyncAnnotateFileResponse {
3128 fn typename() -> &'static str {
3129 "type.googleapis.com/google.cloud.vision.v1.AsyncAnnotateFileResponse"
3130 }
3131}
3132
3133#[derive(Clone, Default, PartialEq)]
3135#[non_exhaustive]
3136pub struct AsyncBatchAnnotateImagesRequest {
3137 pub requests: std::vec::Vec<crate::model::AnnotateImageRequest>,
3139
3140 pub output_config: std::option::Option<crate::model::OutputConfig>,
3142
3143 pub parent: std::string::String,
3156
3157 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3164
3165 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3166}
3167
3168impl AsyncBatchAnnotateImagesRequest {
3169 pub fn new() -> Self {
3170 std::default::Default::default()
3171 }
3172
3173 pub fn set_requests<T, V>(mut self, v: T) -> Self
3175 where
3176 T: std::iter::IntoIterator<Item = V>,
3177 V: std::convert::Into<crate::model::AnnotateImageRequest>,
3178 {
3179 use std::iter::Iterator;
3180 self.requests = v.into_iter().map(|i| i.into()).collect();
3181 self
3182 }
3183
3184 pub fn set_output_config<T>(mut self, v: T) -> Self
3186 where
3187 T: std::convert::Into<crate::model::OutputConfig>,
3188 {
3189 self.output_config = std::option::Option::Some(v.into());
3190 self
3191 }
3192
3193 pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
3195 where
3196 T: std::convert::Into<crate::model::OutputConfig>,
3197 {
3198 self.output_config = v.map(|x| x.into());
3199 self
3200 }
3201
3202 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3204 self.parent = v.into();
3205 self
3206 }
3207
3208 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3210 where
3211 T: std::iter::IntoIterator<Item = (K, V)>,
3212 K: std::convert::Into<std::string::String>,
3213 V: std::convert::Into<std::string::String>,
3214 {
3215 use std::iter::Iterator;
3216 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3217 self
3218 }
3219}
3220
3221impl wkt::message::Message for AsyncBatchAnnotateImagesRequest {
3222 fn typename() -> &'static str {
3223 "type.googleapis.com/google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest"
3224 }
3225}
3226
3227#[derive(Clone, Default, PartialEq)]
3229#[non_exhaustive]
3230pub struct AsyncBatchAnnotateImagesResponse {
3231 pub output_config: std::option::Option<crate::model::OutputConfig>,
3233
3234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3235}
3236
3237impl AsyncBatchAnnotateImagesResponse {
3238 pub fn new() -> Self {
3239 std::default::Default::default()
3240 }
3241
3242 pub fn set_output_config<T>(mut self, v: T) -> Self
3244 where
3245 T: std::convert::Into<crate::model::OutputConfig>,
3246 {
3247 self.output_config = std::option::Option::Some(v.into());
3248 self
3249 }
3250
3251 pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
3253 where
3254 T: std::convert::Into<crate::model::OutputConfig>,
3255 {
3256 self.output_config = v.map(|x| x.into());
3257 self
3258 }
3259}
3260
3261impl wkt::message::Message for AsyncBatchAnnotateImagesResponse {
3262 fn typename() -> &'static str {
3263 "type.googleapis.com/google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse"
3264 }
3265}
3266
3267#[derive(Clone, Default, PartialEq)]
3270#[non_exhaustive]
3271pub struct AsyncBatchAnnotateFilesRequest {
3272 pub requests: std::vec::Vec<crate::model::AsyncAnnotateFileRequest>,
3274
3275 pub parent: std::string::String,
3288
3289 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3296
3297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3298}
3299
3300impl AsyncBatchAnnotateFilesRequest {
3301 pub fn new() -> Self {
3302 std::default::Default::default()
3303 }
3304
3305 pub fn set_requests<T, V>(mut self, v: T) -> Self
3307 where
3308 T: std::iter::IntoIterator<Item = V>,
3309 V: std::convert::Into<crate::model::AsyncAnnotateFileRequest>,
3310 {
3311 use std::iter::Iterator;
3312 self.requests = v.into_iter().map(|i| i.into()).collect();
3313 self
3314 }
3315
3316 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3318 self.parent = v.into();
3319 self
3320 }
3321
3322 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3324 where
3325 T: std::iter::IntoIterator<Item = (K, V)>,
3326 K: std::convert::Into<std::string::String>,
3327 V: std::convert::Into<std::string::String>,
3328 {
3329 use std::iter::Iterator;
3330 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3331 self
3332 }
3333}
3334
3335impl wkt::message::Message for AsyncBatchAnnotateFilesRequest {
3336 fn typename() -> &'static str {
3337 "type.googleapis.com/google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest"
3338 }
3339}
3340
3341#[derive(Clone, Default, PartialEq)]
3343#[non_exhaustive]
3344pub struct AsyncBatchAnnotateFilesResponse {
3345 pub responses: std::vec::Vec<crate::model::AsyncAnnotateFileResponse>,
3348
3349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3350}
3351
3352impl AsyncBatchAnnotateFilesResponse {
3353 pub fn new() -> Self {
3354 std::default::Default::default()
3355 }
3356
3357 pub fn set_responses<T, V>(mut self, v: T) -> Self
3359 where
3360 T: std::iter::IntoIterator<Item = V>,
3361 V: std::convert::Into<crate::model::AsyncAnnotateFileResponse>,
3362 {
3363 use std::iter::Iterator;
3364 self.responses = v.into_iter().map(|i| i.into()).collect();
3365 self
3366 }
3367}
3368
3369impl wkt::message::Message for AsyncBatchAnnotateFilesResponse {
3370 fn typename() -> &'static str {
3371 "type.googleapis.com/google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse"
3372 }
3373}
3374
3375#[derive(Clone, Default, PartialEq)]
3377#[non_exhaustive]
3378pub struct InputConfig {
3379 pub gcs_source: std::option::Option<crate::model::GcsSource>,
3381
3382 pub content: ::bytes::Bytes,
3389
3390 pub mime_type: std::string::String,
3393
3394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3395}
3396
3397impl InputConfig {
3398 pub fn new() -> Self {
3399 std::default::Default::default()
3400 }
3401
3402 pub fn set_gcs_source<T>(mut self, v: T) -> Self
3404 where
3405 T: std::convert::Into<crate::model::GcsSource>,
3406 {
3407 self.gcs_source = std::option::Option::Some(v.into());
3408 self
3409 }
3410
3411 pub fn set_or_clear_gcs_source<T>(mut self, v: std::option::Option<T>) -> Self
3413 where
3414 T: std::convert::Into<crate::model::GcsSource>,
3415 {
3416 self.gcs_source = v.map(|x| x.into());
3417 self
3418 }
3419
3420 pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
3422 self.content = v.into();
3423 self
3424 }
3425
3426 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3428 self.mime_type = v.into();
3429 self
3430 }
3431}
3432
3433impl wkt::message::Message for InputConfig {
3434 fn typename() -> &'static str {
3435 "type.googleapis.com/google.cloud.vision.v1.InputConfig"
3436 }
3437}
3438
3439#[derive(Clone, Default, PartialEq)]
3441#[non_exhaustive]
3442pub struct OutputConfig {
3443 pub gcs_destination: std::option::Option<crate::model::GcsDestination>,
3445
3446 pub batch_size: i32,
3458
3459 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3460}
3461
3462impl OutputConfig {
3463 pub fn new() -> Self {
3464 std::default::Default::default()
3465 }
3466
3467 pub fn set_gcs_destination<T>(mut self, v: T) -> Self
3469 where
3470 T: std::convert::Into<crate::model::GcsDestination>,
3471 {
3472 self.gcs_destination = std::option::Option::Some(v.into());
3473 self
3474 }
3475
3476 pub fn set_or_clear_gcs_destination<T>(mut self, v: std::option::Option<T>) -> Self
3478 where
3479 T: std::convert::Into<crate::model::GcsDestination>,
3480 {
3481 self.gcs_destination = v.map(|x| x.into());
3482 self
3483 }
3484
3485 pub fn set_batch_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3487 self.batch_size = v.into();
3488 self
3489 }
3490}
3491
3492impl wkt::message::Message for OutputConfig {
3493 fn typename() -> &'static str {
3494 "type.googleapis.com/google.cloud.vision.v1.OutputConfig"
3495 }
3496}
3497
3498#[derive(Clone, Default, PartialEq)]
3500#[non_exhaustive]
3501pub struct GcsSource {
3502 pub uri: std::string::String,
3505
3506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3507}
3508
3509impl GcsSource {
3510 pub fn new() -> Self {
3511 std::default::Default::default()
3512 }
3513
3514 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3516 self.uri = v.into();
3517 self
3518 }
3519}
3520
3521impl wkt::message::Message for GcsSource {
3522 fn typename() -> &'static str {
3523 "type.googleapis.com/google.cloud.vision.v1.GcsSource"
3524 }
3525}
3526
3527#[derive(Clone, Default, PartialEq)]
3529#[non_exhaustive]
3530pub struct GcsDestination {
3531 pub uri: std::string::String,
3555
3556 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3557}
3558
3559impl GcsDestination {
3560 pub fn new() -> Self {
3561 std::default::Default::default()
3562 }
3563
3564 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3566 self.uri = v.into();
3567 self
3568 }
3569}
3570
3571impl wkt::message::Message for GcsDestination {
3572 fn typename() -> &'static str {
3573 "type.googleapis.com/google.cloud.vision.v1.GcsDestination"
3574 }
3575}
3576
3577#[derive(Clone, Default, PartialEq)]
3579#[non_exhaustive]
3580pub struct OperationMetadata {
3581 pub state: crate::model::operation_metadata::State,
3583
3584 pub create_time: std::option::Option<wkt::Timestamp>,
3586
3587 pub update_time: std::option::Option<wkt::Timestamp>,
3589
3590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3591}
3592
3593impl OperationMetadata {
3594 pub fn new() -> Self {
3595 std::default::Default::default()
3596 }
3597
3598 pub fn set_state<T: std::convert::Into<crate::model::operation_metadata::State>>(
3600 mut self,
3601 v: T,
3602 ) -> Self {
3603 self.state = v.into();
3604 self
3605 }
3606
3607 pub fn set_create_time<T>(mut self, v: T) -> Self
3609 where
3610 T: std::convert::Into<wkt::Timestamp>,
3611 {
3612 self.create_time = std::option::Option::Some(v.into());
3613 self
3614 }
3615
3616 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3618 where
3619 T: std::convert::Into<wkt::Timestamp>,
3620 {
3621 self.create_time = v.map(|x| x.into());
3622 self
3623 }
3624
3625 pub fn set_update_time<T>(mut self, v: T) -> Self
3627 where
3628 T: std::convert::Into<wkt::Timestamp>,
3629 {
3630 self.update_time = std::option::Option::Some(v.into());
3631 self
3632 }
3633
3634 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3636 where
3637 T: std::convert::Into<wkt::Timestamp>,
3638 {
3639 self.update_time = v.map(|x| x.into());
3640 self
3641 }
3642}
3643
3644impl wkt::message::Message for OperationMetadata {
3645 fn typename() -> &'static str {
3646 "type.googleapis.com/google.cloud.vision.v1.OperationMetadata"
3647 }
3648}
3649
3650pub mod operation_metadata {
3652 #[allow(unused_imports)]
3653 use super::*;
3654
3655 #[derive(Clone, Debug, PartialEq)]
3671 #[non_exhaustive]
3672 pub enum State {
3673 Unspecified,
3675 Created,
3677 Running,
3679 Done,
3681 Cancelled,
3683 UnknownValue(state::UnknownValue),
3688 }
3689
3690 #[doc(hidden)]
3691 pub mod state {
3692 #[allow(unused_imports)]
3693 use super::*;
3694 #[derive(Clone, Debug, PartialEq)]
3695 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3696 }
3697
3698 impl State {
3699 pub fn value(&self) -> std::option::Option<i32> {
3704 match self {
3705 Self::Unspecified => std::option::Option::Some(0),
3706 Self::Created => std::option::Option::Some(1),
3707 Self::Running => std::option::Option::Some(2),
3708 Self::Done => std::option::Option::Some(3),
3709 Self::Cancelled => std::option::Option::Some(4),
3710 Self::UnknownValue(u) => u.0.value(),
3711 }
3712 }
3713
3714 pub fn name(&self) -> std::option::Option<&str> {
3719 match self {
3720 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3721 Self::Created => std::option::Option::Some("CREATED"),
3722 Self::Running => std::option::Option::Some("RUNNING"),
3723 Self::Done => std::option::Option::Some("DONE"),
3724 Self::Cancelled => std::option::Option::Some("CANCELLED"),
3725 Self::UnknownValue(u) => u.0.name(),
3726 }
3727 }
3728 }
3729
3730 impl std::default::Default for State {
3731 fn default() -> Self {
3732 use std::convert::From;
3733 Self::from(0)
3734 }
3735 }
3736
3737 impl std::fmt::Display for State {
3738 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3739 wkt::internal::display_enum(f, self.name(), self.value())
3740 }
3741 }
3742
3743 impl std::convert::From<i32> for State {
3744 fn from(value: i32) -> Self {
3745 match value {
3746 0 => Self::Unspecified,
3747 1 => Self::Created,
3748 2 => Self::Running,
3749 3 => Self::Done,
3750 4 => Self::Cancelled,
3751 _ => Self::UnknownValue(state::UnknownValue(
3752 wkt::internal::UnknownEnumValue::Integer(value),
3753 )),
3754 }
3755 }
3756 }
3757
3758 impl std::convert::From<&str> for State {
3759 fn from(value: &str) -> Self {
3760 use std::string::ToString;
3761 match value {
3762 "STATE_UNSPECIFIED" => Self::Unspecified,
3763 "CREATED" => Self::Created,
3764 "RUNNING" => Self::Running,
3765 "DONE" => Self::Done,
3766 "CANCELLED" => Self::Cancelled,
3767 _ => Self::UnknownValue(state::UnknownValue(
3768 wkt::internal::UnknownEnumValue::String(value.to_string()),
3769 )),
3770 }
3771 }
3772 }
3773
3774 impl serde::ser::Serialize for State {
3775 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3776 where
3777 S: serde::Serializer,
3778 {
3779 match self {
3780 Self::Unspecified => serializer.serialize_i32(0),
3781 Self::Created => serializer.serialize_i32(1),
3782 Self::Running => serializer.serialize_i32(2),
3783 Self::Done => serializer.serialize_i32(3),
3784 Self::Cancelled => serializer.serialize_i32(4),
3785 Self::UnknownValue(u) => u.0.serialize(serializer),
3786 }
3787 }
3788 }
3789
3790 impl<'de> serde::de::Deserialize<'de> for State {
3791 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3792 where
3793 D: serde::Deserializer<'de>,
3794 {
3795 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3796 ".google.cloud.vision.v1.OperationMetadata.State",
3797 ))
3798 }
3799 }
3800}
3801
3802#[derive(Clone, Default, PartialEq)]
3804#[non_exhaustive]
3805pub struct ProductSearchParams {
3806 pub bounding_poly: std::option::Option<crate::model::BoundingPoly>,
3809
3810 pub product_set: std::string::String,
3818
3819 pub product_categories: std::vec::Vec<std::string::String>,
3827
3828 pub filter: std::string::String,
3837
3838 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3839}
3840
3841impl ProductSearchParams {
3842 pub fn new() -> Self {
3843 std::default::Default::default()
3844 }
3845
3846 pub fn set_bounding_poly<T>(mut self, v: T) -> Self
3848 where
3849 T: std::convert::Into<crate::model::BoundingPoly>,
3850 {
3851 self.bounding_poly = std::option::Option::Some(v.into());
3852 self
3853 }
3854
3855 pub fn set_or_clear_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
3857 where
3858 T: std::convert::Into<crate::model::BoundingPoly>,
3859 {
3860 self.bounding_poly = v.map(|x| x.into());
3861 self
3862 }
3863
3864 pub fn set_product_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3866 self.product_set = v.into();
3867 self
3868 }
3869
3870 pub fn set_product_categories<T, V>(mut self, v: T) -> Self
3872 where
3873 T: std::iter::IntoIterator<Item = V>,
3874 V: std::convert::Into<std::string::String>,
3875 {
3876 use std::iter::Iterator;
3877 self.product_categories = v.into_iter().map(|i| i.into()).collect();
3878 self
3879 }
3880
3881 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3883 self.filter = v.into();
3884 self
3885 }
3886}
3887
3888impl wkt::message::Message for ProductSearchParams {
3889 fn typename() -> &'static str {
3890 "type.googleapis.com/google.cloud.vision.v1.ProductSearchParams"
3891 }
3892}
3893
3894#[derive(Clone, Default, PartialEq)]
3896#[non_exhaustive]
3897pub struct ProductSearchResults {
3898 pub index_time: std::option::Option<wkt::Timestamp>,
3902
3903 pub results: std::vec::Vec<crate::model::product_search_results::Result>,
3905
3906 pub product_grouped_results: std::vec::Vec<crate::model::product_search_results::GroupedResult>,
3911
3912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3913}
3914
3915impl ProductSearchResults {
3916 pub fn new() -> Self {
3917 std::default::Default::default()
3918 }
3919
3920 pub fn set_index_time<T>(mut self, v: T) -> Self
3922 where
3923 T: std::convert::Into<wkt::Timestamp>,
3924 {
3925 self.index_time = std::option::Option::Some(v.into());
3926 self
3927 }
3928
3929 pub fn set_or_clear_index_time<T>(mut self, v: std::option::Option<T>) -> Self
3931 where
3932 T: std::convert::Into<wkt::Timestamp>,
3933 {
3934 self.index_time = v.map(|x| x.into());
3935 self
3936 }
3937
3938 pub fn set_results<T, V>(mut self, v: T) -> Self
3940 where
3941 T: std::iter::IntoIterator<Item = V>,
3942 V: std::convert::Into<crate::model::product_search_results::Result>,
3943 {
3944 use std::iter::Iterator;
3945 self.results = v.into_iter().map(|i| i.into()).collect();
3946 self
3947 }
3948
3949 pub fn set_product_grouped_results<T, V>(mut self, v: T) -> Self
3951 where
3952 T: std::iter::IntoIterator<Item = V>,
3953 V: std::convert::Into<crate::model::product_search_results::GroupedResult>,
3954 {
3955 use std::iter::Iterator;
3956 self.product_grouped_results = v.into_iter().map(|i| i.into()).collect();
3957 self
3958 }
3959}
3960
3961impl wkt::message::Message for ProductSearchResults {
3962 fn typename() -> &'static str {
3963 "type.googleapis.com/google.cloud.vision.v1.ProductSearchResults"
3964 }
3965}
3966
3967pub mod product_search_results {
3969 #[allow(unused_imports)]
3970 use super::*;
3971
3972 #[derive(Clone, Default, PartialEq)]
3974 #[non_exhaustive]
3975 pub struct Result {
3976 pub product: std::option::Option<crate::model::Product>,
3978
3979 pub score: f32,
3982
3983 pub image: std::string::String,
3986
3987 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3988 }
3989
3990 impl Result {
3991 pub fn new() -> Self {
3992 std::default::Default::default()
3993 }
3994
3995 pub fn set_product<T>(mut self, v: T) -> Self
3997 where
3998 T: std::convert::Into<crate::model::Product>,
3999 {
4000 self.product = std::option::Option::Some(v.into());
4001 self
4002 }
4003
4004 pub fn set_or_clear_product<T>(mut self, v: std::option::Option<T>) -> Self
4006 where
4007 T: std::convert::Into<crate::model::Product>,
4008 {
4009 self.product = v.map(|x| x.into());
4010 self
4011 }
4012
4013 pub fn set_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
4015 self.score = v.into();
4016 self
4017 }
4018
4019 pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4021 self.image = v.into();
4022 self
4023 }
4024 }
4025
4026 impl wkt::message::Message for Result {
4027 fn typename() -> &'static str {
4028 "type.googleapis.com/google.cloud.vision.v1.ProductSearchResults.Result"
4029 }
4030 }
4031
4032 #[derive(Clone, Default, PartialEq)]
4034 #[non_exhaustive]
4035 pub struct ObjectAnnotation {
4036 pub mid: std::string::String,
4038
4039 pub language_code: std::string::String,
4043
4044 pub name: std::string::String,
4046
4047 pub score: f32,
4049
4050 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4051 }
4052
4053 impl ObjectAnnotation {
4054 pub fn new() -> Self {
4055 std::default::Default::default()
4056 }
4057
4058 pub fn set_mid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4060 self.mid = v.into();
4061 self
4062 }
4063
4064 pub fn set_language_code<T: std::convert::Into<std::string::String>>(
4066 mut self,
4067 v: T,
4068 ) -> Self {
4069 self.language_code = v.into();
4070 self
4071 }
4072
4073 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4075 self.name = v.into();
4076 self
4077 }
4078
4079 pub fn set_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
4081 self.score = v.into();
4082 self
4083 }
4084 }
4085
4086 impl wkt::message::Message for ObjectAnnotation {
4087 fn typename() -> &'static str {
4088 "type.googleapis.com/google.cloud.vision.v1.ProductSearchResults.ObjectAnnotation"
4089 }
4090 }
4091
4092 #[derive(Clone, Default, PartialEq)]
4095 #[non_exhaustive]
4096 pub struct GroupedResult {
4097 pub bounding_poly: std::option::Option<crate::model::BoundingPoly>,
4099
4100 pub results: std::vec::Vec<crate::model::product_search_results::Result>,
4102
4103 pub object_annotations:
4105 std::vec::Vec<crate::model::product_search_results::ObjectAnnotation>,
4106
4107 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4108 }
4109
4110 impl GroupedResult {
4111 pub fn new() -> Self {
4112 std::default::Default::default()
4113 }
4114
4115 pub fn set_bounding_poly<T>(mut self, v: T) -> Self
4117 where
4118 T: std::convert::Into<crate::model::BoundingPoly>,
4119 {
4120 self.bounding_poly = std::option::Option::Some(v.into());
4121 self
4122 }
4123
4124 pub fn set_or_clear_bounding_poly<T>(mut self, v: std::option::Option<T>) -> Self
4126 where
4127 T: std::convert::Into<crate::model::BoundingPoly>,
4128 {
4129 self.bounding_poly = v.map(|x| x.into());
4130 self
4131 }
4132
4133 pub fn set_results<T, V>(mut self, v: T) -> Self
4135 where
4136 T: std::iter::IntoIterator<Item = V>,
4137 V: std::convert::Into<crate::model::product_search_results::Result>,
4138 {
4139 use std::iter::Iterator;
4140 self.results = v.into_iter().map(|i| i.into()).collect();
4141 self
4142 }
4143
4144 pub fn set_object_annotations<T, V>(mut self, v: T) -> Self
4146 where
4147 T: std::iter::IntoIterator<Item = V>,
4148 V: std::convert::Into<crate::model::product_search_results::ObjectAnnotation>,
4149 {
4150 use std::iter::Iterator;
4151 self.object_annotations = v.into_iter().map(|i| i.into()).collect();
4152 self
4153 }
4154 }
4155
4156 impl wkt::message::Message for GroupedResult {
4157 fn typename() -> &'static str {
4158 "type.googleapis.com/google.cloud.vision.v1.ProductSearchResults.GroupedResult"
4159 }
4160 }
4161}
4162
4163#[derive(Clone, Default, PartialEq)]
4165#[non_exhaustive]
4166pub struct Product {
4167 pub name: std::string::String,
4174
4175 pub display_name: std::string::String,
4178
4179 pub description: std::string::String,
4182
4183 pub product_category: std::string::String,
4189
4190 pub product_labels: std::vec::Vec<crate::model::product::KeyValue>,
4204
4205 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4206}
4207
4208impl Product {
4209 pub fn new() -> Self {
4210 std::default::Default::default()
4211 }
4212
4213 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4215 self.name = v.into();
4216 self
4217 }
4218
4219 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4221 self.display_name = v.into();
4222 self
4223 }
4224
4225 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4227 self.description = v.into();
4228 self
4229 }
4230
4231 pub fn set_product_category<T: std::convert::Into<std::string::String>>(
4233 mut self,
4234 v: T,
4235 ) -> Self {
4236 self.product_category = v.into();
4237 self
4238 }
4239
4240 pub fn set_product_labels<T, V>(mut self, v: T) -> Self
4242 where
4243 T: std::iter::IntoIterator<Item = V>,
4244 V: std::convert::Into<crate::model::product::KeyValue>,
4245 {
4246 use std::iter::Iterator;
4247 self.product_labels = v.into_iter().map(|i| i.into()).collect();
4248 self
4249 }
4250}
4251
4252impl wkt::message::Message for Product {
4253 fn typename() -> &'static str {
4254 "type.googleapis.com/google.cloud.vision.v1.Product"
4255 }
4256}
4257
4258pub mod product {
4260 #[allow(unused_imports)]
4261 use super::*;
4262
4263 #[derive(Clone, Default, PartialEq)]
4265 #[non_exhaustive]
4266 pub struct KeyValue {
4267 pub key: std::string::String,
4270
4271 pub value: std::string::String,
4274
4275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4276 }
4277
4278 impl KeyValue {
4279 pub fn new() -> Self {
4280 std::default::Default::default()
4281 }
4282
4283 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4285 self.key = v.into();
4286 self
4287 }
4288
4289 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4291 self.value = v.into();
4292 self
4293 }
4294 }
4295
4296 impl wkt::message::Message for KeyValue {
4297 fn typename() -> &'static str {
4298 "type.googleapis.com/google.cloud.vision.v1.Product.KeyValue"
4299 }
4300 }
4301}
4302
4303#[derive(Clone, Default, PartialEq)]
4307#[non_exhaustive]
4308pub struct ProductSet {
4309 pub name: std::string::String,
4316
4317 pub display_name: std::string::String,
4320
4321 pub index_time: std::option::Option<wkt::Timestamp>,
4328
4329 pub index_error: std::option::Option<rpc::model::Status>,
4334
4335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4336}
4337
4338impl ProductSet {
4339 pub fn new() -> Self {
4340 std::default::Default::default()
4341 }
4342
4343 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4345 self.name = v.into();
4346 self
4347 }
4348
4349 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4351 self.display_name = v.into();
4352 self
4353 }
4354
4355 pub fn set_index_time<T>(mut self, v: T) -> Self
4357 where
4358 T: std::convert::Into<wkt::Timestamp>,
4359 {
4360 self.index_time = std::option::Option::Some(v.into());
4361 self
4362 }
4363
4364 pub fn set_or_clear_index_time<T>(mut self, v: std::option::Option<T>) -> Self
4366 where
4367 T: std::convert::Into<wkt::Timestamp>,
4368 {
4369 self.index_time = v.map(|x| x.into());
4370 self
4371 }
4372
4373 pub fn set_index_error<T>(mut self, v: T) -> Self
4375 where
4376 T: std::convert::Into<rpc::model::Status>,
4377 {
4378 self.index_error = std::option::Option::Some(v.into());
4379 self
4380 }
4381
4382 pub fn set_or_clear_index_error<T>(mut self, v: std::option::Option<T>) -> Self
4384 where
4385 T: std::convert::Into<rpc::model::Status>,
4386 {
4387 self.index_error = v.map(|x| x.into());
4388 self
4389 }
4390}
4391
4392impl wkt::message::Message for ProductSet {
4393 fn typename() -> &'static str {
4394 "type.googleapis.com/google.cloud.vision.v1.ProductSet"
4395 }
4396}
4397
4398#[derive(Clone, Default, PartialEq)]
4401#[non_exhaustive]
4402pub struct ReferenceImage {
4403 pub name: std::string::String,
4410
4411 pub uri: std::string::String,
4415
4416 pub bounding_polys: std::vec::Vec<crate::model::BoundingPoly>,
4425
4426 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4427}
4428
4429impl ReferenceImage {
4430 pub fn new() -> Self {
4431 std::default::Default::default()
4432 }
4433
4434 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4436 self.name = v.into();
4437 self
4438 }
4439
4440 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4442 self.uri = v.into();
4443 self
4444 }
4445
4446 pub fn set_bounding_polys<T, V>(mut self, v: T) -> Self
4448 where
4449 T: std::iter::IntoIterator<Item = V>,
4450 V: std::convert::Into<crate::model::BoundingPoly>,
4451 {
4452 use std::iter::Iterator;
4453 self.bounding_polys = v.into_iter().map(|i| i.into()).collect();
4454 self
4455 }
4456}
4457
4458impl wkt::message::Message for ReferenceImage {
4459 fn typename() -> &'static str {
4460 "type.googleapis.com/google.cloud.vision.v1.ReferenceImage"
4461 }
4462}
4463
4464#[derive(Clone, Default, PartialEq)]
4466#[non_exhaustive]
4467pub struct CreateProductRequest {
4468 pub parent: std::string::String,
4473
4474 pub product: std::option::Option<crate::model::Product>,
4476
4477 pub product_id: std::string::String,
4482
4483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4484}
4485
4486impl CreateProductRequest {
4487 pub fn new() -> Self {
4488 std::default::Default::default()
4489 }
4490
4491 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4493 self.parent = v.into();
4494 self
4495 }
4496
4497 pub fn set_product<T>(mut self, v: T) -> Self
4499 where
4500 T: std::convert::Into<crate::model::Product>,
4501 {
4502 self.product = std::option::Option::Some(v.into());
4503 self
4504 }
4505
4506 pub fn set_or_clear_product<T>(mut self, v: std::option::Option<T>) -> Self
4508 where
4509 T: std::convert::Into<crate::model::Product>,
4510 {
4511 self.product = v.map(|x| x.into());
4512 self
4513 }
4514
4515 pub fn set_product_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4517 self.product_id = v.into();
4518 self
4519 }
4520}
4521
4522impl wkt::message::Message for CreateProductRequest {
4523 fn typename() -> &'static str {
4524 "type.googleapis.com/google.cloud.vision.v1.CreateProductRequest"
4525 }
4526}
4527
4528#[derive(Clone, Default, PartialEq)]
4530#[non_exhaustive]
4531pub struct ListProductsRequest {
4532 pub parent: std::string::String,
4537
4538 pub page_size: i32,
4540
4541 pub page_token: std::string::String,
4543
4544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4545}
4546
4547impl ListProductsRequest {
4548 pub fn new() -> Self {
4549 std::default::Default::default()
4550 }
4551
4552 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4554 self.parent = v.into();
4555 self
4556 }
4557
4558 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4560 self.page_size = v.into();
4561 self
4562 }
4563
4564 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4566 self.page_token = v.into();
4567 self
4568 }
4569}
4570
4571impl wkt::message::Message for ListProductsRequest {
4572 fn typename() -> &'static str {
4573 "type.googleapis.com/google.cloud.vision.v1.ListProductsRequest"
4574 }
4575}
4576
4577#[derive(Clone, Default, PartialEq)]
4579#[non_exhaustive]
4580pub struct ListProductsResponse {
4581 pub products: std::vec::Vec<crate::model::Product>,
4583
4584 pub next_page_token: std::string::String,
4587
4588 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4589}
4590
4591impl ListProductsResponse {
4592 pub fn new() -> Self {
4593 std::default::Default::default()
4594 }
4595
4596 pub fn set_products<T, V>(mut self, v: T) -> Self
4598 where
4599 T: std::iter::IntoIterator<Item = V>,
4600 V: std::convert::Into<crate::model::Product>,
4601 {
4602 use std::iter::Iterator;
4603 self.products = v.into_iter().map(|i| i.into()).collect();
4604 self
4605 }
4606
4607 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4609 self.next_page_token = v.into();
4610 self
4611 }
4612}
4613
4614impl wkt::message::Message for ListProductsResponse {
4615 fn typename() -> &'static str {
4616 "type.googleapis.com/google.cloud.vision.v1.ListProductsResponse"
4617 }
4618}
4619
4620#[doc(hidden)]
4621impl gax::paginator::internal::PageableResponse for ListProductsResponse {
4622 type PageItem = crate::model::Product;
4623
4624 fn items(self) -> std::vec::Vec<Self::PageItem> {
4625 self.products
4626 }
4627
4628 fn next_page_token(&self) -> std::string::String {
4629 use std::clone::Clone;
4630 self.next_page_token.clone()
4631 }
4632}
4633
4634#[derive(Clone, Default, PartialEq)]
4636#[non_exhaustive]
4637pub struct GetProductRequest {
4638 pub name: std::string::String,
4643
4644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4645}
4646
4647impl GetProductRequest {
4648 pub fn new() -> Self {
4649 std::default::Default::default()
4650 }
4651
4652 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4654 self.name = v.into();
4655 self
4656 }
4657}
4658
4659impl wkt::message::Message for GetProductRequest {
4660 fn typename() -> &'static str {
4661 "type.googleapis.com/google.cloud.vision.v1.GetProductRequest"
4662 }
4663}
4664
4665#[derive(Clone, Default, PartialEq)]
4667#[non_exhaustive]
4668pub struct UpdateProductRequest {
4669 pub product: std::option::Option<crate::model::Product>,
4672
4673 pub update_mask: std::option::Option<wkt::FieldMask>,
4681
4682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4683}
4684
4685impl UpdateProductRequest {
4686 pub fn new() -> Self {
4687 std::default::Default::default()
4688 }
4689
4690 pub fn set_product<T>(mut self, v: T) -> Self
4692 where
4693 T: std::convert::Into<crate::model::Product>,
4694 {
4695 self.product = std::option::Option::Some(v.into());
4696 self
4697 }
4698
4699 pub fn set_or_clear_product<T>(mut self, v: std::option::Option<T>) -> Self
4701 where
4702 T: std::convert::Into<crate::model::Product>,
4703 {
4704 self.product = v.map(|x| x.into());
4705 self
4706 }
4707
4708 pub fn set_update_mask<T>(mut self, v: T) -> Self
4710 where
4711 T: std::convert::Into<wkt::FieldMask>,
4712 {
4713 self.update_mask = std::option::Option::Some(v.into());
4714 self
4715 }
4716
4717 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4719 where
4720 T: std::convert::Into<wkt::FieldMask>,
4721 {
4722 self.update_mask = v.map(|x| x.into());
4723 self
4724 }
4725}
4726
4727impl wkt::message::Message for UpdateProductRequest {
4728 fn typename() -> &'static str {
4729 "type.googleapis.com/google.cloud.vision.v1.UpdateProductRequest"
4730 }
4731}
4732
4733#[derive(Clone, Default, PartialEq)]
4735#[non_exhaustive]
4736pub struct DeleteProductRequest {
4737 pub name: std::string::String,
4742
4743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4744}
4745
4746impl DeleteProductRequest {
4747 pub fn new() -> Self {
4748 std::default::Default::default()
4749 }
4750
4751 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4753 self.name = v.into();
4754 self
4755 }
4756}
4757
4758impl wkt::message::Message for DeleteProductRequest {
4759 fn typename() -> &'static str {
4760 "type.googleapis.com/google.cloud.vision.v1.DeleteProductRequest"
4761 }
4762}
4763
4764#[derive(Clone, Default, PartialEq)]
4766#[non_exhaustive]
4767pub struct CreateProductSetRequest {
4768 pub parent: std::string::String,
4772
4773 pub product_set: std::option::Option<crate::model::ProductSet>,
4775
4776 pub product_set_id: std::string::String,
4781
4782 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4783}
4784
4785impl CreateProductSetRequest {
4786 pub fn new() -> Self {
4787 std::default::Default::default()
4788 }
4789
4790 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4792 self.parent = v.into();
4793 self
4794 }
4795
4796 pub fn set_product_set<T>(mut self, v: T) -> Self
4798 where
4799 T: std::convert::Into<crate::model::ProductSet>,
4800 {
4801 self.product_set = std::option::Option::Some(v.into());
4802 self
4803 }
4804
4805 pub fn set_or_clear_product_set<T>(mut self, v: std::option::Option<T>) -> Self
4807 where
4808 T: std::convert::Into<crate::model::ProductSet>,
4809 {
4810 self.product_set = v.map(|x| x.into());
4811 self
4812 }
4813
4814 pub fn set_product_set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4816 self.product_set_id = v.into();
4817 self
4818 }
4819}
4820
4821impl wkt::message::Message for CreateProductSetRequest {
4822 fn typename() -> &'static str {
4823 "type.googleapis.com/google.cloud.vision.v1.CreateProductSetRequest"
4824 }
4825}
4826
4827#[derive(Clone, Default, PartialEq)]
4829#[non_exhaustive]
4830pub struct ListProductSetsRequest {
4831 pub parent: std::string::String,
4835
4836 pub page_size: i32,
4838
4839 pub page_token: std::string::String,
4841
4842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4843}
4844
4845impl ListProductSetsRequest {
4846 pub fn new() -> Self {
4847 std::default::Default::default()
4848 }
4849
4850 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4852 self.parent = v.into();
4853 self
4854 }
4855
4856 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4858 self.page_size = v.into();
4859 self
4860 }
4861
4862 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4864 self.page_token = v.into();
4865 self
4866 }
4867}
4868
4869impl wkt::message::Message for ListProductSetsRequest {
4870 fn typename() -> &'static str {
4871 "type.googleapis.com/google.cloud.vision.v1.ListProductSetsRequest"
4872 }
4873}
4874
4875#[derive(Clone, Default, PartialEq)]
4877#[non_exhaustive]
4878pub struct ListProductSetsResponse {
4879 pub product_sets: std::vec::Vec<crate::model::ProductSet>,
4881
4882 pub next_page_token: std::string::String,
4885
4886 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4887}
4888
4889impl ListProductSetsResponse {
4890 pub fn new() -> Self {
4891 std::default::Default::default()
4892 }
4893
4894 pub fn set_product_sets<T, V>(mut self, v: T) -> Self
4896 where
4897 T: std::iter::IntoIterator<Item = V>,
4898 V: std::convert::Into<crate::model::ProductSet>,
4899 {
4900 use std::iter::Iterator;
4901 self.product_sets = v.into_iter().map(|i| i.into()).collect();
4902 self
4903 }
4904
4905 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4907 self.next_page_token = v.into();
4908 self
4909 }
4910}
4911
4912impl wkt::message::Message for ListProductSetsResponse {
4913 fn typename() -> &'static str {
4914 "type.googleapis.com/google.cloud.vision.v1.ListProductSetsResponse"
4915 }
4916}
4917
4918#[doc(hidden)]
4919impl gax::paginator::internal::PageableResponse for ListProductSetsResponse {
4920 type PageItem = crate::model::ProductSet;
4921
4922 fn items(self) -> std::vec::Vec<Self::PageItem> {
4923 self.product_sets
4924 }
4925
4926 fn next_page_token(&self) -> std::string::String {
4927 use std::clone::Clone;
4928 self.next_page_token.clone()
4929 }
4930}
4931
4932#[derive(Clone, Default, PartialEq)]
4934#[non_exhaustive]
4935pub struct GetProductSetRequest {
4936 pub name: std::string::String,
4941
4942 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4943}
4944
4945impl GetProductSetRequest {
4946 pub fn new() -> Self {
4947 std::default::Default::default()
4948 }
4949
4950 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4952 self.name = v.into();
4953 self
4954 }
4955}
4956
4957impl wkt::message::Message for GetProductSetRequest {
4958 fn typename() -> &'static str {
4959 "type.googleapis.com/google.cloud.vision.v1.GetProductSetRequest"
4960 }
4961}
4962
4963#[derive(Clone, Default, PartialEq)]
4965#[non_exhaustive]
4966pub struct UpdateProductSetRequest {
4967 pub product_set: std::option::Option<crate::model::ProductSet>,
4969
4970 pub update_mask: std::option::Option<wkt::FieldMask>,
4977
4978 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4979}
4980
4981impl UpdateProductSetRequest {
4982 pub fn new() -> Self {
4983 std::default::Default::default()
4984 }
4985
4986 pub fn set_product_set<T>(mut self, v: T) -> Self
4988 where
4989 T: std::convert::Into<crate::model::ProductSet>,
4990 {
4991 self.product_set = std::option::Option::Some(v.into());
4992 self
4993 }
4994
4995 pub fn set_or_clear_product_set<T>(mut self, v: std::option::Option<T>) -> Self
4997 where
4998 T: std::convert::Into<crate::model::ProductSet>,
4999 {
5000 self.product_set = v.map(|x| x.into());
5001 self
5002 }
5003
5004 pub fn set_update_mask<T>(mut self, v: T) -> Self
5006 where
5007 T: std::convert::Into<wkt::FieldMask>,
5008 {
5009 self.update_mask = std::option::Option::Some(v.into());
5010 self
5011 }
5012
5013 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5015 where
5016 T: std::convert::Into<wkt::FieldMask>,
5017 {
5018 self.update_mask = v.map(|x| x.into());
5019 self
5020 }
5021}
5022
5023impl wkt::message::Message for UpdateProductSetRequest {
5024 fn typename() -> &'static str {
5025 "type.googleapis.com/google.cloud.vision.v1.UpdateProductSetRequest"
5026 }
5027}
5028
5029#[derive(Clone, Default, PartialEq)]
5031#[non_exhaustive]
5032pub struct DeleteProductSetRequest {
5033 pub name: std::string::String,
5038
5039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5040}
5041
5042impl DeleteProductSetRequest {
5043 pub fn new() -> Self {
5044 std::default::Default::default()
5045 }
5046
5047 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5049 self.name = v.into();
5050 self
5051 }
5052}
5053
5054impl wkt::message::Message for DeleteProductSetRequest {
5055 fn typename() -> &'static str {
5056 "type.googleapis.com/google.cloud.vision.v1.DeleteProductSetRequest"
5057 }
5058}
5059
5060#[derive(Clone, Default, PartialEq)]
5062#[non_exhaustive]
5063pub struct CreateReferenceImageRequest {
5064 pub parent: std::string::String,
5070
5071 pub reference_image: std::option::Option<crate::model::ReferenceImage>,
5074
5075 pub reference_image_id: std::string::String,
5080
5081 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5082}
5083
5084impl CreateReferenceImageRequest {
5085 pub fn new() -> Self {
5086 std::default::Default::default()
5087 }
5088
5089 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5091 self.parent = v.into();
5092 self
5093 }
5094
5095 pub fn set_reference_image<T>(mut self, v: T) -> Self
5097 where
5098 T: std::convert::Into<crate::model::ReferenceImage>,
5099 {
5100 self.reference_image = std::option::Option::Some(v.into());
5101 self
5102 }
5103
5104 pub fn set_or_clear_reference_image<T>(mut self, v: std::option::Option<T>) -> Self
5106 where
5107 T: std::convert::Into<crate::model::ReferenceImage>,
5108 {
5109 self.reference_image = v.map(|x| x.into());
5110 self
5111 }
5112
5113 pub fn set_reference_image_id<T: std::convert::Into<std::string::String>>(
5115 mut self,
5116 v: T,
5117 ) -> Self {
5118 self.reference_image_id = v.into();
5119 self
5120 }
5121}
5122
5123impl wkt::message::Message for CreateReferenceImageRequest {
5124 fn typename() -> &'static str {
5125 "type.googleapis.com/google.cloud.vision.v1.CreateReferenceImageRequest"
5126 }
5127}
5128
5129#[derive(Clone, Default, PartialEq)]
5131#[non_exhaustive]
5132pub struct ListReferenceImagesRequest {
5133 pub parent: std::string::String,
5138
5139 pub page_size: i32,
5141
5142 pub page_token: std::string::String,
5147
5148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5149}
5150
5151impl ListReferenceImagesRequest {
5152 pub fn new() -> Self {
5153 std::default::Default::default()
5154 }
5155
5156 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5158 self.parent = v.into();
5159 self
5160 }
5161
5162 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5164 self.page_size = v.into();
5165 self
5166 }
5167
5168 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5170 self.page_token = v.into();
5171 self
5172 }
5173}
5174
5175impl wkt::message::Message for ListReferenceImagesRequest {
5176 fn typename() -> &'static str {
5177 "type.googleapis.com/google.cloud.vision.v1.ListReferenceImagesRequest"
5178 }
5179}
5180
5181#[derive(Clone, Default, PartialEq)]
5183#[non_exhaustive]
5184pub struct ListReferenceImagesResponse {
5185 pub reference_images: std::vec::Vec<crate::model::ReferenceImage>,
5187
5188 pub page_size: i32,
5190
5191 pub next_page_token: std::string::String,
5193
5194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5195}
5196
5197impl ListReferenceImagesResponse {
5198 pub fn new() -> Self {
5199 std::default::Default::default()
5200 }
5201
5202 pub fn set_reference_images<T, V>(mut self, v: T) -> Self
5204 where
5205 T: std::iter::IntoIterator<Item = V>,
5206 V: std::convert::Into<crate::model::ReferenceImage>,
5207 {
5208 use std::iter::Iterator;
5209 self.reference_images = v.into_iter().map(|i| i.into()).collect();
5210 self
5211 }
5212
5213 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5215 self.page_size = v.into();
5216 self
5217 }
5218
5219 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5221 self.next_page_token = v.into();
5222 self
5223 }
5224}
5225
5226impl wkt::message::Message for ListReferenceImagesResponse {
5227 fn typename() -> &'static str {
5228 "type.googleapis.com/google.cloud.vision.v1.ListReferenceImagesResponse"
5229 }
5230}
5231
5232#[doc(hidden)]
5233impl gax::paginator::internal::PageableResponse for ListReferenceImagesResponse {
5234 type PageItem = crate::model::ReferenceImage;
5235
5236 fn items(self) -> std::vec::Vec<Self::PageItem> {
5237 self.reference_images
5238 }
5239
5240 fn next_page_token(&self) -> std::string::String {
5241 use std::clone::Clone;
5242 self.next_page_token.clone()
5243 }
5244}
5245
5246#[derive(Clone, Default, PartialEq)]
5248#[non_exhaustive]
5249pub struct GetReferenceImageRequest {
5250 pub name: std::string::String,
5255
5256 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5257}
5258
5259impl GetReferenceImageRequest {
5260 pub fn new() -> Self {
5261 std::default::Default::default()
5262 }
5263
5264 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5266 self.name = v.into();
5267 self
5268 }
5269}
5270
5271impl wkt::message::Message for GetReferenceImageRequest {
5272 fn typename() -> &'static str {
5273 "type.googleapis.com/google.cloud.vision.v1.GetReferenceImageRequest"
5274 }
5275}
5276
5277#[derive(Clone, Default, PartialEq)]
5279#[non_exhaustive]
5280pub struct DeleteReferenceImageRequest {
5281 pub name: std::string::String,
5286
5287 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5288}
5289
5290impl DeleteReferenceImageRequest {
5291 pub fn new() -> Self {
5292 std::default::Default::default()
5293 }
5294
5295 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5297 self.name = v.into();
5298 self
5299 }
5300}
5301
5302impl wkt::message::Message for DeleteReferenceImageRequest {
5303 fn typename() -> &'static str {
5304 "type.googleapis.com/google.cloud.vision.v1.DeleteReferenceImageRequest"
5305 }
5306}
5307
5308#[derive(Clone, Default, PartialEq)]
5310#[non_exhaustive]
5311pub struct AddProductToProductSetRequest {
5312 pub name: std::string::String,
5317
5318 pub product: std::string::String,
5323
5324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5325}
5326
5327impl AddProductToProductSetRequest {
5328 pub fn new() -> Self {
5329 std::default::Default::default()
5330 }
5331
5332 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5334 self.name = v.into();
5335 self
5336 }
5337
5338 pub fn set_product<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5340 self.product = v.into();
5341 self
5342 }
5343}
5344
5345impl wkt::message::Message for AddProductToProductSetRequest {
5346 fn typename() -> &'static str {
5347 "type.googleapis.com/google.cloud.vision.v1.AddProductToProductSetRequest"
5348 }
5349}
5350
5351#[derive(Clone, Default, PartialEq)]
5353#[non_exhaustive]
5354pub struct RemoveProductFromProductSetRequest {
5355 pub name: std::string::String,
5360
5361 pub product: std::string::String,
5367
5368 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5369}
5370
5371impl RemoveProductFromProductSetRequest {
5372 pub fn new() -> Self {
5373 std::default::Default::default()
5374 }
5375
5376 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5378 self.name = v.into();
5379 self
5380 }
5381
5382 pub fn set_product<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5384 self.product = v.into();
5385 self
5386 }
5387}
5388
5389impl wkt::message::Message for RemoveProductFromProductSetRequest {
5390 fn typename() -> &'static str {
5391 "type.googleapis.com/google.cloud.vision.v1.RemoveProductFromProductSetRequest"
5392 }
5393}
5394
5395#[derive(Clone, Default, PartialEq)]
5397#[non_exhaustive]
5398pub struct ListProductsInProductSetRequest {
5399 pub name: std::string::String,
5404
5405 pub page_size: i32,
5407
5408 pub page_token: std::string::String,
5410
5411 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5412}
5413
5414impl ListProductsInProductSetRequest {
5415 pub fn new() -> Self {
5416 std::default::Default::default()
5417 }
5418
5419 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5421 self.name = v.into();
5422 self
5423 }
5424
5425 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5427 self.page_size = v.into();
5428 self
5429 }
5430
5431 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5433 self.page_token = v.into();
5434 self
5435 }
5436}
5437
5438impl wkt::message::Message for ListProductsInProductSetRequest {
5439 fn typename() -> &'static str {
5440 "type.googleapis.com/google.cloud.vision.v1.ListProductsInProductSetRequest"
5441 }
5442}
5443
5444#[derive(Clone, Default, PartialEq)]
5446#[non_exhaustive]
5447pub struct ListProductsInProductSetResponse {
5448 pub products: std::vec::Vec<crate::model::Product>,
5450
5451 pub next_page_token: std::string::String,
5454
5455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5456}
5457
5458impl ListProductsInProductSetResponse {
5459 pub fn new() -> Self {
5460 std::default::Default::default()
5461 }
5462
5463 pub fn set_products<T, V>(mut self, v: T) -> Self
5465 where
5466 T: std::iter::IntoIterator<Item = V>,
5467 V: std::convert::Into<crate::model::Product>,
5468 {
5469 use std::iter::Iterator;
5470 self.products = v.into_iter().map(|i| i.into()).collect();
5471 self
5472 }
5473
5474 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5476 self.next_page_token = v.into();
5477 self
5478 }
5479}
5480
5481impl wkt::message::Message for ListProductsInProductSetResponse {
5482 fn typename() -> &'static str {
5483 "type.googleapis.com/google.cloud.vision.v1.ListProductsInProductSetResponse"
5484 }
5485}
5486
5487#[doc(hidden)]
5488impl gax::paginator::internal::PageableResponse for ListProductsInProductSetResponse {
5489 type PageItem = crate::model::Product;
5490
5491 fn items(self) -> std::vec::Vec<Self::PageItem> {
5492 self.products
5493 }
5494
5495 fn next_page_token(&self) -> std::string::String {
5496 use std::clone::Clone;
5497 self.next_page_token.clone()
5498 }
5499}
5500
5501#[derive(Clone, Default, PartialEq)]
5504#[non_exhaustive]
5505pub struct ImportProductSetsGcsSource {
5506 pub csv_file_uri: std::string::String,
5576
5577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5578}
5579
5580impl ImportProductSetsGcsSource {
5581 pub fn new() -> Self {
5582 std::default::Default::default()
5583 }
5584
5585 pub fn set_csv_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5587 self.csv_file_uri = v.into();
5588 self
5589 }
5590}
5591
5592impl wkt::message::Message for ImportProductSetsGcsSource {
5593 fn typename() -> &'static str {
5594 "type.googleapis.com/google.cloud.vision.v1.ImportProductSetsGcsSource"
5595 }
5596}
5597
5598#[derive(Clone, Default, PartialEq)]
5600#[non_exhaustive]
5601pub struct ImportProductSetsInputConfig {
5602 pub source: std::option::Option<crate::model::import_product_sets_input_config::Source>,
5604
5605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5606}
5607
5608impl ImportProductSetsInputConfig {
5609 pub fn new() -> Self {
5610 std::default::Default::default()
5611 }
5612
5613 pub fn set_source<
5618 T: std::convert::Into<
5619 std::option::Option<crate::model::import_product_sets_input_config::Source>,
5620 >,
5621 >(
5622 mut self,
5623 v: T,
5624 ) -> Self {
5625 self.source = v.into();
5626 self
5627 }
5628
5629 pub fn gcs_source(
5633 &self,
5634 ) -> std::option::Option<&std::boxed::Box<crate::model::ImportProductSetsGcsSource>> {
5635 #[allow(unreachable_patterns)]
5636 self.source.as_ref().and_then(|v| match v {
5637 crate::model::import_product_sets_input_config::Source::GcsSource(v) => {
5638 std::option::Option::Some(v)
5639 }
5640 _ => std::option::Option::None,
5641 })
5642 }
5643
5644 pub fn set_gcs_source<
5650 T: std::convert::Into<std::boxed::Box<crate::model::ImportProductSetsGcsSource>>,
5651 >(
5652 mut self,
5653 v: T,
5654 ) -> Self {
5655 self.source = std::option::Option::Some(
5656 crate::model::import_product_sets_input_config::Source::GcsSource(v.into()),
5657 );
5658 self
5659 }
5660}
5661
5662impl wkt::message::Message for ImportProductSetsInputConfig {
5663 fn typename() -> &'static str {
5664 "type.googleapis.com/google.cloud.vision.v1.ImportProductSetsInputConfig"
5665 }
5666}
5667
5668pub mod import_product_sets_input_config {
5670 #[allow(unused_imports)]
5671 use super::*;
5672
5673 #[derive(Clone, Debug, PartialEq)]
5675 #[non_exhaustive]
5676 pub enum Source {
5677 GcsSource(std::boxed::Box<crate::model::ImportProductSetsGcsSource>),
5680 }
5681}
5682
5683#[derive(Clone, Default, PartialEq)]
5685#[non_exhaustive]
5686pub struct ImportProductSetsRequest {
5687 pub parent: std::string::String,
5691
5692 pub input_config: std::option::Option<crate::model::ImportProductSetsInputConfig>,
5694
5695 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5696}
5697
5698impl ImportProductSetsRequest {
5699 pub fn new() -> Self {
5700 std::default::Default::default()
5701 }
5702
5703 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5705 self.parent = v.into();
5706 self
5707 }
5708
5709 pub fn set_input_config<T>(mut self, v: T) -> Self
5711 where
5712 T: std::convert::Into<crate::model::ImportProductSetsInputConfig>,
5713 {
5714 self.input_config = std::option::Option::Some(v.into());
5715 self
5716 }
5717
5718 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
5720 where
5721 T: std::convert::Into<crate::model::ImportProductSetsInputConfig>,
5722 {
5723 self.input_config = v.map(|x| x.into());
5724 self
5725 }
5726}
5727
5728impl wkt::message::Message for ImportProductSetsRequest {
5729 fn typename() -> &'static str {
5730 "type.googleapis.com/google.cloud.vision.v1.ImportProductSetsRequest"
5731 }
5732}
5733
5734#[derive(Clone, Default, PartialEq)]
5744#[non_exhaustive]
5745pub struct ImportProductSetsResponse {
5746 pub reference_images: std::vec::Vec<crate::model::ReferenceImage>,
5748
5749 pub statuses: std::vec::Vec<rpc::model::Status>,
5756
5757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5758}
5759
5760impl ImportProductSetsResponse {
5761 pub fn new() -> Self {
5762 std::default::Default::default()
5763 }
5764
5765 pub fn set_reference_images<T, V>(mut self, v: T) -> Self
5767 where
5768 T: std::iter::IntoIterator<Item = V>,
5769 V: std::convert::Into<crate::model::ReferenceImage>,
5770 {
5771 use std::iter::Iterator;
5772 self.reference_images = v.into_iter().map(|i| i.into()).collect();
5773 self
5774 }
5775
5776 pub fn set_statuses<T, V>(mut self, v: T) -> Self
5778 where
5779 T: std::iter::IntoIterator<Item = V>,
5780 V: std::convert::Into<rpc::model::Status>,
5781 {
5782 use std::iter::Iterator;
5783 self.statuses = v.into_iter().map(|i| i.into()).collect();
5784 self
5785 }
5786}
5787
5788impl wkt::message::Message for ImportProductSetsResponse {
5789 fn typename() -> &'static str {
5790 "type.googleapis.com/google.cloud.vision.v1.ImportProductSetsResponse"
5791 }
5792}
5793
5794#[derive(Clone, Default, PartialEq)]
5799#[non_exhaustive]
5800pub struct BatchOperationMetadata {
5801 pub state: crate::model::batch_operation_metadata::State,
5803
5804 pub submit_time: std::option::Option<wkt::Timestamp>,
5806
5807 pub end_time: std::option::Option<wkt::Timestamp>,
5813
5814 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5815}
5816
5817impl BatchOperationMetadata {
5818 pub fn new() -> Self {
5819 std::default::Default::default()
5820 }
5821
5822 pub fn set_state<T: std::convert::Into<crate::model::batch_operation_metadata::State>>(
5824 mut self,
5825 v: T,
5826 ) -> Self {
5827 self.state = v.into();
5828 self
5829 }
5830
5831 pub fn set_submit_time<T>(mut self, v: T) -> Self
5833 where
5834 T: std::convert::Into<wkt::Timestamp>,
5835 {
5836 self.submit_time = std::option::Option::Some(v.into());
5837 self
5838 }
5839
5840 pub fn set_or_clear_submit_time<T>(mut self, v: std::option::Option<T>) -> Self
5842 where
5843 T: std::convert::Into<wkt::Timestamp>,
5844 {
5845 self.submit_time = v.map(|x| x.into());
5846 self
5847 }
5848
5849 pub fn set_end_time<T>(mut self, v: T) -> Self
5851 where
5852 T: std::convert::Into<wkt::Timestamp>,
5853 {
5854 self.end_time = std::option::Option::Some(v.into());
5855 self
5856 }
5857
5858 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5860 where
5861 T: std::convert::Into<wkt::Timestamp>,
5862 {
5863 self.end_time = v.map(|x| x.into());
5864 self
5865 }
5866}
5867
5868impl wkt::message::Message for BatchOperationMetadata {
5869 fn typename() -> &'static str {
5870 "type.googleapis.com/google.cloud.vision.v1.BatchOperationMetadata"
5871 }
5872}
5873
5874pub mod batch_operation_metadata {
5876 #[allow(unused_imports)]
5877 use super::*;
5878
5879 #[derive(Clone, Debug, PartialEq)]
5895 #[non_exhaustive]
5896 pub enum State {
5897 Unspecified,
5899 Processing,
5901 Successful,
5904 Failed,
5906 Cancelled,
5910 UnknownValue(state::UnknownValue),
5915 }
5916
5917 #[doc(hidden)]
5918 pub mod state {
5919 #[allow(unused_imports)]
5920 use super::*;
5921 #[derive(Clone, Debug, PartialEq)]
5922 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5923 }
5924
5925 impl State {
5926 pub fn value(&self) -> std::option::Option<i32> {
5931 match self {
5932 Self::Unspecified => std::option::Option::Some(0),
5933 Self::Processing => std::option::Option::Some(1),
5934 Self::Successful => std::option::Option::Some(2),
5935 Self::Failed => std::option::Option::Some(3),
5936 Self::Cancelled => std::option::Option::Some(4),
5937 Self::UnknownValue(u) => u.0.value(),
5938 }
5939 }
5940
5941 pub fn name(&self) -> std::option::Option<&str> {
5946 match self {
5947 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5948 Self::Processing => std::option::Option::Some("PROCESSING"),
5949 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
5950 Self::Failed => std::option::Option::Some("FAILED"),
5951 Self::Cancelled => std::option::Option::Some("CANCELLED"),
5952 Self::UnknownValue(u) => u.0.name(),
5953 }
5954 }
5955 }
5956
5957 impl std::default::Default for State {
5958 fn default() -> Self {
5959 use std::convert::From;
5960 Self::from(0)
5961 }
5962 }
5963
5964 impl std::fmt::Display for State {
5965 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5966 wkt::internal::display_enum(f, self.name(), self.value())
5967 }
5968 }
5969
5970 impl std::convert::From<i32> for State {
5971 fn from(value: i32) -> Self {
5972 match value {
5973 0 => Self::Unspecified,
5974 1 => Self::Processing,
5975 2 => Self::Successful,
5976 3 => Self::Failed,
5977 4 => Self::Cancelled,
5978 _ => Self::UnknownValue(state::UnknownValue(
5979 wkt::internal::UnknownEnumValue::Integer(value),
5980 )),
5981 }
5982 }
5983 }
5984
5985 impl std::convert::From<&str> for State {
5986 fn from(value: &str) -> Self {
5987 use std::string::ToString;
5988 match value {
5989 "STATE_UNSPECIFIED" => Self::Unspecified,
5990 "PROCESSING" => Self::Processing,
5991 "SUCCESSFUL" => Self::Successful,
5992 "FAILED" => Self::Failed,
5993 "CANCELLED" => Self::Cancelled,
5994 _ => Self::UnknownValue(state::UnknownValue(
5995 wkt::internal::UnknownEnumValue::String(value.to_string()),
5996 )),
5997 }
5998 }
5999 }
6000
6001 impl serde::ser::Serialize for State {
6002 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6003 where
6004 S: serde::Serializer,
6005 {
6006 match self {
6007 Self::Unspecified => serializer.serialize_i32(0),
6008 Self::Processing => serializer.serialize_i32(1),
6009 Self::Successful => serializer.serialize_i32(2),
6010 Self::Failed => serializer.serialize_i32(3),
6011 Self::Cancelled => serializer.serialize_i32(4),
6012 Self::UnknownValue(u) => u.0.serialize(serializer),
6013 }
6014 }
6015 }
6016
6017 impl<'de> serde::de::Deserialize<'de> for State {
6018 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6019 where
6020 D: serde::Deserializer<'de>,
6021 {
6022 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6023 ".google.cloud.vision.v1.BatchOperationMetadata.State",
6024 ))
6025 }
6026 }
6027}
6028
6029#[derive(Clone, Default, PartialEq)]
6031#[non_exhaustive]
6032pub struct ProductSetPurgeConfig {
6033 pub product_set_id: std::string::String,
6037
6038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6039}
6040
6041impl ProductSetPurgeConfig {
6042 pub fn new() -> Self {
6043 std::default::Default::default()
6044 }
6045
6046 pub fn set_product_set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6048 self.product_set_id = v.into();
6049 self
6050 }
6051}
6052
6053impl wkt::message::Message for ProductSetPurgeConfig {
6054 fn typename() -> &'static str {
6055 "type.googleapis.com/google.cloud.vision.v1.ProductSetPurgeConfig"
6056 }
6057}
6058
6059#[derive(Clone, Default, PartialEq)]
6061#[non_exhaustive]
6062pub struct PurgeProductsRequest {
6063 pub parent: std::string::String,
6067
6068 pub force: bool,
6071
6072 pub target: std::option::Option<crate::model::purge_products_request::Target>,
6074
6075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6076}
6077
6078impl PurgeProductsRequest {
6079 pub fn new() -> Self {
6080 std::default::Default::default()
6081 }
6082
6083 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6085 self.parent = v.into();
6086 self
6087 }
6088
6089 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6091 self.force = v.into();
6092 self
6093 }
6094
6095 pub fn set_target<
6100 T: std::convert::Into<std::option::Option<crate::model::purge_products_request::Target>>,
6101 >(
6102 mut self,
6103 v: T,
6104 ) -> Self {
6105 self.target = v.into();
6106 self
6107 }
6108
6109 pub fn product_set_purge_config(
6113 &self,
6114 ) -> std::option::Option<&std::boxed::Box<crate::model::ProductSetPurgeConfig>> {
6115 #[allow(unreachable_patterns)]
6116 self.target.as_ref().and_then(|v| match v {
6117 crate::model::purge_products_request::Target::ProductSetPurgeConfig(v) => {
6118 std::option::Option::Some(v)
6119 }
6120 _ => std::option::Option::None,
6121 })
6122 }
6123
6124 pub fn set_product_set_purge_config<
6130 T: std::convert::Into<std::boxed::Box<crate::model::ProductSetPurgeConfig>>,
6131 >(
6132 mut self,
6133 v: T,
6134 ) -> Self {
6135 self.target = std::option::Option::Some(
6136 crate::model::purge_products_request::Target::ProductSetPurgeConfig(v.into()),
6137 );
6138 self
6139 }
6140
6141 pub fn delete_orphan_products(&self) -> std::option::Option<&bool> {
6145 #[allow(unreachable_patterns)]
6146 self.target.as_ref().and_then(|v| match v {
6147 crate::model::purge_products_request::Target::DeleteOrphanProducts(v) => {
6148 std::option::Option::Some(v)
6149 }
6150 _ => std::option::Option::None,
6151 })
6152 }
6153
6154 pub fn set_delete_orphan_products<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6160 self.target = std::option::Option::Some(
6161 crate::model::purge_products_request::Target::DeleteOrphanProducts(v.into()),
6162 );
6163 self
6164 }
6165}
6166
6167impl wkt::message::Message for PurgeProductsRequest {
6168 fn typename() -> &'static str {
6169 "type.googleapis.com/google.cloud.vision.v1.PurgeProductsRequest"
6170 }
6171}
6172
6173pub mod purge_products_request {
6175 #[allow(unused_imports)]
6176 use super::*;
6177
6178 #[derive(Clone, Debug, PartialEq)]
6180 #[non_exhaustive]
6181 pub enum Target {
6182 ProductSetPurgeConfig(std::boxed::Box<crate::model::ProductSetPurgeConfig>),
6184 DeleteOrphanProducts(bool),
6187 }
6188}
6189
6190#[derive(Clone, Default, PartialEq)]
6201#[non_exhaustive]
6202pub struct TextAnnotation {
6203 pub pages: std::vec::Vec<crate::model::Page>,
6205
6206 pub text: std::string::String,
6208
6209 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6210}
6211
6212impl TextAnnotation {
6213 pub fn new() -> Self {
6214 std::default::Default::default()
6215 }
6216
6217 pub fn set_pages<T, V>(mut self, v: T) -> Self
6219 where
6220 T: std::iter::IntoIterator<Item = V>,
6221 V: std::convert::Into<crate::model::Page>,
6222 {
6223 use std::iter::Iterator;
6224 self.pages = v.into_iter().map(|i| i.into()).collect();
6225 self
6226 }
6227
6228 pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6230 self.text = v.into();
6231 self
6232 }
6233}
6234
6235impl wkt::message::Message for TextAnnotation {
6236 fn typename() -> &'static str {
6237 "type.googleapis.com/google.cloud.vision.v1.TextAnnotation"
6238 }
6239}
6240
6241pub mod text_annotation {
6243 #[allow(unused_imports)]
6244 use super::*;
6245
6246 #[derive(Clone, Default, PartialEq)]
6248 #[non_exhaustive]
6249 pub struct DetectedLanguage {
6250 pub language_code: std::string::String,
6254
6255 pub confidence: f32,
6257
6258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6259 }
6260
6261 impl DetectedLanguage {
6262 pub fn new() -> Self {
6263 std::default::Default::default()
6264 }
6265
6266 pub fn set_language_code<T: std::convert::Into<std::string::String>>(
6268 mut self,
6269 v: T,
6270 ) -> Self {
6271 self.language_code = v.into();
6272 self
6273 }
6274
6275 pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
6277 self.confidence = v.into();
6278 self
6279 }
6280 }
6281
6282 impl wkt::message::Message for DetectedLanguage {
6283 fn typename() -> &'static str {
6284 "type.googleapis.com/google.cloud.vision.v1.TextAnnotation.DetectedLanguage"
6285 }
6286 }
6287
6288 #[derive(Clone, Default, PartialEq)]
6290 #[non_exhaustive]
6291 pub struct DetectedBreak {
6292 pub r#type: crate::model::text_annotation::detected_break::BreakType,
6294
6295 pub is_prefix: bool,
6297
6298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6299 }
6300
6301 impl DetectedBreak {
6302 pub fn new() -> Self {
6303 std::default::Default::default()
6304 }
6305
6306 pub fn set_type<
6308 T: std::convert::Into<crate::model::text_annotation::detected_break::BreakType>,
6309 >(
6310 mut self,
6311 v: T,
6312 ) -> Self {
6313 self.r#type = v.into();
6314 self
6315 }
6316
6317 pub fn set_is_prefix<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6319 self.is_prefix = v.into();
6320 self
6321 }
6322 }
6323
6324 impl wkt::message::Message for DetectedBreak {
6325 fn typename() -> &'static str {
6326 "type.googleapis.com/google.cloud.vision.v1.TextAnnotation.DetectedBreak"
6327 }
6328 }
6329
6330 pub mod detected_break {
6332 #[allow(unused_imports)]
6333 use super::*;
6334
6335 #[derive(Clone, Debug, PartialEq)]
6351 #[non_exhaustive]
6352 pub enum BreakType {
6353 Unknown,
6355 Space,
6357 SureSpace,
6359 EolSureSpace,
6361 Hyphen,
6364 LineBreak,
6366 UnknownValue(break_type::UnknownValue),
6371 }
6372
6373 #[doc(hidden)]
6374 pub mod break_type {
6375 #[allow(unused_imports)]
6376 use super::*;
6377 #[derive(Clone, Debug, PartialEq)]
6378 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6379 }
6380
6381 impl BreakType {
6382 pub fn value(&self) -> std::option::Option<i32> {
6387 match self {
6388 Self::Unknown => std::option::Option::Some(0),
6389 Self::Space => std::option::Option::Some(1),
6390 Self::SureSpace => std::option::Option::Some(2),
6391 Self::EolSureSpace => std::option::Option::Some(3),
6392 Self::Hyphen => std::option::Option::Some(4),
6393 Self::LineBreak => std::option::Option::Some(5),
6394 Self::UnknownValue(u) => u.0.value(),
6395 }
6396 }
6397
6398 pub fn name(&self) -> std::option::Option<&str> {
6403 match self {
6404 Self::Unknown => std::option::Option::Some("UNKNOWN"),
6405 Self::Space => std::option::Option::Some("SPACE"),
6406 Self::SureSpace => std::option::Option::Some("SURE_SPACE"),
6407 Self::EolSureSpace => std::option::Option::Some("EOL_SURE_SPACE"),
6408 Self::Hyphen => std::option::Option::Some("HYPHEN"),
6409 Self::LineBreak => std::option::Option::Some("LINE_BREAK"),
6410 Self::UnknownValue(u) => u.0.name(),
6411 }
6412 }
6413 }
6414
6415 impl std::default::Default for BreakType {
6416 fn default() -> Self {
6417 use std::convert::From;
6418 Self::from(0)
6419 }
6420 }
6421
6422 impl std::fmt::Display for BreakType {
6423 fn fmt(
6424 &self,
6425 f: &mut std::fmt::Formatter<'_>,
6426 ) -> std::result::Result<(), std::fmt::Error> {
6427 wkt::internal::display_enum(f, self.name(), self.value())
6428 }
6429 }
6430
6431 impl std::convert::From<i32> for BreakType {
6432 fn from(value: i32) -> Self {
6433 match value {
6434 0 => Self::Unknown,
6435 1 => Self::Space,
6436 2 => Self::SureSpace,
6437 3 => Self::EolSureSpace,
6438 4 => Self::Hyphen,
6439 5 => Self::LineBreak,
6440 _ => Self::UnknownValue(break_type::UnknownValue(
6441 wkt::internal::UnknownEnumValue::Integer(value),
6442 )),
6443 }
6444 }
6445 }
6446
6447 impl std::convert::From<&str> for BreakType {
6448 fn from(value: &str) -> Self {
6449 use std::string::ToString;
6450 match value {
6451 "UNKNOWN" => Self::Unknown,
6452 "SPACE" => Self::Space,
6453 "SURE_SPACE" => Self::SureSpace,
6454 "EOL_SURE_SPACE" => Self::EolSureSpace,
6455 "HYPHEN" => Self::Hyphen,
6456 "LINE_BREAK" => Self::LineBreak,
6457 _ => Self::UnknownValue(break_type::UnknownValue(
6458 wkt::internal::UnknownEnumValue::String(value.to_string()),
6459 )),
6460 }
6461 }
6462 }
6463
6464 impl serde::ser::Serialize for BreakType {
6465 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6466 where
6467 S: serde::Serializer,
6468 {
6469 match self {
6470 Self::Unknown => serializer.serialize_i32(0),
6471 Self::Space => serializer.serialize_i32(1),
6472 Self::SureSpace => serializer.serialize_i32(2),
6473 Self::EolSureSpace => serializer.serialize_i32(3),
6474 Self::Hyphen => serializer.serialize_i32(4),
6475 Self::LineBreak => serializer.serialize_i32(5),
6476 Self::UnknownValue(u) => u.0.serialize(serializer),
6477 }
6478 }
6479 }
6480
6481 impl<'de> serde::de::Deserialize<'de> for BreakType {
6482 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6483 where
6484 D: serde::Deserializer<'de>,
6485 {
6486 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BreakType>::new(
6487 ".google.cloud.vision.v1.TextAnnotation.DetectedBreak.BreakType",
6488 ))
6489 }
6490 }
6491 }
6492
6493 #[derive(Clone, Default, PartialEq)]
6495 #[non_exhaustive]
6496 pub struct TextProperty {
6497 pub detected_languages: std::vec::Vec<crate::model::text_annotation::DetectedLanguage>,
6499
6500 pub detected_break: std::option::Option<crate::model::text_annotation::DetectedBreak>,
6502
6503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6504 }
6505
6506 impl TextProperty {
6507 pub fn new() -> Self {
6508 std::default::Default::default()
6509 }
6510
6511 pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
6513 where
6514 T: std::iter::IntoIterator<Item = V>,
6515 V: std::convert::Into<crate::model::text_annotation::DetectedLanguage>,
6516 {
6517 use std::iter::Iterator;
6518 self.detected_languages = v.into_iter().map(|i| i.into()).collect();
6519 self
6520 }
6521
6522 pub fn set_detected_break<T>(mut self, v: T) -> Self
6524 where
6525 T: std::convert::Into<crate::model::text_annotation::DetectedBreak>,
6526 {
6527 self.detected_break = std::option::Option::Some(v.into());
6528 self
6529 }
6530
6531 pub fn set_or_clear_detected_break<T>(mut self, v: std::option::Option<T>) -> Self
6533 where
6534 T: std::convert::Into<crate::model::text_annotation::DetectedBreak>,
6535 {
6536 self.detected_break = v.map(|x| x.into());
6537 self
6538 }
6539 }
6540
6541 impl wkt::message::Message for TextProperty {
6542 fn typename() -> &'static str {
6543 "type.googleapis.com/google.cloud.vision.v1.TextAnnotation.TextProperty"
6544 }
6545 }
6546}
6547
6548#[derive(Clone, Default, PartialEq)]
6550#[non_exhaustive]
6551pub struct Page {
6552 pub property: std::option::Option<crate::model::text_annotation::TextProperty>,
6554
6555 pub width: i32,
6558
6559 pub height: i32,
6562
6563 pub blocks: std::vec::Vec<crate::model::Block>,
6565
6566 pub confidence: f32,
6568
6569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6570}
6571
6572impl Page {
6573 pub fn new() -> Self {
6574 std::default::Default::default()
6575 }
6576
6577 pub fn set_property<T>(mut self, v: T) -> Self
6579 where
6580 T: std::convert::Into<crate::model::text_annotation::TextProperty>,
6581 {
6582 self.property = std::option::Option::Some(v.into());
6583 self
6584 }
6585
6586 pub fn set_or_clear_property<T>(mut self, v: std::option::Option<T>) -> Self
6588 where
6589 T: std::convert::Into<crate::model::text_annotation::TextProperty>,
6590 {
6591 self.property = v.map(|x| x.into());
6592 self
6593 }
6594
6595 pub fn set_width<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6597 self.width = v.into();
6598 self
6599 }
6600
6601 pub fn set_height<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6603 self.height = v.into();
6604 self
6605 }
6606
6607 pub fn set_blocks<T, V>(mut self, v: T) -> Self
6609 where
6610 T: std::iter::IntoIterator<Item = V>,
6611 V: std::convert::Into<crate::model::Block>,
6612 {
6613 use std::iter::Iterator;
6614 self.blocks = v.into_iter().map(|i| i.into()).collect();
6615 self
6616 }
6617
6618 pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
6620 self.confidence = v.into();
6621 self
6622 }
6623}
6624
6625impl wkt::message::Message for Page {
6626 fn typename() -> &'static str {
6627 "type.googleapis.com/google.cloud.vision.v1.Page"
6628 }
6629}
6630
6631#[derive(Clone, Default, PartialEq)]
6633#[non_exhaustive]
6634pub struct Block {
6635 pub property: std::option::Option<crate::model::text_annotation::TextProperty>,
6637
6638 pub bounding_box: std::option::Option<crate::model::BoundingPoly>,
6664
6665 pub paragraphs: std::vec::Vec<crate::model::Paragraph>,
6667
6668 pub block_type: crate::model::block::BlockType,
6670
6671 pub confidence: f32,
6673
6674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6675}
6676
6677impl Block {
6678 pub fn new() -> Self {
6679 std::default::Default::default()
6680 }
6681
6682 pub fn set_property<T>(mut self, v: T) -> Self
6684 where
6685 T: std::convert::Into<crate::model::text_annotation::TextProperty>,
6686 {
6687 self.property = std::option::Option::Some(v.into());
6688 self
6689 }
6690
6691 pub fn set_or_clear_property<T>(mut self, v: std::option::Option<T>) -> Self
6693 where
6694 T: std::convert::Into<crate::model::text_annotation::TextProperty>,
6695 {
6696 self.property = v.map(|x| x.into());
6697 self
6698 }
6699
6700 pub fn set_bounding_box<T>(mut self, v: T) -> Self
6702 where
6703 T: std::convert::Into<crate::model::BoundingPoly>,
6704 {
6705 self.bounding_box = std::option::Option::Some(v.into());
6706 self
6707 }
6708
6709 pub fn set_or_clear_bounding_box<T>(mut self, v: std::option::Option<T>) -> Self
6711 where
6712 T: std::convert::Into<crate::model::BoundingPoly>,
6713 {
6714 self.bounding_box = v.map(|x| x.into());
6715 self
6716 }
6717
6718 pub fn set_paragraphs<T, V>(mut self, v: T) -> Self
6720 where
6721 T: std::iter::IntoIterator<Item = V>,
6722 V: std::convert::Into<crate::model::Paragraph>,
6723 {
6724 use std::iter::Iterator;
6725 self.paragraphs = v.into_iter().map(|i| i.into()).collect();
6726 self
6727 }
6728
6729 pub fn set_block_type<T: std::convert::Into<crate::model::block::BlockType>>(
6731 mut self,
6732 v: T,
6733 ) -> Self {
6734 self.block_type = v.into();
6735 self
6736 }
6737
6738 pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
6740 self.confidence = v.into();
6741 self
6742 }
6743}
6744
6745impl wkt::message::Message for Block {
6746 fn typename() -> &'static str {
6747 "type.googleapis.com/google.cloud.vision.v1.Block"
6748 }
6749}
6750
6751pub mod block {
6753 #[allow(unused_imports)]
6754 use super::*;
6755
6756 #[derive(Clone, Debug, PartialEq)]
6772 #[non_exhaustive]
6773 pub enum BlockType {
6774 Unknown,
6776 Text,
6778 Table,
6780 Picture,
6782 Ruler,
6784 Barcode,
6786 UnknownValue(block_type::UnknownValue),
6791 }
6792
6793 #[doc(hidden)]
6794 pub mod block_type {
6795 #[allow(unused_imports)]
6796 use super::*;
6797 #[derive(Clone, Debug, PartialEq)]
6798 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6799 }
6800
6801 impl BlockType {
6802 pub fn value(&self) -> std::option::Option<i32> {
6807 match self {
6808 Self::Unknown => std::option::Option::Some(0),
6809 Self::Text => std::option::Option::Some(1),
6810 Self::Table => std::option::Option::Some(2),
6811 Self::Picture => std::option::Option::Some(3),
6812 Self::Ruler => std::option::Option::Some(4),
6813 Self::Barcode => std::option::Option::Some(5),
6814 Self::UnknownValue(u) => u.0.value(),
6815 }
6816 }
6817
6818 pub fn name(&self) -> std::option::Option<&str> {
6823 match self {
6824 Self::Unknown => std::option::Option::Some("UNKNOWN"),
6825 Self::Text => std::option::Option::Some("TEXT"),
6826 Self::Table => std::option::Option::Some("TABLE"),
6827 Self::Picture => std::option::Option::Some("PICTURE"),
6828 Self::Ruler => std::option::Option::Some("RULER"),
6829 Self::Barcode => std::option::Option::Some("BARCODE"),
6830 Self::UnknownValue(u) => u.0.name(),
6831 }
6832 }
6833 }
6834
6835 impl std::default::Default for BlockType {
6836 fn default() -> Self {
6837 use std::convert::From;
6838 Self::from(0)
6839 }
6840 }
6841
6842 impl std::fmt::Display for BlockType {
6843 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6844 wkt::internal::display_enum(f, self.name(), self.value())
6845 }
6846 }
6847
6848 impl std::convert::From<i32> for BlockType {
6849 fn from(value: i32) -> Self {
6850 match value {
6851 0 => Self::Unknown,
6852 1 => Self::Text,
6853 2 => Self::Table,
6854 3 => Self::Picture,
6855 4 => Self::Ruler,
6856 5 => Self::Barcode,
6857 _ => Self::UnknownValue(block_type::UnknownValue(
6858 wkt::internal::UnknownEnumValue::Integer(value),
6859 )),
6860 }
6861 }
6862 }
6863
6864 impl std::convert::From<&str> for BlockType {
6865 fn from(value: &str) -> Self {
6866 use std::string::ToString;
6867 match value {
6868 "UNKNOWN" => Self::Unknown,
6869 "TEXT" => Self::Text,
6870 "TABLE" => Self::Table,
6871 "PICTURE" => Self::Picture,
6872 "RULER" => Self::Ruler,
6873 "BARCODE" => Self::Barcode,
6874 _ => Self::UnknownValue(block_type::UnknownValue(
6875 wkt::internal::UnknownEnumValue::String(value.to_string()),
6876 )),
6877 }
6878 }
6879 }
6880
6881 impl serde::ser::Serialize for BlockType {
6882 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6883 where
6884 S: serde::Serializer,
6885 {
6886 match self {
6887 Self::Unknown => serializer.serialize_i32(0),
6888 Self::Text => serializer.serialize_i32(1),
6889 Self::Table => serializer.serialize_i32(2),
6890 Self::Picture => serializer.serialize_i32(3),
6891 Self::Ruler => serializer.serialize_i32(4),
6892 Self::Barcode => serializer.serialize_i32(5),
6893 Self::UnknownValue(u) => u.0.serialize(serializer),
6894 }
6895 }
6896 }
6897
6898 impl<'de> serde::de::Deserialize<'de> for BlockType {
6899 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6900 where
6901 D: serde::Deserializer<'de>,
6902 {
6903 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BlockType>::new(
6904 ".google.cloud.vision.v1.Block.BlockType",
6905 ))
6906 }
6907 }
6908}
6909
6910#[derive(Clone, Default, PartialEq)]
6912#[non_exhaustive]
6913pub struct Paragraph {
6914 pub property: std::option::Option<crate::model::text_annotation::TextProperty>,
6916
6917 pub bounding_box: std::option::Option<crate::model::BoundingPoly>,
6934
6935 pub words: std::vec::Vec<crate::model::Word>,
6937
6938 pub confidence: f32,
6940
6941 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6942}
6943
6944impl Paragraph {
6945 pub fn new() -> Self {
6946 std::default::Default::default()
6947 }
6948
6949 pub fn set_property<T>(mut self, v: T) -> Self
6951 where
6952 T: std::convert::Into<crate::model::text_annotation::TextProperty>,
6953 {
6954 self.property = std::option::Option::Some(v.into());
6955 self
6956 }
6957
6958 pub fn set_or_clear_property<T>(mut self, v: std::option::Option<T>) -> Self
6960 where
6961 T: std::convert::Into<crate::model::text_annotation::TextProperty>,
6962 {
6963 self.property = v.map(|x| x.into());
6964 self
6965 }
6966
6967 pub fn set_bounding_box<T>(mut self, v: T) -> Self
6969 where
6970 T: std::convert::Into<crate::model::BoundingPoly>,
6971 {
6972 self.bounding_box = std::option::Option::Some(v.into());
6973 self
6974 }
6975
6976 pub fn set_or_clear_bounding_box<T>(mut self, v: std::option::Option<T>) -> Self
6978 where
6979 T: std::convert::Into<crate::model::BoundingPoly>,
6980 {
6981 self.bounding_box = v.map(|x| x.into());
6982 self
6983 }
6984
6985 pub fn set_words<T, V>(mut self, v: T) -> Self
6987 where
6988 T: std::iter::IntoIterator<Item = V>,
6989 V: std::convert::Into<crate::model::Word>,
6990 {
6991 use std::iter::Iterator;
6992 self.words = v.into_iter().map(|i| i.into()).collect();
6993 self
6994 }
6995
6996 pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
6998 self.confidence = v.into();
6999 self
7000 }
7001}
7002
7003impl wkt::message::Message for Paragraph {
7004 fn typename() -> &'static str {
7005 "type.googleapis.com/google.cloud.vision.v1.Paragraph"
7006 }
7007}
7008
7009#[derive(Clone, Default, PartialEq)]
7011#[non_exhaustive]
7012pub struct Word {
7013 pub property: std::option::Option<crate::model::text_annotation::TextProperty>,
7015
7016 pub bounding_box: std::option::Option<crate::model::BoundingPoly>,
7033
7034 pub symbols: std::vec::Vec<crate::model::Symbol>,
7037
7038 pub confidence: f32,
7040
7041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7042}
7043
7044impl Word {
7045 pub fn new() -> Self {
7046 std::default::Default::default()
7047 }
7048
7049 pub fn set_property<T>(mut self, v: T) -> Self
7051 where
7052 T: std::convert::Into<crate::model::text_annotation::TextProperty>,
7053 {
7054 self.property = std::option::Option::Some(v.into());
7055 self
7056 }
7057
7058 pub fn set_or_clear_property<T>(mut self, v: std::option::Option<T>) -> Self
7060 where
7061 T: std::convert::Into<crate::model::text_annotation::TextProperty>,
7062 {
7063 self.property = v.map(|x| x.into());
7064 self
7065 }
7066
7067 pub fn set_bounding_box<T>(mut self, v: T) -> Self
7069 where
7070 T: std::convert::Into<crate::model::BoundingPoly>,
7071 {
7072 self.bounding_box = std::option::Option::Some(v.into());
7073 self
7074 }
7075
7076 pub fn set_or_clear_bounding_box<T>(mut self, v: std::option::Option<T>) -> Self
7078 where
7079 T: std::convert::Into<crate::model::BoundingPoly>,
7080 {
7081 self.bounding_box = v.map(|x| x.into());
7082 self
7083 }
7084
7085 pub fn set_symbols<T, V>(mut self, v: T) -> Self
7087 where
7088 T: std::iter::IntoIterator<Item = V>,
7089 V: std::convert::Into<crate::model::Symbol>,
7090 {
7091 use std::iter::Iterator;
7092 self.symbols = v.into_iter().map(|i| i.into()).collect();
7093 self
7094 }
7095
7096 pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
7098 self.confidence = v.into();
7099 self
7100 }
7101}
7102
7103impl wkt::message::Message for Word {
7104 fn typename() -> &'static str {
7105 "type.googleapis.com/google.cloud.vision.v1.Word"
7106 }
7107}
7108
7109#[derive(Clone, Default, PartialEq)]
7111#[non_exhaustive]
7112pub struct Symbol {
7113 pub property: std::option::Option<crate::model::text_annotation::TextProperty>,
7115
7116 pub bounding_box: std::option::Option<crate::model::BoundingPoly>,
7133
7134 pub text: std::string::String,
7136
7137 pub confidence: f32,
7139
7140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7141}
7142
7143impl Symbol {
7144 pub fn new() -> Self {
7145 std::default::Default::default()
7146 }
7147
7148 pub fn set_property<T>(mut self, v: T) -> Self
7150 where
7151 T: std::convert::Into<crate::model::text_annotation::TextProperty>,
7152 {
7153 self.property = std::option::Option::Some(v.into());
7154 self
7155 }
7156
7157 pub fn set_or_clear_property<T>(mut self, v: std::option::Option<T>) -> Self
7159 where
7160 T: std::convert::Into<crate::model::text_annotation::TextProperty>,
7161 {
7162 self.property = v.map(|x| x.into());
7163 self
7164 }
7165
7166 pub fn set_bounding_box<T>(mut self, v: T) -> Self
7168 where
7169 T: std::convert::Into<crate::model::BoundingPoly>,
7170 {
7171 self.bounding_box = std::option::Option::Some(v.into());
7172 self
7173 }
7174
7175 pub fn set_or_clear_bounding_box<T>(mut self, v: std::option::Option<T>) -> Self
7177 where
7178 T: std::convert::Into<crate::model::BoundingPoly>,
7179 {
7180 self.bounding_box = v.map(|x| x.into());
7181 self
7182 }
7183
7184 pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7186 self.text = v.into();
7187 self
7188 }
7189
7190 pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
7192 self.confidence = v.into();
7193 self
7194 }
7195}
7196
7197impl wkt::message::Message for Symbol {
7198 fn typename() -> &'static str {
7199 "type.googleapis.com/google.cloud.vision.v1.Symbol"
7200 }
7201}
7202
7203#[derive(Clone, Default, PartialEq)]
7205#[non_exhaustive]
7206pub struct WebDetection {
7207 pub web_entities: std::vec::Vec<crate::model::web_detection::WebEntity>,
7209
7210 pub full_matching_images: std::vec::Vec<crate::model::web_detection::WebImage>,
7213
7214 pub partial_matching_images: std::vec::Vec<crate::model::web_detection::WebImage>,
7218
7219 pub pages_with_matching_images: std::vec::Vec<crate::model::web_detection::WebPage>,
7221
7222 pub visually_similar_images: std::vec::Vec<crate::model::web_detection::WebImage>,
7224
7225 pub best_guess_labels: std::vec::Vec<crate::model::web_detection::WebLabel>,
7228
7229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7230}
7231
7232impl WebDetection {
7233 pub fn new() -> Self {
7234 std::default::Default::default()
7235 }
7236
7237 pub fn set_web_entities<T, V>(mut self, v: T) -> Self
7239 where
7240 T: std::iter::IntoIterator<Item = V>,
7241 V: std::convert::Into<crate::model::web_detection::WebEntity>,
7242 {
7243 use std::iter::Iterator;
7244 self.web_entities = v.into_iter().map(|i| i.into()).collect();
7245 self
7246 }
7247
7248 pub fn set_full_matching_images<T, V>(mut self, v: T) -> Self
7250 where
7251 T: std::iter::IntoIterator<Item = V>,
7252 V: std::convert::Into<crate::model::web_detection::WebImage>,
7253 {
7254 use std::iter::Iterator;
7255 self.full_matching_images = v.into_iter().map(|i| i.into()).collect();
7256 self
7257 }
7258
7259 pub fn set_partial_matching_images<T, V>(mut self, v: T) -> Self
7261 where
7262 T: std::iter::IntoIterator<Item = V>,
7263 V: std::convert::Into<crate::model::web_detection::WebImage>,
7264 {
7265 use std::iter::Iterator;
7266 self.partial_matching_images = v.into_iter().map(|i| i.into()).collect();
7267 self
7268 }
7269
7270 pub fn set_pages_with_matching_images<T, V>(mut self, v: T) -> Self
7272 where
7273 T: std::iter::IntoIterator<Item = V>,
7274 V: std::convert::Into<crate::model::web_detection::WebPage>,
7275 {
7276 use std::iter::Iterator;
7277 self.pages_with_matching_images = v.into_iter().map(|i| i.into()).collect();
7278 self
7279 }
7280
7281 pub fn set_visually_similar_images<T, V>(mut self, v: T) -> Self
7283 where
7284 T: std::iter::IntoIterator<Item = V>,
7285 V: std::convert::Into<crate::model::web_detection::WebImage>,
7286 {
7287 use std::iter::Iterator;
7288 self.visually_similar_images = v.into_iter().map(|i| i.into()).collect();
7289 self
7290 }
7291
7292 pub fn set_best_guess_labels<T, V>(mut self, v: T) -> Self
7294 where
7295 T: std::iter::IntoIterator<Item = V>,
7296 V: std::convert::Into<crate::model::web_detection::WebLabel>,
7297 {
7298 use std::iter::Iterator;
7299 self.best_guess_labels = v.into_iter().map(|i| i.into()).collect();
7300 self
7301 }
7302}
7303
7304impl wkt::message::Message for WebDetection {
7305 fn typename() -> &'static str {
7306 "type.googleapis.com/google.cloud.vision.v1.WebDetection"
7307 }
7308}
7309
7310pub mod web_detection {
7312 #[allow(unused_imports)]
7313 use super::*;
7314
7315 #[derive(Clone, Default, PartialEq)]
7317 #[non_exhaustive]
7318 pub struct WebEntity {
7319 pub entity_id: std::string::String,
7321
7322 pub score: f32,
7325
7326 pub description: std::string::String,
7328
7329 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7330 }
7331
7332 impl WebEntity {
7333 pub fn new() -> Self {
7334 std::default::Default::default()
7335 }
7336
7337 pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7339 self.entity_id = v.into();
7340 self
7341 }
7342
7343 pub fn set_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
7345 self.score = v.into();
7346 self
7347 }
7348
7349 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7351 self.description = v.into();
7352 self
7353 }
7354 }
7355
7356 impl wkt::message::Message for WebEntity {
7357 fn typename() -> &'static str {
7358 "type.googleapis.com/google.cloud.vision.v1.WebDetection.WebEntity"
7359 }
7360 }
7361
7362 #[derive(Clone, Default, PartialEq)]
7364 #[non_exhaustive]
7365 pub struct WebImage {
7366 pub url: std::string::String,
7368
7369 pub score: f32,
7371
7372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7373 }
7374
7375 impl WebImage {
7376 pub fn new() -> Self {
7377 std::default::Default::default()
7378 }
7379
7380 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7382 self.url = v.into();
7383 self
7384 }
7385
7386 pub fn set_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
7388 self.score = v.into();
7389 self
7390 }
7391 }
7392
7393 impl wkt::message::Message for WebImage {
7394 fn typename() -> &'static str {
7395 "type.googleapis.com/google.cloud.vision.v1.WebDetection.WebImage"
7396 }
7397 }
7398
7399 #[derive(Clone, Default, PartialEq)]
7401 #[non_exhaustive]
7402 pub struct WebPage {
7403 pub url: std::string::String,
7405
7406 pub score: f32,
7408
7409 pub page_title: std::string::String,
7411
7412 pub full_matching_images: std::vec::Vec<crate::model::web_detection::WebImage>,
7415
7416 pub partial_matching_images: std::vec::Vec<crate::model::web_detection::WebImage>,
7421
7422 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7423 }
7424
7425 impl WebPage {
7426 pub fn new() -> Self {
7427 std::default::Default::default()
7428 }
7429
7430 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7432 self.url = v.into();
7433 self
7434 }
7435
7436 pub fn set_score<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
7438 self.score = v.into();
7439 self
7440 }
7441
7442 pub fn set_page_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7444 self.page_title = v.into();
7445 self
7446 }
7447
7448 pub fn set_full_matching_images<T, V>(mut self, v: T) -> Self
7450 where
7451 T: std::iter::IntoIterator<Item = V>,
7452 V: std::convert::Into<crate::model::web_detection::WebImage>,
7453 {
7454 use std::iter::Iterator;
7455 self.full_matching_images = v.into_iter().map(|i| i.into()).collect();
7456 self
7457 }
7458
7459 pub fn set_partial_matching_images<T, V>(mut self, v: T) -> Self
7461 where
7462 T: std::iter::IntoIterator<Item = V>,
7463 V: std::convert::Into<crate::model::web_detection::WebImage>,
7464 {
7465 use std::iter::Iterator;
7466 self.partial_matching_images = v.into_iter().map(|i| i.into()).collect();
7467 self
7468 }
7469 }
7470
7471 impl wkt::message::Message for WebPage {
7472 fn typename() -> &'static str {
7473 "type.googleapis.com/google.cloud.vision.v1.WebDetection.WebPage"
7474 }
7475 }
7476
7477 #[derive(Clone, Default, PartialEq)]
7479 #[non_exhaustive]
7480 pub struct WebLabel {
7481 pub label: std::string::String,
7483
7484 pub language_code: std::string::String,
7488
7489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7490 }
7491
7492 impl WebLabel {
7493 pub fn new() -> Self {
7494 std::default::Default::default()
7495 }
7496
7497 pub fn set_label<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7499 self.label = v.into();
7500 self
7501 }
7502
7503 pub fn set_language_code<T: std::convert::Into<std::string::String>>(
7505 mut self,
7506 v: T,
7507 ) -> Self {
7508 self.language_code = v.into();
7509 self
7510 }
7511 }
7512
7513 impl wkt::message::Message for WebLabel {
7514 fn typename() -> &'static str {
7515 "type.googleapis.com/google.cloud.vision.v1.WebDetection.WebLabel"
7516 }
7517 }
7518}
7519
7520#[derive(Clone, Debug, PartialEq)]
7537#[non_exhaustive]
7538pub enum Likelihood {
7539 Unknown,
7541 VeryUnlikely,
7543 Unlikely,
7545 Possible,
7547 Likely,
7549 VeryLikely,
7551 UnknownValue(likelihood::UnknownValue),
7556}
7557
7558#[doc(hidden)]
7559pub mod likelihood {
7560 #[allow(unused_imports)]
7561 use super::*;
7562 #[derive(Clone, Debug, PartialEq)]
7563 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7564}
7565
7566impl Likelihood {
7567 pub fn value(&self) -> std::option::Option<i32> {
7572 match self {
7573 Self::Unknown => std::option::Option::Some(0),
7574 Self::VeryUnlikely => std::option::Option::Some(1),
7575 Self::Unlikely => std::option::Option::Some(2),
7576 Self::Possible => std::option::Option::Some(3),
7577 Self::Likely => std::option::Option::Some(4),
7578 Self::VeryLikely => std::option::Option::Some(5),
7579 Self::UnknownValue(u) => u.0.value(),
7580 }
7581 }
7582
7583 pub fn name(&self) -> std::option::Option<&str> {
7588 match self {
7589 Self::Unknown => std::option::Option::Some("UNKNOWN"),
7590 Self::VeryUnlikely => std::option::Option::Some("VERY_UNLIKELY"),
7591 Self::Unlikely => std::option::Option::Some("UNLIKELY"),
7592 Self::Possible => std::option::Option::Some("POSSIBLE"),
7593 Self::Likely => std::option::Option::Some("LIKELY"),
7594 Self::VeryLikely => std::option::Option::Some("VERY_LIKELY"),
7595 Self::UnknownValue(u) => u.0.name(),
7596 }
7597 }
7598}
7599
7600impl std::default::Default for Likelihood {
7601 fn default() -> Self {
7602 use std::convert::From;
7603 Self::from(0)
7604 }
7605}
7606
7607impl std::fmt::Display for Likelihood {
7608 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7609 wkt::internal::display_enum(f, self.name(), self.value())
7610 }
7611}
7612
7613impl std::convert::From<i32> for Likelihood {
7614 fn from(value: i32) -> Self {
7615 match value {
7616 0 => Self::Unknown,
7617 1 => Self::VeryUnlikely,
7618 2 => Self::Unlikely,
7619 3 => Self::Possible,
7620 4 => Self::Likely,
7621 5 => Self::VeryLikely,
7622 _ => Self::UnknownValue(likelihood::UnknownValue(
7623 wkt::internal::UnknownEnumValue::Integer(value),
7624 )),
7625 }
7626 }
7627}
7628
7629impl std::convert::From<&str> for Likelihood {
7630 fn from(value: &str) -> Self {
7631 use std::string::ToString;
7632 match value {
7633 "UNKNOWN" => Self::Unknown,
7634 "VERY_UNLIKELY" => Self::VeryUnlikely,
7635 "UNLIKELY" => Self::Unlikely,
7636 "POSSIBLE" => Self::Possible,
7637 "LIKELY" => Self::Likely,
7638 "VERY_LIKELY" => Self::VeryLikely,
7639 _ => Self::UnknownValue(likelihood::UnknownValue(
7640 wkt::internal::UnknownEnumValue::String(value.to_string()),
7641 )),
7642 }
7643 }
7644}
7645
7646impl serde::ser::Serialize for Likelihood {
7647 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7648 where
7649 S: serde::Serializer,
7650 {
7651 match self {
7652 Self::Unknown => serializer.serialize_i32(0),
7653 Self::VeryUnlikely => serializer.serialize_i32(1),
7654 Self::Unlikely => serializer.serialize_i32(2),
7655 Self::Possible => serializer.serialize_i32(3),
7656 Self::Likely => serializer.serialize_i32(4),
7657 Self::VeryLikely => serializer.serialize_i32(5),
7658 Self::UnknownValue(u) => u.0.serialize(serializer),
7659 }
7660 }
7661}
7662
7663impl<'de> serde::de::Deserialize<'de> for Likelihood {
7664 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7665 where
7666 D: serde::Deserializer<'de>,
7667 {
7668 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Likelihood>::new(
7669 ".google.cloud.vision.v1.Likelihood",
7670 ))
7671 }
7672}