1#![allow(rustdoc::invalid_html_tags)]
18#![allow(rustdoc::redundant_explicit_links)]
19use crate as wkt;
20
21#[serde_with::serde_as]
31#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
32#[serde(default, rename_all = "camelCase")]
33#[non_exhaustive]
34pub struct Api {
35 #[serde(skip_serializing_if = "std::string::String::is_empty")]
38 pub name: std::string::String,
39
40 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
42 pub methods: std::vec::Vec<crate::Method>,
43
44 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
46 pub options: std::vec::Vec<crate::Option>,
47
48 #[serde(skip_serializing_if = "std::string::String::is_empty")]
68 pub version: std::string::String,
69
70 #[serde(skip_serializing_if = "std::option::Option::is_none")]
73 pub source_context: std::option::Option<crate::SourceContext>,
74
75 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
79 pub mixins: std::vec::Vec<crate::Mixin>,
80
81 pub syntax: crate::Syntax,
83
84 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
85 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
86}
87
88impl Api {
89 pub fn new() -> Self {
90 std::default::Default::default()
91 }
92
93 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
95 self.name = v.into();
96 self
97 }
98
99 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
101 self.version = v.into();
102 self
103 }
104
105 pub fn set_source_context<T: std::convert::Into<std::option::Option<crate::SourceContext>>>(
107 mut self,
108 v: T,
109 ) -> Self {
110 self.source_context = v.into();
111 self
112 }
113
114 pub fn set_syntax<T: std::convert::Into<crate::Syntax>>(mut self, v: T) -> Self {
116 self.syntax = v.into();
117 self
118 }
119
120 pub fn set_methods<T, V>(mut self, v: T) -> Self
122 where
123 T: std::iter::IntoIterator<Item = V>,
124 V: std::convert::Into<crate::Method>,
125 {
126 use std::iter::Iterator;
127 self.methods = v.into_iter().map(|i| i.into()).collect();
128 self
129 }
130
131 pub fn set_options<T, V>(mut self, v: T) -> Self
133 where
134 T: std::iter::IntoIterator<Item = V>,
135 V: std::convert::Into<crate::Option>,
136 {
137 use std::iter::Iterator;
138 self.options = v.into_iter().map(|i| i.into()).collect();
139 self
140 }
141
142 pub fn set_mixins<T, V>(mut self, v: T) -> Self
144 where
145 T: std::iter::IntoIterator<Item = V>,
146 V: std::convert::Into<crate::Mixin>,
147 {
148 use std::iter::Iterator;
149 self.mixins = v.into_iter().map(|i| i.into()).collect();
150 self
151 }
152}
153
154impl wkt::message::Message for Api {
155 fn typename() -> &'static str {
156 "type.googleapis.com/google.protobuf.Api"
157 }
158}
159
160#[serde_with::serde_as]
162#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
163#[serde(default, rename_all = "camelCase")]
164#[non_exhaustive]
165pub struct Method {
166 #[serde(skip_serializing_if = "std::string::String::is_empty")]
168 pub name: std::string::String,
169
170 #[serde(skip_serializing_if = "std::string::String::is_empty")]
172 pub request_type_url: std::string::String,
173
174 pub request_streaming: bool,
176
177 #[serde(skip_serializing_if = "std::string::String::is_empty")]
179 pub response_type_url: std::string::String,
180
181 pub response_streaming: bool,
183
184 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
186 pub options: std::vec::Vec<crate::Option>,
187
188 pub syntax: crate::Syntax,
190
191 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
192 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
193}
194
195impl Method {
196 pub fn new() -> Self {
197 std::default::Default::default()
198 }
199
200 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
202 self.name = v.into();
203 self
204 }
205
206 pub fn set_request_type_url<T: std::convert::Into<std::string::String>>(
208 mut self,
209 v: T,
210 ) -> Self {
211 self.request_type_url = v.into();
212 self
213 }
214
215 pub fn set_request_streaming<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
217 self.request_streaming = v.into();
218 self
219 }
220
221 pub fn set_response_type_url<T: std::convert::Into<std::string::String>>(
223 mut self,
224 v: T,
225 ) -> Self {
226 self.response_type_url = v.into();
227 self
228 }
229
230 pub fn set_response_streaming<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
232 self.response_streaming = v.into();
233 self
234 }
235
236 pub fn set_syntax<T: std::convert::Into<crate::Syntax>>(mut self, v: T) -> Self {
238 self.syntax = v.into();
239 self
240 }
241
242 pub fn set_options<T, V>(mut self, v: T) -> Self
244 where
245 T: std::iter::IntoIterator<Item = V>,
246 V: std::convert::Into<crate::Option>,
247 {
248 use std::iter::Iterator;
249 self.options = v.into_iter().map(|i| i.into()).collect();
250 self
251 }
252}
253
254impl wkt::message::Message for Method {
255 fn typename() -> &'static str {
256 "type.googleapis.com/google.protobuf.Method"
257 }
258}
259
260#[serde_with::serde_as]
352#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
353#[serde(default, rename_all = "camelCase")]
354#[non_exhaustive]
355pub struct Mixin {
356 #[serde(skip_serializing_if = "std::string::String::is_empty")]
358 pub name: std::string::String,
359
360 #[serde(skip_serializing_if = "std::string::String::is_empty")]
363 pub root: std::string::String,
364
365 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
366 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
367}
368
369impl Mixin {
370 pub fn new() -> Self {
371 std::default::Default::default()
372 }
373
374 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
376 self.name = v.into();
377 self
378 }
379
380 pub fn set_root<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
382 self.root = v.into();
383 self
384 }
385}
386
387impl wkt::message::Message for Mixin {
388 fn typename() -> &'static str {
389 "type.googleapis.com/google.protobuf.Mixin"
390 }
391}
392
393#[serde_with::serde_as]
396#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
397#[serde(default, rename_all = "camelCase")]
398#[non_exhaustive]
399pub struct FileDescriptorSet {
400 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
401 pub file: std::vec::Vec<crate::FileDescriptorProto>,
402
403 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
404 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
405}
406
407impl FileDescriptorSet {
408 pub fn new() -> Self {
409 std::default::Default::default()
410 }
411
412 pub fn set_file<T, V>(mut self, v: T) -> Self
414 where
415 T: std::iter::IntoIterator<Item = V>,
416 V: std::convert::Into<crate::FileDescriptorProto>,
417 {
418 use std::iter::Iterator;
419 self.file = v.into_iter().map(|i| i.into()).collect();
420 self
421 }
422}
423
424impl wkt::message::Message for FileDescriptorSet {
425 fn typename() -> &'static str {
426 "type.googleapis.com/google.protobuf.FileDescriptorSet"
427 }
428}
429
430#[serde_with::serde_as]
432#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
433#[serde(default, rename_all = "camelCase")]
434#[non_exhaustive]
435pub struct FileDescriptorProto {
436 #[serde(skip_serializing_if = "std::string::String::is_empty")]
437 pub name: std::string::String,
438
439 #[serde(skip_serializing_if = "std::string::String::is_empty")]
440 pub package: std::string::String,
441
442 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
444 pub dependency: std::vec::Vec<std::string::String>,
445
446 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
448 pub public_dependency: std::vec::Vec<i32>,
449
450 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
453 pub weak_dependency: std::vec::Vec<i32>,
454
455 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
457 pub message_type: std::vec::Vec<crate::DescriptorProto>,
458
459 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
460 pub enum_type: std::vec::Vec<crate::EnumDescriptorProto>,
461
462 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
463 pub service: std::vec::Vec<crate::ServiceDescriptorProto>,
464
465 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
466 pub extension: std::vec::Vec<crate::FieldDescriptorProto>,
467
468 #[serde(skip_serializing_if = "std::option::Option::is_none")]
469 pub options: std::option::Option<crate::FileOptions>,
470
471 #[serde(skip_serializing_if = "std::option::Option::is_none")]
476 pub source_code_info: std::option::Option<crate::SourceCodeInfo>,
477
478 #[serde(skip_serializing_if = "std::string::String::is_empty")]
483 pub syntax: std::string::String,
484
485 pub edition: crate::Edition,
487
488 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
489 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
490}
491
492impl FileDescriptorProto {
493 pub fn new() -> Self {
494 std::default::Default::default()
495 }
496
497 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
499 self.name = v.into();
500 self
501 }
502
503 pub fn set_package<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
505 self.package = v.into();
506 self
507 }
508
509 pub fn set_options<T: std::convert::Into<std::option::Option<crate::FileOptions>>>(
511 mut self,
512 v: T,
513 ) -> Self {
514 self.options = v.into();
515 self
516 }
517
518 pub fn set_source_code_info<
520 T: std::convert::Into<std::option::Option<crate::SourceCodeInfo>>,
521 >(
522 mut self,
523 v: T,
524 ) -> Self {
525 self.source_code_info = v.into();
526 self
527 }
528
529 pub fn set_syntax<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
531 self.syntax = v.into();
532 self
533 }
534
535 pub fn set_edition<T: std::convert::Into<crate::Edition>>(mut self, v: T) -> Self {
537 self.edition = v.into();
538 self
539 }
540
541 pub fn set_dependency<T, V>(mut self, v: T) -> Self
543 where
544 T: std::iter::IntoIterator<Item = V>,
545 V: std::convert::Into<std::string::String>,
546 {
547 use std::iter::Iterator;
548 self.dependency = v.into_iter().map(|i| i.into()).collect();
549 self
550 }
551
552 pub fn set_public_dependency<T, V>(mut self, v: T) -> Self
554 where
555 T: std::iter::IntoIterator<Item = V>,
556 V: std::convert::Into<i32>,
557 {
558 use std::iter::Iterator;
559 self.public_dependency = v.into_iter().map(|i| i.into()).collect();
560 self
561 }
562
563 pub fn set_weak_dependency<T, V>(mut self, v: T) -> Self
565 where
566 T: std::iter::IntoIterator<Item = V>,
567 V: std::convert::Into<i32>,
568 {
569 use std::iter::Iterator;
570 self.weak_dependency = v.into_iter().map(|i| i.into()).collect();
571 self
572 }
573
574 pub fn set_message_type<T, V>(mut self, v: T) -> Self
576 where
577 T: std::iter::IntoIterator<Item = V>,
578 V: std::convert::Into<crate::DescriptorProto>,
579 {
580 use std::iter::Iterator;
581 self.message_type = v.into_iter().map(|i| i.into()).collect();
582 self
583 }
584
585 pub fn set_enum_type<T, V>(mut self, v: T) -> Self
587 where
588 T: std::iter::IntoIterator<Item = V>,
589 V: std::convert::Into<crate::EnumDescriptorProto>,
590 {
591 use std::iter::Iterator;
592 self.enum_type = v.into_iter().map(|i| i.into()).collect();
593 self
594 }
595
596 pub fn set_service<T, V>(mut self, v: T) -> Self
598 where
599 T: std::iter::IntoIterator<Item = V>,
600 V: std::convert::Into<crate::ServiceDescriptorProto>,
601 {
602 use std::iter::Iterator;
603 self.service = v.into_iter().map(|i| i.into()).collect();
604 self
605 }
606
607 pub fn set_extension<T, V>(mut self, v: T) -> Self
609 where
610 T: std::iter::IntoIterator<Item = V>,
611 V: std::convert::Into<crate::FieldDescriptorProto>,
612 {
613 use std::iter::Iterator;
614 self.extension = v.into_iter().map(|i| i.into()).collect();
615 self
616 }
617}
618
619impl wkt::message::Message for FileDescriptorProto {
620 fn typename() -> &'static str {
621 "type.googleapis.com/google.protobuf.FileDescriptorProto"
622 }
623}
624
625#[serde_with::serde_as]
627#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
628#[serde(default, rename_all = "camelCase")]
629#[non_exhaustive]
630pub struct DescriptorProto {
631 #[serde(skip_serializing_if = "std::string::String::is_empty")]
632 pub name: std::string::String,
633
634 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
635 pub field: std::vec::Vec<crate::FieldDescriptorProto>,
636
637 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
638 pub extension: std::vec::Vec<crate::FieldDescriptorProto>,
639
640 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
641 pub nested_type: std::vec::Vec<crate::DescriptorProto>,
642
643 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
644 pub enum_type: std::vec::Vec<crate::EnumDescriptorProto>,
645
646 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
647 pub extension_range: std::vec::Vec<crate::descriptor_proto::ExtensionRange>,
648
649 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
650 pub oneof_decl: std::vec::Vec<crate::OneofDescriptorProto>,
651
652 #[serde(skip_serializing_if = "std::option::Option::is_none")]
653 pub options: std::option::Option<crate::MessageOptions>,
654
655 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
656 pub reserved_range: std::vec::Vec<crate::descriptor_proto::ReservedRange>,
657
658 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
661 pub reserved_name: std::vec::Vec<std::string::String>,
662
663 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
664 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
665}
666
667impl DescriptorProto {
668 pub fn new() -> Self {
669 std::default::Default::default()
670 }
671
672 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
674 self.name = v.into();
675 self
676 }
677
678 pub fn set_options<T: std::convert::Into<std::option::Option<crate::MessageOptions>>>(
680 mut self,
681 v: T,
682 ) -> Self {
683 self.options = v.into();
684 self
685 }
686
687 pub fn set_field<T, V>(mut self, v: T) -> Self
689 where
690 T: std::iter::IntoIterator<Item = V>,
691 V: std::convert::Into<crate::FieldDescriptorProto>,
692 {
693 use std::iter::Iterator;
694 self.field = v.into_iter().map(|i| i.into()).collect();
695 self
696 }
697
698 pub fn set_extension<T, V>(mut self, v: T) -> Self
700 where
701 T: std::iter::IntoIterator<Item = V>,
702 V: std::convert::Into<crate::FieldDescriptorProto>,
703 {
704 use std::iter::Iterator;
705 self.extension = v.into_iter().map(|i| i.into()).collect();
706 self
707 }
708
709 pub fn set_nested_type<T, V>(mut self, v: T) -> Self
711 where
712 T: std::iter::IntoIterator<Item = V>,
713 V: std::convert::Into<crate::DescriptorProto>,
714 {
715 use std::iter::Iterator;
716 self.nested_type = v.into_iter().map(|i| i.into()).collect();
717 self
718 }
719
720 pub fn set_enum_type<T, V>(mut self, v: T) -> Self
722 where
723 T: std::iter::IntoIterator<Item = V>,
724 V: std::convert::Into<crate::EnumDescriptorProto>,
725 {
726 use std::iter::Iterator;
727 self.enum_type = v.into_iter().map(|i| i.into()).collect();
728 self
729 }
730
731 pub fn set_extension_range<T, V>(mut self, v: T) -> Self
733 where
734 T: std::iter::IntoIterator<Item = V>,
735 V: std::convert::Into<crate::descriptor_proto::ExtensionRange>,
736 {
737 use std::iter::Iterator;
738 self.extension_range = v.into_iter().map(|i| i.into()).collect();
739 self
740 }
741
742 pub fn set_oneof_decl<T, V>(mut self, v: T) -> Self
744 where
745 T: std::iter::IntoIterator<Item = V>,
746 V: std::convert::Into<crate::OneofDescriptorProto>,
747 {
748 use std::iter::Iterator;
749 self.oneof_decl = v.into_iter().map(|i| i.into()).collect();
750 self
751 }
752
753 pub fn set_reserved_range<T, V>(mut self, v: T) -> Self
755 where
756 T: std::iter::IntoIterator<Item = V>,
757 V: std::convert::Into<crate::descriptor_proto::ReservedRange>,
758 {
759 use std::iter::Iterator;
760 self.reserved_range = v.into_iter().map(|i| i.into()).collect();
761 self
762 }
763
764 pub fn set_reserved_name<T, V>(mut self, v: T) -> Self
766 where
767 T: std::iter::IntoIterator<Item = V>,
768 V: std::convert::Into<std::string::String>,
769 {
770 use std::iter::Iterator;
771 self.reserved_name = v.into_iter().map(|i| i.into()).collect();
772 self
773 }
774}
775
776impl wkt::message::Message for DescriptorProto {
777 fn typename() -> &'static str {
778 "type.googleapis.com/google.protobuf.DescriptorProto"
779 }
780}
781
782pub mod descriptor_proto {
784 #[allow(unused_imports)]
785 use super::*;
786
787 #[serde_with::serde_as]
788 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
789 #[serde(default, rename_all = "camelCase")]
790 #[non_exhaustive]
791 pub struct ExtensionRange {
792 pub start: i32,
793
794 pub end: i32,
795
796 #[serde(skip_serializing_if = "std::option::Option::is_none")]
797 pub options: std::option::Option<crate::ExtensionRangeOptions>,
798
799 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
800 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
801 }
802
803 impl ExtensionRange {
804 pub fn new() -> Self {
805 std::default::Default::default()
806 }
807
808 pub fn set_start<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
810 self.start = v.into();
811 self
812 }
813
814 pub fn set_end<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
816 self.end = v.into();
817 self
818 }
819
820 pub fn set_options<
822 T: std::convert::Into<std::option::Option<crate::ExtensionRangeOptions>>,
823 >(
824 mut self,
825 v: T,
826 ) -> Self {
827 self.options = v.into();
828 self
829 }
830 }
831
832 impl wkt::message::Message for ExtensionRange {
833 fn typename() -> &'static str {
834 "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange"
835 }
836 }
837
838 #[serde_with::serde_as]
842 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
843 #[serde(default, rename_all = "camelCase")]
844 #[non_exhaustive]
845 pub struct ReservedRange {
846 pub start: i32,
847
848 pub end: i32,
849
850 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
851 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
852 }
853
854 impl ReservedRange {
855 pub fn new() -> Self {
856 std::default::Default::default()
857 }
858
859 pub fn set_start<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
861 self.start = v.into();
862 self
863 }
864
865 pub fn set_end<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
867 self.end = v.into();
868 self
869 }
870 }
871
872 impl wkt::message::Message for ReservedRange {
873 fn typename() -> &'static str {
874 "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange"
875 }
876 }
877}
878
879#[serde_with::serde_as]
880#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
881#[serde(default, rename_all = "camelCase")]
882#[non_exhaustive]
883pub struct ExtensionRangeOptions {
884 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
886 pub uninterpreted_option: std::vec::Vec<crate::UninterpretedOption>,
887
888 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
892 pub declaration: std::vec::Vec<crate::extension_range_options::Declaration>,
893
894 #[serde(skip_serializing_if = "std::option::Option::is_none")]
896 pub features: std::option::Option<crate::FeatureSet>,
897
898 pub verification: crate::extension_range_options::VerificationState,
902
903 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
904 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
905}
906
907impl ExtensionRangeOptions {
908 pub fn new() -> Self {
909 std::default::Default::default()
910 }
911
912 pub fn set_features<T: std::convert::Into<std::option::Option<crate::FeatureSet>>>(
914 mut self,
915 v: T,
916 ) -> Self {
917 self.features = v.into();
918 self
919 }
920
921 pub fn set_verification<
923 T: std::convert::Into<crate::extension_range_options::VerificationState>,
924 >(
925 mut self,
926 v: T,
927 ) -> Self {
928 self.verification = v.into();
929 self
930 }
931
932 pub fn set_uninterpreted_option<T, V>(mut self, v: T) -> Self
934 where
935 T: std::iter::IntoIterator<Item = V>,
936 V: std::convert::Into<crate::UninterpretedOption>,
937 {
938 use std::iter::Iterator;
939 self.uninterpreted_option = v.into_iter().map(|i| i.into()).collect();
940 self
941 }
942
943 pub fn set_declaration<T, V>(mut self, v: T) -> Self
945 where
946 T: std::iter::IntoIterator<Item = V>,
947 V: std::convert::Into<crate::extension_range_options::Declaration>,
948 {
949 use std::iter::Iterator;
950 self.declaration = v.into_iter().map(|i| i.into()).collect();
951 self
952 }
953}
954
955impl wkt::message::Message for ExtensionRangeOptions {
956 fn typename() -> &'static str {
957 "type.googleapis.com/google.protobuf.ExtensionRangeOptions"
958 }
959}
960
961pub mod extension_range_options {
963 #[allow(unused_imports)]
964 use super::*;
965
966 #[serde_with::serde_as]
967 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
968 #[serde(default, rename_all = "camelCase")]
969 #[non_exhaustive]
970 pub struct Declaration {
971 pub number: i32,
973
974 #[serde(skip_serializing_if = "std::string::String::is_empty")]
977 pub full_name: std::string::String,
978
979 #[serde(rename = "type")]
983 #[serde(skip_serializing_if = "std::string::String::is_empty")]
984 pub r#type: std::string::String,
985
986 pub reserved: bool,
990
991 pub repeated: bool,
994
995 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
996 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
997 }
998
999 impl Declaration {
1000 pub fn new() -> Self {
1001 std::default::Default::default()
1002 }
1003
1004 pub fn set_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1006 self.number = v.into();
1007 self
1008 }
1009
1010 pub fn set_full_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1012 self.full_name = v.into();
1013 self
1014 }
1015
1016 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1018 self.r#type = v.into();
1019 self
1020 }
1021
1022 pub fn set_reserved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1024 self.reserved = v.into();
1025 self
1026 }
1027
1028 pub fn set_repeated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1030 self.repeated = v.into();
1031 self
1032 }
1033 }
1034
1035 impl wkt::message::Message for Declaration {
1036 fn typename() -> &'static str {
1037 "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration"
1038 }
1039 }
1040
1041 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1043 pub struct VerificationState(i32);
1044
1045 impl VerificationState {
1046 pub const DECLARATION: VerificationState = VerificationState::new(0);
1048
1049 pub const UNVERIFIED: VerificationState = VerificationState::new(1);
1050
1051 pub(crate) const fn new(value: i32) -> Self {
1053 Self(value)
1054 }
1055
1056 pub fn value(&self) -> i32 {
1058 self.0
1059 }
1060
1061 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1063 match self.0 {
1064 0 => std::borrow::Cow::Borrowed("DECLARATION"),
1065 1 => std::borrow::Cow::Borrowed("UNVERIFIED"),
1066 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1067 }
1068 }
1069
1070 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1072 match name {
1073 "DECLARATION" => std::option::Option::Some(Self::DECLARATION),
1074 "UNVERIFIED" => std::option::Option::Some(Self::UNVERIFIED),
1075 _ => std::option::Option::None,
1076 }
1077 }
1078 }
1079
1080 impl std::convert::From<i32> for VerificationState {
1081 fn from(value: i32) -> Self {
1082 Self::new(value)
1083 }
1084 }
1085
1086 impl std::default::Default for VerificationState {
1087 fn default() -> Self {
1088 Self::new(0)
1089 }
1090 }
1091}
1092
1093#[serde_with::serde_as]
1095#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1096#[serde(default, rename_all = "camelCase")]
1097#[non_exhaustive]
1098pub struct FieldDescriptorProto {
1099 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1100 pub name: std::string::String,
1101
1102 pub number: i32,
1103
1104 pub label: crate::field_descriptor_proto::Label,
1105
1106 #[serde(rename = "type")]
1109 pub r#type: crate::field_descriptor_proto::Type,
1110
1111 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1117 pub type_name: std::string::String,
1118
1119 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1122 pub extendee: std::string::String,
1123
1124 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1129 pub default_value: std::string::String,
1130
1131 pub oneof_index: i32,
1134
1135 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1140 pub json_name: std::string::String,
1141
1142 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1143 pub options: std::option::Option<crate::FieldOptions>,
1144
1145 pub proto3_optional: bool,
1167
1168 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1169 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1170}
1171
1172impl FieldDescriptorProto {
1173 pub fn new() -> Self {
1174 std::default::Default::default()
1175 }
1176
1177 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1179 self.name = v.into();
1180 self
1181 }
1182
1183 pub fn set_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1185 self.number = v.into();
1186 self
1187 }
1188
1189 pub fn set_label<T: std::convert::Into<crate::field_descriptor_proto::Label>>(
1191 mut self,
1192 v: T,
1193 ) -> Self {
1194 self.label = v.into();
1195 self
1196 }
1197
1198 pub fn set_type<T: std::convert::Into<crate::field_descriptor_proto::Type>>(
1200 mut self,
1201 v: T,
1202 ) -> Self {
1203 self.r#type = v.into();
1204 self
1205 }
1206
1207 pub fn set_type_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1209 self.type_name = v.into();
1210 self
1211 }
1212
1213 pub fn set_extendee<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1215 self.extendee = v.into();
1216 self
1217 }
1218
1219 pub fn set_default_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1221 self.default_value = v.into();
1222 self
1223 }
1224
1225 pub fn set_oneof_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1227 self.oneof_index = v.into();
1228 self
1229 }
1230
1231 pub fn set_json_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1233 self.json_name = v.into();
1234 self
1235 }
1236
1237 pub fn set_options<T: std::convert::Into<std::option::Option<crate::FieldOptions>>>(
1239 mut self,
1240 v: T,
1241 ) -> Self {
1242 self.options = v.into();
1243 self
1244 }
1245
1246 pub fn set_proto3_optional<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1248 self.proto3_optional = v.into();
1249 self
1250 }
1251}
1252
1253impl wkt::message::Message for FieldDescriptorProto {
1254 fn typename() -> &'static str {
1255 "type.googleapis.com/google.protobuf.FieldDescriptorProto"
1256 }
1257}
1258
1259pub mod field_descriptor_proto {
1261 #[allow(unused_imports)]
1262 use super::*;
1263
1264 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1265 pub struct Type(i32);
1266
1267 impl Type {
1268 pub const TYPE_DOUBLE: Type = Type::new(1);
1271
1272 pub const TYPE_FLOAT: Type = Type::new(2);
1273
1274 pub const TYPE_INT64: Type = Type::new(3);
1277
1278 pub const TYPE_UINT64: Type = Type::new(4);
1279
1280 pub const TYPE_INT32: Type = Type::new(5);
1283
1284 pub const TYPE_FIXED64: Type = Type::new(6);
1285
1286 pub const TYPE_FIXED32: Type = Type::new(7);
1287
1288 pub const TYPE_BOOL: Type = Type::new(8);
1289
1290 pub const TYPE_STRING: Type = Type::new(9);
1291
1292 pub const TYPE_GROUP: Type = Type::new(10);
1298
1299 pub const TYPE_MESSAGE: Type = Type::new(11);
1300
1301 pub const TYPE_BYTES: Type = Type::new(12);
1303
1304 pub const TYPE_UINT32: Type = Type::new(13);
1305
1306 pub const TYPE_ENUM: Type = Type::new(14);
1307
1308 pub const TYPE_SFIXED32: Type = Type::new(15);
1309
1310 pub const TYPE_SFIXED64: Type = Type::new(16);
1311
1312 pub const TYPE_SINT32: Type = Type::new(17);
1313
1314 pub const TYPE_SINT64: Type = Type::new(18);
1315
1316 pub(crate) const fn new(value: i32) -> Self {
1318 Self(value)
1319 }
1320
1321 pub fn value(&self) -> i32 {
1323 self.0
1324 }
1325
1326 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1328 match self.0 {
1329 1 => std::borrow::Cow::Borrowed("TYPE_DOUBLE"),
1330 2 => std::borrow::Cow::Borrowed("TYPE_FLOAT"),
1331 3 => std::borrow::Cow::Borrowed("TYPE_INT64"),
1332 4 => std::borrow::Cow::Borrowed("TYPE_UINT64"),
1333 5 => std::borrow::Cow::Borrowed("TYPE_INT32"),
1334 6 => std::borrow::Cow::Borrowed("TYPE_FIXED64"),
1335 7 => std::borrow::Cow::Borrowed("TYPE_FIXED32"),
1336 8 => std::borrow::Cow::Borrowed("TYPE_BOOL"),
1337 9 => std::borrow::Cow::Borrowed("TYPE_STRING"),
1338 10 => std::borrow::Cow::Borrowed("TYPE_GROUP"),
1339 11 => std::borrow::Cow::Borrowed("TYPE_MESSAGE"),
1340 12 => std::borrow::Cow::Borrowed("TYPE_BYTES"),
1341 13 => std::borrow::Cow::Borrowed("TYPE_UINT32"),
1342 14 => std::borrow::Cow::Borrowed("TYPE_ENUM"),
1343 15 => std::borrow::Cow::Borrowed("TYPE_SFIXED32"),
1344 16 => std::borrow::Cow::Borrowed("TYPE_SFIXED64"),
1345 17 => std::borrow::Cow::Borrowed("TYPE_SINT32"),
1346 18 => std::borrow::Cow::Borrowed("TYPE_SINT64"),
1347 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1348 }
1349 }
1350
1351 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1353 match name {
1354 "TYPE_DOUBLE" => std::option::Option::Some(Self::TYPE_DOUBLE),
1355 "TYPE_FLOAT" => std::option::Option::Some(Self::TYPE_FLOAT),
1356 "TYPE_INT64" => std::option::Option::Some(Self::TYPE_INT64),
1357 "TYPE_UINT64" => std::option::Option::Some(Self::TYPE_UINT64),
1358 "TYPE_INT32" => std::option::Option::Some(Self::TYPE_INT32),
1359 "TYPE_FIXED64" => std::option::Option::Some(Self::TYPE_FIXED64),
1360 "TYPE_FIXED32" => std::option::Option::Some(Self::TYPE_FIXED32),
1361 "TYPE_BOOL" => std::option::Option::Some(Self::TYPE_BOOL),
1362 "TYPE_STRING" => std::option::Option::Some(Self::TYPE_STRING),
1363 "TYPE_GROUP" => std::option::Option::Some(Self::TYPE_GROUP),
1364 "TYPE_MESSAGE" => std::option::Option::Some(Self::TYPE_MESSAGE),
1365 "TYPE_BYTES" => std::option::Option::Some(Self::TYPE_BYTES),
1366 "TYPE_UINT32" => std::option::Option::Some(Self::TYPE_UINT32),
1367 "TYPE_ENUM" => std::option::Option::Some(Self::TYPE_ENUM),
1368 "TYPE_SFIXED32" => std::option::Option::Some(Self::TYPE_SFIXED32),
1369 "TYPE_SFIXED64" => std::option::Option::Some(Self::TYPE_SFIXED64),
1370 "TYPE_SINT32" => std::option::Option::Some(Self::TYPE_SINT32),
1371 "TYPE_SINT64" => std::option::Option::Some(Self::TYPE_SINT64),
1372 _ => std::option::Option::None,
1373 }
1374 }
1375 }
1376
1377 impl std::convert::From<i32> for Type {
1378 fn from(value: i32) -> Self {
1379 Self::new(value)
1380 }
1381 }
1382
1383 impl std::default::Default for Type {
1384 fn default() -> Self {
1385 Self::new(0)
1386 }
1387 }
1388
1389 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1390 pub struct Label(i32);
1391
1392 impl Label {
1393 pub const LABEL_OPTIONAL: Label = Label::new(1);
1395
1396 pub const LABEL_REPEATED: Label = Label::new(3);
1397
1398 pub const LABEL_REQUIRED: Label = Label::new(2);
1402
1403 pub(crate) const fn new(value: i32) -> Self {
1405 Self(value)
1406 }
1407
1408 pub fn value(&self) -> i32 {
1410 self.0
1411 }
1412
1413 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1415 match self.0 {
1416 1 => std::borrow::Cow::Borrowed("LABEL_OPTIONAL"),
1417 2 => std::borrow::Cow::Borrowed("LABEL_REQUIRED"),
1418 3 => std::borrow::Cow::Borrowed("LABEL_REPEATED"),
1419 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1420 }
1421 }
1422
1423 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1425 match name {
1426 "LABEL_OPTIONAL" => std::option::Option::Some(Self::LABEL_OPTIONAL),
1427 "LABEL_REPEATED" => std::option::Option::Some(Self::LABEL_REPEATED),
1428 "LABEL_REQUIRED" => std::option::Option::Some(Self::LABEL_REQUIRED),
1429 _ => std::option::Option::None,
1430 }
1431 }
1432 }
1433
1434 impl std::convert::From<i32> for Label {
1435 fn from(value: i32) -> Self {
1436 Self::new(value)
1437 }
1438 }
1439
1440 impl std::default::Default for Label {
1441 fn default() -> Self {
1442 Self::new(0)
1443 }
1444 }
1445}
1446
1447#[serde_with::serde_as]
1449#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1450#[serde(default, rename_all = "camelCase")]
1451#[non_exhaustive]
1452pub struct OneofDescriptorProto {
1453 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1454 pub name: std::string::String,
1455
1456 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1457 pub options: std::option::Option<crate::OneofOptions>,
1458
1459 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1460 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1461}
1462
1463impl OneofDescriptorProto {
1464 pub fn new() -> Self {
1465 std::default::Default::default()
1466 }
1467
1468 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1470 self.name = v.into();
1471 self
1472 }
1473
1474 pub fn set_options<T: std::convert::Into<std::option::Option<crate::OneofOptions>>>(
1476 mut self,
1477 v: T,
1478 ) -> Self {
1479 self.options = v.into();
1480 self
1481 }
1482}
1483
1484impl wkt::message::Message for OneofDescriptorProto {
1485 fn typename() -> &'static str {
1486 "type.googleapis.com/google.protobuf.OneofDescriptorProto"
1487 }
1488}
1489
1490#[serde_with::serde_as]
1492#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1493#[serde(default, rename_all = "camelCase")]
1494#[non_exhaustive]
1495pub struct EnumDescriptorProto {
1496 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1497 pub name: std::string::String,
1498
1499 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1500 pub value: std::vec::Vec<crate::EnumValueDescriptorProto>,
1501
1502 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1503 pub options: std::option::Option<crate::EnumOptions>,
1504
1505 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1509 pub reserved_range: std::vec::Vec<crate::enum_descriptor_proto::EnumReservedRange>,
1510
1511 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1514 pub reserved_name: std::vec::Vec<std::string::String>,
1515
1516 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1517 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1518}
1519
1520impl EnumDescriptorProto {
1521 pub fn new() -> Self {
1522 std::default::Default::default()
1523 }
1524
1525 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1527 self.name = v.into();
1528 self
1529 }
1530
1531 pub fn set_options<T: std::convert::Into<std::option::Option<crate::EnumOptions>>>(
1533 mut self,
1534 v: T,
1535 ) -> Self {
1536 self.options = v.into();
1537 self
1538 }
1539
1540 pub fn set_value<T, V>(mut self, v: T) -> Self
1542 where
1543 T: std::iter::IntoIterator<Item = V>,
1544 V: std::convert::Into<crate::EnumValueDescriptorProto>,
1545 {
1546 use std::iter::Iterator;
1547 self.value = v.into_iter().map(|i| i.into()).collect();
1548 self
1549 }
1550
1551 pub fn set_reserved_range<T, V>(mut self, v: T) -> Self
1553 where
1554 T: std::iter::IntoIterator<Item = V>,
1555 V: std::convert::Into<crate::enum_descriptor_proto::EnumReservedRange>,
1556 {
1557 use std::iter::Iterator;
1558 self.reserved_range = v.into_iter().map(|i| i.into()).collect();
1559 self
1560 }
1561
1562 pub fn set_reserved_name<T, V>(mut self, v: T) -> Self
1564 where
1565 T: std::iter::IntoIterator<Item = V>,
1566 V: std::convert::Into<std::string::String>,
1567 {
1568 use std::iter::Iterator;
1569 self.reserved_name = v.into_iter().map(|i| i.into()).collect();
1570 self
1571 }
1572}
1573
1574impl wkt::message::Message for EnumDescriptorProto {
1575 fn typename() -> &'static str {
1576 "type.googleapis.com/google.protobuf.EnumDescriptorProto"
1577 }
1578}
1579
1580pub mod enum_descriptor_proto {
1582 #[allow(unused_imports)]
1583 use super::*;
1584
1585 #[serde_with::serde_as]
1592 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1593 #[serde(default, rename_all = "camelCase")]
1594 #[non_exhaustive]
1595 pub struct EnumReservedRange {
1596 pub start: i32,
1597
1598 pub end: i32,
1599
1600 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1601 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1602 }
1603
1604 impl EnumReservedRange {
1605 pub fn new() -> Self {
1606 std::default::Default::default()
1607 }
1608
1609 pub fn set_start<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1611 self.start = v.into();
1612 self
1613 }
1614
1615 pub fn set_end<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1617 self.end = v.into();
1618 self
1619 }
1620 }
1621
1622 impl wkt::message::Message for EnumReservedRange {
1623 fn typename() -> &'static str {
1624 "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange"
1625 }
1626 }
1627}
1628
1629#[serde_with::serde_as]
1631#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1632#[serde(default, rename_all = "camelCase")]
1633#[non_exhaustive]
1634pub struct EnumValueDescriptorProto {
1635 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1636 pub name: std::string::String,
1637
1638 pub number: i32,
1639
1640 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1641 pub options: std::option::Option<crate::EnumValueOptions>,
1642
1643 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1644 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1645}
1646
1647impl EnumValueDescriptorProto {
1648 pub fn new() -> Self {
1649 std::default::Default::default()
1650 }
1651
1652 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1654 self.name = v.into();
1655 self
1656 }
1657
1658 pub fn set_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1660 self.number = v.into();
1661 self
1662 }
1663
1664 pub fn set_options<T: std::convert::Into<std::option::Option<crate::EnumValueOptions>>>(
1666 mut self,
1667 v: T,
1668 ) -> Self {
1669 self.options = v.into();
1670 self
1671 }
1672}
1673
1674impl wkt::message::Message for EnumValueDescriptorProto {
1675 fn typename() -> &'static str {
1676 "type.googleapis.com/google.protobuf.EnumValueDescriptorProto"
1677 }
1678}
1679
1680#[serde_with::serde_as]
1682#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1683#[serde(default, rename_all = "camelCase")]
1684#[non_exhaustive]
1685pub struct ServiceDescriptorProto {
1686 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1687 pub name: std::string::String,
1688
1689 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1690 pub method: std::vec::Vec<crate::MethodDescriptorProto>,
1691
1692 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1693 pub options: std::option::Option<crate::ServiceOptions>,
1694
1695 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1696 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1697}
1698
1699impl ServiceDescriptorProto {
1700 pub fn new() -> Self {
1701 std::default::Default::default()
1702 }
1703
1704 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1706 self.name = v.into();
1707 self
1708 }
1709
1710 pub fn set_options<T: std::convert::Into<std::option::Option<crate::ServiceOptions>>>(
1712 mut self,
1713 v: T,
1714 ) -> Self {
1715 self.options = v.into();
1716 self
1717 }
1718
1719 pub fn set_method<T, V>(mut self, v: T) -> Self
1721 where
1722 T: std::iter::IntoIterator<Item = V>,
1723 V: std::convert::Into<crate::MethodDescriptorProto>,
1724 {
1725 use std::iter::Iterator;
1726 self.method = v.into_iter().map(|i| i.into()).collect();
1727 self
1728 }
1729}
1730
1731impl wkt::message::Message for ServiceDescriptorProto {
1732 fn typename() -> &'static str {
1733 "type.googleapis.com/google.protobuf.ServiceDescriptorProto"
1734 }
1735}
1736
1737#[serde_with::serde_as]
1739#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1740#[serde(default, rename_all = "camelCase")]
1741#[non_exhaustive]
1742pub struct MethodDescriptorProto {
1743 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1744 pub name: std::string::String,
1745
1746 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1749 pub input_type: std::string::String,
1750
1751 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1752 pub output_type: std::string::String,
1753
1754 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1755 pub options: std::option::Option<crate::MethodOptions>,
1756
1757 pub client_streaming: bool,
1759
1760 pub server_streaming: bool,
1762
1763 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1764 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1765}
1766
1767impl MethodDescriptorProto {
1768 pub fn new() -> Self {
1769 std::default::Default::default()
1770 }
1771
1772 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1774 self.name = v.into();
1775 self
1776 }
1777
1778 pub fn set_input_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1780 self.input_type = v.into();
1781 self
1782 }
1783
1784 pub fn set_output_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1786 self.output_type = v.into();
1787 self
1788 }
1789
1790 pub fn set_options<T: std::convert::Into<std::option::Option<crate::MethodOptions>>>(
1792 mut self,
1793 v: T,
1794 ) -> Self {
1795 self.options = v.into();
1796 self
1797 }
1798
1799 pub fn set_client_streaming<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1801 self.client_streaming = v.into();
1802 self
1803 }
1804
1805 pub fn set_server_streaming<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1807 self.server_streaming = v.into();
1808 self
1809 }
1810}
1811
1812impl wkt::message::Message for MethodDescriptorProto {
1813 fn typename() -> &'static str {
1814 "type.googleapis.com/google.protobuf.MethodDescriptorProto"
1815 }
1816}
1817
1818#[serde_with::serde_as]
1819#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1820#[serde(default, rename_all = "camelCase")]
1821#[non_exhaustive]
1822pub struct FileOptions {
1823 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1828 pub java_package: std::string::String,
1829
1830 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1836 pub java_outer_classname: std::string::String,
1837
1838 pub java_multiple_files: bool,
1845
1846 pub java_generate_equals_and_hash: bool,
1848
1849 pub java_string_check_utf8: bool,
1860
1861 pub optimize_for: crate::file_options::OptimizeMode,
1862
1863 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1870 pub go_package: std::string::String,
1871
1872 pub cc_generic_services: bool,
1883
1884 pub java_generic_services: bool,
1885
1886 pub py_generic_services: bool,
1887
1888 pub deprecated: bool,
1893
1894 pub cc_enable_arenas: bool,
1897
1898 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1901 pub objc_class_prefix: std::string::String,
1902
1903 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1905 pub csharp_namespace: std::string::String,
1906
1907 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1912 pub swift_prefix: std::string::String,
1913
1914 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1917 pub php_class_prefix: std::string::String,
1918
1919 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1923 pub php_namespace: std::string::String,
1924
1925 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1929 pub php_metadata_namespace: std::string::String,
1930
1931 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1935 pub ruby_package: std::string::String,
1936
1937 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1939 pub features: std::option::Option<crate::FeatureSet>,
1940
1941 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1944 pub uninterpreted_option: std::vec::Vec<crate::UninterpretedOption>,
1945
1946 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1947 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1948}
1949
1950impl FileOptions {
1951 pub fn new() -> Self {
1952 std::default::Default::default()
1953 }
1954
1955 pub fn set_java_package<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1957 self.java_package = v.into();
1958 self
1959 }
1960
1961 pub fn set_java_outer_classname<T: std::convert::Into<std::string::String>>(
1963 mut self,
1964 v: T,
1965 ) -> Self {
1966 self.java_outer_classname = v.into();
1967 self
1968 }
1969
1970 pub fn set_java_multiple_files<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1972 self.java_multiple_files = v.into();
1973 self
1974 }
1975
1976 pub fn set_java_generate_equals_and_hash<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1978 self.java_generate_equals_and_hash = v.into();
1979 self
1980 }
1981
1982 pub fn set_java_string_check_utf8<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1984 self.java_string_check_utf8 = v.into();
1985 self
1986 }
1987
1988 pub fn set_optimize_for<T: std::convert::Into<crate::file_options::OptimizeMode>>(
1990 mut self,
1991 v: T,
1992 ) -> Self {
1993 self.optimize_for = v.into();
1994 self
1995 }
1996
1997 pub fn set_go_package<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1999 self.go_package = v.into();
2000 self
2001 }
2002
2003 pub fn set_cc_generic_services<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2005 self.cc_generic_services = v.into();
2006 self
2007 }
2008
2009 pub fn set_java_generic_services<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2011 self.java_generic_services = v.into();
2012 self
2013 }
2014
2015 pub fn set_py_generic_services<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2017 self.py_generic_services = v.into();
2018 self
2019 }
2020
2021 pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2023 self.deprecated = v.into();
2024 self
2025 }
2026
2027 pub fn set_cc_enable_arenas<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2029 self.cc_enable_arenas = v.into();
2030 self
2031 }
2032
2033 pub fn set_objc_class_prefix<T: std::convert::Into<std::string::String>>(
2035 mut self,
2036 v: T,
2037 ) -> Self {
2038 self.objc_class_prefix = v.into();
2039 self
2040 }
2041
2042 pub fn set_csharp_namespace<T: std::convert::Into<std::string::String>>(
2044 mut self,
2045 v: T,
2046 ) -> Self {
2047 self.csharp_namespace = v.into();
2048 self
2049 }
2050
2051 pub fn set_swift_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2053 self.swift_prefix = v.into();
2054 self
2055 }
2056
2057 pub fn set_php_class_prefix<T: std::convert::Into<std::string::String>>(
2059 mut self,
2060 v: T,
2061 ) -> Self {
2062 self.php_class_prefix = v.into();
2063 self
2064 }
2065
2066 pub fn set_php_namespace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2068 self.php_namespace = v.into();
2069 self
2070 }
2071
2072 pub fn set_php_metadata_namespace<T: std::convert::Into<std::string::String>>(
2074 mut self,
2075 v: T,
2076 ) -> Self {
2077 self.php_metadata_namespace = v.into();
2078 self
2079 }
2080
2081 pub fn set_ruby_package<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2083 self.ruby_package = v.into();
2084 self
2085 }
2086
2087 pub fn set_features<T: std::convert::Into<std::option::Option<crate::FeatureSet>>>(
2089 mut self,
2090 v: T,
2091 ) -> Self {
2092 self.features = v.into();
2093 self
2094 }
2095
2096 pub fn set_uninterpreted_option<T, V>(mut self, v: T) -> Self
2098 where
2099 T: std::iter::IntoIterator<Item = V>,
2100 V: std::convert::Into<crate::UninterpretedOption>,
2101 {
2102 use std::iter::Iterator;
2103 self.uninterpreted_option = v.into_iter().map(|i| i.into()).collect();
2104 self
2105 }
2106}
2107
2108impl wkt::message::Message for FileOptions {
2109 fn typename() -> &'static str {
2110 "type.googleapis.com/google.protobuf.FileOptions"
2111 }
2112}
2113
2114pub mod file_options {
2116 #[allow(unused_imports)]
2117 use super::*;
2118
2119 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2121 pub struct OptimizeMode(i32);
2122
2123 impl OptimizeMode {
2124 pub const SPEED: OptimizeMode = OptimizeMode::new(1);
2125
2126 pub const CODE_SIZE: OptimizeMode = OptimizeMode::new(2);
2128
2129 pub const LITE_RUNTIME: OptimizeMode = OptimizeMode::new(3);
2130
2131 pub(crate) const fn new(value: i32) -> Self {
2133 Self(value)
2134 }
2135
2136 pub fn value(&self) -> i32 {
2138 self.0
2139 }
2140
2141 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
2143 match self.0 {
2144 1 => std::borrow::Cow::Borrowed("SPEED"),
2145 2 => std::borrow::Cow::Borrowed("CODE_SIZE"),
2146 3 => std::borrow::Cow::Borrowed("LITE_RUNTIME"),
2147 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
2148 }
2149 }
2150
2151 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
2153 match name {
2154 "SPEED" => std::option::Option::Some(Self::SPEED),
2155 "CODE_SIZE" => std::option::Option::Some(Self::CODE_SIZE),
2156 "LITE_RUNTIME" => std::option::Option::Some(Self::LITE_RUNTIME),
2157 _ => std::option::Option::None,
2158 }
2159 }
2160 }
2161
2162 impl std::convert::From<i32> for OptimizeMode {
2163 fn from(value: i32) -> Self {
2164 Self::new(value)
2165 }
2166 }
2167
2168 impl std::default::Default for OptimizeMode {
2169 fn default() -> Self {
2170 Self::new(0)
2171 }
2172 }
2173}
2174
2175#[serde_with::serde_as]
2176#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2177#[serde(default, rename_all = "camelCase")]
2178#[non_exhaustive]
2179pub struct MessageOptions {
2180 pub message_set_wire_format: bool,
2199
2200 pub no_standard_descriptor_accessor: bool,
2204
2205 pub deprecated: bool,
2210
2211 pub map_entry: bool,
2233
2234 pub deprecated_legacy_json_field_conflicts: bool,
2245
2246 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2248 pub features: std::option::Option<crate::FeatureSet>,
2249
2250 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2252 pub uninterpreted_option: std::vec::Vec<crate::UninterpretedOption>,
2253
2254 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2255 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2256}
2257
2258impl MessageOptions {
2259 pub fn new() -> Self {
2260 std::default::Default::default()
2261 }
2262
2263 pub fn set_message_set_wire_format<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2265 self.message_set_wire_format = v.into();
2266 self
2267 }
2268
2269 pub fn set_no_standard_descriptor_accessor<T: std::convert::Into<bool>>(
2271 mut self,
2272 v: T,
2273 ) -> Self {
2274 self.no_standard_descriptor_accessor = v.into();
2275 self
2276 }
2277
2278 pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2280 self.deprecated = v.into();
2281 self
2282 }
2283
2284 pub fn set_map_entry<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2286 self.map_entry = v.into();
2287 self
2288 }
2289
2290 pub fn set_deprecated_legacy_json_field_conflicts<T: std::convert::Into<bool>>(
2292 mut self,
2293 v: T,
2294 ) -> Self {
2295 self.deprecated_legacy_json_field_conflicts = v.into();
2296 self
2297 }
2298
2299 pub fn set_features<T: std::convert::Into<std::option::Option<crate::FeatureSet>>>(
2301 mut self,
2302 v: T,
2303 ) -> Self {
2304 self.features = v.into();
2305 self
2306 }
2307
2308 pub fn set_uninterpreted_option<T, V>(mut self, v: T) -> Self
2310 where
2311 T: std::iter::IntoIterator<Item = V>,
2312 V: std::convert::Into<crate::UninterpretedOption>,
2313 {
2314 use std::iter::Iterator;
2315 self.uninterpreted_option = v.into_iter().map(|i| i.into()).collect();
2316 self
2317 }
2318}
2319
2320impl wkt::message::Message for MessageOptions {
2321 fn typename() -> &'static str {
2322 "type.googleapis.com/google.protobuf.MessageOptions"
2323 }
2324}
2325
2326#[serde_with::serde_as]
2327#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2328#[serde(default, rename_all = "camelCase")]
2329#[non_exhaustive]
2330pub struct FieldOptions {
2331 pub ctype: crate::field_options::CType,
2339
2340 pub packed: bool,
2348
2349 pub jstype: crate::field_options::JSType,
2361
2362 pub lazy: bool,
2385
2386 pub unverified_lazy: bool,
2390
2391 pub deprecated: bool,
2396
2397 pub weak: bool,
2399
2400 pub debug_redact: bool,
2403
2404 pub retention: crate::field_options::OptionRetention,
2405
2406 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2407 pub targets: std::vec::Vec<crate::field_options::OptionTargetType>,
2408
2409 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2410 pub edition_defaults: std::vec::Vec<crate::field_options::EditionDefault>,
2411
2412 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2414 pub features: std::option::Option<crate::FeatureSet>,
2415
2416 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2417 pub feature_support: std::option::Option<crate::field_options::FeatureSupport>,
2418
2419 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2421 pub uninterpreted_option: std::vec::Vec<crate::UninterpretedOption>,
2422
2423 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2424 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2425}
2426
2427impl FieldOptions {
2428 pub fn new() -> Self {
2429 std::default::Default::default()
2430 }
2431
2432 pub fn set_ctype<T: std::convert::Into<crate::field_options::CType>>(mut self, v: T) -> Self {
2434 self.ctype = v.into();
2435 self
2436 }
2437
2438 pub fn set_packed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2440 self.packed = v.into();
2441 self
2442 }
2443
2444 pub fn set_jstype<T: std::convert::Into<crate::field_options::JSType>>(mut self, v: T) -> Self {
2446 self.jstype = v.into();
2447 self
2448 }
2449
2450 pub fn set_lazy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2452 self.lazy = v.into();
2453 self
2454 }
2455
2456 pub fn set_unverified_lazy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2458 self.unverified_lazy = v.into();
2459 self
2460 }
2461
2462 pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2464 self.deprecated = v.into();
2465 self
2466 }
2467
2468 pub fn set_weak<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2470 self.weak = v.into();
2471 self
2472 }
2473
2474 pub fn set_debug_redact<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2476 self.debug_redact = v.into();
2477 self
2478 }
2479
2480 pub fn set_retention<T: std::convert::Into<crate::field_options::OptionRetention>>(
2482 mut self,
2483 v: T,
2484 ) -> Self {
2485 self.retention = v.into();
2486 self
2487 }
2488
2489 pub fn set_features<T: std::convert::Into<std::option::Option<crate::FeatureSet>>>(
2491 mut self,
2492 v: T,
2493 ) -> Self {
2494 self.features = v.into();
2495 self
2496 }
2497
2498 pub fn set_feature_support<
2500 T: std::convert::Into<std::option::Option<crate::field_options::FeatureSupport>>,
2501 >(
2502 mut self,
2503 v: T,
2504 ) -> Self {
2505 self.feature_support = v.into();
2506 self
2507 }
2508
2509 pub fn set_targets<T, V>(mut self, v: T) -> Self
2511 where
2512 T: std::iter::IntoIterator<Item = V>,
2513 V: std::convert::Into<crate::field_options::OptionTargetType>,
2514 {
2515 use std::iter::Iterator;
2516 self.targets = v.into_iter().map(|i| i.into()).collect();
2517 self
2518 }
2519
2520 pub fn set_edition_defaults<T, V>(mut self, v: T) -> Self
2522 where
2523 T: std::iter::IntoIterator<Item = V>,
2524 V: std::convert::Into<crate::field_options::EditionDefault>,
2525 {
2526 use std::iter::Iterator;
2527 self.edition_defaults = v.into_iter().map(|i| i.into()).collect();
2528 self
2529 }
2530
2531 pub fn set_uninterpreted_option<T, V>(mut self, v: T) -> Self
2533 where
2534 T: std::iter::IntoIterator<Item = V>,
2535 V: std::convert::Into<crate::UninterpretedOption>,
2536 {
2537 use std::iter::Iterator;
2538 self.uninterpreted_option = v.into_iter().map(|i| i.into()).collect();
2539 self
2540 }
2541}
2542
2543impl wkt::message::Message for FieldOptions {
2544 fn typename() -> &'static str {
2545 "type.googleapis.com/google.protobuf.FieldOptions"
2546 }
2547}
2548
2549pub mod field_options {
2551 #[allow(unused_imports)]
2552 use super::*;
2553
2554 #[serde_with::serde_as]
2555 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2556 #[serde(default, rename_all = "camelCase")]
2557 #[non_exhaustive]
2558 pub struct EditionDefault {
2559 pub edition: crate::Edition,
2560
2561 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2562 pub value: std::string::String,
2563
2564 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2565 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2566 }
2567
2568 impl EditionDefault {
2569 pub fn new() -> Self {
2570 std::default::Default::default()
2571 }
2572
2573 pub fn set_edition<T: std::convert::Into<crate::Edition>>(mut self, v: T) -> Self {
2575 self.edition = v.into();
2576 self
2577 }
2578
2579 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2581 self.value = v.into();
2582 self
2583 }
2584 }
2585
2586 impl wkt::message::Message for EditionDefault {
2587 fn typename() -> &'static str {
2588 "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault"
2589 }
2590 }
2591
2592 #[serde_with::serde_as]
2594 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2595 #[serde(default, rename_all = "camelCase")]
2596 #[non_exhaustive]
2597 pub struct FeatureSupport {
2598 pub edition_introduced: crate::Edition,
2602
2603 pub edition_deprecated: crate::Edition,
2606
2607 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2610 pub deprecation_warning: std::string::String,
2611
2612 pub edition_removed: crate::Edition,
2616
2617 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2618 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2619 }
2620
2621 impl FeatureSupport {
2622 pub fn new() -> Self {
2623 std::default::Default::default()
2624 }
2625
2626 pub fn set_edition_introduced<T: std::convert::Into<crate::Edition>>(
2628 mut self,
2629 v: T,
2630 ) -> Self {
2631 self.edition_introduced = v.into();
2632 self
2633 }
2634
2635 pub fn set_edition_deprecated<T: std::convert::Into<crate::Edition>>(
2637 mut self,
2638 v: T,
2639 ) -> Self {
2640 self.edition_deprecated = v.into();
2641 self
2642 }
2643
2644 pub fn set_deprecation_warning<T: std::convert::Into<std::string::String>>(
2646 mut self,
2647 v: T,
2648 ) -> Self {
2649 self.deprecation_warning = v.into();
2650 self
2651 }
2652
2653 pub fn set_edition_removed<T: std::convert::Into<crate::Edition>>(mut self, v: T) -> Self {
2655 self.edition_removed = v.into();
2656 self
2657 }
2658 }
2659
2660 impl wkt::message::Message for FeatureSupport {
2661 fn typename() -> &'static str {
2662 "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport"
2663 }
2664 }
2665
2666 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2667 pub struct CType(i32);
2668
2669 impl CType {
2670 pub const STRING: CType = CType::new(0);
2672
2673 pub const CORD: CType = CType::new(1);
2680
2681 pub const STRING_PIECE: CType = CType::new(2);
2682
2683 pub(crate) const fn new(value: i32) -> Self {
2685 Self(value)
2686 }
2687
2688 pub fn value(&self) -> i32 {
2690 self.0
2691 }
2692
2693 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
2695 match self.0 {
2696 0 => std::borrow::Cow::Borrowed("STRING"),
2697 1 => std::borrow::Cow::Borrowed("CORD"),
2698 2 => std::borrow::Cow::Borrowed("STRING_PIECE"),
2699 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
2700 }
2701 }
2702
2703 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
2705 match name {
2706 "STRING" => std::option::Option::Some(Self::STRING),
2707 "CORD" => std::option::Option::Some(Self::CORD),
2708 "STRING_PIECE" => std::option::Option::Some(Self::STRING_PIECE),
2709 _ => std::option::Option::None,
2710 }
2711 }
2712 }
2713
2714 impl std::convert::From<i32> for CType {
2715 fn from(value: i32) -> Self {
2716 Self::new(value)
2717 }
2718 }
2719
2720 impl std::default::Default for CType {
2721 fn default() -> Self {
2722 Self::new(0)
2723 }
2724 }
2725
2726 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2727 pub struct JSType(i32);
2728
2729 impl JSType {
2730 pub const JS_NORMAL: JSType = JSType::new(0);
2732
2733 pub const JS_STRING: JSType = JSType::new(1);
2735
2736 pub const JS_NUMBER: JSType = JSType::new(2);
2738
2739 pub(crate) const fn new(value: i32) -> Self {
2741 Self(value)
2742 }
2743
2744 pub fn value(&self) -> i32 {
2746 self.0
2747 }
2748
2749 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
2751 match self.0 {
2752 0 => std::borrow::Cow::Borrowed("JS_NORMAL"),
2753 1 => std::borrow::Cow::Borrowed("JS_STRING"),
2754 2 => std::borrow::Cow::Borrowed("JS_NUMBER"),
2755 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
2756 }
2757 }
2758
2759 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
2761 match name {
2762 "JS_NORMAL" => std::option::Option::Some(Self::JS_NORMAL),
2763 "JS_STRING" => std::option::Option::Some(Self::JS_STRING),
2764 "JS_NUMBER" => std::option::Option::Some(Self::JS_NUMBER),
2765 _ => std::option::Option::None,
2766 }
2767 }
2768 }
2769
2770 impl std::convert::From<i32> for JSType {
2771 fn from(value: i32) -> Self {
2772 Self::new(value)
2773 }
2774 }
2775
2776 impl std::default::Default for JSType {
2777 fn default() -> Self {
2778 Self::new(0)
2779 }
2780 }
2781
2782 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2784 pub struct OptionRetention(i32);
2785
2786 impl OptionRetention {
2787 pub const RETENTION_UNKNOWN: OptionRetention = OptionRetention::new(0);
2788
2789 pub const RETENTION_RUNTIME: OptionRetention = OptionRetention::new(1);
2790
2791 pub const RETENTION_SOURCE: OptionRetention = OptionRetention::new(2);
2792
2793 pub(crate) const fn new(value: i32) -> Self {
2795 Self(value)
2796 }
2797
2798 pub fn value(&self) -> i32 {
2800 self.0
2801 }
2802
2803 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
2805 match self.0 {
2806 0 => std::borrow::Cow::Borrowed("RETENTION_UNKNOWN"),
2807 1 => std::borrow::Cow::Borrowed("RETENTION_RUNTIME"),
2808 2 => std::borrow::Cow::Borrowed("RETENTION_SOURCE"),
2809 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
2810 }
2811 }
2812
2813 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
2815 match name {
2816 "RETENTION_UNKNOWN" => std::option::Option::Some(Self::RETENTION_UNKNOWN),
2817 "RETENTION_RUNTIME" => std::option::Option::Some(Self::RETENTION_RUNTIME),
2818 "RETENTION_SOURCE" => std::option::Option::Some(Self::RETENTION_SOURCE),
2819 _ => std::option::Option::None,
2820 }
2821 }
2822 }
2823
2824 impl std::convert::From<i32> for OptionRetention {
2825 fn from(value: i32) -> Self {
2826 Self::new(value)
2827 }
2828 }
2829
2830 impl std::default::Default for OptionRetention {
2831 fn default() -> Self {
2832 Self::new(0)
2833 }
2834 }
2835
2836 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2840 pub struct OptionTargetType(i32);
2841
2842 impl OptionTargetType {
2843 pub const TARGET_TYPE_UNKNOWN: OptionTargetType = OptionTargetType::new(0);
2844
2845 pub const TARGET_TYPE_FILE: OptionTargetType = OptionTargetType::new(1);
2846
2847 pub const TARGET_TYPE_EXTENSION_RANGE: OptionTargetType = OptionTargetType::new(2);
2848
2849 pub const TARGET_TYPE_MESSAGE: OptionTargetType = OptionTargetType::new(3);
2850
2851 pub const TARGET_TYPE_FIELD: OptionTargetType = OptionTargetType::new(4);
2852
2853 pub const TARGET_TYPE_ONEOF: OptionTargetType = OptionTargetType::new(5);
2854
2855 pub const TARGET_TYPE_ENUM: OptionTargetType = OptionTargetType::new(6);
2856
2857 pub const TARGET_TYPE_ENUM_ENTRY: OptionTargetType = OptionTargetType::new(7);
2858
2859 pub const TARGET_TYPE_SERVICE: OptionTargetType = OptionTargetType::new(8);
2860
2861 pub const TARGET_TYPE_METHOD: OptionTargetType = OptionTargetType::new(9);
2862
2863 pub(crate) const fn new(value: i32) -> Self {
2865 Self(value)
2866 }
2867
2868 pub fn value(&self) -> i32 {
2870 self.0
2871 }
2872
2873 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
2875 match self.0 {
2876 0 => std::borrow::Cow::Borrowed("TARGET_TYPE_UNKNOWN"),
2877 1 => std::borrow::Cow::Borrowed("TARGET_TYPE_FILE"),
2878 2 => std::borrow::Cow::Borrowed("TARGET_TYPE_EXTENSION_RANGE"),
2879 3 => std::borrow::Cow::Borrowed("TARGET_TYPE_MESSAGE"),
2880 4 => std::borrow::Cow::Borrowed("TARGET_TYPE_FIELD"),
2881 5 => std::borrow::Cow::Borrowed("TARGET_TYPE_ONEOF"),
2882 6 => std::borrow::Cow::Borrowed("TARGET_TYPE_ENUM"),
2883 7 => std::borrow::Cow::Borrowed("TARGET_TYPE_ENUM_ENTRY"),
2884 8 => std::borrow::Cow::Borrowed("TARGET_TYPE_SERVICE"),
2885 9 => std::borrow::Cow::Borrowed("TARGET_TYPE_METHOD"),
2886 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
2887 }
2888 }
2889
2890 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
2892 match name {
2893 "TARGET_TYPE_UNKNOWN" => std::option::Option::Some(Self::TARGET_TYPE_UNKNOWN),
2894 "TARGET_TYPE_FILE" => std::option::Option::Some(Self::TARGET_TYPE_FILE),
2895 "TARGET_TYPE_EXTENSION_RANGE" => {
2896 std::option::Option::Some(Self::TARGET_TYPE_EXTENSION_RANGE)
2897 }
2898 "TARGET_TYPE_MESSAGE" => std::option::Option::Some(Self::TARGET_TYPE_MESSAGE),
2899 "TARGET_TYPE_FIELD" => std::option::Option::Some(Self::TARGET_TYPE_FIELD),
2900 "TARGET_TYPE_ONEOF" => std::option::Option::Some(Self::TARGET_TYPE_ONEOF),
2901 "TARGET_TYPE_ENUM" => std::option::Option::Some(Self::TARGET_TYPE_ENUM),
2902 "TARGET_TYPE_ENUM_ENTRY" => std::option::Option::Some(Self::TARGET_TYPE_ENUM_ENTRY),
2903 "TARGET_TYPE_SERVICE" => std::option::Option::Some(Self::TARGET_TYPE_SERVICE),
2904 "TARGET_TYPE_METHOD" => std::option::Option::Some(Self::TARGET_TYPE_METHOD),
2905 _ => std::option::Option::None,
2906 }
2907 }
2908 }
2909
2910 impl std::convert::From<i32> for OptionTargetType {
2911 fn from(value: i32) -> Self {
2912 Self::new(value)
2913 }
2914 }
2915
2916 impl std::default::Default for OptionTargetType {
2917 fn default() -> Self {
2918 Self::new(0)
2919 }
2920 }
2921}
2922
2923#[serde_with::serde_as]
2924#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2925#[serde(default, rename_all = "camelCase")]
2926#[non_exhaustive]
2927pub struct OneofOptions {
2928 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2930 pub features: std::option::Option<crate::FeatureSet>,
2931
2932 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2934 pub uninterpreted_option: std::vec::Vec<crate::UninterpretedOption>,
2935
2936 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2937 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2938}
2939
2940impl OneofOptions {
2941 pub fn new() -> Self {
2942 std::default::Default::default()
2943 }
2944
2945 pub fn set_features<T: std::convert::Into<std::option::Option<crate::FeatureSet>>>(
2947 mut self,
2948 v: T,
2949 ) -> Self {
2950 self.features = v.into();
2951 self
2952 }
2953
2954 pub fn set_uninterpreted_option<T, V>(mut self, v: T) -> Self
2956 where
2957 T: std::iter::IntoIterator<Item = V>,
2958 V: std::convert::Into<crate::UninterpretedOption>,
2959 {
2960 use std::iter::Iterator;
2961 self.uninterpreted_option = v.into_iter().map(|i| i.into()).collect();
2962 self
2963 }
2964}
2965
2966impl wkt::message::Message for OneofOptions {
2967 fn typename() -> &'static str {
2968 "type.googleapis.com/google.protobuf.OneofOptions"
2969 }
2970}
2971
2972#[serde_with::serde_as]
2973#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2974#[serde(default, rename_all = "camelCase")]
2975#[non_exhaustive]
2976pub struct EnumOptions {
2977 pub allow_alias: bool,
2980
2981 pub deprecated: bool,
2986
2987 pub deprecated_legacy_json_field_conflicts: bool,
2994
2995 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2997 pub features: std::option::Option<crate::FeatureSet>,
2998
2999 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3001 pub uninterpreted_option: std::vec::Vec<crate::UninterpretedOption>,
3002
3003 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3004 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3005}
3006
3007impl EnumOptions {
3008 pub fn new() -> Self {
3009 std::default::Default::default()
3010 }
3011
3012 pub fn set_allow_alias<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3014 self.allow_alias = v.into();
3015 self
3016 }
3017
3018 pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3020 self.deprecated = v.into();
3021 self
3022 }
3023
3024 pub fn set_deprecated_legacy_json_field_conflicts<T: std::convert::Into<bool>>(
3026 mut self,
3027 v: T,
3028 ) -> Self {
3029 self.deprecated_legacy_json_field_conflicts = v.into();
3030 self
3031 }
3032
3033 pub fn set_features<T: std::convert::Into<std::option::Option<crate::FeatureSet>>>(
3035 mut self,
3036 v: T,
3037 ) -> Self {
3038 self.features = v.into();
3039 self
3040 }
3041
3042 pub fn set_uninterpreted_option<T, V>(mut self, v: T) -> Self
3044 where
3045 T: std::iter::IntoIterator<Item = V>,
3046 V: std::convert::Into<crate::UninterpretedOption>,
3047 {
3048 use std::iter::Iterator;
3049 self.uninterpreted_option = v.into_iter().map(|i| i.into()).collect();
3050 self
3051 }
3052}
3053
3054impl wkt::message::Message for EnumOptions {
3055 fn typename() -> &'static str {
3056 "type.googleapis.com/google.protobuf.EnumOptions"
3057 }
3058}
3059
3060#[serde_with::serde_as]
3061#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3062#[serde(default, rename_all = "camelCase")]
3063#[non_exhaustive]
3064pub struct EnumValueOptions {
3065 pub deprecated: bool,
3070
3071 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3073 pub features: std::option::Option<crate::FeatureSet>,
3074
3075 pub debug_redact: bool,
3079
3080 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3082 pub feature_support: std::option::Option<crate::field_options::FeatureSupport>,
3083
3084 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3086 pub uninterpreted_option: std::vec::Vec<crate::UninterpretedOption>,
3087
3088 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3089 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3090}
3091
3092impl EnumValueOptions {
3093 pub fn new() -> Self {
3094 std::default::Default::default()
3095 }
3096
3097 pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3099 self.deprecated = v.into();
3100 self
3101 }
3102
3103 pub fn set_features<T: std::convert::Into<std::option::Option<crate::FeatureSet>>>(
3105 mut self,
3106 v: T,
3107 ) -> Self {
3108 self.features = v.into();
3109 self
3110 }
3111
3112 pub fn set_debug_redact<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3114 self.debug_redact = v.into();
3115 self
3116 }
3117
3118 pub fn set_feature_support<
3120 T: std::convert::Into<std::option::Option<crate::field_options::FeatureSupport>>,
3121 >(
3122 mut self,
3123 v: T,
3124 ) -> Self {
3125 self.feature_support = v.into();
3126 self
3127 }
3128
3129 pub fn set_uninterpreted_option<T, V>(mut self, v: T) -> Self
3131 where
3132 T: std::iter::IntoIterator<Item = V>,
3133 V: std::convert::Into<crate::UninterpretedOption>,
3134 {
3135 use std::iter::Iterator;
3136 self.uninterpreted_option = v.into_iter().map(|i| i.into()).collect();
3137 self
3138 }
3139}
3140
3141impl wkt::message::Message for EnumValueOptions {
3142 fn typename() -> &'static str {
3143 "type.googleapis.com/google.protobuf.EnumValueOptions"
3144 }
3145}
3146
3147#[serde_with::serde_as]
3148#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3149#[serde(default, rename_all = "camelCase")]
3150#[non_exhaustive]
3151pub struct ServiceOptions {
3152 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3154 pub features: std::option::Option<crate::FeatureSet>,
3155
3156 pub deprecated: bool,
3161
3162 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3164 pub uninterpreted_option: std::vec::Vec<crate::UninterpretedOption>,
3165
3166 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3167 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3168}
3169
3170impl ServiceOptions {
3171 pub fn new() -> Self {
3172 std::default::Default::default()
3173 }
3174
3175 pub fn set_features<T: std::convert::Into<std::option::Option<crate::FeatureSet>>>(
3177 mut self,
3178 v: T,
3179 ) -> Self {
3180 self.features = v.into();
3181 self
3182 }
3183
3184 pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3186 self.deprecated = v.into();
3187 self
3188 }
3189
3190 pub fn set_uninterpreted_option<T, V>(mut self, v: T) -> Self
3192 where
3193 T: std::iter::IntoIterator<Item = V>,
3194 V: std::convert::Into<crate::UninterpretedOption>,
3195 {
3196 use std::iter::Iterator;
3197 self.uninterpreted_option = v.into_iter().map(|i| i.into()).collect();
3198 self
3199 }
3200}
3201
3202impl wkt::message::Message for ServiceOptions {
3203 fn typename() -> &'static str {
3204 "type.googleapis.com/google.protobuf.ServiceOptions"
3205 }
3206}
3207
3208#[serde_with::serde_as]
3209#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3210#[serde(default, rename_all = "camelCase")]
3211#[non_exhaustive]
3212pub struct MethodOptions {
3213 pub deprecated: bool,
3218
3219 pub idempotency_level: crate::method_options::IdempotencyLevel,
3220
3221 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3223 pub features: std::option::Option<crate::FeatureSet>,
3224
3225 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3227 pub uninterpreted_option: std::vec::Vec<crate::UninterpretedOption>,
3228
3229 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3230 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3231}
3232
3233impl MethodOptions {
3234 pub fn new() -> Self {
3235 std::default::Default::default()
3236 }
3237
3238 pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3240 self.deprecated = v.into();
3241 self
3242 }
3243
3244 pub fn set_idempotency_level<T: std::convert::Into<crate::method_options::IdempotencyLevel>>(
3246 mut self,
3247 v: T,
3248 ) -> Self {
3249 self.idempotency_level = v.into();
3250 self
3251 }
3252
3253 pub fn set_features<T: std::convert::Into<std::option::Option<crate::FeatureSet>>>(
3255 mut self,
3256 v: T,
3257 ) -> Self {
3258 self.features = v.into();
3259 self
3260 }
3261
3262 pub fn set_uninterpreted_option<T, V>(mut self, v: T) -> Self
3264 where
3265 T: std::iter::IntoIterator<Item = V>,
3266 V: std::convert::Into<crate::UninterpretedOption>,
3267 {
3268 use std::iter::Iterator;
3269 self.uninterpreted_option = v.into_iter().map(|i| i.into()).collect();
3270 self
3271 }
3272}
3273
3274impl wkt::message::Message for MethodOptions {
3275 fn typename() -> &'static str {
3276 "type.googleapis.com/google.protobuf.MethodOptions"
3277 }
3278}
3279
3280pub mod method_options {
3282 #[allow(unused_imports)]
3283 use super::*;
3284
3285 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3289 pub struct IdempotencyLevel(i32);
3290
3291 impl IdempotencyLevel {
3292 pub const IDEMPOTENCY_UNKNOWN: IdempotencyLevel = IdempotencyLevel::new(0);
3293
3294 pub const NO_SIDE_EFFECTS: IdempotencyLevel = IdempotencyLevel::new(1);
3295
3296 pub const IDEMPOTENT: IdempotencyLevel = IdempotencyLevel::new(2);
3297
3298 pub(crate) const fn new(value: i32) -> Self {
3300 Self(value)
3301 }
3302
3303 pub fn value(&self) -> i32 {
3305 self.0
3306 }
3307
3308 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3310 match self.0 {
3311 0 => std::borrow::Cow::Borrowed("IDEMPOTENCY_UNKNOWN"),
3312 1 => std::borrow::Cow::Borrowed("NO_SIDE_EFFECTS"),
3313 2 => std::borrow::Cow::Borrowed("IDEMPOTENT"),
3314 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3315 }
3316 }
3317
3318 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3320 match name {
3321 "IDEMPOTENCY_UNKNOWN" => std::option::Option::Some(Self::IDEMPOTENCY_UNKNOWN),
3322 "NO_SIDE_EFFECTS" => std::option::Option::Some(Self::NO_SIDE_EFFECTS),
3323 "IDEMPOTENT" => std::option::Option::Some(Self::IDEMPOTENT),
3324 _ => std::option::Option::None,
3325 }
3326 }
3327 }
3328
3329 impl std::convert::From<i32> for IdempotencyLevel {
3330 fn from(value: i32) -> Self {
3331 Self::new(value)
3332 }
3333 }
3334
3335 impl std::default::Default for IdempotencyLevel {
3336 fn default() -> Self {
3337 Self::new(0)
3338 }
3339 }
3340}
3341
3342#[serde_with::serde_as]
3349#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3350#[serde(default, rename_all = "camelCase")]
3351#[non_exhaustive]
3352pub struct UninterpretedOption {
3353 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3354 pub name: std::vec::Vec<crate::uninterpreted_option::NamePart>,
3355
3356 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3359 pub identifier_value: std::string::String,
3360
3361 #[serde_as(as = "serde_with::DisplayFromStr")]
3362 pub positive_int_value: u64,
3363
3364 #[serde_as(as = "serde_with::DisplayFromStr")]
3365 pub negative_int_value: i64,
3366
3367 pub double_value: f64,
3368
3369 #[serde(skip_serializing_if = "::bytes::Bytes::is_empty")]
3370 #[serde_as(as = "serde_with::base64::Base64")]
3371 pub string_value: ::bytes::Bytes,
3372
3373 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3374 pub aggregate_value: std::string::String,
3375
3376 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3377 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3378}
3379
3380impl UninterpretedOption {
3381 pub fn new() -> Self {
3382 std::default::Default::default()
3383 }
3384
3385 pub fn set_identifier_value<T: std::convert::Into<std::string::String>>(
3387 mut self,
3388 v: T,
3389 ) -> Self {
3390 self.identifier_value = v.into();
3391 self
3392 }
3393
3394 pub fn set_positive_int_value<T: std::convert::Into<u64>>(mut self, v: T) -> Self {
3396 self.positive_int_value = v.into();
3397 self
3398 }
3399
3400 pub fn set_negative_int_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3402 self.negative_int_value = v.into();
3403 self
3404 }
3405
3406 pub fn set_double_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3408 self.double_value = v.into();
3409 self
3410 }
3411
3412 pub fn set_string_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
3414 self.string_value = v.into();
3415 self
3416 }
3417
3418 pub fn set_aggregate_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3420 self.aggregate_value = v.into();
3421 self
3422 }
3423
3424 pub fn set_name<T, V>(mut self, v: T) -> Self
3426 where
3427 T: std::iter::IntoIterator<Item = V>,
3428 V: std::convert::Into<crate::uninterpreted_option::NamePart>,
3429 {
3430 use std::iter::Iterator;
3431 self.name = v.into_iter().map(|i| i.into()).collect();
3432 self
3433 }
3434}
3435
3436impl wkt::message::Message for UninterpretedOption {
3437 fn typename() -> &'static str {
3438 "type.googleapis.com/google.protobuf.UninterpretedOption"
3439 }
3440}
3441
3442pub mod uninterpreted_option {
3444 #[allow(unused_imports)]
3445 use super::*;
3446
3447 #[serde_with::serde_as]
3453 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3454 #[serde(default, rename_all = "camelCase")]
3455 #[non_exhaustive]
3456 pub struct NamePart {
3457 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3458 pub name_part: std::string::String,
3459
3460 pub is_extension: bool,
3461
3462 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3463 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3464 }
3465
3466 impl NamePart {
3467 pub fn new() -> Self {
3468 std::default::Default::default()
3469 }
3470
3471 pub fn set_name_part<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3473 self.name_part = v.into();
3474 self
3475 }
3476
3477 pub fn set_is_extension<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3479 self.is_extension = v.into();
3480 self
3481 }
3482 }
3483
3484 impl wkt::message::Message for NamePart {
3485 fn typename() -> &'static str {
3486 "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart"
3487 }
3488 }
3489}
3490
3491#[serde_with::serde_as]
3498#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3499#[serde(default, rename_all = "camelCase")]
3500#[non_exhaustive]
3501pub struct FeatureSet {
3502 pub field_presence: crate::feature_set::FieldPresence,
3503
3504 pub enum_type: crate::feature_set::EnumType,
3505
3506 pub repeated_field_encoding: crate::feature_set::RepeatedFieldEncoding,
3507
3508 pub utf8_validation: crate::feature_set::Utf8Validation,
3509
3510 pub message_encoding: crate::feature_set::MessageEncoding,
3511
3512 pub json_format: crate::feature_set::JsonFormat,
3513
3514 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3515 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3516}
3517
3518impl FeatureSet {
3519 pub fn new() -> Self {
3520 std::default::Default::default()
3521 }
3522
3523 pub fn set_field_presence<T: std::convert::Into<crate::feature_set::FieldPresence>>(
3525 mut self,
3526 v: T,
3527 ) -> Self {
3528 self.field_presence = v.into();
3529 self
3530 }
3531
3532 pub fn set_enum_type<T: std::convert::Into<crate::feature_set::EnumType>>(
3534 mut self,
3535 v: T,
3536 ) -> Self {
3537 self.enum_type = v.into();
3538 self
3539 }
3540
3541 pub fn set_repeated_field_encoding<
3543 T: std::convert::Into<crate::feature_set::RepeatedFieldEncoding>,
3544 >(
3545 mut self,
3546 v: T,
3547 ) -> Self {
3548 self.repeated_field_encoding = v.into();
3549 self
3550 }
3551
3552 pub fn set_utf8_validation<T: std::convert::Into<crate::feature_set::Utf8Validation>>(
3554 mut self,
3555 v: T,
3556 ) -> Self {
3557 self.utf8_validation = v.into();
3558 self
3559 }
3560
3561 pub fn set_message_encoding<T: std::convert::Into<crate::feature_set::MessageEncoding>>(
3563 mut self,
3564 v: T,
3565 ) -> Self {
3566 self.message_encoding = v.into();
3567 self
3568 }
3569
3570 pub fn set_json_format<T: std::convert::Into<crate::feature_set::JsonFormat>>(
3572 mut self,
3573 v: T,
3574 ) -> Self {
3575 self.json_format = v.into();
3576 self
3577 }
3578}
3579
3580impl wkt::message::Message for FeatureSet {
3581 fn typename() -> &'static str {
3582 "type.googleapis.com/google.protobuf.FeatureSet"
3583 }
3584}
3585
3586pub mod feature_set {
3588 #[allow(unused_imports)]
3589 use super::*;
3590
3591 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3592 pub struct FieldPresence(i32);
3593
3594 impl FieldPresence {
3595 pub const FIELD_PRESENCE_UNKNOWN: FieldPresence = FieldPresence::new(0);
3596
3597 pub const EXPLICIT: FieldPresence = FieldPresence::new(1);
3598
3599 pub const IMPLICIT: FieldPresence = FieldPresence::new(2);
3600
3601 pub const LEGACY_REQUIRED: FieldPresence = FieldPresence::new(3);
3602
3603 pub(crate) const fn new(value: i32) -> Self {
3605 Self(value)
3606 }
3607
3608 pub fn value(&self) -> i32 {
3610 self.0
3611 }
3612
3613 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3615 match self.0 {
3616 0 => std::borrow::Cow::Borrowed("FIELD_PRESENCE_UNKNOWN"),
3617 1 => std::borrow::Cow::Borrowed("EXPLICIT"),
3618 2 => std::borrow::Cow::Borrowed("IMPLICIT"),
3619 3 => std::borrow::Cow::Borrowed("LEGACY_REQUIRED"),
3620 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3621 }
3622 }
3623
3624 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3626 match name {
3627 "FIELD_PRESENCE_UNKNOWN" => std::option::Option::Some(Self::FIELD_PRESENCE_UNKNOWN),
3628 "EXPLICIT" => std::option::Option::Some(Self::EXPLICIT),
3629 "IMPLICIT" => std::option::Option::Some(Self::IMPLICIT),
3630 "LEGACY_REQUIRED" => std::option::Option::Some(Self::LEGACY_REQUIRED),
3631 _ => std::option::Option::None,
3632 }
3633 }
3634 }
3635
3636 impl std::convert::From<i32> for FieldPresence {
3637 fn from(value: i32) -> Self {
3638 Self::new(value)
3639 }
3640 }
3641
3642 impl std::default::Default for FieldPresence {
3643 fn default() -> Self {
3644 Self::new(0)
3645 }
3646 }
3647
3648 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3649 pub struct EnumType(i32);
3650
3651 impl EnumType {
3652 pub const ENUM_TYPE_UNKNOWN: EnumType = EnumType::new(0);
3653
3654 pub const OPEN: EnumType = EnumType::new(1);
3655
3656 pub const CLOSED: EnumType = EnumType::new(2);
3657
3658 pub(crate) const fn new(value: i32) -> Self {
3660 Self(value)
3661 }
3662
3663 pub fn value(&self) -> i32 {
3665 self.0
3666 }
3667
3668 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3670 match self.0 {
3671 0 => std::borrow::Cow::Borrowed("ENUM_TYPE_UNKNOWN"),
3672 1 => std::borrow::Cow::Borrowed("OPEN"),
3673 2 => std::borrow::Cow::Borrowed("CLOSED"),
3674 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3675 }
3676 }
3677
3678 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3680 match name {
3681 "ENUM_TYPE_UNKNOWN" => std::option::Option::Some(Self::ENUM_TYPE_UNKNOWN),
3682 "OPEN" => std::option::Option::Some(Self::OPEN),
3683 "CLOSED" => std::option::Option::Some(Self::CLOSED),
3684 _ => std::option::Option::None,
3685 }
3686 }
3687 }
3688
3689 impl std::convert::From<i32> for EnumType {
3690 fn from(value: i32) -> Self {
3691 Self::new(value)
3692 }
3693 }
3694
3695 impl std::default::Default for EnumType {
3696 fn default() -> Self {
3697 Self::new(0)
3698 }
3699 }
3700
3701 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3702 pub struct RepeatedFieldEncoding(i32);
3703
3704 impl RepeatedFieldEncoding {
3705 pub const REPEATED_FIELD_ENCODING_UNKNOWN: RepeatedFieldEncoding =
3706 RepeatedFieldEncoding::new(0);
3707
3708 pub const PACKED: RepeatedFieldEncoding = RepeatedFieldEncoding::new(1);
3709
3710 pub const EXPANDED: RepeatedFieldEncoding = RepeatedFieldEncoding::new(2);
3711
3712 pub(crate) const fn new(value: i32) -> Self {
3714 Self(value)
3715 }
3716
3717 pub fn value(&self) -> i32 {
3719 self.0
3720 }
3721
3722 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3724 match self.0 {
3725 0 => std::borrow::Cow::Borrowed("REPEATED_FIELD_ENCODING_UNKNOWN"),
3726 1 => std::borrow::Cow::Borrowed("PACKED"),
3727 2 => std::borrow::Cow::Borrowed("EXPANDED"),
3728 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3729 }
3730 }
3731
3732 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3734 match name {
3735 "REPEATED_FIELD_ENCODING_UNKNOWN" => {
3736 std::option::Option::Some(Self::REPEATED_FIELD_ENCODING_UNKNOWN)
3737 }
3738 "PACKED" => std::option::Option::Some(Self::PACKED),
3739 "EXPANDED" => std::option::Option::Some(Self::EXPANDED),
3740 _ => std::option::Option::None,
3741 }
3742 }
3743 }
3744
3745 impl std::convert::From<i32> for RepeatedFieldEncoding {
3746 fn from(value: i32) -> Self {
3747 Self::new(value)
3748 }
3749 }
3750
3751 impl std::default::Default for RepeatedFieldEncoding {
3752 fn default() -> Self {
3753 Self::new(0)
3754 }
3755 }
3756
3757 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3758 pub struct Utf8Validation(i32);
3759
3760 impl Utf8Validation {
3761 pub const UTF8_VALIDATION_UNKNOWN: Utf8Validation = Utf8Validation::new(0);
3762
3763 pub const VERIFY: Utf8Validation = Utf8Validation::new(2);
3764
3765 pub const NONE: Utf8Validation = Utf8Validation::new(3);
3766
3767 pub(crate) const fn new(value: i32) -> Self {
3769 Self(value)
3770 }
3771
3772 pub fn value(&self) -> i32 {
3774 self.0
3775 }
3776
3777 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3779 match self.0 {
3780 0 => std::borrow::Cow::Borrowed("UTF8_VALIDATION_UNKNOWN"),
3781 2 => std::borrow::Cow::Borrowed("VERIFY"),
3782 3 => std::borrow::Cow::Borrowed("NONE"),
3783 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3784 }
3785 }
3786
3787 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3789 match name {
3790 "UTF8_VALIDATION_UNKNOWN" => {
3791 std::option::Option::Some(Self::UTF8_VALIDATION_UNKNOWN)
3792 }
3793 "VERIFY" => std::option::Option::Some(Self::VERIFY),
3794 "NONE" => std::option::Option::Some(Self::NONE),
3795 _ => std::option::Option::None,
3796 }
3797 }
3798 }
3799
3800 impl std::convert::From<i32> for Utf8Validation {
3801 fn from(value: i32) -> Self {
3802 Self::new(value)
3803 }
3804 }
3805
3806 impl std::default::Default for Utf8Validation {
3807 fn default() -> Self {
3808 Self::new(0)
3809 }
3810 }
3811
3812 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3813 pub struct MessageEncoding(i32);
3814
3815 impl MessageEncoding {
3816 pub const MESSAGE_ENCODING_UNKNOWN: MessageEncoding = MessageEncoding::new(0);
3817
3818 pub const LENGTH_PREFIXED: MessageEncoding = MessageEncoding::new(1);
3819
3820 pub const DELIMITED: MessageEncoding = MessageEncoding::new(2);
3821
3822 pub(crate) const fn new(value: i32) -> Self {
3824 Self(value)
3825 }
3826
3827 pub fn value(&self) -> i32 {
3829 self.0
3830 }
3831
3832 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3834 match self.0 {
3835 0 => std::borrow::Cow::Borrowed("MESSAGE_ENCODING_UNKNOWN"),
3836 1 => std::borrow::Cow::Borrowed("LENGTH_PREFIXED"),
3837 2 => std::borrow::Cow::Borrowed("DELIMITED"),
3838 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3839 }
3840 }
3841
3842 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3844 match name {
3845 "MESSAGE_ENCODING_UNKNOWN" => {
3846 std::option::Option::Some(Self::MESSAGE_ENCODING_UNKNOWN)
3847 }
3848 "LENGTH_PREFIXED" => std::option::Option::Some(Self::LENGTH_PREFIXED),
3849 "DELIMITED" => std::option::Option::Some(Self::DELIMITED),
3850 _ => std::option::Option::None,
3851 }
3852 }
3853 }
3854
3855 impl std::convert::From<i32> for MessageEncoding {
3856 fn from(value: i32) -> Self {
3857 Self::new(value)
3858 }
3859 }
3860
3861 impl std::default::Default for MessageEncoding {
3862 fn default() -> Self {
3863 Self::new(0)
3864 }
3865 }
3866
3867 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3868 pub struct JsonFormat(i32);
3869
3870 impl JsonFormat {
3871 pub const JSON_FORMAT_UNKNOWN: JsonFormat = JsonFormat::new(0);
3872
3873 pub const ALLOW: JsonFormat = JsonFormat::new(1);
3874
3875 pub const LEGACY_BEST_EFFORT: JsonFormat = JsonFormat::new(2);
3876
3877 pub(crate) const fn new(value: i32) -> Self {
3879 Self(value)
3880 }
3881
3882 pub fn value(&self) -> i32 {
3884 self.0
3885 }
3886
3887 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3889 match self.0 {
3890 0 => std::borrow::Cow::Borrowed("JSON_FORMAT_UNKNOWN"),
3891 1 => std::borrow::Cow::Borrowed("ALLOW"),
3892 2 => std::borrow::Cow::Borrowed("LEGACY_BEST_EFFORT"),
3893 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3894 }
3895 }
3896
3897 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3899 match name {
3900 "JSON_FORMAT_UNKNOWN" => std::option::Option::Some(Self::JSON_FORMAT_UNKNOWN),
3901 "ALLOW" => std::option::Option::Some(Self::ALLOW),
3902 "LEGACY_BEST_EFFORT" => std::option::Option::Some(Self::LEGACY_BEST_EFFORT),
3903 _ => std::option::Option::None,
3904 }
3905 }
3906 }
3907
3908 impl std::convert::From<i32> for JsonFormat {
3909 fn from(value: i32) -> Self {
3910 Self::new(value)
3911 }
3912 }
3913
3914 impl std::default::Default for JsonFormat {
3915 fn default() -> Self {
3916 Self::new(0)
3917 }
3918 }
3919}
3920
3921#[serde_with::serde_as]
3926#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3927#[serde(default, rename_all = "camelCase")]
3928#[non_exhaustive]
3929pub struct FeatureSetDefaults {
3930 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3931 pub defaults: std::vec::Vec<crate::feature_set_defaults::FeatureSetEditionDefault>,
3932
3933 pub minimum_edition: crate::Edition,
3936
3937 pub maximum_edition: crate::Edition,
3940
3941 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3942 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3943}
3944
3945impl FeatureSetDefaults {
3946 pub fn new() -> Self {
3947 std::default::Default::default()
3948 }
3949
3950 pub fn set_minimum_edition<T: std::convert::Into<crate::Edition>>(mut self, v: T) -> Self {
3952 self.minimum_edition = v.into();
3953 self
3954 }
3955
3956 pub fn set_maximum_edition<T: std::convert::Into<crate::Edition>>(mut self, v: T) -> Self {
3958 self.maximum_edition = v.into();
3959 self
3960 }
3961
3962 pub fn set_defaults<T, V>(mut self, v: T) -> Self
3964 where
3965 T: std::iter::IntoIterator<Item = V>,
3966 V: std::convert::Into<crate::feature_set_defaults::FeatureSetEditionDefault>,
3967 {
3968 use std::iter::Iterator;
3969 self.defaults = v.into_iter().map(|i| i.into()).collect();
3970 self
3971 }
3972}
3973
3974impl wkt::message::Message for FeatureSetDefaults {
3975 fn typename() -> &'static str {
3976 "type.googleapis.com/google.protobuf.FeatureSetDefaults"
3977 }
3978}
3979
3980pub mod feature_set_defaults {
3982 #[allow(unused_imports)]
3983 use super::*;
3984
3985 #[serde_with::serde_as]
3990 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3991 #[serde(default, rename_all = "camelCase")]
3992 #[non_exhaustive]
3993 pub struct FeatureSetEditionDefault {
3994 pub edition: crate::Edition,
3995
3996 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3998 pub overridable_features: std::option::Option<crate::FeatureSet>,
3999
4000 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4002 pub fixed_features: std::option::Option<crate::FeatureSet>,
4003
4004 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4005 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4006 }
4007
4008 impl FeatureSetEditionDefault {
4009 pub fn new() -> Self {
4010 std::default::Default::default()
4011 }
4012
4013 pub fn set_edition<T: std::convert::Into<crate::Edition>>(mut self, v: T) -> Self {
4015 self.edition = v.into();
4016 self
4017 }
4018
4019 pub fn set_overridable_features<
4021 T: std::convert::Into<std::option::Option<crate::FeatureSet>>,
4022 >(
4023 mut self,
4024 v: T,
4025 ) -> Self {
4026 self.overridable_features = v.into();
4027 self
4028 }
4029
4030 pub fn set_fixed_features<T: std::convert::Into<std::option::Option<crate::FeatureSet>>>(
4032 mut self,
4033 v: T,
4034 ) -> Self {
4035 self.fixed_features = v.into();
4036 self
4037 }
4038 }
4039
4040 impl wkt::message::Message for FeatureSetEditionDefault {
4041 fn typename() -> &'static str {
4042 "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"
4043 }
4044 }
4045}
4046
4047#[serde_with::serde_as]
4050#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4051#[serde(default, rename_all = "camelCase")]
4052#[non_exhaustive]
4053pub struct SourceCodeInfo {
4054 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4099 pub location: std::vec::Vec<crate::source_code_info::Location>,
4100
4101 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4102 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4103}
4104
4105impl SourceCodeInfo {
4106 pub fn new() -> Self {
4107 std::default::Default::default()
4108 }
4109
4110 pub fn set_location<T, V>(mut self, v: T) -> Self
4112 where
4113 T: std::iter::IntoIterator<Item = V>,
4114 V: std::convert::Into<crate::source_code_info::Location>,
4115 {
4116 use std::iter::Iterator;
4117 self.location = v.into_iter().map(|i| i.into()).collect();
4118 self
4119 }
4120}
4121
4122impl wkt::message::Message for SourceCodeInfo {
4123 fn typename() -> &'static str {
4124 "type.googleapis.com/google.protobuf.SourceCodeInfo"
4125 }
4126}
4127
4128pub mod source_code_info {
4130 #[allow(unused_imports)]
4131 use super::*;
4132
4133 #[serde_with::serde_as]
4134 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4135 #[serde(default, rename_all = "camelCase")]
4136 #[non_exhaustive]
4137 pub struct Location {
4138 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4162 pub path: std::vec::Vec<i32>,
4163
4164 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4170 pub span: std::vec::Vec<i32>,
4171
4172 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4221 pub leading_comments: std::string::String,
4222
4223 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4224 pub trailing_comments: std::string::String,
4225
4226 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4227 pub leading_detached_comments: std::vec::Vec<std::string::String>,
4228
4229 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4230 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4231 }
4232
4233 impl Location {
4234 pub fn new() -> Self {
4235 std::default::Default::default()
4236 }
4237
4238 pub fn set_leading_comments<T: std::convert::Into<std::string::String>>(
4240 mut self,
4241 v: T,
4242 ) -> Self {
4243 self.leading_comments = v.into();
4244 self
4245 }
4246
4247 pub fn set_trailing_comments<T: std::convert::Into<std::string::String>>(
4249 mut self,
4250 v: T,
4251 ) -> Self {
4252 self.trailing_comments = v.into();
4253 self
4254 }
4255
4256 pub fn set_path<T, V>(mut self, v: T) -> Self
4258 where
4259 T: std::iter::IntoIterator<Item = V>,
4260 V: std::convert::Into<i32>,
4261 {
4262 use std::iter::Iterator;
4263 self.path = v.into_iter().map(|i| i.into()).collect();
4264 self
4265 }
4266
4267 pub fn set_span<T, V>(mut self, v: T) -> Self
4269 where
4270 T: std::iter::IntoIterator<Item = V>,
4271 V: std::convert::Into<i32>,
4272 {
4273 use std::iter::Iterator;
4274 self.span = v.into_iter().map(|i| i.into()).collect();
4275 self
4276 }
4277
4278 pub fn set_leading_detached_comments<T, V>(mut self, v: T) -> Self
4280 where
4281 T: std::iter::IntoIterator<Item = V>,
4282 V: std::convert::Into<std::string::String>,
4283 {
4284 use std::iter::Iterator;
4285 self.leading_detached_comments = v.into_iter().map(|i| i.into()).collect();
4286 self
4287 }
4288 }
4289
4290 impl wkt::message::Message for Location {
4291 fn typename() -> &'static str {
4292 "type.googleapis.com/google.protobuf.SourceCodeInfo.Location"
4293 }
4294 }
4295}
4296
4297#[serde_with::serde_as]
4301#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4302#[serde(default, rename_all = "camelCase")]
4303#[non_exhaustive]
4304pub struct GeneratedCodeInfo {
4305 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4308 pub annotation: std::vec::Vec<crate::generated_code_info::Annotation>,
4309
4310 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4311 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4312}
4313
4314impl GeneratedCodeInfo {
4315 pub fn new() -> Self {
4316 std::default::Default::default()
4317 }
4318
4319 pub fn set_annotation<T, V>(mut self, v: T) -> Self
4321 where
4322 T: std::iter::IntoIterator<Item = V>,
4323 V: std::convert::Into<crate::generated_code_info::Annotation>,
4324 {
4325 use std::iter::Iterator;
4326 self.annotation = v.into_iter().map(|i| i.into()).collect();
4327 self
4328 }
4329}
4330
4331impl wkt::message::Message for GeneratedCodeInfo {
4332 fn typename() -> &'static str {
4333 "type.googleapis.com/google.protobuf.GeneratedCodeInfo"
4334 }
4335}
4336
4337pub mod generated_code_info {
4339 #[allow(unused_imports)]
4340 use super::*;
4341
4342 #[serde_with::serde_as]
4343 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4344 #[serde(default, rename_all = "camelCase")]
4345 #[non_exhaustive]
4346 pub struct Annotation {
4347 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4350 pub path: std::vec::Vec<i32>,
4351
4352 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4354 pub source_file: std::string::String,
4355
4356 pub begin: i32,
4359
4360 pub end: i32,
4364
4365 pub semantic: crate::generated_code_info::annotation::Semantic,
4366
4367 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4368 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4369 }
4370
4371 impl Annotation {
4372 pub fn new() -> Self {
4373 std::default::Default::default()
4374 }
4375
4376 pub fn set_source_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4378 self.source_file = v.into();
4379 self
4380 }
4381
4382 pub fn set_begin<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4384 self.begin = v.into();
4385 self
4386 }
4387
4388 pub fn set_end<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4390 self.end = v.into();
4391 self
4392 }
4393
4394 pub fn set_semantic<
4396 T: std::convert::Into<crate::generated_code_info::annotation::Semantic>,
4397 >(
4398 mut self,
4399 v: T,
4400 ) -> Self {
4401 self.semantic = v.into();
4402 self
4403 }
4404
4405 pub fn set_path<T, V>(mut self, v: T) -> Self
4407 where
4408 T: std::iter::IntoIterator<Item = V>,
4409 V: std::convert::Into<i32>,
4410 {
4411 use std::iter::Iterator;
4412 self.path = v.into_iter().map(|i| i.into()).collect();
4413 self
4414 }
4415 }
4416
4417 impl wkt::message::Message for Annotation {
4418 fn typename() -> &'static str {
4419 "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation"
4420 }
4421 }
4422
4423 pub mod annotation {
4425 #[allow(unused_imports)]
4426 use super::*;
4427
4428 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4431 pub struct Semantic(i32);
4432
4433 impl Semantic {
4434 pub const NONE: Semantic = Semantic::new(0);
4436
4437 pub const SET: Semantic = Semantic::new(1);
4439
4440 pub const ALIAS: Semantic = Semantic::new(2);
4442
4443 pub(crate) const fn new(value: i32) -> Self {
4445 Self(value)
4446 }
4447
4448 pub fn value(&self) -> i32 {
4450 self.0
4451 }
4452
4453 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4455 match self.0 {
4456 0 => std::borrow::Cow::Borrowed("NONE"),
4457 1 => std::borrow::Cow::Borrowed("SET"),
4458 2 => std::borrow::Cow::Borrowed("ALIAS"),
4459 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4460 }
4461 }
4462
4463 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4465 match name {
4466 "NONE" => std::option::Option::Some(Self::NONE),
4467 "SET" => std::option::Option::Some(Self::SET),
4468 "ALIAS" => std::option::Option::Some(Self::ALIAS),
4469 _ => std::option::Option::None,
4470 }
4471 }
4472 }
4473
4474 impl std::convert::From<i32> for Semantic {
4475 fn from(value: i32) -> Self {
4476 Self::new(value)
4477 }
4478 }
4479
4480 impl std::default::Default for Semantic {
4481 fn default() -> Self {
4482 Self::new(0)
4483 }
4484 }
4485 }
4486}
4487
4488#[serde_with::serde_as]
4491#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4492#[serde(default, rename_all = "camelCase")]
4493#[non_exhaustive]
4494pub struct SourceContext {
4495 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4498 pub file_name: std::string::String,
4499
4500 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4501 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4502}
4503
4504impl SourceContext {
4505 pub fn new() -> Self {
4506 std::default::Default::default()
4507 }
4508
4509 pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4511 self.file_name = v.into();
4512 self
4513 }
4514}
4515
4516impl wkt::message::Message for SourceContext {
4517 fn typename() -> &'static str {
4518 "type.googleapis.com/google.protobuf.SourceContext"
4519 }
4520}
4521
4522#[serde_with::serde_as]
4524#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4525#[serde(default, rename_all = "camelCase")]
4526#[non_exhaustive]
4527pub struct Type {
4528 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4530 pub name: std::string::String,
4531
4532 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4534 pub fields: std::vec::Vec<crate::Field>,
4535
4536 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4538 pub oneofs: std::vec::Vec<std::string::String>,
4539
4540 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4542 pub options: std::vec::Vec<crate::Option>,
4543
4544 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4546 pub source_context: std::option::Option<crate::SourceContext>,
4547
4548 pub syntax: crate::Syntax,
4550
4551 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4553 pub edition: std::string::String,
4554
4555 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4556 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4557}
4558
4559impl Type {
4560 pub fn new() -> Self {
4561 std::default::Default::default()
4562 }
4563
4564 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4566 self.name = v.into();
4567 self
4568 }
4569
4570 pub fn set_source_context<T: std::convert::Into<std::option::Option<crate::SourceContext>>>(
4572 mut self,
4573 v: T,
4574 ) -> Self {
4575 self.source_context = v.into();
4576 self
4577 }
4578
4579 pub fn set_syntax<T: std::convert::Into<crate::Syntax>>(mut self, v: T) -> Self {
4581 self.syntax = v.into();
4582 self
4583 }
4584
4585 pub fn set_edition<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4587 self.edition = v.into();
4588 self
4589 }
4590
4591 pub fn set_fields<T, V>(mut self, v: T) -> Self
4593 where
4594 T: std::iter::IntoIterator<Item = V>,
4595 V: std::convert::Into<crate::Field>,
4596 {
4597 use std::iter::Iterator;
4598 self.fields = v.into_iter().map(|i| i.into()).collect();
4599 self
4600 }
4601
4602 pub fn set_oneofs<T, V>(mut self, v: T) -> Self
4604 where
4605 T: std::iter::IntoIterator<Item = V>,
4606 V: std::convert::Into<std::string::String>,
4607 {
4608 use std::iter::Iterator;
4609 self.oneofs = v.into_iter().map(|i| i.into()).collect();
4610 self
4611 }
4612
4613 pub fn set_options<T, V>(mut self, v: T) -> Self
4615 where
4616 T: std::iter::IntoIterator<Item = V>,
4617 V: std::convert::Into<crate::Option>,
4618 {
4619 use std::iter::Iterator;
4620 self.options = v.into_iter().map(|i| i.into()).collect();
4621 self
4622 }
4623}
4624
4625impl wkt::message::Message for Type {
4626 fn typename() -> &'static str {
4627 "type.googleapis.com/google.protobuf.Type"
4628 }
4629}
4630
4631#[serde_with::serde_as]
4633#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4634#[serde(default, rename_all = "camelCase")]
4635#[non_exhaustive]
4636pub struct Field {
4637 pub kind: crate::field::Kind,
4639
4640 pub cardinality: crate::field::Cardinality,
4642
4643 pub number: i32,
4645
4646 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4648 pub name: std::string::String,
4649
4650 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4653 pub type_url: std::string::String,
4654
4655 pub oneof_index: i32,
4658
4659 pub packed: bool,
4661
4662 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4664 pub options: std::vec::Vec<crate::Option>,
4665
4666 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4668 pub json_name: std::string::String,
4669
4670 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4672 pub default_value: std::string::String,
4673
4674 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4675 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4676}
4677
4678impl Field {
4679 pub fn new() -> Self {
4680 std::default::Default::default()
4681 }
4682
4683 pub fn set_kind<T: std::convert::Into<crate::field::Kind>>(mut self, v: T) -> Self {
4685 self.kind = v.into();
4686 self
4687 }
4688
4689 pub fn set_cardinality<T: std::convert::Into<crate::field::Cardinality>>(
4691 mut self,
4692 v: T,
4693 ) -> Self {
4694 self.cardinality = v.into();
4695 self
4696 }
4697
4698 pub fn set_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4700 self.number = v.into();
4701 self
4702 }
4703
4704 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4706 self.name = v.into();
4707 self
4708 }
4709
4710 pub fn set_type_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4712 self.type_url = v.into();
4713 self
4714 }
4715
4716 pub fn set_oneof_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4718 self.oneof_index = v.into();
4719 self
4720 }
4721
4722 pub fn set_packed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4724 self.packed = v.into();
4725 self
4726 }
4727
4728 pub fn set_json_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4730 self.json_name = v.into();
4731 self
4732 }
4733
4734 pub fn set_default_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4736 self.default_value = v.into();
4737 self
4738 }
4739
4740 pub fn set_options<T, V>(mut self, v: T) -> Self
4742 where
4743 T: std::iter::IntoIterator<Item = V>,
4744 V: std::convert::Into<crate::Option>,
4745 {
4746 use std::iter::Iterator;
4747 self.options = v.into_iter().map(|i| i.into()).collect();
4748 self
4749 }
4750}
4751
4752impl wkt::message::Message for Field {
4753 fn typename() -> &'static str {
4754 "type.googleapis.com/google.protobuf.Field"
4755 }
4756}
4757
4758pub mod field {
4760 #[allow(unused_imports)]
4761 use super::*;
4762
4763 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4765 pub struct Kind(i32);
4766
4767 impl Kind {
4768 pub const TYPE_UNKNOWN: Kind = Kind::new(0);
4770
4771 pub const TYPE_DOUBLE: Kind = Kind::new(1);
4773
4774 pub const TYPE_FLOAT: Kind = Kind::new(2);
4776
4777 pub const TYPE_INT64: Kind = Kind::new(3);
4779
4780 pub const TYPE_UINT64: Kind = Kind::new(4);
4782
4783 pub const TYPE_INT32: Kind = Kind::new(5);
4785
4786 pub const TYPE_FIXED64: Kind = Kind::new(6);
4788
4789 pub const TYPE_FIXED32: Kind = Kind::new(7);
4791
4792 pub const TYPE_BOOL: Kind = Kind::new(8);
4794
4795 pub const TYPE_STRING: Kind = Kind::new(9);
4797
4798 pub const TYPE_GROUP: Kind = Kind::new(10);
4800
4801 pub const TYPE_MESSAGE: Kind = Kind::new(11);
4803
4804 pub const TYPE_BYTES: Kind = Kind::new(12);
4806
4807 pub const TYPE_UINT32: Kind = Kind::new(13);
4809
4810 pub const TYPE_ENUM: Kind = Kind::new(14);
4812
4813 pub const TYPE_SFIXED32: Kind = Kind::new(15);
4815
4816 pub const TYPE_SFIXED64: Kind = Kind::new(16);
4818
4819 pub const TYPE_SINT32: Kind = Kind::new(17);
4821
4822 pub const TYPE_SINT64: Kind = Kind::new(18);
4824
4825 pub(crate) const fn new(value: i32) -> Self {
4827 Self(value)
4828 }
4829
4830 pub fn value(&self) -> i32 {
4832 self.0
4833 }
4834
4835 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4837 match self.0 {
4838 0 => std::borrow::Cow::Borrowed("TYPE_UNKNOWN"),
4839 1 => std::borrow::Cow::Borrowed("TYPE_DOUBLE"),
4840 2 => std::borrow::Cow::Borrowed("TYPE_FLOAT"),
4841 3 => std::borrow::Cow::Borrowed("TYPE_INT64"),
4842 4 => std::borrow::Cow::Borrowed("TYPE_UINT64"),
4843 5 => std::borrow::Cow::Borrowed("TYPE_INT32"),
4844 6 => std::borrow::Cow::Borrowed("TYPE_FIXED64"),
4845 7 => std::borrow::Cow::Borrowed("TYPE_FIXED32"),
4846 8 => std::borrow::Cow::Borrowed("TYPE_BOOL"),
4847 9 => std::borrow::Cow::Borrowed("TYPE_STRING"),
4848 10 => std::borrow::Cow::Borrowed("TYPE_GROUP"),
4849 11 => std::borrow::Cow::Borrowed("TYPE_MESSAGE"),
4850 12 => std::borrow::Cow::Borrowed("TYPE_BYTES"),
4851 13 => std::borrow::Cow::Borrowed("TYPE_UINT32"),
4852 14 => std::borrow::Cow::Borrowed("TYPE_ENUM"),
4853 15 => std::borrow::Cow::Borrowed("TYPE_SFIXED32"),
4854 16 => std::borrow::Cow::Borrowed("TYPE_SFIXED64"),
4855 17 => std::borrow::Cow::Borrowed("TYPE_SINT32"),
4856 18 => std::borrow::Cow::Borrowed("TYPE_SINT64"),
4857 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4858 }
4859 }
4860
4861 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4863 match name {
4864 "TYPE_UNKNOWN" => std::option::Option::Some(Self::TYPE_UNKNOWN),
4865 "TYPE_DOUBLE" => std::option::Option::Some(Self::TYPE_DOUBLE),
4866 "TYPE_FLOAT" => std::option::Option::Some(Self::TYPE_FLOAT),
4867 "TYPE_INT64" => std::option::Option::Some(Self::TYPE_INT64),
4868 "TYPE_UINT64" => std::option::Option::Some(Self::TYPE_UINT64),
4869 "TYPE_INT32" => std::option::Option::Some(Self::TYPE_INT32),
4870 "TYPE_FIXED64" => std::option::Option::Some(Self::TYPE_FIXED64),
4871 "TYPE_FIXED32" => std::option::Option::Some(Self::TYPE_FIXED32),
4872 "TYPE_BOOL" => std::option::Option::Some(Self::TYPE_BOOL),
4873 "TYPE_STRING" => std::option::Option::Some(Self::TYPE_STRING),
4874 "TYPE_GROUP" => std::option::Option::Some(Self::TYPE_GROUP),
4875 "TYPE_MESSAGE" => std::option::Option::Some(Self::TYPE_MESSAGE),
4876 "TYPE_BYTES" => std::option::Option::Some(Self::TYPE_BYTES),
4877 "TYPE_UINT32" => std::option::Option::Some(Self::TYPE_UINT32),
4878 "TYPE_ENUM" => std::option::Option::Some(Self::TYPE_ENUM),
4879 "TYPE_SFIXED32" => std::option::Option::Some(Self::TYPE_SFIXED32),
4880 "TYPE_SFIXED64" => std::option::Option::Some(Self::TYPE_SFIXED64),
4881 "TYPE_SINT32" => std::option::Option::Some(Self::TYPE_SINT32),
4882 "TYPE_SINT64" => std::option::Option::Some(Self::TYPE_SINT64),
4883 _ => std::option::Option::None,
4884 }
4885 }
4886 }
4887
4888 impl std::convert::From<i32> for Kind {
4889 fn from(value: i32) -> Self {
4890 Self::new(value)
4891 }
4892 }
4893
4894 impl std::default::Default for Kind {
4895 fn default() -> Self {
4896 Self::new(0)
4897 }
4898 }
4899
4900 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4902 pub struct Cardinality(i32);
4903
4904 impl Cardinality {
4905 pub const CARDINALITY_UNKNOWN: Cardinality = Cardinality::new(0);
4907
4908 pub const CARDINALITY_OPTIONAL: Cardinality = Cardinality::new(1);
4910
4911 pub const CARDINALITY_REQUIRED: Cardinality = Cardinality::new(2);
4913
4914 pub const CARDINALITY_REPEATED: Cardinality = Cardinality::new(3);
4916
4917 pub(crate) const fn new(value: i32) -> Self {
4919 Self(value)
4920 }
4921
4922 pub fn value(&self) -> i32 {
4924 self.0
4925 }
4926
4927 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4929 match self.0 {
4930 0 => std::borrow::Cow::Borrowed("CARDINALITY_UNKNOWN"),
4931 1 => std::borrow::Cow::Borrowed("CARDINALITY_OPTIONAL"),
4932 2 => std::borrow::Cow::Borrowed("CARDINALITY_REQUIRED"),
4933 3 => std::borrow::Cow::Borrowed("CARDINALITY_REPEATED"),
4934 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4935 }
4936 }
4937
4938 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4940 match name {
4941 "CARDINALITY_UNKNOWN" => std::option::Option::Some(Self::CARDINALITY_UNKNOWN),
4942 "CARDINALITY_OPTIONAL" => std::option::Option::Some(Self::CARDINALITY_OPTIONAL),
4943 "CARDINALITY_REQUIRED" => std::option::Option::Some(Self::CARDINALITY_REQUIRED),
4944 "CARDINALITY_REPEATED" => std::option::Option::Some(Self::CARDINALITY_REPEATED),
4945 _ => std::option::Option::None,
4946 }
4947 }
4948 }
4949
4950 impl std::convert::From<i32> for Cardinality {
4951 fn from(value: i32) -> Self {
4952 Self::new(value)
4953 }
4954 }
4955
4956 impl std::default::Default for Cardinality {
4957 fn default() -> Self {
4958 Self::new(0)
4959 }
4960 }
4961}
4962
4963#[serde_with::serde_as]
4965#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4966#[serde(default, rename_all = "camelCase")]
4967#[non_exhaustive]
4968pub struct Enum {
4969 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4971 pub name: std::string::String,
4972
4973 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4975 pub enumvalue: std::vec::Vec<crate::EnumValue>,
4976
4977 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4979 pub options: std::vec::Vec<crate::Option>,
4980
4981 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4983 pub source_context: std::option::Option<crate::SourceContext>,
4984
4985 pub syntax: crate::Syntax,
4987
4988 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4990 pub edition: std::string::String,
4991
4992 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4993 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4994}
4995
4996impl Enum {
4997 pub fn new() -> Self {
4998 std::default::Default::default()
4999 }
5000
5001 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5003 self.name = v.into();
5004 self
5005 }
5006
5007 pub fn set_source_context<T: std::convert::Into<std::option::Option<crate::SourceContext>>>(
5009 mut self,
5010 v: T,
5011 ) -> Self {
5012 self.source_context = v.into();
5013 self
5014 }
5015
5016 pub fn set_syntax<T: std::convert::Into<crate::Syntax>>(mut self, v: T) -> Self {
5018 self.syntax = v.into();
5019 self
5020 }
5021
5022 pub fn set_edition<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5024 self.edition = v.into();
5025 self
5026 }
5027
5028 pub fn set_enumvalue<T, V>(mut self, v: T) -> Self
5030 where
5031 T: std::iter::IntoIterator<Item = V>,
5032 V: std::convert::Into<crate::EnumValue>,
5033 {
5034 use std::iter::Iterator;
5035 self.enumvalue = v.into_iter().map(|i| i.into()).collect();
5036 self
5037 }
5038
5039 pub fn set_options<T, V>(mut self, v: T) -> Self
5041 where
5042 T: std::iter::IntoIterator<Item = V>,
5043 V: std::convert::Into<crate::Option>,
5044 {
5045 use std::iter::Iterator;
5046 self.options = v.into_iter().map(|i| i.into()).collect();
5047 self
5048 }
5049}
5050
5051impl wkt::message::Message for Enum {
5052 fn typename() -> &'static str {
5053 "type.googleapis.com/google.protobuf.Enum"
5054 }
5055}
5056
5057#[serde_with::serde_as]
5059#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5060#[serde(default, rename_all = "camelCase")]
5061#[non_exhaustive]
5062pub struct EnumValue {
5063 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5065 pub name: std::string::String,
5066
5067 pub number: i32,
5069
5070 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5072 pub options: std::vec::Vec<crate::Option>,
5073
5074 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5075 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5076}
5077
5078impl EnumValue {
5079 pub fn new() -> Self {
5080 std::default::Default::default()
5081 }
5082
5083 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5085 self.name = v.into();
5086 self
5087 }
5088
5089 pub fn set_number<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5091 self.number = v.into();
5092 self
5093 }
5094
5095 pub fn set_options<T, V>(mut self, v: T) -> Self
5097 where
5098 T: std::iter::IntoIterator<Item = V>,
5099 V: std::convert::Into<crate::Option>,
5100 {
5101 use std::iter::Iterator;
5102 self.options = v.into_iter().map(|i| i.into()).collect();
5103 self
5104 }
5105}
5106
5107impl wkt::message::Message for EnumValue {
5108 fn typename() -> &'static str {
5109 "type.googleapis.com/google.protobuf.EnumValue"
5110 }
5111}
5112
5113#[serde_with::serde_as]
5116#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5117#[serde(default, rename_all = "camelCase")]
5118#[non_exhaustive]
5119pub struct Option {
5120 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5125 pub name: std::string::String,
5126
5127 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5132 pub value: std::option::Option<crate::Any>,
5133
5134 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5135 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5136}
5137
5138impl Option {
5139 pub fn new() -> Self {
5140 std::default::Default::default()
5141 }
5142
5143 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5145 self.name = v.into();
5146 self
5147 }
5148
5149 pub fn set_value<T: std::convert::Into<std::option::Option<crate::Any>>>(
5151 mut self,
5152 v: T,
5153 ) -> Self {
5154 self.value = v.into();
5155 self
5156 }
5157}
5158
5159impl wkt::message::Message for Option {
5160 fn typename() -> &'static str {
5161 "type.googleapis.com/google.protobuf.Option"
5162 }
5163}
5164
5165#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5167pub struct Edition(i32);
5168
5169impl Edition {
5170 pub const EDITION_UNKNOWN: Edition = Edition::new(0);
5172
5173 pub const EDITION_LEGACY: Edition = Edition::new(900);
5176
5177 pub const EDITION_PROTO2: Edition = Edition::new(998);
5182
5183 pub const EDITION_PROTO3: Edition = Edition::new(999);
5184
5185 pub const EDITION_2023: Edition = Edition::new(1000);
5189
5190 pub const EDITION_2024: Edition = Edition::new(1001);
5191
5192 pub const EDITION_1_TEST_ONLY: Edition = Edition::new(1);
5195
5196 pub const EDITION_2_TEST_ONLY: Edition = Edition::new(2);
5197
5198 pub const EDITION_99997_TEST_ONLY: Edition = Edition::new(99997);
5199
5200 pub const EDITION_99998_TEST_ONLY: Edition = Edition::new(99998);
5201
5202 pub const EDITION_99999_TEST_ONLY: Edition = Edition::new(99999);
5203
5204 pub const EDITION_MAX: Edition = Edition::new(2147483647);
5208
5209 pub(crate) const fn new(value: i32) -> Self {
5211 Self(value)
5212 }
5213
5214 pub fn value(&self) -> i32 {
5216 self.0
5217 }
5218
5219 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
5221 match self.0 {
5222 0 => std::borrow::Cow::Borrowed("EDITION_UNKNOWN"),
5223 1 => std::borrow::Cow::Borrowed("EDITION_1_TEST_ONLY"),
5224 2 => std::borrow::Cow::Borrowed("EDITION_2_TEST_ONLY"),
5225 900 => std::borrow::Cow::Borrowed("EDITION_LEGACY"),
5226 998 => std::borrow::Cow::Borrowed("EDITION_PROTO2"),
5227 999 => std::borrow::Cow::Borrowed("EDITION_PROTO3"),
5228 1000 => std::borrow::Cow::Borrowed("EDITION_2023"),
5229 1001 => std::borrow::Cow::Borrowed("EDITION_2024"),
5230 99997 => std::borrow::Cow::Borrowed("EDITION_99997_TEST_ONLY"),
5231 99998 => std::borrow::Cow::Borrowed("EDITION_99998_TEST_ONLY"),
5232 99999 => std::borrow::Cow::Borrowed("EDITION_99999_TEST_ONLY"),
5233 2147483647 => std::borrow::Cow::Borrowed("EDITION_MAX"),
5234 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
5235 }
5236 }
5237
5238 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
5240 match name {
5241 "EDITION_UNKNOWN" => std::option::Option::Some(Self::EDITION_UNKNOWN),
5242 "EDITION_LEGACY" => std::option::Option::Some(Self::EDITION_LEGACY),
5243 "EDITION_PROTO2" => std::option::Option::Some(Self::EDITION_PROTO2),
5244 "EDITION_PROTO3" => std::option::Option::Some(Self::EDITION_PROTO3),
5245 "EDITION_2023" => std::option::Option::Some(Self::EDITION_2023),
5246 "EDITION_2024" => std::option::Option::Some(Self::EDITION_2024),
5247 "EDITION_1_TEST_ONLY" => std::option::Option::Some(Self::EDITION_1_TEST_ONLY),
5248 "EDITION_2_TEST_ONLY" => std::option::Option::Some(Self::EDITION_2_TEST_ONLY),
5249 "EDITION_99997_TEST_ONLY" => std::option::Option::Some(Self::EDITION_99997_TEST_ONLY),
5250 "EDITION_99998_TEST_ONLY" => std::option::Option::Some(Self::EDITION_99998_TEST_ONLY),
5251 "EDITION_99999_TEST_ONLY" => std::option::Option::Some(Self::EDITION_99999_TEST_ONLY),
5252 "EDITION_MAX" => std::option::Option::Some(Self::EDITION_MAX),
5253 _ => std::option::Option::None,
5254 }
5255 }
5256}
5257
5258impl std::convert::From<i32> for Edition {
5259 fn from(value: i32) -> Self {
5260 Self::new(value)
5261 }
5262}
5263
5264impl std::default::Default for Edition {
5265 fn default() -> Self {
5266 Self::new(0)
5267 }
5268}
5269
5270#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5272pub struct Syntax(i32);
5273
5274impl Syntax {
5275 pub const SYNTAX_PROTO2: Syntax = Syntax::new(0);
5277
5278 pub const SYNTAX_PROTO3: Syntax = Syntax::new(1);
5280
5281 pub const SYNTAX_EDITIONS: Syntax = Syntax::new(2);
5283
5284 pub(crate) const fn new(value: i32) -> Self {
5286 Self(value)
5287 }
5288
5289 pub fn value(&self) -> i32 {
5291 self.0
5292 }
5293
5294 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
5296 match self.0 {
5297 0 => std::borrow::Cow::Borrowed("SYNTAX_PROTO2"),
5298 1 => std::borrow::Cow::Borrowed("SYNTAX_PROTO3"),
5299 2 => std::borrow::Cow::Borrowed("SYNTAX_EDITIONS"),
5300 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
5301 }
5302 }
5303
5304 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
5306 match name {
5307 "SYNTAX_PROTO2" => std::option::Option::Some(Self::SYNTAX_PROTO2),
5308 "SYNTAX_PROTO3" => std::option::Option::Some(Self::SYNTAX_PROTO3),
5309 "SYNTAX_EDITIONS" => std::option::Option::Some(Self::SYNTAX_EDITIONS),
5310 _ => std::option::Option::None,
5311 }
5312 }
5313}
5314
5315impl std::convert::From<i32> for Syntax {
5316 fn from(value: i32) -> Self {
5317 Self::new(value)
5318 }
5319}
5320
5321impl std::default::Default for Syntax {
5322 fn default() -> Self {
5323 Self::new(0)
5324 }
5325}