1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct CreateApiRequest {
46 pub parent: std::string::String,
49
50 pub api_id: std::string::String,
60
61 pub api: std::option::Option<crate::model::Api>,
63
64 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
65}
66
67impl CreateApiRequest {
68 pub fn new() -> Self {
69 std::default::Default::default()
70 }
71
72 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
74 self.parent = v.into();
75 self
76 }
77
78 pub fn set_api_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
80 self.api_id = v.into();
81 self
82 }
83
84 pub fn set_api<T>(mut self, v: T) -> Self
86 where
87 T: std::convert::Into<crate::model::Api>,
88 {
89 self.api = std::option::Option::Some(v.into());
90 self
91 }
92
93 pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
95 where
96 T: std::convert::Into<crate::model::Api>,
97 {
98 self.api = v.map(|x| x.into());
99 self
100 }
101}
102
103impl wkt::message::Message for CreateApiRequest {
104 fn typename() -> &'static str {
105 "type.googleapis.com/google.cloud.apihub.v1.CreateApiRequest"
106 }
107}
108
109#[derive(Clone, Default, PartialEq)]
113#[non_exhaustive]
114pub struct GetApiRequest {
115 pub name: std::string::String,
118
119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
120}
121
122impl GetApiRequest {
123 pub fn new() -> Self {
124 std::default::Default::default()
125 }
126
127 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
129 self.name = v.into();
130 self
131 }
132}
133
134impl wkt::message::Message for GetApiRequest {
135 fn typename() -> &'static str {
136 "type.googleapis.com/google.cloud.apihub.v1.GetApiRequest"
137 }
138}
139
140#[derive(Clone, Default, PartialEq)]
144#[non_exhaustive]
145pub struct UpdateApiRequest {
146 pub api: std::option::Option<crate::model::Api>,
152
153 pub update_mask: std::option::Option<wkt::FieldMask>,
155
156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
157}
158
159impl UpdateApiRequest {
160 pub fn new() -> Self {
161 std::default::Default::default()
162 }
163
164 pub fn set_api<T>(mut self, v: T) -> Self
166 where
167 T: std::convert::Into<crate::model::Api>,
168 {
169 self.api = std::option::Option::Some(v.into());
170 self
171 }
172
173 pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
175 where
176 T: std::convert::Into<crate::model::Api>,
177 {
178 self.api = v.map(|x| x.into());
179 self
180 }
181
182 pub fn set_update_mask<T>(mut self, v: T) -> Self
184 where
185 T: std::convert::Into<wkt::FieldMask>,
186 {
187 self.update_mask = std::option::Option::Some(v.into());
188 self
189 }
190
191 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
193 where
194 T: std::convert::Into<wkt::FieldMask>,
195 {
196 self.update_mask = v.map(|x| x.into());
197 self
198 }
199}
200
201impl wkt::message::Message for UpdateApiRequest {
202 fn typename() -> &'static str {
203 "type.googleapis.com/google.cloud.apihub.v1.UpdateApiRequest"
204 }
205}
206
207#[derive(Clone, Default, PartialEq)]
211#[non_exhaustive]
212pub struct DeleteApiRequest {
213 pub name: std::string::String,
216
217 pub force: bool,
220
221 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
222}
223
224impl DeleteApiRequest {
225 pub fn new() -> Self {
226 std::default::Default::default()
227 }
228
229 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
231 self.name = v.into();
232 self
233 }
234
235 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
237 self.force = v.into();
238 self
239 }
240}
241
242impl wkt::message::Message for DeleteApiRequest {
243 fn typename() -> &'static str {
244 "type.googleapis.com/google.cloud.apihub.v1.DeleteApiRequest"
245 }
246}
247
248#[derive(Clone, Default, PartialEq)]
252#[non_exhaustive]
253pub struct ListApisRequest {
254 pub parent: std::string::String,
257
258 pub filter: std::string::String,
373
374 pub page_size: i32,
379
380 pub page_token: std::string::String,
386
387 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
388}
389
390impl ListApisRequest {
391 pub fn new() -> Self {
392 std::default::Default::default()
393 }
394
395 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
397 self.parent = v.into();
398 self
399 }
400
401 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
403 self.filter = v.into();
404 self
405 }
406
407 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
409 self.page_size = v.into();
410 self
411 }
412
413 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
415 self.page_token = v.into();
416 self
417 }
418}
419
420impl wkt::message::Message for ListApisRequest {
421 fn typename() -> &'static str {
422 "type.googleapis.com/google.cloud.apihub.v1.ListApisRequest"
423 }
424}
425
426#[derive(Clone, Default, PartialEq)]
430#[non_exhaustive]
431pub struct ListApisResponse {
432 pub apis: std::vec::Vec<crate::model::Api>,
434
435 pub next_page_token: std::string::String,
438
439 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
440}
441
442impl ListApisResponse {
443 pub fn new() -> Self {
444 std::default::Default::default()
445 }
446
447 pub fn set_apis<T, V>(mut self, v: T) -> Self
449 where
450 T: std::iter::IntoIterator<Item = V>,
451 V: std::convert::Into<crate::model::Api>,
452 {
453 use std::iter::Iterator;
454 self.apis = v.into_iter().map(|i| i.into()).collect();
455 self
456 }
457
458 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
460 self.next_page_token = v.into();
461 self
462 }
463}
464
465impl wkt::message::Message for ListApisResponse {
466 fn typename() -> &'static str {
467 "type.googleapis.com/google.cloud.apihub.v1.ListApisResponse"
468 }
469}
470
471#[doc(hidden)]
472impl gax::paginator::internal::PageableResponse for ListApisResponse {
473 type PageItem = crate::model::Api;
474
475 fn items(self) -> std::vec::Vec<Self::PageItem> {
476 self.apis
477 }
478
479 fn next_page_token(&self) -> std::string::String {
480 use std::clone::Clone;
481 self.next_page_token.clone()
482 }
483}
484
485#[derive(Clone, Default, PartialEq)]
490#[non_exhaustive]
491pub struct CreateVersionRequest {
492 pub parent: std::string::String,
495
496 pub version_id: std::string::String,
509
510 pub version: std::option::Option<crate::model::Version>,
512
513 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
514}
515
516impl CreateVersionRequest {
517 pub fn new() -> Self {
518 std::default::Default::default()
519 }
520
521 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
523 self.parent = v.into();
524 self
525 }
526
527 pub fn set_version_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
529 self.version_id = v.into();
530 self
531 }
532
533 pub fn set_version<T>(mut self, v: T) -> Self
535 where
536 T: std::convert::Into<crate::model::Version>,
537 {
538 self.version = std::option::Option::Some(v.into());
539 self
540 }
541
542 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
544 where
545 T: std::convert::Into<crate::model::Version>,
546 {
547 self.version = v.map(|x| x.into());
548 self
549 }
550}
551
552impl wkt::message::Message for CreateVersionRequest {
553 fn typename() -> &'static str {
554 "type.googleapis.com/google.cloud.apihub.v1.CreateVersionRequest"
555 }
556}
557
558#[derive(Clone, Default, PartialEq)]
562#[non_exhaustive]
563pub struct GetVersionRequest {
564 pub name: std::string::String,
568
569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
570}
571
572impl GetVersionRequest {
573 pub fn new() -> Self {
574 std::default::Default::default()
575 }
576
577 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
579 self.name = v.into();
580 self
581 }
582}
583
584impl wkt::message::Message for GetVersionRequest {
585 fn typename() -> &'static str {
586 "type.googleapis.com/google.cloud.apihub.v1.GetVersionRequest"
587 }
588}
589
590#[derive(Clone, Default, PartialEq)]
595#[non_exhaustive]
596pub struct UpdateVersionRequest {
597 pub version: std::option::Option<crate::model::Version>,
603
604 pub update_mask: std::option::Option<wkt::FieldMask>,
606
607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
608}
609
610impl UpdateVersionRequest {
611 pub fn new() -> Self {
612 std::default::Default::default()
613 }
614
615 pub fn set_version<T>(mut self, v: T) -> Self
617 where
618 T: std::convert::Into<crate::model::Version>,
619 {
620 self.version = std::option::Option::Some(v.into());
621 self
622 }
623
624 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
626 where
627 T: std::convert::Into<crate::model::Version>,
628 {
629 self.version = v.map(|x| x.into());
630 self
631 }
632
633 pub fn set_update_mask<T>(mut self, v: T) -> Self
635 where
636 T: std::convert::Into<wkt::FieldMask>,
637 {
638 self.update_mask = std::option::Option::Some(v.into());
639 self
640 }
641
642 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
644 where
645 T: std::convert::Into<wkt::FieldMask>,
646 {
647 self.update_mask = v.map(|x| x.into());
648 self
649 }
650}
651
652impl wkt::message::Message for UpdateVersionRequest {
653 fn typename() -> &'static str {
654 "type.googleapis.com/google.cloud.apihub.v1.UpdateVersionRequest"
655 }
656}
657
658#[derive(Clone, Default, PartialEq)]
663#[non_exhaustive]
664pub struct DeleteVersionRequest {
665 pub name: std::string::String,
669
670 pub force: bool,
673
674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
675}
676
677impl DeleteVersionRequest {
678 pub fn new() -> Self {
679 std::default::Default::default()
680 }
681
682 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
684 self.name = v.into();
685 self
686 }
687
688 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
690 self.force = v.into();
691 self
692 }
693}
694
695impl wkt::message::Message for DeleteVersionRequest {
696 fn typename() -> &'static str {
697 "type.googleapis.com/google.cloud.apihub.v1.DeleteVersionRequest"
698 }
699}
700
701#[derive(Clone, Default, PartialEq)]
706#[non_exhaustive]
707pub struct ListVersionsRequest {
708 pub parent: std::string::String,
711
712 pub filter: std::string::String,
806
807 pub page_size: i32,
812
813 pub page_token: std::string::String,
819
820 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
821}
822
823impl ListVersionsRequest {
824 pub fn new() -> Self {
825 std::default::Default::default()
826 }
827
828 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
830 self.parent = v.into();
831 self
832 }
833
834 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
836 self.filter = v.into();
837 self
838 }
839
840 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
842 self.page_size = v.into();
843 self
844 }
845
846 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
848 self.page_token = v.into();
849 self
850 }
851}
852
853impl wkt::message::Message for ListVersionsRequest {
854 fn typename() -> &'static str {
855 "type.googleapis.com/google.cloud.apihub.v1.ListVersionsRequest"
856 }
857}
858
859#[derive(Clone, Default, PartialEq)]
864#[non_exhaustive]
865pub struct ListVersionsResponse {
866 pub versions: std::vec::Vec<crate::model::Version>,
868
869 pub next_page_token: std::string::String,
872
873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
874}
875
876impl ListVersionsResponse {
877 pub fn new() -> Self {
878 std::default::Default::default()
879 }
880
881 pub fn set_versions<T, V>(mut self, v: T) -> Self
883 where
884 T: std::iter::IntoIterator<Item = V>,
885 V: std::convert::Into<crate::model::Version>,
886 {
887 use std::iter::Iterator;
888 self.versions = v.into_iter().map(|i| i.into()).collect();
889 self
890 }
891
892 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
894 self.next_page_token = v.into();
895 self
896 }
897}
898
899impl wkt::message::Message for ListVersionsResponse {
900 fn typename() -> &'static str {
901 "type.googleapis.com/google.cloud.apihub.v1.ListVersionsResponse"
902 }
903}
904
905#[doc(hidden)]
906impl gax::paginator::internal::PageableResponse for ListVersionsResponse {
907 type PageItem = crate::model::Version;
908
909 fn items(self) -> std::vec::Vec<Self::PageItem> {
910 self.versions
911 }
912
913 fn next_page_token(&self) -> std::string::String {
914 use std::clone::Clone;
915 self.next_page_token.clone()
916 }
917}
918
919#[derive(Clone, Default, PartialEq)]
923#[non_exhaustive]
924pub struct CreateSpecRequest {
925 pub parent: std::string::String,
929
930 pub spec_id: std::string::String,
944
945 pub spec: std::option::Option<crate::model::Spec>,
947
948 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
949}
950
951impl CreateSpecRequest {
952 pub fn new() -> Self {
953 std::default::Default::default()
954 }
955
956 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
958 self.parent = v.into();
959 self
960 }
961
962 pub fn set_spec_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
964 self.spec_id = v.into();
965 self
966 }
967
968 pub fn set_spec<T>(mut self, v: T) -> Self
970 where
971 T: std::convert::Into<crate::model::Spec>,
972 {
973 self.spec = std::option::Option::Some(v.into());
974 self
975 }
976
977 pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
979 where
980 T: std::convert::Into<crate::model::Spec>,
981 {
982 self.spec = v.map(|x| x.into());
983 self
984 }
985}
986
987impl wkt::message::Message for CreateSpecRequest {
988 fn typename() -> &'static str {
989 "type.googleapis.com/google.cloud.apihub.v1.CreateSpecRequest"
990 }
991}
992
993#[derive(Clone, Default, PartialEq)]
997#[non_exhaustive]
998pub struct GetSpecRequest {
999 pub name: std::string::String,
1003
1004 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1005}
1006
1007impl GetSpecRequest {
1008 pub fn new() -> Self {
1009 std::default::Default::default()
1010 }
1011
1012 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1014 self.name = v.into();
1015 self
1016 }
1017}
1018
1019impl wkt::message::Message for GetSpecRequest {
1020 fn typename() -> &'static str {
1021 "type.googleapis.com/google.cloud.apihub.v1.GetSpecRequest"
1022 }
1023}
1024
1025#[derive(Clone, Default, PartialEq)]
1029#[non_exhaustive]
1030pub struct UpdateSpecRequest {
1031 pub spec: std::option::Option<crate::model::Spec>,
1037
1038 pub update_mask: std::option::Option<wkt::FieldMask>,
1040
1041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1042}
1043
1044impl UpdateSpecRequest {
1045 pub fn new() -> Self {
1046 std::default::Default::default()
1047 }
1048
1049 pub fn set_spec<T>(mut self, v: T) -> Self
1051 where
1052 T: std::convert::Into<crate::model::Spec>,
1053 {
1054 self.spec = std::option::Option::Some(v.into());
1055 self
1056 }
1057
1058 pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
1060 where
1061 T: std::convert::Into<crate::model::Spec>,
1062 {
1063 self.spec = v.map(|x| x.into());
1064 self
1065 }
1066
1067 pub fn set_update_mask<T>(mut self, v: T) -> Self
1069 where
1070 T: std::convert::Into<wkt::FieldMask>,
1071 {
1072 self.update_mask = std::option::Option::Some(v.into());
1073 self
1074 }
1075
1076 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1078 where
1079 T: std::convert::Into<wkt::FieldMask>,
1080 {
1081 self.update_mask = v.map(|x| x.into());
1082 self
1083 }
1084}
1085
1086impl wkt::message::Message for UpdateSpecRequest {
1087 fn typename() -> &'static str {
1088 "type.googleapis.com/google.cloud.apihub.v1.UpdateSpecRequest"
1089 }
1090}
1091
1092#[derive(Clone, Default, PartialEq)]
1096#[non_exhaustive]
1097pub struct DeleteSpecRequest {
1098 pub name: std::string::String,
1102
1103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1104}
1105
1106impl DeleteSpecRequest {
1107 pub fn new() -> Self {
1108 std::default::Default::default()
1109 }
1110
1111 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1113 self.name = v.into();
1114 self
1115 }
1116}
1117
1118impl wkt::message::Message for DeleteSpecRequest {
1119 fn typename() -> &'static str {
1120 "type.googleapis.com/google.cloud.apihub.v1.DeleteSpecRequest"
1121 }
1122}
1123
1124#[derive(Clone, Default, PartialEq)]
1126#[non_exhaustive]
1127pub struct ListSpecsRequest {
1128 pub parent: std::string::String,
1132
1133 pub filter: std::string::String,
1220
1221 pub page_size: i32,
1226
1227 pub page_token: std::string::String,
1233
1234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1235}
1236
1237impl ListSpecsRequest {
1238 pub fn new() -> Self {
1239 std::default::Default::default()
1240 }
1241
1242 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1244 self.parent = v.into();
1245 self
1246 }
1247
1248 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1250 self.filter = v.into();
1251 self
1252 }
1253
1254 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1256 self.page_size = v.into();
1257 self
1258 }
1259
1260 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1262 self.page_token = v.into();
1263 self
1264 }
1265}
1266
1267impl wkt::message::Message for ListSpecsRequest {
1268 fn typename() -> &'static str {
1269 "type.googleapis.com/google.cloud.apihub.v1.ListSpecsRequest"
1270 }
1271}
1272
1273#[derive(Clone, Default, PartialEq)]
1277#[non_exhaustive]
1278pub struct ListSpecsResponse {
1279 pub specs: std::vec::Vec<crate::model::Spec>,
1281
1282 pub next_page_token: std::string::String,
1285
1286 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1287}
1288
1289impl ListSpecsResponse {
1290 pub fn new() -> Self {
1291 std::default::Default::default()
1292 }
1293
1294 pub fn set_specs<T, V>(mut self, v: T) -> Self
1296 where
1297 T: std::iter::IntoIterator<Item = V>,
1298 V: std::convert::Into<crate::model::Spec>,
1299 {
1300 use std::iter::Iterator;
1301 self.specs = v.into_iter().map(|i| i.into()).collect();
1302 self
1303 }
1304
1305 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1307 self.next_page_token = v.into();
1308 self
1309 }
1310}
1311
1312impl wkt::message::Message for ListSpecsResponse {
1313 fn typename() -> &'static str {
1314 "type.googleapis.com/google.cloud.apihub.v1.ListSpecsResponse"
1315 }
1316}
1317
1318#[doc(hidden)]
1319impl gax::paginator::internal::PageableResponse for ListSpecsResponse {
1320 type PageItem = crate::model::Spec;
1321
1322 fn items(self) -> std::vec::Vec<Self::PageItem> {
1323 self.specs
1324 }
1325
1326 fn next_page_token(&self) -> std::string::String {
1327 use std::clone::Clone;
1328 self.next_page_token.clone()
1329 }
1330}
1331
1332#[derive(Clone, Default, PartialEq)]
1337#[non_exhaustive]
1338pub struct GetSpecContentsRequest {
1339 pub name: std::string::String,
1343
1344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1345}
1346
1347impl GetSpecContentsRequest {
1348 pub fn new() -> Self {
1349 std::default::Default::default()
1350 }
1351
1352 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1354 self.name = v.into();
1355 self
1356 }
1357}
1358
1359impl wkt::message::Message for GetSpecContentsRequest {
1360 fn typename() -> &'static str {
1361 "type.googleapis.com/google.cloud.apihub.v1.GetSpecContentsRequest"
1362 }
1363}
1364
1365#[derive(Clone, Default, PartialEq)]
1370#[non_exhaustive]
1371pub struct CreateApiOperationRequest {
1372 pub parent: std::string::String,
1376
1377 pub api_operation_id: std::string::String,
1391
1392 pub api_operation: std::option::Option<crate::model::ApiOperation>,
1394
1395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1396}
1397
1398impl CreateApiOperationRequest {
1399 pub fn new() -> Self {
1400 std::default::Default::default()
1401 }
1402
1403 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1405 self.parent = v.into();
1406 self
1407 }
1408
1409 pub fn set_api_operation_id<T: std::convert::Into<std::string::String>>(
1411 mut self,
1412 v: T,
1413 ) -> Self {
1414 self.api_operation_id = v.into();
1415 self
1416 }
1417
1418 pub fn set_api_operation<T>(mut self, v: T) -> Self
1420 where
1421 T: std::convert::Into<crate::model::ApiOperation>,
1422 {
1423 self.api_operation = std::option::Option::Some(v.into());
1424 self
1425 }
1426
1427 pub fn set_or_clear_api_operation<T>(mut self, v: std::option::Option<T>) -> Self
1429 where
1430 T: std::convert::Into<crate::model::ApiOperation>,
1431 {
1432 self.api_operation = v.map(|x| x.into());
1433 self
1434 }
1435}
1436
1437impl wkt::message::Message for CreateApiOperationRequest {
1438 fn typename() -> &'static str {
1439 "type.googleapis.com/google.cloud.apihub.v1.CreateApiOperationRequest"
1440 }
1441}
1442
1443#[derive(Clone, Default, PartialEq)]
1448#[non_exhaustive]
1449pub struct GetApiOperationRequest {
1450 pub name: std::string::String,
1454
1455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1456}
1457
1458impl GetApiOperationRequest {
1459 pub fn new() -> Self {
1460 std::default::Default::default()
1461 }
1462
1463 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1465 self.name = v.into();
1466 self
1467 }
1468}
1469
1470impl wkt::message::Message for GetApiOperationRequest {
1471 fn typename() -> &'static str {
1472 "type.googleapis.com/google.cloud.apihub.v1.GetApiOperationRequest"
1473 }
1474}
1475
1476#[derive(Clone, Default, PartialEq)]
1481#[non_exhaustive]
1482pub struct UpdateApiOperationRequest {
1483 pub api_operation: std::option::Option<crate::model::ApiOperation>,
1490
1491 pub update_mask: std::option::Option<wkt::FieldMask>,
1493
1494 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1495}
1496
1497impl UpdateApiOperationRequest {
1498 pub fn new() -> Self {
1499 std::default::Default::default()
1500 }
1501
1502 pub fn set_api_operation<T>(mut self, v: T) -> Self
1504 where
1505 T: std::convert::Into<crate::model::ApiOperation>,
1506 {
1507 self.api_operation = std::option::Option::Some(v.into());
1508 self
1509 }
1510
1511 pub fn set_or_clear_api_operation<T>(mut self, v: std::option::Option<T>) -> Self
1513 where
1514 T: std::convert::Into<crate::model::ApiOperation>,
1515 {
1516 self.api_operation = v.map(|x| x.into());
1517 self
1518 }
1519
1520 pub fn set_update_mask<T>(mut self, v: T) -> Self
1522 where
1523 T: std::convert::Into<wkt::FieldMask>,
1524 {
1525 self.update_mask = std::option::Option::Some(v.into());
1526 self
1527 }
1528
1529 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1531 where
1532 T: std::convert::Into<wkt::FieldMask>,
1533 {
1534 self.update_mask = v.map(|x| x.into());
1535 self
1536 }
1537}
1538
1539impl wkt::message::Message for UpdateApiOperationRequest {
1540 fn typename() -> &'static str {
1541 "type.googleapis.com/google.cloud.apihub.v1.UpdateApiOperationRequest"
1542 }
1543}
1544
1545#[derive(Clone, Default, PartialEq)]
1550#[non_exhaustive]
1551pub struct DeleteApiOperationRequest {
1552 pub name: std::string::String,
1556
1557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1558}
1559
1560impl DeleteApiOperationRequest {
1561 pub fn new() -> Self {
1562 std::default::Default::default()
1563 }
1564
1565 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1567 self.name = v.into();
1568 self
1569 }
1570}
1571
1572impl wkt::message::Message for DeleteApiOperationRequest {
1573 fn typename() -> &'static str {
1574 "type.googleapis.com/google.cloud.apihub.v1.DeleteApiOperationRequest"
1575 }
1576}
1577
1578#[derive(Clone, Default, PartialEq)]
1583#[non_exhaustive]
1584pub struct ListApiOperationsRequest {
1585 pub parent: std::string::String,
1589
1590 pub filter: std::string::String,
1663
1664 pub page_size: i32,
1669
1670 pub page_token: std::string::String,
1676
1677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1678}
1679
1680impl ListApiOperationsRequest {
1681 pub fn new() -> Self {
1682 std::default::Default::default()
1683 }
1684
1685 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1687 self.parent = v.into();
1688 self
1689 }
1690
1691 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1693 self.filter = v.into();
1694 self
1695 }
1696
1697 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1699 self.page_size = v.into();
1700 self
1701 }
1702
1703 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1705 self.page_token = v.into();
1706 self
1707 }
1708}
1709
1710impl wkt::message::Message for ListApiOperationsRequest {
1711 fn typename() -> &'static str {
1712 "type.googleapis.com/google.cloud.apihub.v1.ListApiOperationsRequest"
1713 }
1714}
1715
1716#[derive(Clone, Default, PartialEq)]
1721#[non_exhaustive]
1722pub struct ListApiOperationsResponse {
1723 pub api_operations: std::vec::Vec<crate::model::ApiOperation>,
1725
1726 pub next_page_token: std::string::String,
1729
1730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1731}
1732
1733impl ListApiOperationsResponse {
1734 pub fn new() -> Self {
1735 std::default::Default::default()
1736 }
1737
1738 pub fn set_api_operations<T, V>(mut self, v: T) -> Self
1740 where
1741 T: std::iter::IntoIterator<Item = V>,
1742 V: std::convert::Into<crate::model::ApiOperation>,
1743 {
1744 use std::iter::Iterator;
1745 self.api_operations = v.into_iter().map(|i| i.into()).collect();
1746 self
1747 }
1748
1749 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1751 self.next_page_token = v.into();
1752 self
1753 }
1754}
1755
1756impl wkt::message::Message for ListApiOperationsResponse {
1757 fn typename() -> &'static str {
1758 "type.googleapis.com/google.cloud.apihub.v1.ListApiOperationsResponse"
1759 }
1760}
1761
1762#[doc(hidden)]
1763impl gax::paginator::internal::PageableResponse for ListApiOperationsResponse {
1764 type PageItem = crate::model::ApiOperation;
1765
1766 fn items(self) -> std::vec::Vec<Self::PageItem> {
1767 self.api_operations
1768 }
1769
1770 fn next_page_token(&self) -> std::string::String {
1771 use std::clone::Clone;
1772 self.next_page_token.clone()
1773 }
1774}
1775
1776#[derive(Clone, Default, PartialEq)]
1781#[non_exhaustive]
1782pub struct GetDefinitionRequest {
1783 pub name: std::string::String,
1787
1788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1789}
1790
1791impl GetDefinitionRequest {
1792 pub fn new() -> Self {
1793 std::default::Default::default()
1794 }
1795
1796 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1798 self.name = v.into();
1799 self
1800 }
1801}
1802
1803impl wkt::message::Message for GetDefinitionRequest {
1804 fn typename() -> &'static str {
1805 "type.googleapis.com/google.cloud.apihub.v1.GetDefinitionRequest"
1806 }
1807}
1808
1809#[derive(Clone, Default, PartialEq)]
1814#[non_exhaustive]
1815pub struct CreateDeploymentRequest {
1816 pub parent: std::string::String,
1819
1820 pub deployment_id: std::string::String,
1831
1832 pub deployment: std::option::Option<crate::model::Deployment>,
1834
1835 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1836}
1837
1838impl CreateDeploymentRequest {
1839 pub fn new() -> Self {
1840 std::default::Default::default()
1841 }
1842
1843 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1845 self.parent = v.into();
1846 self
1847 }
1848
1849 pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1851 self.deployment_id = v.into();
1852 self
1853 }
1854
1855 pub fn set_deployment<T>(mut self, v: T) -> Self
1857 where
1858 T: std::convert::Into<crate::model::Deployment>,
1859 {
1860 self.deployment = std::option::Option::Some(v.into());
1861 self
1862 }
1863
1864 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1866 where
1867 T: std::convert::Into<crate::model::Deployment>,
1868 {
1869 self.deployment = v.map(|x| x.into());
1870 self
1871 }
1872}
1873
1874impl wkt::message::Message for CreateDeploymentRequest {
1875 fn typename() -> &'static str {
1876 "type.googleapis.com/google.cloud.apihub.v1.CreateDeploymentRequest"
1877 }
1878}
1879
1880#[derive(Clone, Default, PartialEq)]
1885#[non_exhaustive]
1886pub struct GetDeploymentRequest {
1887 pub name: std::string::String,
1890
1891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1892}
1893
1894impl GetDeploymentRequest {
1895 pub fn new() -> Self {
1896 std::default::Default::default()
1897 }
1898
1899 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1901 self.name = v.into();
1902 self
1903 }
1904}
1905
1906impl wkt::message::Message for GetDeploymentRequest {
1907 fn typename() -> &'static str {
1908 "type.googleapis.com/google.cloud.apihub.v1.GetDeploymentRequest"
1909 }
1910}
1911
1912#[derive(Clone, Default, PartialEq)]
1917#[non_exhaustive]
1918pub struct UpdateDeploymentRequest {
1919 pub deployment: std::option::Option<crate::model::Deployment>,
1925
1926 pub update_mask: std::option::Option<wkt::FieldMask>,
1928
1929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1930}
1931
1932impl UpdateDeploymentRequest {
1933 pub fn new() -> Self {
1934 std::default::Default::default()
1935 }
1936
1937 pub fn set_deployment<T>(mut self, v: T) -> Self
1939 where
1940 T: std::convert::Into<crate::model::Deployment>,
1941 {
1942 self.deployment = std::option::Option::Some(v.into());
1943 self
1944 }
1945
1946 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
1948 where
1949 T: std::convert::Into<crate::model::Deployment>,
1950 {
1951 self.deployment = v.map(|x| x.into());
1952 self
1953 }
1954
1955 pub fn set_update_mask<T>(mut self, v: T) -> Self
1957 where
1958 T: std::convert::Into<wkt::FieldMask>,
1959 {
1960 self.update_mask = std::option::Option::Some(v.into());
1961 self
1962 }
1963
1964 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1966 where
1967 T: std::convert::Into<wkt::FieldMask>,
1968 {
1969 self.update_mask = v.map(|x| x.into());
1970 self
1971 }
1972}
1973
1974impl wkt::message::Message for UpdateDeploymentRequest {
1975 fn typename() -> &'static str {
1976 "type.googleapis.com/google.cloud.apihub.v1.UpdateDeploymentRequest"
1977 }
1978}
1979
1980#[derive(Clone, Default, PartialEq)]
1985#[non_exhaustive]
1986pub struct DeleteDeploymentRequest {
1987 pub name: std::string::String,
1990
1991 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1992}
1993
1994impl DeleteDeploymentRequest {
1995 pub fn new() -> Self {
1996 std::default::Default::default()
1997 }
1998
1999 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2001 self.name = v.into();
2002 self
2003 }
2004}
2005
2006impl wkt::message::Message for DeleteDeploymentRequest {
2007 fn typename() -> &'static str {
2008 "type.googleapis.com/google.cloud.apihub.v1.DeleteDeploymentRequest"
2009 }
2010}
2011
2012#[derive(Clone, Default, PartialEq)]
2017#[non_exhaustive]
2018pub struct ListDeploymentsRequest {
2019 pub parent: std::string::String,
2022
2023 pub filter: std::string::String,
2128
2129 pub page_size: i32,
2134
2135 pub page_token: std::string::String,
2141
2142 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2143}
2144
2145impl ListDeploymentsRequest {
2146 pub fn new() -> Self {
2147 std::default::Default::default()
2148 }
2149
2150 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2152 self.parent = v.into();
2153 self
2154 }
2155
2156 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2158 self.filter = v.into();
2159 self
2160 }
2161
2162 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2164 self.page_size = v.into();
2165 self
2166 }
2167
2168 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2170 self.page_token = v.into();
2171 self
2172 }
2173}
2174
2175impl wkt::message::Message for ListDeploymentsRequest {
2176 fn typename() -> &'static str {
2177 "type.googleapis.com/google.cloud.apihub.v1.ListDeploymentsRequest"
2178 }
2179}
2180
2181#[derive(Clone, Default, PartialEq)]
2186#[non_exhaustive]
2187pub struct ListDeploymentsResponse {
2188 pub deployments: std::vec::Vec<crate::model::Deployment>,
2190
2191 pub next_page_token: std::string::String,
2194
2195 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2196}
2197
2198impl ListDeploymentsResponse {
2199 pub fn new() -> Self {
2200 std::default::Default::default()
2201 }
2202
2203 pub fn set_deployments<T, V>(mut self, v: T) -> Self
2205 where
2206 T: std::iter::IntoIterator<Item = V>,
2207 V: std::convert::Into<crate::model::Deployment>,
2208 {
2209 use std::iter::Iterator;
2210 self.deployments = v.into_iter().map(|i| i.into()).collect();
2211 self
2212 }
2213
2214 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2216 self.next_page_token = v.into();
2217 self
2218 }
2219}
2220
2221impl wkt::message::Message for ListDeploymentsResponse {
2222 fn typename() -> &'static str {
2223 "type.googleapis.com/google.cloud.apihub.v1.ListDeploymentsResponse"
2224 }
2225}
2226
2227#[doc(hidden)]
2228impl gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
2229 type PageItem = crate::model::Deployment;
2230
2231 fn items(self) -> std::vec::Vec<Self::PageItem> {
2232 self.deployments
2233 }
2234
2235 fn next_page_token(&self) -> std::string::String {
2236 use std::clone::Clone;
2237 self.next_page_token.clone()
2238 }
2239}
2240
2241#[derive(Clone, Default, PartialEq)]
2246#[non_exhaustive]
2247pub struct CreateAttributeRequest {
2248 pub parent: std::string::String,
2251
2252 pub attribute_id: std::string::String,
2263
2264 pub attribute: std::option::Option<crate::model::Attribute>,
2266
2267 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2268}
2269
2270impl CreateAttributeRequest {
2271 pub fn new() -> Self {
2272 std::default::Default::default()
2273 }
2274
2275 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2277 self.parent = v.into();
2278 self
2279 }
2280
2281 pub fn set_attribute_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2283 self.attribute_id = v.into();
2284 self
2285 }
2286
2287 pub fn set_attribute<T>(mut self, v: T) -> Self
2289 where
2290 T: std::convert::Into<crate::model::Attribute>,
2291 {
2292 self.attribute = std::option::Option::Some(v.into());
2293 self
2294 }
2295
2296 pub fn set_or_clear_attribute<T>(mut self, v: std::option::Option<T>) -> Self
2298 where
2299 T: std::convert::Into<crate::model::Attribute>,
2300 {
2301 self.attribute = v.map(|x| x.into());
2302 self
2303 }
2304}
2305
2306impl wkt::message::Message for CreateAttributeRequest {
2307 fn typename() -> &'static str {
2308 "type.googleapis.com/google.cloud.apihub.v1.CreateAttributeRequest"
2309 }
2310}
2311
2312#[derive(Clone, Default, PartialEq)]
2317#[non_exhaustive]
2318pub struct GetAttributeRequest {
2319 pub name: std::string::String,
2323
2324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2325}
2326
2327impl GetAttributeRequest {
2328 pub fn new() -> Self {
2329 std::default::Default::default()
2330 }
2331
2332 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2334 self.name = v.into();
2335 self
2336 }
2337}
2338
2339impl wkt::message::Message for GetAttributeRequest {
2340 fn typename() -> &'static str {
2341 "type.googleapis.com/google.cloud.apihub.v1.GetAttributeRequest"
2342 }
2343}
2344
2345#[derive(Clone, Default, PartialEq)]
2350#[non_exhaustive]
2351pub struct UpdateAttributeRequest {
2352 pub attribute: std::option::Option<crate::model::Attribute>,
2358
2359 pub update_mask: std::option::Option<wkt::FieldMask>,
2361
2362 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2363}
2364
2365impl UpdateAttributeRequest {
2366 pub fn new() -> Self {
2367 std::default::Default::default()
2368 }
2369
2370 pub fn set_attribute<T>(mut self, v: T) -> Self
2372 where
2373 T: std::convert::Into<crate::model::Attribute>,
2374 {
2375 self.attribute = std::option::Option::Some(v.into());
2376 self
2377 }
2378
2379 pub fn set_or_clear_attribute<T>(mut self, v: std::option::Option<T>) -> Self
2381 where
2382 T: std::convert::Into<crate::model::Attribute>,
2383 {
2384 self.attribute = v.map(|x| x.into());
2385 self
2386 }
2387
2388 pub fn set_update_mask<T>(mut self, v: T) -> Self
2390 where
2391 T: std::convert::Into<wkt::FieldMask>,
2392 {
2393 self.update_mask = std::option::Option::Some(v.into());
2394 self
2395 }
2396
2397 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2399 where
2400 T: std::convert::Into<wkt::FieldMask>,
2401 {
2402 self.update_mask = v.map(|x| x.into());
2403 self
2404 }
2405}
2406
2407impl wkt::message::Message for UpdateAttributeRequest {
2408 fn typename() -> &'static str {
2409 "type.googleapis.com/google.cloud.apihub.v1.UpdateAttributeRequest"
2410 }
2411}
2412
2413#[derive(Clone, Default, PartialEq)]
2418#[non_exhaustive]
2419pub struct DeleteAttributeRequest {
2420 pub name: std::string::String,
2424
2425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2426}
2427
2428impl DeleteAttributeRequest {
2429 pub fn new() -> Self {
2430 std::default::Default::default()
2431 }
2432
2433 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2435 self.name = v.into();
2436 self
2437 }
2438}
2439
2440impl wkt::message::Message for DeleteAttributeRequest {
2441 fn typename() -> &'static str {
2442 "type.googleapis.com/google.cloud.apihub.v1.DeleteAttributeRequest"
2443 }
2444}
2445
2446#[derive(Clone, Default, PartialEq)]
2451#[non_exhaustive]
2452pub struct ListAttributesRequest {
2453 pub parent: std::string::String,
2456
2457 pub filter: std::string::String,
2501
2502 pub page_size: i32,
2507
2508 pub page_token: std::string::String,
2514
2515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2516}
2517
2518impl ListAttributesRequest {
2519 pub fn new() -> Self {
2520 std::default::Default::default()
2521 }
2522
2523 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2525 self.parent = v.into();
2526 self
2527 }
2528
2529 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2531 self.filter = v.into();
2532 self
2533 }
2534
2535 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2537 self.page_size = v.into();
2538 self
2539 }
2540
2541 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2543 self.page_token = v.into();
2544 self
2545 }
2546}
2547
2548impl wkt::message::Message for ListAttributesRequest {
2549 fn typename() -> &'static str {
2550 "type.googleapis.com/google.cloud.apihub.v1.ListAttributesRequest"
2551 }
2552}
2553
2554#[derive(Clone, Default, PartialEq)]
2559#[non_exhaustive]
2560pub struct ListAttributesResponse {
2561 pub attributes: std::vec::Vec<crate::model::Attribute>,
2563
2564 pub next_page_token: std::string::String,
2567
2568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2569}
2570
2571impl ListAttributesResponse {
2572 pub fn new() -> Self {
2573 std::default::Default::default()
2574 }
2575
2576 pub fn set_attributes<T, V>(mut self, v: T) -> Self
2578 where
2579 T: std::iter::IntoIterator<Item = V>,
2580 V: std::convert::Into<crate::model::Attribute>,
2581 {
2582 use std::iter::Iterator;
2583 self.attributes = v.into_iter().map(|i| i.into()).collect();
2584 self
2585 }
2586
2587 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2589 self.next_page_token = v.into();
2590 self
2591 }
2592}
2593
2594impl wkt::message::Message for ListAttributesResponse {
2595 fn typename() -> &'static str {
2596 "type.googleapis.com/google.cloud.apihub.v1.ListAttributesResponse"
2597 }
2598}
2599
2600#[doc(hidden)]
2601impl gax::paginator::internal::PageableResponse for ListAttributesResponse {
2602 type PageItem = crate::model::Attribute;
2603
2604 fn items(self) -> std::vec::Vec<Self::PageItem> {
2605 self.attributes
2606 }
2607
2608 fn next_page_token(&self) -> std::string::String {
2609 use std::clone::Clone;
2610 self.next_page_token.clone()
2611 }
2612}
2613
2614#[derive(Clone, Default, PartialEq)]
2619#[non_exhaustive]
2620pub struct SearchResourcesRequest {
2621 pub location: std::string::String,
2625
2626 pub query: std::string::String,
2630
2631 pub filter: std::string::String,
2649
2650 pub page_size: i32,
2657
2658 pub page_token: std::string::String,
2671
2672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2673}
2674
2675impl SearchResourcesRequest {
2676 pub fn new() -> Self {
2677 std::default::Default::default()
2678 }
2679
2680 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2682 self.location = v.into();
2683 self
2684 }
2685
2686 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2688 self.query = v.into();
2689 self
2690 }
2691
2692 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2694 self.filter = v.into();
2695 self
2696 }
2697
2698 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2700 self.page_size = v.into();
2701 self
2702 }
2703
2704 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2706 self.page_token = v.into();
2707 self
2708 }
2709}
2710
2711impl wkt::message::Message for SearchResourcesRequest {
2712 fn typename() -> &'static str {
2713 "type.googleapis.com/google.cloud.apihub.v1.SearchResourcesRequest"
2714 }
2715}
2716
2717#[derive(Clone, Default, PartialEq)]
2720#[non_exhaustive]
2721pub struct ApiHubResource {
2722 pub resource: std::option::Option<crate::model::api_hub_resource::Resource>,
2723
2724 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2725}
2726
2727impl ApiHubResource {
2728 pub fn new() -> Self {
2729 std::default::Default::default()
2730 }
2731
2732 pub fn set_resource<
2737 T: std::convert::Into<std::option::Option<crate::model::api_hub_resource::Resource>>,
2738 >(
2739 mut self,
2740 v: T,
2741 ) -> Self {
2742 self.resource = v.into();
2743 self
2744 }
2745
2746 pub fn api(&self) -> std::option::Option<&std::boxed::Box<crate::model::Api>> {
2750 #[allow(unreachable_patterns)]
2751 self.resource.as_ref().and_then(|v| match v {
2752 crate::model::api_hub_resource::Resource::Api(v) => std::option::Option::Some(v),
2753 _ => std::option::Option::None,
2754 })
2755 }
2756
2757 pub fn set_api<T: std::convert::Into<std::boxed::Box<crate::model::Api>>>(
2763 mut self,
2764 v: T,
2765 ) -> Self {
2766 self.resource =
2767 std::option::Option::Some(crate::model::api_hub_resource::Resource::Api(v.into()));
2768 self
2769 }
2770
2771 pub fn operation(&self) -> std::option::Option<&std::boxed::Box<crate::model::ApiOperation>> {
2775 #[allow(unreachable_patterns)]
2776 self.resource.as_ref().and_then(|v| match v {
2777 crate::model::api_hub_resource::Resource::Operation(v) => std::option::Option::Some(v),
2778 _ => std::option::Option::None,
2779 })
2780 }
2781
2782 pub fn set_operation<T: std::convert::Into<std::boxed::Box<crate::model::ApiOperation>>>(
2788 mut self,
2789 v: T,
2790 ) -> Self {
2791 self.resource = std::option::Option::Some(
2792 crate::model::api_hub_resource::Resource::Operation(v.into()),
2793 );
2794 self
2795 }
2796
2797 pub fn deployment(&self) -> std::option::Option<&std::boxed::Box<crate::model::Deployment>> {
2801 #[allow(unreachable_patterns)]
2802 self.resource.as_ref().and_then(|v| match v {
2803 crate::model::api_hub_resource::Resource::Deployment(v) => std::option::Option::Some(v),
2804 _ => std::option::Option::None,
2805 })
2806 }
2807
2808 pub fn set_deployment<T: std::convert::Into<std::boxed::Box<crate::model::Deployment>>>(
2814 mut self,
2815 v: T,
2816 ) -> Self {
2817 self.resource = std::option::Option::Some(
2818 crate::model::api_hub_resource::Resource::Deployment(v.into()),
2819 );
2820 self
2821 }
2822
2823 pub fn spec(&self) -> std::option::Option<&std::boxed::Box<crate::model::Spec>> {
2827 #[allow(unreachable_patterns)]
2828 self.resource.as_ref().and_then(|v| match v {
2829 crate::model::api_hub_resource::Resource::Spec(v) => std::option::Option::Some(v),
2830 _ => std::option::Option::None,
2831 })
2832 }
2833
2834 pub fn set_spec<T: std::convert::Into<std::boxed::Box<crate::model::Spec>>>(
2840 mut self,
2841 v: T,
2842 ) -> Self {
2843 self.resource =
2844 std::option::Option::Some(crate::model::api_hub_resource::Resource::Spec(v.into()));
2845 self
2846 }
2847
2848 pub fn definition(&self) -> std::option::Option<&std::boxed::Box<crate::model::Definition>> {
2852 #[allow(unreachable_patterns)]
2853 self.resource.as_ref().and_then(|v| match v {
2854 crate::model::api_hub_resource::Resource::Definition(v) => std::option::Option::Some(v),
2855 _ => std::option::Option::None,
2856 })
2857 }
2858
2859 pub fn set_definition<T: std::convert::Into<std::boxed::Box<crate::model::Definition>>>(
2865 mut self,
2866 v: T,
2867 ) -> Self {
2868 self.resource = std::option::Option::Some(
2869 crate::model::api_hub_resource::Resource::Definition(v.into()),
2870 );
2871 self
2872 }
2873
2874 pub fn version(&self) -> std::option::Option<&std::boxed::Box<crate::model::Version>> {
2878 #[allow(unreachable_patterns)]
2879 self.resource.as_ref().and_then(|v| match v {
2880 crate::model::api_hub_resource::Resource::Version(v) => std::option::Option::Some(v),
2881 _ => std::option::Option::None,
2882 })
2883 }
2884
2885 pub fn set_version<T: std::convert::Into<std::boxed::Box<crate::model::Version>>>(
2891 mut self,
2892 v: T,
2893 ) -> Self {
2894 self.resource =
2895 std::option::Option::Some(crate::model::api_hub_resource::Resource::Version(v.into()));
2896 self
2897 }
2898}
2899
2900impl wkt::message::Message for ApiHubResource {
2901 fn typename() -> &'static str {
2902 "type.googleapis.com/google.cloud.apihub.v1.ApiHubResource"
2903 }
2904}
2905
2906pub mod api_hub_resource {
2908 #[allow(unused_imports)]
2909 use super::*;
2910
2911 #[derive(Clone, Debug, PartialEq)]
2912 #[non_exhaustive]
2913 pub enum Resource {
2914 Api(std::boxed::Box<crate::model::Api>),
2917 Operation(std::boxed::Box<crate::model::ApiOperation>),
2920 Deployment(std::boxed::Box<crate::model::Deployment>),
2924 Spec(std::boxed::Box<crate::model::Spec>),
2928 Definition(std::boxed::Box<crate::model::Definition>),
2931 Version(std::boxed::Box<crate::model::Version>),
2935 }
2936}
2937
2938#[derive(Clone, Default, PartialEq)]
2940#[non_exhaustive]
2941pub struct SearchResult {
2942 pub resource: std::option::Option<crate::model::ApiHubResource>,
2945
2946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2947}
2948
2949impl SearchResult {
2950 pub fn new() -> Self {
2951 std::default::Default::default()
2952 }
2953
2954 pub fn set_resource<T>(mut self, v: T) -> Self
2956 where
2957 T: std::convert::Into<crate::model::ApiHubResource>,
2958 {
2959 self.resource = std::option::Option::Some(v.into());
2960 self
2961 }
2962
2963 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2965 where
2966 T: std::convert::Into<crate::model::ApiHubResource>,
2967 {
2968 self.resource = v.map(|x| x.into());
2969 self
2970 }
2971}
2972
2973impl wkt::message::Message for SearchResult {
2974 fn typename() -> &'static str {
2975 "type.googleapis.com/google.cloud.apihub.v1.SearchResult"
2976 }
2977}
2978
2979#[derive(Clone, Default, PartialEq)]
2984#[non_exhaustive]
2985pub struct SearchResourcesResponse {
2986 pub search_results: std::vec::Vec<crate::model::SearchResult>,
2989
2990 pub next_page_token: std::string::String,
2997
2998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2999}
3000
3001impl SearchResourcesResponse {
3002 pub fn new() -> Self {
3003 std::default::Default::default()
3004 }
3005
3006 pub fn set_search_results<T, V>(mut self, v: T) -> Self
3008 where
3009 T: std::iter::IntoIterator<Item = V>,
3010 V: std::convert::Into<crate::model::SearchResult>,
3011 {
3012 use std::iter::Iterator;
3013 self.search_results = v.into_iter().map(|i| i.into()).collect();
3014 self
3015 }
3016
3017 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3019 self.next_page_token = v.into();
3020 self
3021 }
3022}
3023
3024impl wkt::message::Message for SearchResourcesResponse {
3025 fn typename() -> &'static str {
3026 "type.googleapis.com/google.cloud.apihub.v1.SearchResourcesResponse"
3027 }
3028}
3029
3030#[doc(hidden)]
3031impl gax::paginator::internal::PageableResponse for SearchResourcesResponse {
3032 type PageItem = crate::model::SearchResult;
3033
3034 fn items(self) -> std::vec::Vec<Self::PageItem> {
3035 self.search_results
3036 }
3037
3038 fn next_page_token(&self) -> std::string::String {
3039 use std::clone::Clone;
3040 self.next_page_token.clone()
3041 }
3042}
3043
3044#[derive(Clone, Default, PartialEq)]
3050#[non_exhaustive]
3051pub struct CreateDependencyRequest {
3052 pub parent: std::string::String,
3055
3056 pub dependency_id: std::string::String,
3066
3067 pub dependency: std::option::Option<crate::model::Dependency>,
3069
3070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3071}
3072
3073impl CreateDependencyRequest {
3074 pub fn new() -> Self {
3075 std::default::Default::default()
3076 }
3077
3078 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3080 self.parent = v.into();
3081 self
3082 }
3083
3084 pub fn set_dependency_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3086 self.dependency_id = v.into();
3087 self
3088 }
3089
3090 pub fn set_dependency<T>(mut self, v: T) -> Self
3092 where
3093 T: std::convert::Into<crate::model::Dependency>,
3094 {
3095 self.dependency = std::option::Option::Some(v.into());
3096 self
3097 }
3098
3099 pub fn set_or_clear_dependency<T>(mut self, v: std::option::Option<T>) -> Self
3101 where
3102 T: std::convert::Into<crate::model::Dependency>,
3103 {
3104 self.dependency = v.map(|x| x.into());
3105 self
3106 }
3107}
3108
3109impl wkt::message::Message for CreateDependencyRequest {
3110 fn typename() -> &'static str {
3111 "type.googleapis.com/google.cloud.apihub.v1.CreateDependencyRequest"
3112 }
3113}
3114
3115#[derive(Clone, Default, PartialEq)]
3118#[non_exhaustive]
3119pub struct GetDependencyRequest {
3120 pub name: std::string::String,
3123
3124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3125}
3126
3127impl GetDependencyRequest {
3128 pub fn new() -> Self {
3129 std::default::Default::default()
3130 }
3131
3132 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3134 self.name = v.into();
3135 self
3136 }
3137}
3138
3139impl wkt::message::Message for GetDependencyRequest {
3140 fn typename() -> &'static str {
3141 "type.googleapis.com/google.cloud.apihub.v1.GetDependencyRequest"
3142 }
3143}
3144
3145#[derive(Clone, Default, PartialEq)]
3151#[non_exhaustive]
3152pub struct UpdateDependencyRequest {
3153 pub dependency: std::option::Option<crate::model::Dependency>,
3158
3159 pub update_mask: std::option::Option<wkt::FieldMask>,
3161
3162 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3163}
3164
3165impl UpdateDependencyRequest {
3166 pub fn new() -> Self {
3167 std::default::Default::default()
3168 }
3169
3170 pub fn set_dependency<T>(mut self, v: T) -> Self
3172 where
3173 T: std::convert::Into<crate::model::Dependency>,
3174 {
3175 self.dependency = std::option::Option::Some(v.into());
3176 self
3177 }
3178
3179 pub fn set_or_clear_dependency<T>(mut self, v: std::option::Option<T>) -> Self
3181 where
3182 T: std::convert::Into<crate::model::Dependency>,
3183 {
3184 self.dependency = v.map(|x| x.into());
3185 self
3186 }
3187
3188 pub fn set_update_mask<T>(mut self, v: T) -> Self
3190 where
3191 T: std::convert::Into<wkt::FieldMask>,
3192 {
3193 self.update_mask = std::option::Option::Some(v.into());
3194 self
3195 }
3196
3197 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3199 where
3200 T: std::convert::Into<wkt::FieldMask>,
3201 {
3202 self.update_mask = v.map(|x| x.into());
3203 self
3204 }
3205}
3206
3207impl wkt::message::Message for UpdateDependencyRequest {
3208 fn typename() -> &'static str {
3209 "type.googleapis.com/google.cloud.apihub.v1.UpdateDependencyRequest"
3210 }
3211}
3212
3213#[derive(Clone, Default, PartialEq)]
3219#[non_exhaustive]
3220pub struct DeleteDependencyRequest {
3221 pub name: std::string::String,
3224
3225 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3226}
3227
3228impl DeleteDependencyRequest {
3229 pub fn new() -> Self {
3230 std::default::Default::default()
3231 }
3232
3233 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3235 self.name = v.into();
3236 self
3237 }
3238}
3239
3240impl wkt::message::Message for DeleteDependencyRequest {
3241 fn typename() -> &'static str {
3242 "type.googleapis.com/google.cloud.apihub.v1.DeleteDependencyRequest"
3243 }
3244}
3245
3246#[derive(Clone, Default, PartialEq)]
3252#[non_exhaustive]
3253pub struct ListDependenciesRequest {
3254 pub parent: std::string::String,
3257
3258 pub filter: std::string::String,
3293
3294 pub page_size: i32,
3299
3300 pub page_token: std::string::String,
3306
3307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3308}
3309
3310impl ListDependenciesRequest {
3311 pub fn new() -> Self {
3312 std::default::Default::default()
3313 }
3314
3315 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3317 self.parent = v.into();
3318 self
3319 }
3320
3321 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3323 self.filter = v.into();
3324 self
3325 }
3326
3327 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3329 self.page_size = v.into();
3330 self
3331 }
3332
3333 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3335 self.page_token = v.into();
3336 self
3337 }
3338}
3339
3340impl wkt::message::Message for ListDependenciesRequest {
3341 fn typename() -> &'static str {
3342 "type.googleapis.com/google.cloud.apihub.v1.ListDependenciesRequest"
3343 }
3344}
3345
3346#[derive(Clone, Default, PartialEq)]
3352#[non_exhaustive]
3353pub struct ListDependenciesResponse {
3354 pub dependencies: std::vec::Vec<crate::model::Dependency>,
3356
3357 pub next_page_token: std::string::String,
3360
3361 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3362}
3363
3364impl ListDependenciesResponse {
3365 pub fn new() -> Self {
3366 std::default::Default::default()
3367 }
3368
3369 pub fn set_dependencies<T, V>(mut self, v: T) -> Self
3371 where
3372 T: std::iter::IntoIterator<Item = V>,
3373 V: std::convert::Into<crate::model::Dependency>,
3374 {
3375 use std::iter::Iterator;
3376 self.dependencies = v.into_iter().map(|i| i.into()).collect();
3377 self
3378 }
3379
3380 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3382 self.next_page_token = v.into();
3383 self
3384 }
3385}
3386
3387impl wkt::message::Message for ListDependenciesResponse {
3388 fn typename() -> &'static str {
3389 "type.googleapis.com/google.cloud.apihub.v1.ListDependenciesResponse"
3390 }
3391}
3392
3393#[doc(hidden)]
3394impl gax::paginator::internal::PageableResponse for ListDependenciesResponse {
3395 type PageItem = crate::model::Dependency;
3396
3397 fn items(self) -> std::vec::Vec<Self::PageItem> {
3398 self.dependencies
3399 }
3400
3401 fn next_page_token(&self) -> std::string::String {
3402 use std::clone::Clone;
3403 self.next_page_token.clone()
3404 }
3405}
3406
3407#[derive(Clone, Default, PartialEq)]
3412#[non_exhaustive]
3413pub struct CreateExternalApiRequest {
3414 pub parent: std::string::String,
3417
3418 pub external_api_id: std::string::String,
3430
3431 pub external_api: std::option::Option<crate::model::ExternalApi>,
3433
3434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3435}
3436
3437impl CreateExternalApiRequest {
3438 pub fn new() -> Self {
3439 std::default::Default::default()
3440 }
3441
3442 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3444 self.parent = v.into();
3445 self
3446 }
3447
3448 pub fn set_external_api_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3450 self.external_api_id = v.into();
3451 self
3452 }
3453
3454 pub fn set_external_api<T>(mut self, v: T) -> Self
3456 where
3457 T: std::convert::Into<crate::model::ExternalApi>,
3458 {
3459 self.external_api = std::option::Option::Some(v.into());
3460 self
3461 }
3462
3463 pub fn set_or_clear_external_api<T>(mut self, v: std::option::Option<T>) -> Self
3465 where
3466 T: std::convert::Into<crate::model::ExternalApi>,
3467 {
3468 self.external_api = v.map(|x| x.into());
3469 self
3470 }
3471}
3472
3473impl wkt::message::Message for CreateExternalApiRequest {
3474 fn typename() -> &'static str {
3475 "type.googleapis.com/google.cloud.apihub.v1.CreateExternalApiRequest"
3476 }
3477}
3478
3479#[derive(Clone, Default, PartialEq)]
3484#[non_exhaustive]
3485pub struct GetExternalApiRequest {
3486 pub name: std::string::String,
3490
3491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3492}
3493
3494impl GetExternalApiRequest {
3495 pub fn new() -> Self {
3496 std::default::Default::default()
3497 }
3498
3499 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3501 self.name = v.into();
3502 self
3503 }
3504}
3505
3506impl wkt::message::Message for GetExternalApiRequest {
3507 fn typename() -> &'static str {
3508 "type.googleapis.com/google.cloud.apihub.v1.GetExternalApiRequest"
3509 }
3510}
3511
3512#[derive(Clone, Default, PartialEq)]
3517#[non_exhaustive]
3518pub struct UpdateExternalApiRequest {
3519 pub external_api: std::option::Option<crate::model::ExternalApi>,
3525
3526 pub update_mask: std::option::Option<wkt::FieldMask>,
3528
3529 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3530}
3531
3532impl UpdateExternalApiRequest {
3533 pub fn new() -> Self {
3534 std::default::Default::default()
3535 }
3536
3537 pub fn set_external_api<T>(mut self, v: T) -> Self
3539 where
3540 T: std::convert::Into<crate::model::ExternalApi>,
3541 {
3542 self.external_api = std::option::Option::Some(v.into());
3543 self
3544 }
3545
3546 pub fn set_or_clear_external_api<T>(mut self, v: std::option::Option<T>) -> Self
3548 where
3549 T: std::convert::Into<crate::model::ExternalApi>,
3550 {
3551 self.external_api = v.map(|x| x.into());
3552 self
3553 }
3554
3555 pub fn set_update_mask<T>(mut self, v: T) -> Self
3557 where
3558 T: std::convert::Into<wkt::FieldMask>,
3559 {
3560 self.update_mask = std::option::Option::Some(v.into());
3561 self
3562 }
3563
3564 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3566 where
3567 T: std::convert::Into<wkt::FieldMask>,
3568 {
3569 self.update_mask = v.map(|x| x.into());
3570 self
3571 }
3572}
3573
3574impl wkt::message::Message for UpdateExternalApiRequest {
3575 fn typename() -> &'static str {
3576 "type.googleapis.com/google.cloud.apihub.v1.UpdateExternalApiRequest"
3577 }
3578}
3579
3580#[derive(Clone, Default, PartialEq)]
3585#[non_exhaustive]
3586pub struct DeleteExternalApiRequest {
3587 pub name: std::string::String,
3591
3592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3593}
3594
3595impl DeleteExternalApiRequest {
3596 pub fn new() -> Self {
3597 std::default::Default::default()
3598 }
3599
3600 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3602 self.name = v.into();
3603 self
3604 }
3605}
3606
3607impl wkt::message::Message for DeleteExternalApiRequest {
3608 fn typename() -> &'static str {
3609 "type.googleapis.com/google.cloud.apihub.v1.DeleteExternalApiRequest"
3610 }
3611}
3612
3613#[derive(Clone, Default, PartialEq)]
3618#[non_exhaustive]
3619pub struct ListExternalApisRequest {
3620 pub parent: std::string::String,
3623
3624 pub page_size: i32,
3629
3630 pub page_token: std::string::String,
3636
3637 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3638}
3639
3640impl ListExternalApisRequest {
3641 pub fn new() -> Self {
3642 std::default::Default::default()
3643 }
3644
3645 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3647 self.parent = v.into();
3648 self
3649 }
3650
3651 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3653 self.page_size = v.into();
3654 self
3655 }
3656
3657 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3659 self.page_token = v.into();
3660 self
3661 }
3662}
3663
3664impl wkt::message::Message for ListExternalApisRequest {
3665 fn typename() -> &'static str {
3666 "type.googleapis.com/google.cloud.apihub.v1.ListExternalApisRequest"
3667 }
3668}
3669
3670#[derive(Clone, Default, PartialEq)]
3675#[non_exhaustive]
3676pub struct ListExternalApisResponse {
3677 pub external_apis: std::vec::Vec<crate::model::ExternalApi>,
3679
3680 pub next_page_token: std::string::String,
3683
3684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3685}
3686
3687impl ListExternalApisResponse {
3688 pub fn new() -> Self {
3689 std::default::Default::default()
3690 }
3691
3692 pub fn set_external_apis<T, V>(mut self, v: T) -> Self
3694 where
3695 T: std::iter::IntoIterator<Item = V>,
3696 V: std::convert::Into<crate::model::ExternalApi>,
3697 {
3698 use std::iter::Iterator;
3699 self.external_apis = v.into_iter().map(|i| i.into()).collect();
3700 self
3701 }
3702
3703 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3705 self.next_page_token = v.into();
3706 self
3707 }
3708}
3709
3710impl wkt::message::Message for ListExternalApisResponse {
3711 fn typename() -> &'static str {
3712 "type.googleapis.com/google.cloud.apihub.v1.ListExternalApisResponse"
3713 }
3714}
3715
3716#[doc(hidden)]
3717impl gax::paginator::internal::PageableResponse for ListExternalApisResponse {
3718 type PageItem = crate::model::ExternalApi;
3719
3720 fn items(self) -> std::vec::Vec<Self::PageItem> {
3721 self.external_apis
3722 }
3723
3724 fn next_page_token(&self) -> std::string::String {
3725 use std::clone::Clone;
3726 self.next_page_token.clone()
3727 }
3728}
3729
3730#[derive(Clone, Default, PartialEq)]
3732#[non_exhaustive]
3733pub struct CollectApiDataRequest {
3734 pub location: std::string::String,
3737
3738 pub collection_type: crate::model::CollectionType,
3743
3744 pub plugin_instance: std::string::String,
3748
3749 pub action_id: std::string::String,
3753
3754 pub api_data: std::option::Option<crate::model::ApiData>,
3756
3757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3758}
3759
3760impl CollectApiDataRequest {
3761 pub fn new() -> Self {
3762 std::default::Default::default()
3763 }
3764
3765 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3767 self.location = v.into();
3768 self
3769 }
3770
3771 pub fn set_collection_type<T: std::convert::Into<crate::model::CollectionType>>(
3773 mut self,
3774 v: T,
3775 ) -> Self {
3776 self.collection_type = v.into();
3777 self
3778 }
3779
3780 pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3782 self.plugin_instance = v.into();
3783 self
3784 }
3785
3786 pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3788 self.action_id = v.into();
3789 self
3790 }
3791
3792 pub fn set_api_data<T>(mut self, v: T) -> Self
3794 where
3795 T: std::convert::Into<crate::model::ApiData>,
3796 {
3797 self.api_data = std::option::Option::Some(v.into());
3798 self
3799 }
3800
3801 pub fn set_or_clear_api_data<T>(mut self, v: std::option::Option<T>) -> Self
3803 where
3804 T: std::convert::Into<crate::model::ApiData>,
3805 {
3806 self.api_data = v.map(|x| x.into());
3807 self
3808 }
3809}
3810
3811impl wkt::message::Message for CollectApiDataRequest {
3812 fn typename() -> &'static str {
3813 "type.googleapis.com/google.cloud.apihub.v1.CollectApiDataRequest"
3814 }
3815}
3816
3817#[derive(Clone, Default, PartialEq)]
3819#[non_exhaustive]
3820pub struct ApiData {
3821 pub data: std::option::Option<crate::model::api_data::Data>,
3823
3824 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3825}
3826
3827impl ApiData {
3828 pub fn new() -> Self {
3829 std::default::Default::default()
3830 }
3831
3832 pub fn set_data<T: std::convert::Into<std::option::Option<crate::model::api_data::Data>>>(
3837 mut self,
3838 v: T,
3839 ) -> Self {
3840 self.data = v.into();
3841 self
3842 }
3843
3844 pub fn api_metadata_list(
3848 &self,
3849 ) -> std::option::Option<&std::boxed::Box<crate::model::ApiMetadataList>> {
3850 #[allow(unreachable_patterns)]
3851 self.data.as_ref().and_then(|v| match v {
3852 crate::model::api_data::Data::ApiMetadataList(v) => std::option::Option::Some(v),
3853 _ => std::option::Option::None,
3854 })
3855 }
3856
3857 pub fn set_api_metadata_list<
3863 T: std::convert::Into<std::boxed::Box<crate::model::ApiMetadataList>>,
3864 >(
3865 mut self,
3866 v: T,
3867 ) -> Self {
3868 self.data =
3869 std::option::Option::Some(crate::model::api_data::Data::ApiMetadataList(v.into()));
3870 self
3871 }
3872}
3873
3874impl wkt::message::Message for ApiData {
3875 fn typename() -> &'static str {
3876 "type.googleapis.com/google.cloud.apihub.v1.ApiData"
3877 }
3878}
3879
3880pub mod api_data {
3882 #[allow(unused_imports)]
3883 use super::*;
3884
3885 #[derive(Clone, Debug, PartialEq)]
3887 #[non_exhaustive]
3888 pub enum Data {
3889 ApiMetadataList(std::boxed::Box<crate::model::ApiMetadataList>),
3891 }
3892}
3893
3894#[derive(Clone, Default, PartialEq)]
3896#[non_exhaustive]
3897pub struct ApiMetadataList {
3898 pub api_metadata: std::vec::Vec<crate::model::APIMetadata>,
3900
3901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3902}
3903
3904impl ApiMetadataList {
3905 pub fn new() -> Self {
3906 std::default::Default::default()
3907 }
3908
3909 pub fn set_api_metadata<T, V>(mut self, v: T) -> Self
3911 where
3912 T: std::iter::IntoIterator<Item = V>,
3913 V: std::convert::Into<crate::model::APIMetadata>,
3914 {
3915 use std::iter::Iterator;
3916 self.api_metadata = v.into_iter().map(|i| i.into()).collect();
3917 self
3918 }
3919}
3920
3921impl wkt::message::Message for ApiMetadataList {
3922 fn typename() -> &'static str {
3923 "type.googleapis.com/google.cloud.apihub.v1.ApiMetadataList"
3924 }
3925}
3926
3927#[derive(Clone, Default, PartialEq)]
3929#[non_exhaustive]
3930pub struct APIMetadata {
3931 pub api: std::option::Option<crate::model::Api>,
3935
3936 pub versions: std::vec::Vec<crate::model::VersionMetadata>,
3938
3939 pub original_id: std::string::String,
3942
3943 pub original_create_time: std::option::Option<wkt::Timestamp>,
3945
3946 pub original_update_time: std::option::Option<wkt::Timestamp>,
3948
3949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3950}
3951
3952impl APIMetadata {
3953 pub fn new() -> Self {
3954 std::default::Default::default()
3955 }
3956
3957 pub fn set_api<T>(mut self, v: T) -> Self
3959 where
3960 T: std::convert::Into<crate::model::Api>,
3961 {
3962 self.api = std::option::Option::Some(v.into());
3963 self
3964 }
3965
3966 pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
3968 where
3969 T: std::convert::Into<crate::model::Api>,
3970 {
3971 self.api = v.map(|x| x.into());
3972 self
3973 }
3974
3975 pub fn set_versions<T, V>(mut self, v: T) -> Self
3977 where
3978 T: std::iter::IntoIterator<Item = V>,
3979 V: std::convert::Into<crate::model::VersionMetadata>,
3980 {
3981 use std::iter::Iterator;
3982 self.versions = v.into_iter().map(|i| i.into()).collect();
3983 self
3984 }
3985
3986 pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3988 self.original_id = v.into();
3989 self
3990 }
3991
3992 pub fn set_original_create_time<T>(mut self, v: T) -> Self
3994 where
3995 T: std::convert::Into<wkt::Timestamp>,
3996 {
3997 self.original_create_time = std::option::Option::Some(v.into());
3998 self
3999 }
4000
4001 pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4003 where
4004 T: std::convert::Into<wkt::Timestamp>,
4005 {
4006 self.original_create_time = v.map(|x| x.into());
4007 self
4008 }
4009
4010 pub fn set_original_update_time<T>(mut self, v: T) -> Self
4012 where
4013 T: std::convert::Into<wkt::Timestamp>,
4014 {
4015 self.original_update_time = std::option::Option::Some(v.into());
4016 self
4017 }
4018
4019 pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4021 where
4022 T: std::convert::Into<wkt::Timestamp>,
4023 {
4024 self.original_update_time = v.map(|x| x.into());
4025 self
4026 }
4027}
4028
4029impl wkt::message::Message for APIMetadata {
4030 fn typename() -> &'static str {
4031 "type.googleapis.com/google.cloud.apihub.v1.APIMetadata"
4032 }
4033}
4034
4035#[derive(Clone, Default, PartialEq)]
4037#[non_exhaustive]
4038pub struct VersionMetadata {
4039 pub version: std::option::Option<crate::model::Version>,
4042
4043 pub specs: std::vec::Vec<crate::model::SpecMetadata>,
4046
4047 pub deployments: std::vec::Vec<crate::model::DeploymentMetadata>,
4051
4052 pub original_id: std::string::String,
4055
4056 pub original_create_time: std::option::Option<wkt::Timestamp>,
4058
4059 pub original_update_time: std::option::Option<wkt::Timestamp>,
4062
4063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4064}
4065
4066impl VersionMetadata {
4067 pub fn new() -> Self {
4068 std::default::Default::default()
4069 }
4070
4071 pub fn set_version<T>(mut self, v: T) -> Self
4073 where
4074 T: std::convert::Into<crate::model::Version>,
4075 {
4076 self.version = std::option::Option::Some(v.into());
4077 self
4078 }
4079
4080 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
4082 where
4083 T: std::convert::Into<crate::model::Version>,
4084 {
4085 self.version = v.map(|x| x.into());
4086 self
4087 }
4088
4089 pub fn set_specs<T, V>(mut self, v: T) -> Self
4091 where
4092 T: std::iter::IntoIterator<Item = V>,
4093 V: std::convert::Into<crate::model::SpecMetadata>,
4094 {
4095 use std::iter::Iterator;
4096 self.specs = v.into_iter().map(|i| i.into()).collect();
4097 self
4098 }
4099
4100 pub fn set_deployments<T, V>(mut self, v: T) -> Self
4102 where
4103 T: std::iter::IntoIterator<Item = V>,
4104 V: std::convert::Into<crate::model::DeploymentMetadata>,
4105 {
4106 use std::iter::Iterator;
4107 self.deployments = v.into_iter().map(|i| i.into()).collect();
4108 self
4109 }
4110
4111 pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4113 self.original_id = v.into();
4114 self
4115 }
4116
4117 pub fn set_original_create_time<T>(mut self, v: T) -> Self
4119 where
4120 T: std::convert::Into<wkt::Timestamp>,
4121 {
4122 self.original_create_time = std::option::Option::Some(v.into());
4123 self
4124 }
4125
4126 pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4128 where
4129 T: std::convert::Into<wkt::Timestamp>,
4130 {
4131 self.original_create_time = v.map(|x| x.into());
4132 self
4133 }
4134
4135 pub fn set_original_update_time<T>(mut self, v: T) -> Self
4137 where
4138 T: std::convert::Into<wkt::Timestamp>,
4139 {
4140 self.original_update_time = std::option::Option::Some(v.into());
4141 self
4142 }
4143
4144 pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4146 where
4147 T: std::convert::Into<wkt::Timestamp>,
4148 {
4149 self.original_update_time = v.map(|x| x.into());
4150 self
4151 }
4152}
4153
4154impl wkt::message::Message for VersionMetadata {
4155 fn typename() -> &'static str {
4156 "type.googleapis.com/google.cloud.apihub.v1.VersionMetadata"
4157 }
4158}
4159
4160#[derive(Clone, Default, PartialEq)]
4162#[non_exhaustive]
4163pub struct SpecMetadata {
4164 pub spec: std::option::Option<crate::model::Spec>,
4167
4168 pub original_id: std::string::String,
4171
4172 pub original_create_time: std::option::Option<wkt::Timestamp>,
4174
4175 pub original_update_time: std::option::Option<wkt::Timestamp>,
4178
4179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4180}
4181
4182impl SpecMetadata {
4183 pub fn new() -> Self {
4184 std::default::Default::default()
4185 }
4186
4187 pub fn set_spec<T>(mut self, v: T) -> Self
4189 where
4190 T: std::convert::Into<crate::model::Spec>,
4191 {
4192 self.spec = std::option::Option::Some(v.into());
4193 self
4194 }
4195
4196 pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
4198 where
4199 T: std::convert::Into<crate::model::Spec>,
4200 {
4201 self.spec = v.map(|x| x.into());
4202 self
4203 }
4204
4205 pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4207 self.original_id = v.into();
4208 self
4209 }
4210
4211 pub fn set_original_create_time<T>(mut self, v: T) -> Self
4213 where
4214 T: std::convert::Into<wkt::Timestamp>,
4215 {
4216 self.original_create_time = std::option::Option::Some(v.into());
4217 self
4218 }
4219
4220 pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4222 where
4223 T: std::convert::Into<wkt::Timestamp>,
4224 {
4225 self.original_create_time = v.map(|x| x.into());
4226 self
4227 }
4228
4229 pub fn set_original_update_time<T>(mut self, v: T) -> Self
4231 where
4232 T: std::convert::Into<wkt::Timestamp>,
4233 {
4234 self.original_update_time = std::option::Option::Some(v.into());
4235 self
4236 }
4237
4238 pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4240 where
4241 T: std::convert::Into<wkt::Timestamp>,
4242 {
4243 self.original_update_time = v.map(|x| x.into());
4244 self
4245 }
4246}
4247
4248impl wkt::message::Message for SpecMetadata {
4249 fn typename() -> &'static str {
4250 "type.googleapis.com/google.cloud.apihub.v1.SpecMetadata"
4251 }
4252}
4253
4254#[derive(Clone, Default, PartialEq)]
4256#[non_exhaustive]
4257pub struct DeploymentMetadata {
4258 pub deployment: std::option::Option<crate::model::Deployment>,
4261
4262 pub original_id: std::string::String,
4265
4266 pub original_create_time: std::option::Option<wkt::Timestamp>,
4269
4270 pub original_update_time: std::option::Option<wkt::Timestamp>,
4273
4274 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4275}
4276
4277impl DeploymentMetadata {
4278 pub fn new() -> Self {
4279 std::default::Default::default()
4280 }
4281
4282 pub fn set_deployment<T>(mut self, v: T) -> Self
4284 where
4285 T: std::convert::Into<crate::model::Deployment>,
4286 {
4287 self.deployment = std::option::Option::Some(v.into());
4288 self
4289 }
4290
4291 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
4293 where
4294 T: std::convert::Into<crate::model::Deployment>,
4295 {
4296 self.deployment = v.map(|x| x.into());
4297 self
4298 }
4299
4300 pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4302 self.original_id = v.into();
4303 self
4304 }
4305
4306 pub fn set_original_create_time<T>(mut self, v: T) -> Self
4308 where
4309 T: std::convert::Into<wkt::Timestamp>,
4310 {
4311 self.original_create_time = std::option::Option::Some(v.into());
4312 self
4313 }
4314
4315 pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4317 where
4318 T: std::convert::Into<wkt::Timestamp>,
4319 {
4320 self.original_create_time = v.map(|x| x.into());
4321 self
4322 }
4323
4324 pub fn set_original_update_time<T>(mut self, v: T) -> Self
4326 where
4327 T: std::convert::Into<wkt::Timestamp>,
4328 {
4329 self.original_update_time = std::option::Option::Some(v.into());
4330 self
4331 }
4332
4333 pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4335 where
4336 T: std::convert::Into<wkt::Timestamp>,
4337 {
4338 self.original_update_time = v.map(|x| x.into());
4339 self
4340 }
4341}
4342
4343impl wkt::message::Message for DeploymentMetadata {
4344 fn typename() -> &'static str {
4345 "type.googleapis.com/google.cloud.apihub.v1.DeploymentMetadata"
4346 }
4347}
4348
4349#[derive(Clone, Default, PartialEq)]
4351#[non_exhaustive]
4352pub struct CollectApiDataResponse {
4353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4354}
4355
4356impl CollectApiDataResponse {
4357 pub fn new() -> Self {
4358 std::default::Default::default()
4359 }
4360}
4361
4362impl wkt::message::Message for CollectApiDataResponse {
4363 fn typename() -> &'static str {
4364 "type.googleapis.com/google.cloud.apihub.v1.CollectApiDataResponse"
4365 }
4366}
4367
4368#[derive(Clone, Default, PartialEq)]
4370#[non_exhaustive]
4371pub struct Api {
4372 pub name: std::string::String,
4377
4378 pub display_name: std::string::String,
4380
4381 pub description: std::string::String,
4383
4384 pub documentation: std::option::Option<crate::model::Documentation>,
4386
4387 pub owner: std::option::Option<crate::model::Owner>,
4389
4390 pub versions: std::vec::Vec<std::string::String>,
4395
4396 pub create_time: std::option::Option<wkt::Timestamp>,
4398
4399 pub update_time: std::option::Option<wkt::Timestamp>,
4401
4402 pub target_user: std::option::Option<crate::model::AttributeValues>,
4411
4412 pub team: std::option::Option<crate::model::AttributeValues>,
4421
4422 pub business_unit: std::option::Option<crate::model::AttributeValues>,
4431
4432 pub maturity_level: std::option::Option<crate::model::AttributeValues>,
4441
4442 pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
4447
4448 pub api_style: std::option::Option<crate::model::AttributeValues>,
4457
4458 pub selected_version: std::string::String,
4463
4464 pub api_requirements: std::option::Option<crate::model::AttributeValues>,
4472
4473 pub fingerprint: std::string::String,
4475
4476 pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,
4479
4480 pub api_functional_requirements: std::option::Option<crate::model::AttributeValues>,
4488
4489 pub api_technical_requirements: std::option::Option<crate::model::AttributeValues>,
4497
4498 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4499}
4500
4501impl Api {
4502 pub fn new() -> Self {
4503 std::default::Default::default()
4504 }
4505
4506 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4508 self.name = v.into();
4509 self
4510 }
4511
4512 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4514 self.display_name = v.into();
4515 self
4516 }
4517
4518 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4520 self.description = v.into();
4521 self
4522 }
4523
4524 pub fn set_documentation<T>(mut self, v: T) -> Self
4526 where
4527 T: std::convert::Into<crate::model::Documentation>,
4528 {
4529 self.documentation = std::option::Option::Some(v.into());
4530 self
4531 }
4532
4533 pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
4535 where
4536 T: std::convert::Into<crate::model::Documentation>,
4537 {
4538 self.documentation = v.map(|x| x.into());
4539 self
4540 }
4541
4542 pub fn set_owner<T>(mut self, v: T) -> Self
4544 where
4545 T: std::convert::Into<crate::model::Owner>,
4546 {
4547 self.owner = std::option::Option::Some(v.into());
4548 self
4549 }
4550
4551 pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
4553 where
4554 T: std::convert::Into<crate::model::Owner>,
4555 {
4556 self.owner = v.map(|x| x.into());
4557 self
4558 }
4559
4560 pub fn set_versions<T, V>(mut self, v: T) -> Self
4562 where
4563 T: std::iter::IntoIterator<Item = V>,
4564 V: std::convert::Into<std::string::String>,
4565 {
4566 use std::iter::Iterator;
4567 self.versions = v.into_iter().map(|i| i.into()).collect();
4568 self
4569 }
4570
4571 pub fn set_create_time<T>(mut self, v: T) -> Self
4573 where
4574 T: std::convert::Into<wkt::Timestamp>,
4575 {
4576 self.create_time = std::option::Option::Some(v.into());
4577 self
4578 }
4579
4580 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4582 where
4583 T: std::convert::Into<wkt::Timestamp>,
4584 {
4585 self.create_time = v.map(|x| x.into());
4586 self
4587 }
4588
4589 pub fn set_update_time<T>(mut self, v: T) -> Self
4591 where
4592 T: std::convert::Into<wkt::Timestamp>,
4593 {
4594 self.update_time = std::option::Option::Some(v.into());
4595 self
4596 }
4597
4598 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4600 where
4601 T: std::convert::Into<wkt::Timestamp>,
4602 {
4603 self.update_time = v.map(|x| x.into());
4604 self
4605 }
4606
4607 pub fn set_target_user<T>(mut self, v: T) -> Self
4609 where
4610 T: std::convert::Into<crate::model::AttributeValues>,
4611 {
4612 self.target_user = std::option::Option::Some(v.into());
4613 self
4614 }
4615
4616 pub fn set_or_clear_target_user<T>(mut self, v: std::option::Option<T>) -> Self
4618 where
4619 T: std::convert::Into<crate::model::AttributeValues>,
4620 {
4621 self.target_user = v.map(|x| x.into());
4622 self
4623 }
4624
4625 pub fn set_team<T>(mut self, v: T) -> Self
4627 where
4628 T: std::convert::Into<crate::model::AttributeValues>,
4629 {
4630 self.team = std::option::Option::Some(v.into());
4631 self
4632 }
4633
4634 pub fn set_or_clear_team<T>(mut self, v: std::option::Option<T>) -> Self
4636 where
4637 T: std::convert::Into<crate::model::AttributeValues>,
4638 {
4639 self.team = v.map(|x| x.into());
4640 self
4641 }
4642
4643 pub fn set_business_unit<T>(mut self, v: T) -> Self
4645 where
4646 T: std::convert::Into<crate::model::AttributeValues>,
4647 {
4648 self.business_unit = std::option::Option::Some(v.into());
4649 self
4650 }
4651
4652 pub fn set_or_clear_business_unit<T>(mut self, v: std::option::Option<T>) -> Self
4654 where
4655 T: std::convert::Into<crate::model::AttributeValues>,
4656 {
4657 self.business_unit = v.map(|x| x.into());
4658 self
4659 }
4660
4661 pub fn set_maturity_level<T>(mut self, v: T) -> Self
4663 where
4664 T: std::convert::Into<crate::model::AttributeValues>,
4665 {
4666 self.maturity_level = std::option::Option::Some(v.into());
4667 self
4668 }
4669
4670 pub fn set_or_clear_maturity_level<T>(mut self, v: std::option::Option<T>) -> Self
4672 where
4673 T: std::convert::Into<crate::model::AttributeValues>,
4674 {
4675 self.maturity_level = v.map(|x| x.into());
4676 self
4677 }
4678
4679 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
4681 where
4682 T: std::iter::IntoIterator<Item = (K, V)>,
4683 K: std::convert::Into<std::string::String>,
4684 V: std::convert::Into<crate::model::AttributeValues>,
4685 {
4686 use std::iter::Iterator;
4687 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4688 self
4689 }
4690
4691 pub fn set_api_style<T>(mut self, v: T) -> Self
4693 where
4694 T: std::convert::Into<crate::model::AttributeValues>,
4695 {
4696 self.api_style = std::option::Option::Some(v.into());
4697 self
4698 }
4699
4700 pub fn set_or_clear_api_style<T>(mut self, v: std::option::Option<T>) -> Self
4702 where
4703 T: std::convert::Into<crate::model::AttributeValues>,
4704 {
4705 self.api_style = v.map(|x| x.into());
4706 self
4707 }
4708
4709 pub fn set_selected_version<T: std::convert::Into<std::string::String>>(
4711 mut self,
4712 v: T,
4713 ) -> Self {
4714 self.selected_version = v.into();
4715 self
4716 }
4717
4718 pub fn set_api_requirements<T>(mut self, v: T) -> Self
4720 where
4721 T: std::convert::Into<crate::model::AttributeValues>,
4722 {
4723 self.api_requirements = std::option::Option::Some(v.into());
4724 self
4725 }
4726
4727 pub fn set_or_clear_api_requirements<T>(mut self, v: std::option::Option<T>) -> Self
4729 where
4730 T: std::convert::Into<crate::model::AttributeValues>,
4731 {
4732 self.api_requirements = v.map(|x| x.into());
4733 self
4734 }
4735
4736 pub fn set_fingerprint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4738 self.fingerprint = v.into();
4739 self
4740 }
4741
4742 pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
4744 where
4745 T: std::iter::IntoIterator<Item = V>,
4746 V: std::convert::Into<crate::model::SourceMetadata>,
4747 {
4748 use std::iter::Iterator;
4749 self.source_metadata = v.into_iter().map(|i| i.into()).collect();
4750 self
4751 }
4752
4753 pub fn set_api_functional_requirements<T>(mut self, v: T) -> Self
4755 where
4756 T: std::convert::Into<crate::model::AttributeValues>,
4757 {
4758 self.api_functional_requirements = std::option::Option::Some(v.into());
4759 self
4760 }
4761
4762 pub fn set_or_clear_api_functional_requirements<T>(mut self, v: std::option::Option<T>) -> Self
4764 where
4765 T: std::convert::Into<crate::model::AttributeValues>,
4766 {
4767 self.api_functional_requirements = v.map(|x| x.into());
4768 self
4769 }
4770
4771 pub fn set_api_technical_requirements<T>(mut self, v: T) -> Self
4773 where
4774 T: std::convert::Into<crate::model::AttributeValues>,
4775 {
4776 self.api_technical_requirements = std::option::Option::Some(v.into());
4777 self
4778 }
4779
4780 pub fn set_or_clear_api_technical_requirements<T>(mut self, v: std::option::Option<T>) -> Self
4782 where
4783 T: std::convert::Into<crate::model::AttributeValues>,
4784 {
4785 self.api_technical_requirements = v.map(|x| x.into());
4786 self
4787 }
4788}
4789
4790impl wkt::message::Message for Api {
4791 fn typename() -> &'static str {
4792 "type.googleapis.com/google.cloud.apihub.v1.Api"
4793 }
4794}
4795
4796#[derive(Clone, Default, PartialEq)]
4799#[non_exhaustive]
4800pub struct Version {
4801 pub name: std::string::String,
4806
4807 pub display_name: std::string::String,
4809
4810 pub description: std::string::String,
4812
4813 pub documentation: std::option::Option<crate::model::Documentation>,
4815
4816 pub specs: std::vec::Vec<std::string::String>,
4821
4822 pub api_operations: std::vec::Vec<std::string::String>,
4827
4828 pub definitions: std::vec::Vec<std::string::String>,
4833
4834 pub deployments: std::vec::Vec<std::string::String>,
4840
4841 pub create_time: std::option::Option<wkt::Timestamp>,
4843
4844 pub update_time: std::option::Option<wkt::Timestamp>,
4846
4847 pub lifecycle: std::option::Option<crate::model::AttributeValues>,
4856
4857 pub compliance: std::option::Option<crate::model::AttributeValues>,
4866
4867 pub accreditation: std::option::Option<crate::model::AttributeValues>,
4876
4877 pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
4882
4883 pub selected_deployment: std::string::String,
4889
4890 pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,
4893
4894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4895}
4896
4897impl Version {
4898 pub fn new() -> Self {
4899 std::default::Default::default()
4900 }
4901
4902 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4904 self.name = v.into();
4905 self
4906 }
4907
4908 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4910 self.display_name = v.into();
4911 self
4912 }
4913
4914 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4916 self.description = v.into();
4917 self
4918 }
4919
4920 pub fn set_documentation<T>(mut self, v: T) -> Self
4922 where
4923 T: std::convert::Into<crate::model::Documentation>,
4924 {
4925 self.documentation = std::option::Option::Some(v.into());
4926 self
4927 }
4928
4929 pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
4931 where
4932 T: std::convert::Into<crate::model::Documentation>,
4933 {
4934 self.documentation = v.map(|x| x.into());
4935 self
4936 }
4937
4938 pub fn set_specs<T, V>(mut self, v: T) -> Self
4940 where
4941 T: std::iter::IntoIterator<Item = V>,
4942 V: std::convert::Into<std::string::String>,
4943 {
4944 use std::iter::Iterator;
4945 self.specs = v.into_iter().map(|i| i.into()).collect();
4946 self
4947 }
4948
4949 pub fn set_api_operations<T, V>(mut self, v: T) -> Self
4951 where
4952 T: std::iter::IntoIterator<Item = V>,
4953 V: std::convert::Into<std::string::String>,
4954 {
4955 use std::iter::Iterator;
4956 self.api_operations = v.into_iter().map(|i| i.into()).collect();
4957 self
4958 }
4959
4960 pub fn set_definitions<T, V>(mut self, v: T) -> Self
4962 where
4963 T: std::iter::IntoIterator<Item = V>,
4964 V: std::convert::Into<std::string::String>,
4965 {
4966 use std::iter::Iterator;
4967 self.definitions = v.into_iter().map(|i| i.into()).collect();
4968 self
4969 }
4970
4971 pub fn set_deployments<T, V>(mut self, v: T) -> Self
4973 where
4974 T: std::iter::IntoIterator<Item = V>,
4975 V: std::convert::Into<std::string::String>,
4976 {
4977 use std::iter::Iterator;
4978 self.deployments = v.into_iter().map(|i| i.into()).collect();
4979 self
4980 }
4981
4982 pub fn set_create_time<T>(mut self, v: T) -> Self
4984 where
4985 T: std::convert::Into<wkt::Timestamp>,
4986 {
4987 self.create_time = std::option::Option::Some(v.into());
4988 self
4989 }
4990
4991 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4993 where
4994 T: std::convert::Into<wkt::Timestamp>,
4995 {
4996 self.create_time = v.map(|x| x.into());
4997 self
4998 }
4999
5000 pub fn set_update_time<T>(mut self, v: T) -> Self
5002 where
5003 T: std::convert::Into<wkt::Timestamp>,
5004 {
5005 self.update_time = std::option::Option::Some(v.into());
5006 self
5007 }
5008
5009 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5011 where
5012 T: std::convert::Into<wkt::Timestamp>,
5013 {
5014 self.update_time = v.map(|x| x.into());
5015 self
5016 }
5017
5018 pub fn set_lifecycle<T>(mut self, v: T) -> Self
5020 where
5021 T: std::convert::Into<crate::model::AttributeValues>,
5022 {
5023 self.lifecycle = std::option::Option::Some(v.into());
5024 self
5025 }
5026
5027 pub fn set_or_clear_lifecycle<T>(mut self, v: std::option::Option<T>) -> Self
5029 where
5030 T: std::convert::Into<crate::model::AttributeValues>,
5031 {
5032 self.lifecycle = v.map(|x| x.into());
5033 self
5034 }
5035
5036 pub fn set_compliance<T>(mut self, v: T) -> Self
5038 where
5039 T: std::convert::Into<crate::model::AttributeValues>,
5040 {
5041 self.compliance = std::option::Option::Some(v.into());
5042 self
5043 }
5044
5045 pub fn set_or_clear_compliance<T>(mut self, v: std::option::Option<T>) -> Self
5047 where
5048 T: std::convert::Into<crate::model::AttributeValues>,
5049 {
5050 self.compliance = v.map(|x| x.into());
5051 self
5052 }
5053
5054 pub fn set_accreditation<T>(mut self, v: T) -> Self
5056 where
5057 T: std::convert::Into<crate::model::AttributeValues>,
5058 {
5059 self.accreditation = std::option::Option::Some(v.into());
5060 self
5061 }
5062
5063 pub fn set_or_clear_accreditation<T>(mut self, v: std::option::Option<T>) -> Self
5065 where
5066 T: std::convert::Into<crate::model::AttributeValues>,
5067 {
5068 self.accreditation = v.map(|x| x.into());
5069 self
5070 }
5071
5072 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
5074 where
5075 T: std::iter::IntoIterator<Item = (K, V)>,
5076 K: std::convert::Into<std::string::String>,
5077 V: std::convert::Into<crate::model::AttributeValues>,
5078 {
5079 use std::iter::Iterator;
5080 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5081 self
5082 }
5083
5084 pub fn set_selected_deployment<T: std::convert::Into<std::string::String>>(
5086 mut self,
5087 v: T,
5088 ) -> Self {
5089 self.selected_deployment = v.into();
5090 self
5091 }
5092
5093 pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
5095 where
5096 T: std::iter::IntoIterator<Item = V>,
5097 V: std::convert::Into<crate::model::SourceMetadata>,
5098 {
5099 use std::iter::Iterator;
5100 self.source_metadata = v.into_iter().map(|i| i.into()).collect();
5101 self
5102 }
5103}
5104
5105impl wkt::message::Message for Version {
5106 fn typename() -> &'static str {
5107 "type.googleapis.com/google.cloud.apihub.v1.Version"
5108 }
5109}
5110
5111#[derive(Clone, Default, PartialEq)]
5115#[non_exhaustive]
5116pub struct Spec {
5117 pub name: std::string::String,
5122
5123 pub display_name: std::string::String,
5126
5127 pub spec_type: std::option::Option<crate::model::AttributeValues>,
5137
5138 pub contents: std::option::Option<crate::model::SpecContents>,
5140
5141 pub details: std::option::Option<crate::model::SpecDetails>,
5143
5144 pub source_uri: std::string::String,
5147
5148 pub create_time: std::option::Option<wkt::Timestamp>,
5150
5151 pub update_time: std::option::Option<wkt::Timestamp>,
5153
5154 pub lint_response: std::option::Option<crate::model::LintResponse>,
5156
5157 pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
5162
5163 pub documentation: std::option::Option<crate::model::Documentation>,
5167
5168 pub parsing_mode: crate::model::spec::ParsingMode,
5171
5172 pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,
5174
5175 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5176}
5177
5178impl Spec {
5179 pub fn new() -> Self {
5180 std::default::Default::default()
5181 }
5182
5183 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5185 self.name = v.into();
5186 self
5187 }
5188
5189 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5191 self.display_name = v.into();
5192 self
5193 }
5194
5195 pub fn set_spec_type<T>(mut self, v: T) -> Self
5197 where
5198 T: std::convert::Into<crate::model::AttributeValues>,
5199 {
5200 self.spec_type = std::option::Option::Some(v.into());
5201 self
5202 }
5203
5204 pub fn set_or_clear_spec_type<T>(mut self, v: std::option::Option<T>) -> Self
5206 where
5207 T: std::convert::Into<crate::model::AttributeValues>,
5208 {
5209 self.spec_type = v.map(|x| x.into());
5210 self
5211 }
5212
5213 pub fn set_contents<T>(mut self, v: T) -> Self
5215 where
5216 T: std::convert::Into<crate::model::SpecContents>,
5217 {
5218 self.contents = std::option::Option::Some(v.into());
5219 self
5220 }
5221
5222 pub fn set_or_clear_contents<T>(mut self, v: std::option::Option<T>) -> Self
5224 where
5225 T: std::convert::Into<crate::model::SpecContents>,
5226 {
5227 self.contents = v.map(|x| x.into());
5228 self
5229 }
5230
5231 pub fn set_details<T>(mut self, v: T) -> Self
5233 where
5234 T: std::convert::Into<crate::model::SpecDetails>,
5235 {
5236 self.details = std::option::Option::Some(v.into());
5237 self
5238 }
5239
5240 pub fn set_or_clear_details<T>(mut self, v: std::option::Option<T>) -> Self
5242 where
5243 T: std::convert::Into<crate::model::SpecDetails>,
5244 {
5245 self.details = v.map(|x| x.into());
5246 self
5247 }
5248
5249 pub fn set_source_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5251 self.source_uri = v.into();
5252 self
5253 }
5254
5255 pub fn set_create_time<T>(mut self, v: T) -> Self
5257 where
5258 T: std::convert::Into<wkt::Timestamp>,
5259 {
5260 self.create_time = std::option::Option::Some(v.into());
5261 self
5262 }
5263
5264 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5266 where
5267 T: std::convert::Into<wkt::Timestamp>,
5268 {
5269 self.create_time = v.map(|x| x.into());
5270 self
5271 }
5272
5273 pub fn set_update_time<T>(mut self, v: T) -> Self
5275 where
5276 T: std::convert::Into<wkt::Timestamp>,
5277 {
5278 self.update_time = std::option::Option::Some(v.into());
5279 self
5280 }
5281
5282 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5284 where
5285 T: std::convert::Into<wkt::Timestamp>,
5286 {
5287 self.update_time = v.map(|x| x.into());
5288 self
5289 }
5290
5291 pub fn set_lint_response<T>(mut self, v: T) -> Self
5293 where
5294 T: std::convert::Into<crate::model::LintResponse>,
5295 {
5296 self.lint_response = std::option::Option::Some(v.into());
5297 self
5298 }
5299
5300 pub fn set_or_clear_lint_response<T>(mut self, v: std::option::Option<T>) -> Self
5302 where
5303 T: std::convert::Into<crate::model::LintResponse>,
5304 {
5305 self.lint_response = v.map(|x| x.into());
5306 self
5307 }
5308
5309 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
5311 where
5312 T: std::iter::IntoIterator<Item = (K, V)>,
5313 K: std::convert::Into<std::string::String>,
5314 V: std::convert::Into<crate::model::AttributeValues>,
5315 {
5316 use std::iter::Iterator;
5317 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5318 self
5319 }
5320
5321 pub fn set_documentation<T>(mut self, v: T) -> Self
5323 where
5324 T: std::convert::Into<crate::model::Documentation>,
5325 {
5326 self.documentation = std::option::Option::Some(v.into());
5327 self
5328 }
5329
5330 pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
5332 where
5333 T: std::convert::Into<crate::model::Documentation>,
5334 {
5335 self.documentation = v.map(|x| x.into());
5336 self
5337 }
5338
5339 pub fn set_parsing_mode<T: std::convert::Into<crate::model::spec::ParsingMode>>(
5341 mut self,
5342 v: T,
5343 ) -> Self {
5344 self.parsing_mode = v.into();
5345 self
5346 }
5347
5348 pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
5350 where
5351 T: std::iter::IntoIterator<Item = V>,
5352 V: std::convert::Into<crate::model::SourceMetadata>,
5353 {
5354 use std::iter::Iterator;
5355 self.source_metadata = v.into_iter().map(|i| i.into()).collect();
5356 self
5357 }
5358}
5359
5360impl wkt::message::Message for Spec {
5361 fn typename() -> &'static str {
5362 "type.googleapis.com/google.cloud.apihub.v1.Spec"
5363 }
5364}
5365
5366pub mod spec {
5368 #[allow(unused_imports)]
5369 use super::*;
5370
5371 #[derive(Clone, Debug, PartialEq)]
5394 #[non_exhaustive]
5395 pub enum ParsingMode {
5396 Unspecified,
5398 Relaxed,
5401 Strict,
5404 UnknownValue(parsing_mode::UnknownValue),
5409 }
5410
5411 #[doc(hidden)]
5412 pub mod parsing_mode {
5413 #[allow(unused_imports)]
5414 use super::*;
5415 #[derive(Clone, Debug, PartialEq)]
5416 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5417 }
5418
5419 impl ParsingMode {
5420 pub fn value(&self) -> std::option::Option<i32> {
5425 match self {
5426 Self::Unspecified => std::option::Option::Some(0),
5427 Self::Relaxed => std::option::Option::Some(1),
5428 Self::Strict => std::option::Option::Some(2),
5429 Self::UnknownValue(u) => u.0.value(),
5430 }
5431 }
5432
5433 pub fn name(&self) -> std::option::Option<&str> {
5438 match self {
5439 Self::Unspecified => std::option::Option::Some("PARSING_MODE_UNSPECIFIED"),
5440 Self::Relaxed => std::option::Option::Some("RELAXED"),
5441 Self::Strict => std::option::Option::Some("STRICT"),
5442 Self::UnknownValue(u) => u.0.name(),
5443 }
5444 }
5445 }
5446
5447 impl std::default::Default for ParsingMode {
5448 fn default() -> Self {
5449 use std::convert::From;
5450 Self::from(0)
5451 }
5452 }
5453
5454 impl std::fmt::Display for ParsingMode {
5455 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5456 wkt::internal::display_enum(f, self.name(), self.value())
5457 }
5458 }
5459
5460 impl std::convert::From<i32> for ParsingMode {
5461 fn from(value: i32) -> Self {
5462 match value {
5463 0 => Self::Unspecified,
5464 1 => Self::Relaxed,
5465 2 => Self::Strict,
5466 _ => Self::UnknownValue(parsing_mode::UnknownValue(
5467 wkt::internal::UnknownEnumValue::Integer(value),
5468 )),
5469 }
5470 }
5471 }
5472
5473 impl std::convert::From<&str> for ParsingMode {
5474 fn from(value: &str) -> Self {
5475 use std::string::ToString;
5476 match value {
5477 "PARSING_MODE_UNSPECIFIED" => Self::Unspecified,
5478 "RELAXED" => Self::Relaxed,
5479 "STRICT" => Self::Strict,
5480 _ => Self::UnknownValue(parsing_mode::UnknownValue(
5481 wkt::internal::UnknownEnumValue::String(value.to_string()),
5482 )),
5483 }
5484 }
5485 }
5486
5487 impl serde::ser::Serialize for ParsingMode {
5488 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5489 where
5490 S: serde::Serializer,
5491 {
5492 match self {
5493 Self::Unspecified => serializer.serialize_i32(0),
5494 Self::Relaxed => serializer.serialize_i32(1),
5495 Self::Strict => serializer.serialize_i32(2),
5496 Self::UnknownValue(u) => u.0.serialize(serializer),
5497 }
5498 }
5499 }
5500
5501 impl<'de> serde::de::Deserialize<'de> for ParsingMode {
5502 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5503 where
5504 D: serde::Deserializer<'de>,
5505 {
5506 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ParsingMode>::new(
5507 ".google.cloud.apihub.v1.Spec.ParsingMode",
5508 ))
5509 }
5510 }
5511}
5512
5513#[derive(Clone, Default, PartialEq)]
5518#[non_exhaustive]
5519pub struct Deployment {
5520 pub name: std::string::String,
5525
5526 pub display_name: std::string::String,
5528
5529 pub description: std::string::String,
5531
5532 pub documentation: std::option::Option<crate::model::Documentation>,
5534
5535 pub deployment_type: std::option::Option<crate::model::AttributeValues>,
5544
5545 pub resource_uri: std::string::String,
5552
5553 pub endpoints: std::vec::Vec<std::string::String>,
5557
5558 pub api_versions: std::vec::Vec<std::string::String>,
5562
5563 pub create_time: std::option::Option<wkt::Timestamp>,
5565
5566 pub update_time: std::option::Option<wkt::Timestamp>,
5568
5569 pub slo: std::option::Option<crate::model::AttributeValues>,
5578
5579 pub environment: std::option::Option<crate::model::AttributeValues>,
5588
5589 pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
5594
5595 pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,
5598
5599 pub management_url: std::option::Option<crate::model::AttributeValues>,
5606
5607 pub source_uri: std::option::Option<crate::model::AttributeValues>,
5617
5618 pub source_project: std::string::String,
5622
5623 pub source_environment: std::string::String,
5626
5627 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5628}
5629
5630impl Deployment {
5631 pub fn new() -> Self {
5632 std::default::Default::default()
5633 }
5634
5635 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5637 self.name = v.into();
5638 self
5639 }
5640
5641 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5643 self.display_name = v.into();
5644 self
5645 }
5646
5647 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5649 self.description = v.into();
5650 self
5651 }
5652
5653 pub fn set_documentation<T>(mut self, v: T) -> Self
5655 where
5656 T: std::convert::Into<crate::model::Documentation>,
5657 {
5658 self.documentation = std::option::Option::Some(v.into());
5659 self
5660 }
5661
5662 pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
5664 where
5665 T: std::convert::Into<crate::model::Documentation>,
5666 {
5667 self.documentation = v.map(|x| x.into());
5668 self
5669 }
5670
5671 pub fn set_deployment_type<T>(mut self, v: T) -> Self
5673 where
5674 T: std::convert::Into<crate::model::AttributeValues>,
5675 {
5676 self.deployment_type = std::option::Option::Some(v.into());
5677 self
5678 }
5679
5680 pub fn set_or_clear_deployment_type<T>(mut self, v: std::option::Option<T>) -> Self
5682 where
5683 T: std::convert::Into<crate::model::AttributeValues>,
5684 {
5685 self.deployment_type = v.map(|x| x.into());
5686 self
5687 }
5688
5689 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5691 self.resource_uri = v.into();
5692 self
5693 }
5694
5695 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
5697 where
5698 T: std::iter::IntoIterator<Item = V>,
5699 V: std::convert::Into<std::string::String>,
5700 {
5701 use std::iter::Iterator;
5702 self.endpoints = v.into_iter().map(|i| i.into()).collect();
5703 self
5704 }
5705
5706 pub fn set_api_versions<T, V>(mut self, v: T) -> Self
5708 where
5709 T: std::iter::IntoIterator<Item = V>,
5710 V: std::convert::Into<std::string::String>,
5711 {
5712 use std::iter::Iterator;
5713 self.api_versions = v.into_iter().map(|i| i.into()).collect();
5714 self
5715 }
5716
5717 pub fn set_create_time<T>(mut self, v: T) -> Self
5719 where
5720 T: std::convert::Into<wkt::Timestamp>,
5721 {
5722 self.create_time = std::option::Option::Some(v.into());
5723 self
5724 }
5725
5726 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5728 where
5729 T: std::convert::Into<wkt::Timestamp>,
5730 {
5731 self.create_time = v.map(|x| x.into());
5732 self
5733 }
5734
5735 pub fn set_update_time<T>(mut self, v: T) -> Self
5737 where
5738 T: std::convert::Into<wkt::Timestamp>,
5739 {
5740 self.update_time = std::option::Option::Some(v.into());
5741 self
5742 }
5743
5744 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5746 where
5747 T: std::convert::Into<wkt::Timestamp>,
5748 {
5749 self.update_time = v.map(|x| x.into());
5750 self
5751 }
5752
5753 pub fn set_slo<T>(mut self, v: T) -> Self
5755 where
5756 T: std::convert::Into<crate::model::AttributeValues>,
5757 {
5758 self.slo = std::option::Option::Some(v.into());
5759 self
5760 }
5761
5762 pub fn set_or_clear_slo<T>(mut self, v: std::option::Option<T>) -> Self
5764 where
5765 T: std::convert::Into<crate::model::AttributeValues>,
5766 {
5767 self.slo = v.map(|x| x.into());
5768 self
5769 }
5770
5771 pub fn set_environment<T>(mut self, v: T) -> Self
5773 where
5774 T: std::convert::Into<crate::model::AttributeValues>,
5775 {
5776 self.environment = std::option::Option::Some(v.into());
5777 self
5778 }
5779
5780 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
5782 where
5783 T: std::convert::Into<crate::model::AttributeValues>,
5784 {
5785 self.environment = v.map(|x| x.into());
5786 self
5787 }
5788
5789 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
5791 where
5792 T: std::iter::IntoIterator<Item = (K, V)>,
5793 K: std::convert::Into<std::string::String>,
5794 V: std::convert::Into<crate::model::AttributeValues>,
5795 {
5796 use std::iter::Iterator;
5797 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5798 self
5799 }
5800
5801 pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
5803 where
5804 T: std::iter::IntoIterator<Item = V>,
5805 V: std::convert::Into<crate::model::SourceMetadata>,
5806 {
5807 use std::iter::Iterator;
5808 self.source_metadata = v.into_iter().map(|i| i.into()).collect();
5809 self
5810 }
5811
5812 pub fn set_management_url<T>(mut self, v: T) -> Self
5814 where
5815 T: std::convert::Into<crate::model::AttributeValues>,
5816 {
5817 self.management_url = std::option::Option::Some(v.into());
5818 self
5819 }
5820
5821 pub fn set_or_clear_management_url<T>(mut self, v: std::option::Option<T>) -> Self
5823 where
5824 T: std::convert::Into<crate::model::AttributeValues>,
5825 {
5826 self.management_url = v.map(|x| x.into());
5827 self
5828 }
5829
5830 pub fn set_source_uri<T>(mut self, v: T) -> Self
5832 where
5833 T: std::convert::Into<crate::model::AttributeValues>,
5834 {
5835 self.source_uri = std::option::Option::Some(v.into());
5836 self
5837 }
5838
5839 pub fn set_or_clear_source_uri<T>(mut self, v: std::option::Option<T>) -> Self
5841 where
5842 T: std::convert::Into<crate::model::AttributeValues>,
5843 {
5844 self.source_uri = v.map(|x| x.into());
5845 self
5846 }
5847
5848 pub fn set_source_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5850 self.source_project = v.into();
5851 self
5852 }
5853
5854 pub fn set_source_environment<T: std::convert::Into<std::string::String>>(
5856 mut self,
5857 v: T,
5858 ) -> Self {
5859 self.source_environment = v.into();
5860 self
5861 }
5862}
5863
5864impl wkt::message::Message for Deployment {
5865 fn typename() -> &'static str {
5866 "type.googleapis.com/google.cloud.apihub.v1.Deployment"
5867 }
5868}
5869
5870#[derive(Clone, Default, PartialEq)]
5880#[non_exhaustive]
5881pub struct ApiOperation {
5882 pub name: std::string::String,
5887
5888 pub spec: std::string::String,
5895
5896 pub details: std::option::Option<crate::model::OperationDetails>,
5903
5904 pub create_time: std::option::Option<wkt::Timestamp>,
5906
5907 pub update_time: std::option::Option<wkt::Timestamp>,
5909
5910 pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
5915
5916 pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,
5919
5920 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5921}
5922
5923impl ApiOperation {
5924 pub fn new() -> Self {
5925 std::default::Default::default()
5926 }
5927
5928 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5930 self.name = v.into();
5931 self
5932 }
5933
5934 pub fn set_spec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5936 self.spec = v.into();
5937 self
5938 }
5939
5940 pub fn set_details<T>(mut self, v: T) -> Self
5942 where
5943 T: std::convert::Into<crate::model::OperationDetails>,
5944 {
5945 self.details = std::option::Option::Some(v.into());
5946 self
5947 }
5948
5949 pub fn set_or_clear_details<T>(mut self, v: std::option::Option<T>) -> Self
5951 where
5952 T: std::convert::Into<crate::model::OperationDetails>,
5953 {
5954 self.details = v.map(|x| x.into());
5955 self
5956 }
5957
5958 pub fn set_create_time<T>(mut self, v: T) -> Self
5960 where
5961 T: std::convert::Into<wkt::Timestamp>,
5962 {
5963 self.create_time = std::option::Option::Some(v.into());
5964 self
5965 }
5966
5967 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5969 where
5970 T: std::convert::Into<wkt::Timestamp>,
5971 {
5972 self.create_time = v.map(|x| x.into());
5973 self
5974 }
5975
5976 pub fn set_update_time<T>(mut self, v: T) -> Self
5978 where
5979 T: std::convert::Into<wkt::Timestamp>,
5980 {
5981 self.update_time = std::option::Option::Some(v.into());
5982 self
5983 }
5984
5985 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5987 where
5988 T: std::convert::Into<wkt::Timestamp>,
5989 {
5990 self.update_time = v.map(|x| x.into());
5991 self
5992 }
5993
5994 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
5996 where
5997 T: std::iter::IntoIterator<Item = (K, V)>,
5998 K: std::convert::Into<std::string::String>,
5999 V: std::convert::Into<crate::model::AttributeValues>,
6000 {
6001 use std::iter::Iterator;
6002 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6003 self
6004 }
6005
6006 pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
6008 where
6009 T: std::iter::IntoIterator<Item = V>,
6010 V: std::convert::Into<crate::model::SourceMetadata>,
6011 {
6012 use std::iter::Iterator;
6013 self.source_metadata = v.into_iter().map(|i| i.into()).collect();
6014 self
6015 }
6016}
6017
6018impl wkt::message::Message for ApiOperation {
6019 fn typename() -> &'static str {
6020 "type.googleapis.com/google.cloud.apihub.v1.ApiOperation"
6021 }
6022}
6023
6024#[derive(Clone, Default, PartialEq)]
6032#[non_exhaustive]
6033pub struct Definition {
6034 pub name: std::string::String,
6039
6040 pub spec: std::string::String,
6044
6045 pub r#type: crate::model::definition::Type,
6047
6048 pub create_time: std::option::Option<wkt::Timestamp>,
6050
6051 pub update_time: std::option::Option<wkt::Timestamp>,
6053
6054 pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
6059
6060 pub value: std::option::Option<crate::model::definition::Value>,
6061
6062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6063}
6064
6065impl Definition {
6066 pub fn new() -> Self {
6067 std::default::Default::default()
6068 }
6069
6070 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6072 self.name = v.into();
6073 self
6074 }
6075
6076 pub fn set_spec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6078 self.spec = v.into();
6079 self
6080 }
6081
6082 pub fn set_type<T: std::convert::Into<crate::model::definition::Type>>(mut self, v: T) -> Self {
6084 self.r#type = v.into();
6085 self
6086 }
6087
6088 pub fn set_create_time<T>(mut self, v: T) -> Self
6090 where
6091 T: std::convert::Into<wkt::Timestamp>,
6092 {
6093 self.create_time = std::option::Option::Some(v.into());
6094 self
6095 }
6096
6097 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6099 where
6100 T: std::convert::Into<wkt::Timestamp>,
6101 {
6102 self.create_time = v.map(|x| x.into());
6103 self
6104 }
6105
6106 pub fn set_update_time<T>(mut self, v: T) -> Self
6108 where
6109 T: std::convert::Into<wkt::Timestamp>,
6110 {
6111 self.update_time = std::option::Option::Some(v.into());
6112 self
6113 }
6114
6115 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6117 where
6118 T: std::convert::Into<wkt::Timestamp>,
6119 {
6120 self.update_time = v.map(|x| x.into());
6121 self
6122 }
6123
6124 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
6126 where
6127 T: std::iter::IntoIterator<Item = (K, V)>,
6128 K: std::convert::Into<std::string::String>,
6129 V: std::convert::Into<crate::model::AttributeValues>,
6130 {
6131 use std::iter::Iterator;
6132 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6133 self
6134 }
6135
6136 pub fn set_value<
6141 T: std::convert::Into<std::option::Option<crate::model::definition::Value>>,
6142 >(
6143 mut self,
6144 v: T,
6145 ) -> Self {
6146 self.value = v.into();
6147 self
6148 }
6149
6150 pub fn schema(&self) -> std::option::Option<&std::boxed::Box<crate::model::Schema>> {
6154 #[allow(unreachable_patterns)]
6155 self.value.as_ref().and_then(|v| match v {
6156 crate::model::definition::Value::Schema(v) => std::option::Option::Some(v),
6157 _ => std::option::Option::None,
6158 })
6159 }
6160
6161 pub fn set_schema<T: std::convert::Into<std::boxed::Box<crate::model::Schema>>>(
6167 mut self,
6168 v: T,
6169 ) -> Self {
6170 self.value = std::option::Option::Some(crate::model::definition::Value::Schema(v.into()));
6171 self
6172 }
6173}
6174
6175impl wkt::message::Message for Definition {
6176 fn typename() -> &'static str {
6177 "type.googleapis.com/google.cloud.apihub.v1.Definition"
6178 }
6179}
6180
6181pub mod definition {
6183 #[allow(unused_imports)]
6184 use super::*;
6185
6186 #[derive(Clone, Debug, PartialEq)]
6202 #[non_exhaustive]
6203 pub enum Type {
6204 Unspecified,
6206 Schema,
6208 UnknownValue(r#type::UnknownValue),
6213 }
6214
6215 #[doc(hidden)]
6216 pub mod r#type {
6217 #[allow(unused_imports)]
6218 use super::*;
6219 #[derive(Clone, Debug, PartialEq)]
6220 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6221 }
6222
6223 impl Type {
6224 pub fn value(&self) -> std::option::Option<i32> {
6229 match self {
6230 Self::Unspecified => std::option::Option::Some(0),
6231 Self::Schema => std::option::Option::Some(1),
6232 Self::UnknownValue(u) => u.0.value(),
6233 }
6234 }
6235
6236 pub fn name(&self) -> std::option::Option<&str> {
6241 match self {
6242 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
6243 Self::Schema => std::option::Option::Some("SCHEMA"),
6244 Self::UnknownValue(u) => u.0.name(),
6245 }
6246 }
6247 }
6248
6249 impl std::default::Default for Type {
6250 fn default() -> Self {
6251 use std::convert::From;
6252 Self::from(0)
6253 }
6254 }
6255
6256 impl std::fmt::Display for Type {
6257 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6258 wkt::internal::display_enum(f, self.name(), self.value())
6259 }
6260 }
6261
6262 impl std::convert::From<i32> for Type {
6263 fn from(value: i32) -> Self {
6264 match value {
6265 0 => Self::Unspecified,
6266 1 => Self::Schema,
6267 _ => Self::UnknownValue(r#type::UnknownValue(
6268 wkt::internal::UnknownEnumValue::Integer(value),
6269 )),
6270 }
6271 }
6272 }
6273
6274 impl std::convert::From<&str> for Type {
6275 fn from(value: &str) -> Self {
6276 use std::string::ToString;
6277 match value {
6278 "TYPE_UNSPECIFIED" => Self::Unspecified,
6279 "SCHEMA" => Self::Schema,
6280 _ => Self::UnknownValue(r#type::UnknownValue(
6281 wkt::internal::UnknownEnumValue::String(value.to_string()),
6282 )),
6283 }
6284 }
6285 }
6286
6287 impl serde::ser::Serialize for Type {
6288 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6289 where
6290 S: serde::Serializer,
6291 {
6292 match self {
6293 Self::Unspecified => serializer.serialize_i32(0),
6294 Self::Schema => serializer.serialize_i32(1),
6295 Self::UnknownValue(u) => u.0.serialize(serializer),
6296 }
6297 }
6298 }
6299
6300 impl<'de> serde::de::Deserialize<'de> for Type {
6301 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6302 where
6303 D: serde::Deserializer<'de>,
6304 {
6305 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
6306 ".google.cloud.apihub.v1.Definition.Type",
6307 ))
6308 }
6309 }
6310
6311 #[derive(Clone, Debug, PartialEq)]
6312 #[non_exhaustive]
6313 pub enum Value {
6314 Schema(std::boxed::Box<crate::model::Schema>),
6316 }
6317}
6318
6319#[derive(Clone, Default, PartialEq)]
6324#[non_exhaustive]
6325pub struct Attribute {
6326 pub name: std::string::String,
6331
6332 pub display_name: std::string::String,
6334
6335 pub description: std::string::String,
6337
6338 pub definition_type: crate::model::attribute::DefinitionType,
6340
6341 pub scope: crate::model::attribute::Scope,
6344
6345 pub data_type: crate::model::attribute::DataType,
6347
6348 pub allowed_values: std::vec::Vec<crate::model::attribute::AllowedValue>,
6352
6353 pub cardinality: i32,
6359
6360 pub mandatory: bool,
6364
6365 pub create_time: std::option::Option<wkt::Timestamp>,
6367
6368 pub update_time: std::option::Option<wkt::Timestamp>,
6370
6371 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6372}
6373
6374impl Attribute {
6375 pub fn new() -> Self {
6376 std::default::Default::default()
6377 }
6378
6379 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6381 self.name = v.into();
6382 self
6383 }
6384
6385 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6387 self.display_name = v.into();
6388 self
6389 }
6390
6391 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6393 self.description = v.into();
6394 self
6395 }
6396
6397 pub fn set_definition_type<T: std::convert::Into<crate::model::attribute::DefinitionType>>(
6399 mut self,
6400 v: T,
6401 ) -> Self {
6402 self.definition_type = v.into();
6403 self
6404 }
6405
6406 pub fn set_scope<T: std::convert::Into<crate::model::attribute::Scope>>(
6408 mut self,
6409 v: T,
6410 ) -> Self {
6411 self.scope = v.into();
6412 self
6413 }
6414
6415 pub fn set_data_type<T: std::convert::Into<crate::model::attribute::DataType>>(
6417 mut self,
6418 v: T,
6419 ) -> Self {
6420 self.data_type = v.into();
6421 self
6422 }
6423
6424 pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
6426 where
6427 T: std::iter::IntoIterator<Item = V>,
6428 V: std::convert::Into<crate::model::attribute::AllowedValue>,
6429 {
6430 use std::iter::Iterator;
6431 self.allowed_values = v.into_iter().map(|i| i.into()).collect();
6432 self
6433 }
6434
6435 pub fn set_cardinality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6437 self.cardinality = v.into();
6438 self
6439 }
6440
6441 pub fn set_mandatory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6443 self.mandatory = v.into();
6444 self
6445 }
6446
6447 pub fn set_create_time<T>(mut self, v: T) -> Self
6449 where
6450 T: std::convert::Into<wkt::Timestamp>,
6451 {
6452 self.create_time = std::option::Option::Some(v.into());
6453 self
6454 }
6455
6456 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6458 where
6459 T: std::convert::Into<wkt::Timestamp>,
6460 {
6461 self.create_time = v.map(|x| x.into());
6462 self
6463 }
6464
6465 pub fn set_update_time<T>(mut self, v: T) -> Self
6467 where
6468 T: std::convert::Into<wkt::Timestamp>,
6469 {
6470 self.update_time = std::option::Option::Some(v.into());
6471 self
6472 }
6473
6474 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6476 where
6477 T: std::convert::Into<wkt::Timestamp>,
6478 {
6479 self.update_time = v.map(|x| x.into());
6480 self
6481 }
6482}
6483
6484impl wkt::message::Message for Attribute {
6485 fn typename() -> &'static str {
6486 "type.googleapis.com/google.cloud.apihub.v1.Attribute"
6487 }
6488}
6489
6490pub mod attribute {
6492 #[allow(unused_imports)]
6493 use super::*;
6494
6495 #[derive(Clone, Default, PartialEq)]
6498 #[non_exhaustive]
6499 pub struct AllowedValue {
6500 pub id: std::string::String,
6512
6513 pub display_name: std::string::String,
6515
6516 pub description: std::string::String,
6518
6519 pub immutable: bool,
6522
6523 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6524 }
6525
6526 impl AllowedValue {
6527 pub fn new() -> Self {
6528 std::default::Default::default()
6529 }
6530
6531 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6533 self.id = v.into();
6534 self
6535 }
6536
6537 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
6539 mut self,
6540 v: T,
6541 ) -> Self {
6542 self.display_name = v.into();
6543 self
6544 }
6545
6546 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6548 self.description = v.into();
6549 self
6550 }
6551
6552 pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6554 self.immutable = v.into();
6555 self
6556 }
6557 }
6558
6559 impl wkt::message::Message for AllowedValue {
6560 fn typename() -> &'static str {
6561 "type.googleapis.com/google.cloud.apihub.v1.Attribute.AllowedValue"
6562 }
6563 }
6564
6565 #[derive(Clone, Debug, PartialEq)]
6581 #[non_exhaustive]
6582 pub enum DefinitionType {
6583 Unspecified,
6585 SystemDefined,
6588 UserDefined,
6590 UnknownValue(definition_type::UnknownValue),
6595 }
6596
6597 #[doc(hidden)]
6598 pub mod definition_type {
6599 #[allow(unused_imports)]
6600 use super::*;
6601 #[derive(Clone, Debug, PartialEq)]
6602 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6603 }
6604
6605 impl DefinitionType {
6606 pub fn value(&self) -> std::option::Option<i32> {
6611 match self {
6612 Self::Unspecified => std::option::Option::Some(0),
6613 Self::SystemDefined => std::option::Option::Some(1),
6614 Self::UserDefined => std::option::Option::Some(2),
6615 Self::UnknownValue(u) => u.0.value(),
6616 }
6617 }
6618
6619 pub fn name(&self) -> std::option::Option<&str> {
6624 match self {
6625 Self::Unspecified => std::option::Option::Some("DEFINITION_TYPE_UNSPECIFIED"),
6626 Self::SystemDefined => std::option::Option::Some("SYSTEM_DEFINED"),
6627 Self::UserDefined => std::option::Option::Some("USER_DEFINED"),
6628 Self::UnknownValue(u) => u.0.name(),
6629 }
6630 }
6631 }
6632
6633 impl std::default::Default for DefinitionType {
6634 fn default() -> Self {
6635 use std::convert::From;
6636 Self::from(0)
6637 }
6638 }
6639
6640 impl std::fmt::Display for DefinitionType {
6641 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6642 wkt::internal::display_enum(f, self.name(), self.value())
6643 }
6644 }
6645
6646 impl std::convert::From<i32> for DefinitionType {
6647 fn from(value: i32) -> Self {
6648 match value {
6649 0 => Self::Unspecified,
6650 1 => Self::SystemDefined,
6651 2 => Self::UserDefined,
6652 _ => Self::UnknownValue(definition_type::UnknownValue(
6653 wkt::internal::UnknownEnumValue::Integer(value),
6654 )),
6655 }
6656 }
6657 }
6658
6659 impl std::convert::From<&str> for DefinitionType {
6660 fn from(value: &str) -> Self {
6661 use std::string::ToString;
6662 match value {
6663 "DEFINITION_TYPE_UNSPECIFIED" => Self::Unspecified,
6664 "SYSTEM_DEFINED" => Self::SystemDefined,
6665 "USER_DEFINED" => Self::UserDefined,
6666 _ => Self::UnknownValue(definition_type::UnknownValue(
6667 wkt::internal::UnknownEnumValue::String(value.to_string()),
6668 )),
6669 }
6670 }
6671 }
6672
6673 impl serde::ser::Serialize for DefinitionType {
6674 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6675 where
6676 S: serde::Serializer,
6677 {
6678 match self {
6679 Self::Unspecified => serializer.serialize_i32(0),
6680 Self::SystemDefined => serializer.serialize_i32(1),
6681 Self::UserDefined => serializer.serialize_i32(2),
6682 Self::UnknownValue(u) => u.0.serialize(serializer),
6683 }
6684 }
6685 }
6686
6687 impl<'de> serde::de::Deserialize<'de> for DefinitionType {
6688 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6689 where
6690 D: serde::Deserializer<'de>,
6691 {
6692 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DefinitionType>::new(
6693 ".google.cloud.apihub.v1.Attribute.DefinitionType",
6694 ))
6695 }
6696 }
6697
6698 #[derive(Clone, Debug, PartialEq)]
6715 #[non_exhaustive]
6716 pub enum Scope {
6717 Unspecified,
6719 Api,
6721 Version,
6723 Spec,
6725 ApiOperation,
6727 Deployment,
6729 Dependency,
6731 Definition,
6733 ExternalApi,
6735 Plugin,
6737 UnknownValue(scope::UnknownValue),
6742 }
6743
6744 #[doc(hidden)]
6745 pub mod scope {
6746 #[allow(unused_imports)]
6747 use super::*;
6748 #[derive(Clone, Debug, PartialEq)]
6749 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6750 }
6751
6752 impl Scope {
6753 pub fn value(&self) -> std::option::Option<i32> {
6758 match self {
6759 Self::Unspecified => std::option::Option::Some(0),
6760 Self::Api => std::option::Option::Some(1),
6761 Self::Version => std::option::Option::Some(2),
6762 Self::Spec => std::option::Option::Some(3),
6763 Self::ApiOperation => std::option::Option::Some(4),
6764 Self::Deployment => std::option::Option::Some(5),
6765 Self::Dependency => std::option::Option::Some(6),
6766 Self::Definition => std::option::Option::Some(7),
6767 Self::ExternalApi => std::option::Option::Some(8),
6768 Self::Plugin => std::option::Option::Some(9),
6769 Self::UnknownValue(u) => u.0.value(),
6770 }
6771 }
6772
6773 pub fn name(&self) -> std::option::Option<&str> {
6778 match self {
6779 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
6780 Self::Api => std::option::Option::Some("API"),
6781 Self::Version => std::option::Option::Some("VERSION"),
6782 Self::Spec => std::option::Option::Some("SPEC"),
6783 Self::ApiOperation => std::option::Option::Some("API_OPERATION"),
6784 Self::Deployment => std::option::Option::Some("DEPLOYMENT"),
6785 Self::Dependency => std::option::Option::Some("DEPENDENCY"),
6786 Self::Definition => std::option::Option::Some("DEFINITION"),
6787 Self::ExternalApi => std::option::Option::Some("EXTERNAL_API"),
6788 Self::Plugin => std::option::Option::Some("PLUGIN"),
6789 Self::UnknownValue(u) => u.0.name(),
6790 }
6791 }
6792 }
6793
6794 impl std::default::Default for Scope {
6795 fn default() -> Self {
6796 use std::convert::From;
6797 Self::from(0)
6798 }
6799 }
6800
6801 impl std::fmt::Display for Scope {
6802 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6803 wkt::internal::display_enum(f, self.name(), self.value())
6804 }
6805 }
6806
6807 impl std::convert::From<i32> for Scope {
6808 fn from(value: i32) -> Self {
6809 match value {
6810 0 => Self::Unspecified,
6811 1 => Self::Api,
6812 2 => Self::Version,
6813 3 => Self::Spec,
6814 4 => Self::ApiOperation,
6815 5 => Self::Deployment,
6816 6 => Self::Dependency,
6817 7 => Self::Definition,
6818 8 => Self::ExternalApi,
6819 9 => Self::Plugin,
6820 _ => Self::UnknownValue(scope::UnknownValue(
6821 wkt::internal::UnknownEnumValue::Integer(value),
6822 )),
6823 }
6824 }
6825 }
6826
6827 impl std::convert::From<&str> for Scope {
6828 fn from(value: &str) -> Self {
6829 use std::string::ToString;
6830 match value {
6831 "SCOPE_UNSPECIFIED" => Self::Unspecified,
6832 "API" => Self::Api,
6833 "VERSION" => Self::Version,
6834 "SPEC" => Self::Spec,
6835 "API_OPERATION" => Self::ApiOperation,
6836 "DEPLOYMENT" => Self::Deployment,
6837 "DEPENDENCY" => Self::Dependency,
6838 "DEFINITION" => Self::Definition,
6839 "EXTERNAL_API" => Self::ExternalApi,
6840 "PLUGIN" => Self::Plugin,
6841 _ => Self::UnknownValue(scope::UnknownValue(
6842 wkt::internal::UnknownEnumValue::String(value.to_string()),
6843 )),
6844 }
6845 }
6846 }
6847
6848 impl serde::ser::Serialize for Scope {
6849 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6850 where
6851 S: serde::Serializer,
6852 {
6853 match self {
6854 Self::Unspecified => serializer.serialize_i32(0),
6855 Self::Api => serializer.serialize_i32(1),
6856 Self::Version => serializer.serialize_i32(2),
6857 Self::Spec => serializer.serialize_i32(3),
6858 Self::ApiOperation => serializer.serialize_i32(4),
6859 Self::Deployment => serializer.serialize_i32(5),
6860 Self::Dependency => serializer.serialize_i32(6),
6861 Self::Definition => serializer.serialize_i32(7),
6862 Self::ExternalApi => serializer.serialize_i32(8),
6863 Self::Plugin => serializer.serialize_i32(9),
6864 Self::UnknownValue(u) => u.0.serialize(serializer),
6865 }
6866 }
6867 }
6868
6869 impl<'de> serde::de::Deserialize<'de> for Scope {
6870 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6871 where
6872 D: serde::Deserializer<'de>,
6873 {
6874 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
6875 ".google.cloud.apihub.v1.Attribute.Scope",
6876 ))
6877 }
6878 }
6879
6880 #[derive(Clone, Debug, PartialEq)]
6896 #[non_exhaustive]
6897 pub enum DataType {
6898 Unspecified,
6900 Enum,
6902 Json,
6904 String,
6906 Uri,
6908 UnknownValue(data_type::UnknownValue),
6913 }
6914
6915 #[doc(hidden)]
6916 pub mod data_type {
6917 #[allow(unused_imports)]
6918 use super::*;
6919 #[derive(Clone, Debug, PartialEq)]
6920 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6921 }
6922
6923 impl DataType {
6924 pub fn value(&self) -> std::option::Option<i32> {
6929 match self {
6930 Self::Unspecified => std::option::Option::Some(0),
6931 Self::Enum => std::option::Option::Some(1),
6932 Self::Json => std::option::Option::Some(2),
6933 Self::String => std::option::Option::Some(3),
6934 Self::Uri => std::option::Option::Some(4),
6935 Self::UnknownValue(u) => u.0.value(),
6936 }
6937 }
6938
6939 pub fn name(&self) -> std::option::Option<&str> {
6944 match self {
6945 Self::Unspecified => std::option::Option::Some("DATA_TYPE_UNSPECIFIED"),
6946 Self::Enum => std::option::Option::Some("ENUM"),
6947 Self::Json => std::option::Option::Some("JSON"),
6948 Self::String => std::option::Option::Some("STRING"),
6949 Self::Uri => std::option::Option::Some("URI"),
6950 Self::UnknownValue(u) => u.0.name(),
6951 }
6952 }
6953 }
6954
6955 impl std::default::Default for DataType {
6956 fn default() -> Self {
6957 use std::convert::From;
6958 Self::from(0)
6959 }
6960 }
6961
6962 impl std::fmt::Display for DataType {
6963 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6964 wkt::internal::display_enum(f, self.name(), self.value())
6965 }
6966 }
6967
6968 impl std::convert::From<i32> for DataType {
6969 fn from(value: i32) -> Self {
6970 match value {
6971 0 => Self::Unspecified,
6972 1 => Self::Enum,
6973 2 => Self::Json,
6974 3 => Self::String,
6975 4 => Self::Uri,
6976 _ => Self::UnknownValue(data_type::UnknownValue(
6977 wkt::internal::UnknownEnumValue::Integer(value),
6978 )),
6979 }
6980 }
6981 }
6982
6983 impl std::convert::From<&str> for DataType {
6984 fn from(value: &str) -> Self {
6985 use std::string::ToString;
6986 match value {
6987 "DATA_TYPE_UNSPECIFIED" => Self::Unspecified,
6988 "ENUM" => Self::Enum,
6989 "JSON" => Self::Json,
6990 "STRING" => Self::String,
6991 "URI" => Self::Uri,
6992 _ => Self::UnknownValue(data_type::UnknownValue(
6993 wkt::internal::UnknownEnumValue::String(value.to_string()),
6994 )),
6995 }
6996 }
6997 }
6998
6999 impl serde::ser::Serialize for DataType {
7000 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7001 where
7002 S: serde::Serializer,
7003 {
7004 match self {
7005 Self::Unspecified => serializer.serialize_i32(0),
7006 Self::Enum => serializer.serialize_i32(1),
7007 Self::Json => serializer.serialize_i32(2),
7008 Self::String => serializer.serialize_i32(3),
7009 Self::Uri => serializer.serialize_i32(4),
7010 Self::UnknownValue(u) => u.0.serialize(serializer),
7011 }
7012 }
7013 }
7014
7015 impl<'de> serde::de::Deserialize<'de> for DataType {
7016 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7017 where
7018 D: serde::Deserializer<'de>,
7019 {
7020 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataType>::new(
7021 ".google.cloud.apihub.v1.Attribute.DataType",
7022 ))
7023 }
7024 }
7025}
7026
7027#[derive(Clone, Default, PartialEq)]
7029#[non_exhaustive]
7030pub struct SpecContents {
7031 pub contents: ::bytes::Bytes,
7033
7034 pub mime_type: std::string::String,
7037
7038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7039}
7040
7041impl SpecContents {
7042 pub fn new() -> Self {
7043 std::default::Default::default()
7044 }
7045
7046 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7048 self.contents = v.into();
7049 self
7050 }
7051
7052 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7054 self.mime_type = v.into();
7055 self
7056 }
7057}
7058
7059impl wkt::message::Message for SpecContents {
7060 fn typename() -> &'static str {
7061 "type.googleapis.com/google.cloud.apihub.v1.SpecContents"
7062 }
7063}
7064
7065#[derive(Clone, Default, PartialEq)]
7068#[non_exhaustive]
7069pub struct SpecDetails {
7070 pub description: std::string::String,
7072
7073 pub details: std::option::Option<crate::model::spec_details::Details>,
7074
7075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7076}
7077
7078impl SpecDetails {
7079 pub fn new() -> Self {
7080 std::default::Default::default()
7081 }
7082
7083 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7085 self.description = v.into();
7086 self
7087 }
7088
7089 pub fn set_details<
7094 T: std::convert::Into<std::option::Option<crate::model::spec_details::Details>>,
7095 >(
7096 mut self,
7097 v: T,
7098 ) -> Self {
7099 self.details = v.into();
7100 self
7101 }
7102
7103 pub fn open_api_spec_details(
7107 &self,
7108 ) -> std::option::Option<&std::boxed::Box<crate::model::OpenApiSpecDetails>> {
7109 #[allow(unreachable_patterns)]
7110 self.details.as_ref().and_then(|v| match v {
7111 crate::model::spec_details::Details::OpenApiSpecDetails(v) => {
7112 std::option::Option::Some(v)
7113 }
7114 _ => std::option::Option::None,
7115 })
7116 }
7117
7118 pub fn set_open_api_spec_details<
7124 T: std::convert::Into<std::boxed::Box<crate::model::OpenApiSpecDetails>>,
7125 >(
7126 mut self,
7127 v: T,
7128 ) -> Self {
7129 self.details = std::option::Option::Some(
7130 crate::model::spec_details::Details::OpenApiSpecDetails(v.into()),
7131 );
7132 self
7133 }
7134}
7135
7136impl wkt::message::Message for SpecDetails {
7137 fn typename() -> &'static str {
7138 "type.googleapis.com/google.cloud.apihub.v1.SpecDetails"
7139 }
7140}
7141
7142pub mod spec_details {
7144 #[allow(unused_imports)]
7145 use super::*;
7146
7147 #[derive(Clone, Debug, PartialEq)]
7148 #[non_exhaustive]
7149 pub enum Details {
7150 OpenApiSpecDetails(std::boxed::Box<crate::model::OpenApiSpecDetails>),
7158 }
7159}
7160
7161#[derive(Clone, Default, PartialEq)]
7167#[non_exhaustive]
7168pub struct OpenApiSpecDetails {
7169 pub format: crate::model::open_api_spec_details::Format,
7171
7172 pub version: std::string::String,
7175
7176 pub owner: std::option::Option<crate::model::Owner>,
7179
7180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7181}
7182
7183impl OpenApiSpecDetails {
7184 pub fn new() -> Self {
7185 std::default::Default::default()
7186 }
7187
7188 pub fn set_format<T: std::convert::Into<crate::model::open_api_spec_details::Format>>(
7190 mut self,
7191 v: T,
7192 ) -> Self {
7193 self.format = v.into();
7194 self
7195 }
7196
7197 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7199 self.version = v.into();
7200 self
7201 }
7202
7203 pub fn set_owner<T>(mut self, v: T) -> Self
7205 where
7206 T: std::convert::Into<crate::model::Owner>,
7207 {
7208 self.owner = std::option::Option::Some(v.into());
7209 self
7210 }
7211
7212 pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
7214 where
7215 T: std::convert::Into<crate::model::Owner>,
7216 {
7217 self.owner = v.map(|x| x.into());
7218 self
7219 }
7220}
7221
7222impl wkt::message::Message for OpenApiSpecDetails {
7223 fn typename() -> &'static str {
7224 "type.googleapis.com/google.cloud.apihub.v1.OpenApiSpecDetails"
7225 }
7226}
7227
7228pub mod open_api_spec_details {
7230 #[allow(unused_imports)]
7231 use super::*;
7232
7233 #[derive(Clone, Debug, PartialEq)]
7249 #[non_exhaustive]
7250 pub enum Format {
7251 Unspecified,
7253 OpenApiSpec20,
7255 OpenApiSpec30,
7257 OpenApiSpec31,
7259 UnknownValue(format::UnknownValue),
7264 }
7265
7266 #[doc(hidden)]
7267 pub mod format {
7268 #[allow(unused_imports)]
7269 use super::*;
7270 #[derive(Clone, Debug, PartialEq)]
7271 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7272 }
7273
7274 impl Format {
7275 pub fn value(&self) -> std::option::Option<i32> {
7280 match self {
7281 Self::Unspecified => std::option::Option::Some(0),
7282 Self::OpenApiSpec20 => std::option::Option::Some(1),
7283 Self::OpenApiSpec30 => std::option::Option::Some(2),
7284 Self::OpenApiSpec31 => std::option::Option::Some(3),
7285 Self::UnknownValue(u) => u.0.value(),
7286 }
7287 }
7288
7289 pub fn name(&self) -> std::option::Option<&str> {
7294 match self {
7295 Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
7296 Self::OpenApiSpec20 => std::option::Option::Some("OPEN_API_SPEC_2_0"),
7297 Self::OpenApiSpec30 => std::option::Option::Some("OPEN_API_SPEC_3_0"),
7298 Self::OpenApiSpec31 => std::option::Option::Some("OPEN_API_SPEC_3_1"),
7299 Self::UnknownValue(u) => u.0.name(),
7300 }
7301 }
7302 }
7303
7304 impl std::default::Default for Format {
7305 fn default() -> Self {
7306 use std::convert::From;
7307 Self::from(0)
7308 }
7309 }
7310
7311 impl std::fmt::Display for Format {
7312 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7313 wkt::internal::display_enum(f, self.name(), self.value())
7314 }
7315 }
7316
7317 impl std::convert::From<i32> for Format {
7318 fn from(value: i32) -> Self {
7319 match value {
7320 0 => Self::Unspecified,
7321 1 => Self::OpenApiSpec20,
7322 2 => Self::OpenApiSpec30,
7323 3 => Self::OpenApiSpec31,
7324 _ => Self::UnknownValue(format::UnknownValue(
7325 wkt::internal::UnknownEnumValue::Integer(value),
7326 )),
7327 }
7328 }
7329 }
7330
7331 impl std::convert::From<&str> for Format {
7332 fn from(value: &str) -> Self {
7333 use std::string::ToString;
7334 match value {
7335 "FORMAT_UNSPECIFIED" => Self::Unspecified,
7336 "OPEN_API_SPEC_2_0" => Self::OpenApiSpec20,
7337 "OPEN_API_SPEC_3_0" => Self::OpenApiSpec30,
7338 "OPEN_API_SPEC_3_1" => Self::OpenApiSpec31,
7339 _ => Self::UnknownValue(format::UnknownValue(
7340 wkt::internal::UnknownEnumValue::String(value.to_string()),
7341 )),
7342 }
7343 }
7344 }
7345
7346 impl serde::ser::Serialize for Format {
7347 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7348 where
7349 S: serde::Serializer,
7350 {
7351 match self {
7352 Self::Unspecified => serializer.serialize_i32(0),
7353 Self::OpenApiSpec20 => serializer.serialize_i32(1),
7354 Self::OpenApiSpec30 => serializer.serialize_i32(2),
7355 Self::OpenApiSpec31 => serializer.serialize_i32(3),
7356 Self::UnknownValue(u) => u.0.serialize(serializer),
7357 }
7358 }
7359 }
7360
7361 impl<'de> serde::de::Deserialize<'de> for Format {
7362 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7363 where
7364 D: serde::Deserializer<'de>,
7365 {
7366 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
7367 ".google.cloud.apihub.v1.OpenApiSpecDetails.Format",
7368 ))
7369 }
7370 }
7371}
7372
7373#[derive(Clone, Default, PartialEq)]
7375#[non_exhaustive]
7376pub struct OperationDetails {
7377 pub description: std::string::String,
7381
7382 pub documentation: std::option::Option<crate::model::Documentation>,
7385
7386 pub deprecated: bool,
7389
7390 pub operation: std::option::Option<crate::model::operation_details::Operation>,
7391
7392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7393}
7394
7395impl OperationDetails {
7396 pub fn new() -> Self {
7397 std::default::Default::default()
7398 }
7399
7400 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7402 self.description = v.into();
7403 self
7404 }
7405
7406 pub fn set_documentation<T>(mut self, v: T) -> Self
7408 where
7409 T: std::convert::Into<crate::model::Documentation>,
7410 {
7411 self.documentation = std::option::Option::Some(v.into());
7412 self
7413 }
7414
7415 pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
7417 where
7418 T: std::convert::Into<crate::model::Documentation>,
7419 {
7420 self.documentation = v.map(|x| x.into());
7421 self
7422 }
7423
7424 pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7426 self.deprecated = v.into();
7427 self
7428 }
7429
7430 pub fn set_operation<
7435 T: std::convert::Into<std::option::Option<crate::model::operation_details::Operation>>,
7436 >(
7437 mut self,
7438 v: T,
7439 ) -> Self {
7440 self.operation = v.into();
7441 self
7442 }
7443
7444 pub fn http_operation(
7448 &self,
7449 ) -> std::option::Option<&std::boxed::Box<crate::model::HttpOperation>> {
7450 #[allow(unreachable_patterns)]
7451 self.operation.as_ref().and_then(|v| match v {
7452 crate::model::operation_details::Operation::HttpOperation(v) => {
7453 std::option::Option::Some(v)
7454 }
7455 _ => std::option::Option::None,
7456 })
7457 }
7458
7459 pub fn set_http_operation<
7465 T: std::convert::Into<std::boxed::Box<crate::model::HttpOperation>>,
7466 >(
7467 mut self,
7468 v: T,
7469 ) -> Self {
7470 self.operation = std::option::Option::Some(
7471 crate::model::operation_details::Operation::HttpOperation(v.into()),
7472 );
7473 self
7474 }
7475}
7476
7477impl wkt::message::Message for OperationDetails {
7478 fn typename() -> &'static str {
7479 "type.googleapis.com/google.cloud.apihub.v1.OperationDetails"
7480 }
7481}
7482
7483pub mod operation_details {
7485 #[allow(unused_imports)]
7486 use super::*;
7487
7488 #[derive(Clone, Debug, PartialEq)]
7489 #[non_exhaustive]
7490 pub enum Operation {
7491 HttpOperation(std::boxed::Box<crate::model::HttpOperation>),
7493 }
7494}
7495
7496#[derive(Clone, Default, PartialEq)]
7498#[non_exhaustive]
7499pub struct HttpOperation {
7500 pub path: std::option::Option<crate::model::Path>,
7507
7508 pub method: crate::model::http_operation::Method,
7515
7516 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7517}
7518
7519impl HttpOperation {
7520 pub fn new() -> Self {
7521 std::default::Default::default()
7522 }
7523
7524 pub fn set_path<T>(mut self, v: T) -> Self
7526 where
7527 T: std::convert::Into<crate::model::Path>,
7528 {
7529 self.path = std::option::Option::Some(v.into());
7530 self
7531 }
7532
7533 pub fn set_or_clear_path<T>(mut self, v: std::option::Option<T>) -> Self
7535 where
7536 T: std::convert::Into<crate::model::Path>,
7537 {
7538 self.path = v.map(|x| x.into());
7539 self
7540 }
7541
7542 pub fn set_method<T: std::convert::Into<crate::model::http_operation::Method>>(
7544 mut self,
7545 v: T,
7546 ) -> Self {
7547 self.method = v.into();
7548 self
7549 }
7550}
7551
7552impl wkt::message::Message for HttpOperation {
7553 fn typename() -> &'static str {
7554 "type.googleapis.com/google.cloud.apihub.v1.HttpOperation"
7555 }
7556}
7557
7558pub mod http_operation {
7560 #[allow(unused_imports)]
7561 use super::*;
7562
7563 #[derive(Clone, Debug, PartialEq)]
7579 #[non_exhaustive]
7580 pub enum Method {
7581 Unspecified,
7583 Get,
7585 Put,
7587 Post,
7589 Delete,
7591 Options,
7593 Head,
7595 Patch,
7597 Trace,
7599 UnknownValue(method::UnknownValue),
7604 }
7605
7606 #[doc(hidden)]
7607 pub mod method {
7608 #[allow(unused_imports)]
7609 use super::*;
7610 #[derive(Clone, Debug, PartialEq)]
7611 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7612 }
7613
7614 impl Method {
7615 pub fn value(&self) -> std::option::Option<i32> {
7620 match self {
7621 Self::Unspecified => std::option::Option::Some(0),
7622 Self::Get => std::option::Option::Some(1),
7623 Self::Put => std::option::Option::Some(2),
7624 Self::Post => std::option::Option::Some(3),
7625 Self::Delete => std::option::Option::Some(4),
7626 Self::Options => std::option::Option::Some(5),
7627 Self::Head => std::option::Option::Some(6),
7628 Self::Patch => std::option::Option::Some(7),
7629 Self::Trace => std::option::Option::Some(8),
7630 Self::UnknownValue(u) => u.0.value(),
7631 }
7632 }
7633
7634 pub fn name(&self) -> std::option::Option<&str> {
7639 match self {
7640 Self::Unspecified => std::option::Option::Some("METHOD_UNSPECIFIED"),
7641 Self::Get => std::option::Option::Some("GET"),
7642 Self::Put => std::option::Option::Some("PUT"),
7643 Self::Post => std::option::Option::Some("POST"),
7644 Self::Delete => std::option::Option::Some("DELETE"),
7645 Self::Options => std::option::Option::Some("OPTIONS"),
7646 Self::Head => std::option::Option::Some("HEAD"),
7647 Self::Patch => std::option::Option::Some("PATCH"),
7648 Self::Trace => std::option::Option::Some("TRACE"),
7649 Self::UnknownValue(u) => u.0.name(),
7650 }
7651 }
7652 }
7653
7654 impl std::default::Default for Method {
7655 fn default() -> Self {
7656 use std::convert::From;
7657 Self::from(0)
7658 }
7659 }
7660
7661 impl std::fmt::Display for Method {
7662 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7663 wkt::internal::display_enum(f, self.name(), self.value())
7664 }
7665 }
7666
7667 impl std::convert::From<i32> for Method {
7668 fn from(value: i32) -> Self {
7669 match value {
7670 0 => Self::Unspecified,
7671 1 => Self::Get,
7672 2 => Self::Put,
7673 3 => Self::Post,
7674 4 => Self::Delete,
7675 5 => Self::Options,
7676 6 => Self::Head,
7677 7 => Self::Patch,
7678 8 => Self::Trace,
7679 _ => Self::UnknownValue(method::UnknownValue(
7680 wkt::internal::UnknownEnumValue::Integer(value),
7681 )),
7682 }
7683 }
7684 }
7685
7686 impl std::convert::From<&str> for Method {
7687 fn from(value: &str) -> Self {
7688 use std::string::ToString;
7689 match value {
7690 "METHOD_UNSPECIFIED" => Self::Unspecified,
7691 "GET" => Self::Get,
7692 "PUT" => Self::Put,
7693 "POST" => Self::Post,
7694 "DELETE" => Self::Delete,
7695 "OPTIONS" => Self::Options,
7696 "HEAD" => Self::Head,
7697 "PATCH" => Self::Patch,
7698 "TRACE" => Self::Trace,
7699 _ => Self::UnknownValue(method::UnknownValue(
7700 wkt::internal::UnknownEnumValue::String(value.to_string()),
7701 )),
7702 }
7703 }
7704 }
7705
7706 impl serde::ser::Serialize for Method {
7707 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7708 where
7709 S: serde::Serializer,
7710 {
7711 match self {
7712 Self::Unspecified => serializer.serialize_i32(0),
7713 Self::Get => serializer.serialize_i32(1),
7714 Self::Put => serializer.serialize_i32(2),
7715 Self::Post => serializer.serialize_i32(3),
7716 Self::Delete => serializer.serialize_i32(4),
7717 Self::Options => serializer.serialize_i32(5),
7718 Self::Head => serializer.serialize_i32(6),
7719 Self::Patch => serializer.serialize_i32(7),
7720 Self::Trace => serializer.serialize_i32(8),
7721 Self::UnknownValue(u) => u.0.serialize(serializer),
7722 }
7723 }
7724 }
7725
7726 impl<'de> serde::de::Deserialize<'de> for Method {
7727 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7728 where
7729 D: serde::Deserializer<'de>,
7730 {
7731 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Method>::new(
7732 ".google.cloud.apihub.v1.HttpOperation.Method",
7733 ))
7734 }
7735 }
7736}
7737
7738#[derive(Clone, Default, PartialEq)]
7740#[non_exhaustive]
7741pub struct Path {
7742 pub path: std::string::String,
7749
7750 pub description: std::string::String,
7752
7753 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7754}
7755
7756impl Path {
7757 pub fn new() -> Self {
7758 std::default::Default::default()
7759 }
7760
7761 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7763 self.path = v.into();
7764 self
7765 }
7766
7767 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7769 self.description = v.into();
7770 self
7771 }
7772}
7773
7774impl wkt::message::Message for Path {
7775 fn typename() -> &'static str {
7776 "type.googleapis.com/google.cloud.apihub.v1.Path"
7777 }
7778}
7779
7780#[derive(Clone, Default, PartialEq)]
7786#[non_exhaustive]
7787pub struct Schema {
7788 pub display_name: std::string::String,
7791
7792 pub raw_value: ::bytes::Bytes,
7795
7796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7797}
7798
7799impl Schema {
7800 pub fn new() -> Self {
7801 std::default::Default::default()
7802 }
7803
7804 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7806 self.display_name = v.into();
7807 self
7808 }
7809
7810 pub fn set_raw_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
7812 self.raw_value = v.into();
7813 self
7814 }
7815}
7816
7817impl wkt::message::Message for Schema {
7818 fn typename() -> &'static str {
7819 "type.googleapis.com/google.cloud.apihub.v1.Schema"
7820 }
7821}
7822
7823#[derive(Clone, Default, PartialEq)]
7825#[non_exhaustive]
7826pub struct Owner {
7827 pub display_name: std::string::String,
7829
7830 pub email: std::string::String,
7832
7833 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7834}
7835
7836impl Owner {
7837 pub fn new() -> Self {
7838 std::default::Default::default()
7839 }
7840
7841 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7843 self.display_name = v.into();
7844 self
7845 }
7846
7847 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7849 self.email = v.into();
7850 self
7851 }
7852}
7853
7854impl wkt::message::Message for Owner {
7855 fn typename() -> &'static str {
7856 "type.googleapis.com/google.cloud.apihub.v1.Owner"
7857 }
7858}
7859
7860#[derive(Clone, Default, PartialEq)]
7862#[non_exhaustive]
7863pub struct Documentation {
7864 pub external_uri: std::string::String,
7866
7867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7868}
7869
7870impl Documentation {
7871 pub fn new() -> Self {
7872 std::default::Default::default()
7873 }
7874
7875 pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7877 self.external_uri = v.into();
7878 self
7879 }
7880}
7881
7882impl wkt::message::Message for Documentation {
7883 fn typename() -> &'static str {
7884 "type.googleapis.com/google.cloud.apihub.v1.Documentation"
7885 }
7886}
7887
7888#[derive(Clone, Default, PartialEq)]
7890#[non_exhaustive]
7891pub struct AttributeValues {
7892 pub attribute: std::string::String,
7895
7896 pub value: std::option::Option<crate::model::attribute_values::Value>,
7898
7899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7900}
7901
7902impl AttributeValues {
7903 pub fn new() -> Self {
7904 std::default::Default::default()
7905 }
7906
7907 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7909 self.attribute = v.into();
7910 self
7911 }
7912
7913 pub fn set_value<
7918 T: std::convert::Into<std::option::Option<crate::model::attribute_values::Value>>,
7919 >(
7920 mut self,
7921 v: T,
7922 ) -> Self {
7923 self.value = v.into();
7924 self
7925 }
7926
7927 pub fn enum_values(
7931 &self,
7932 ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::EnumAttributeValues>>
7933 {
7934 #[allow(unreachable_patterns)]
7935 self.value.as_ref().and_then(|v| match v {
7936 crate::model::attribute_values::Value::EnumValues(v) => std::option::Option::Some(v),
7937 _ => std::option::Option::None,
7938 })
7939 }
7940
7941 pub fn set_enum_values<
7947 T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::EnumAttributeValues>>,
7948 >(
7949 mut self,
7950 v: T,
7951 ) -> Self {
7952 self.value =
7953 std::option::Option::Some(crate::model::attribute_values::Value::EnumValues(v.into()));
7954 self
7955 }
7956
7957 pub fn string_values(
7961 &self,
7962 ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>
7963 {
7964 #[allow(unreachable_patterns)]
7965 self.value.as_ref().and_then(|v| match v {
7966 crate::model::attribute_values::Value::StringValues(v) => std::option::Option::Some(v),
7967 _ => std::option::Option::None,
7968 })
7969 }
7970
7971 pub fn set_string_values<
7977 T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>,
7978 >(
7979 mut self,
7980 v: T,
7981 ) -> Self {
7982 self.value = std::option::Option::Some(
7983 crate::model::attribute_values::Value::StringValues(v.into()),
7984 );
7985 self
7986 }
7987
7988 pub fn json_values(
7992 &self,
7993 ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>
7994 {
7995 #[allow(unreachable_patterns)]
7996 self.value.as_ref().and_then(|v| match v {
7997 crate::model::attribute_values::Value::JsonValues(v) => std::option::Option::Some(v),
7998 _ => std::option::Option::None,
7999 })
8000 }
8001
8002 pub fn set_json_values<
8008 T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>,
8009 >(
8010 mut self,
8011 v: T,
8012 ) -> Self {
8013 self.value =
8014 std::option::Option::Some(crate::model::attribute_values::Value::JsonValues(v.into()));
8015 self
8016 }
8017
8018 pub fn uri_values(
8022 &self,
8023 ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>
8024 {
8025 #[allow(unreachable_patterns)]
8026 self.value.as_ref().and_then(|v| match v {
8027 crate::model::attribute_values::Value::UriValues(v) => std::option::Option::Some(v),
8028 _ => std::option::Option::None,
8029 })
8030 }
8031
8032 pub fn set_uri_values<
8038 T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>,
8039 >(
8040 mut self,
8041 v: T,
8042 ) -> Self {
8043 self.value =
8044 std::option::Option::Some(crate::model::attribute_values::Value::UriValues(v.into()));
8045 self
8046 }
8047}
8048
8049impl wkt::message::Message for AttributeValues {
8050 fn typename() -> &'static str {
8051 "type.googleapis.com/google.cloud.apihub.v1.AttributeValues"
8052 }
8053}
8054
8055pub mod attribute_values {
8057 #[allow(unused_imports)]
8058 use super::*;
8059
8060 #[derive(Clone, Default, PartialEq)]
8062 #[non_exhaustive]
8063 pub struct EnumAttributeValues {
8064 pub values: std::vec::Vec<crate::model::attribute::AllowedValue>,
8066
8067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8068 }
8069
8070 impl EnumAttributeValues {
8071 pub fn new() -> Self {
8072 std::default::Default::default()
8073 }
8074
8075 pub fn set_values<T, V>(mut self, v: T) -> Self
8077 where
8078 T: std::iter::IntoIterator<Item = V>,
8079 V: std::convert::Into<crate::model::attribute::AllowedValue>,
8080 {
8081 use std::iter::Iterator;
8082 self.values = v.into_iter().map(|i| i.into()).collect();
8083 self
8084 }
8085 }
8086
8087 impl wkt::message::Message for EnumAttributeValues {
8088 fn typename() -> &'static str {
8089 "type.googleapis.com/google.cloud.apihub.v1.AttributeValues.EnumAttributeValues"
8090 }
8091 }
8092
8093 #[derive(Clone, Default, PartialEq)]
8095 #[non_exhaustive]
8096 pub struct StringAttributeValues {
8097 pub values: std::vec::Vec<std::string::String>,
8100
8101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8102 }
8103
8104 impl StringAttributeValues {
8105 pub fn new() -> Self {
8106 std::default::Default::default()
8107 }
8108
8109 pub fn set_values<T, V>(mut self, v: T) -> Self
8111 where
8112 T: std::iter::IntoIterator<Item = V>,
8113 V: std::convert::Into<std::string::String>,
8114 {
8115 use std::iter::Iterator;
8116 self.values = v.into_iter().map(|i| i.into()).collect();
8117 self
8118 }
8119 }
8120
8121 impl wkt::message::Message for StringAttributeValues {
8122 fn typename() -> &'static str {
8123 "type.googleapis.com/google.cloud.apihub.v1.AttributeValues.StringAttributeValues"
8124 }
8125 }
8126
8127 #[derive(Clone, Debug, PartialEq)]
8129 #[non_exhaustive]
8130 pub enum Value {
8131 EnumValues(std::boxed::Box<crate::model::attribute_values::EnumAttributeValues>),
8134 StringValues(std::boxed::Box<crate::model::attribute_values::StringAttributeValues>),
8137 JsonValues(std::boxed::Box<crate::model::attribute_values::StringAttributeValues>),
8140 UriValues(std::boxed::Box<crate::model::attribute_values::StringAttributeValues>),
8143 }
8144}
8145
8146#[derive(Clone, Default, PartialEq)]
8155#[non_exhaustive]
8156pub struct Dependency {
8157 pub name: std::string::String,
8161
8162 pub consumer: std::option::Option<crate::model::DependencyEntityReference>,
8164
8165 pub supplier: std::option::Option<crate::model::DependencyEntityReference>,
8167
8168 pub state: crate::model::dependency::State,
8170
8171 pub description: std::string::String,
8173
8174 pub discovery_mode: crate::model::dependency::DiscoveryMode,
8176
8177 pub error_detail: std::option::Option<crate::model::DependencyErrorDetail>,
8180
8181 pub create_time: std::option::Option<wkt::Timestamp>,
8183
8184 pub update_time: std::option::Option<wkt::Timestamp>,
8186
8187 pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
8192
8193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8194}
8195
8196impl Dependency {
8197 pub fn new() -> Self {
8198 std::default::Default::default()
8199 }
8200
8201 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8203 self.name = v.into();
8204 self
8205 }
8206
8207 pub fn set_consumer<T>(mut self, v: T) -> Self
8209 where
8210 T: std::convert::Into<crate::model::DependencyEntityReference>,
8211 {
8212 self.consumer = std::option::Option::Some(v.into());
8213 self
8214 }
8215
8216 pub fn set_or_clear_consumer<T>(mut self, v: std::option::Option<T>) -> Self
8218 where
8219 T: std::convert::Into<crate::model::DependencyEntityReference>,
8220 {
8221 self.consumer = v.map(|x| x.into());
8222 self
8223 }
8224
8225 pub fn set_supplier<T>(mut self, v: T) -> Self
8227 where
8228 T: std::convert::Into<crate::model::DependencyEntityReference>,
8229 {
8230 self.supplier = std::option::Option::Some(v.into());
8231 self
8232 }
8233
8234 pub fn set_or_clear_supplier<T>(mut self, v: std::option::Option<T>) -> Self
8236 where
8237 T: std::convert::Into<crate::model::DependencyEntityReference>,
8238 {
8239 self.supplier = v.map(|x| x.into());
8240 self
8241 }
8242
8243 pub fn set_state<T: std::convert::Into<crate::model::dependency::State>>(
8245 mut self,
8246 v: T,
8247 ) -> Self {
8248 self.state = v.into();
8249 self
8250 }
8251
8252 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8254 self.description = v.into();
8255 self
8256 }
8257
8258 pub fn set_discovery_mode<T: std::convert::Into<crate::model::dependency::DiscoveryMode>>(
8260 mut self,
8261 v: T,
8262 ) -> Self {
8263 self.discovery_mode = v.into();
8264 self
8265 }
8266
8267 pub fn set_error_detail<T>(mut self, v: T) -> Self
8269 where
8270 T: std::convert::Into<crate::model::DependencyErrorDetail>,
8271 {
8272 self.error_detail = std::option::Option::Some(v.into());
8273 self
8274 }
8275
8276 pub fn set_or_clear_error_detail<T>(mut self, v: std::option::Option<T>) -> Self
8278 where
8279 T: std::convert::Into<crate::model::DependencyErrorDetail>,
8280 {
8281 self.error_detail = v.map(|x| x.into());
8282 self
8283 }
8284
8285 pub fn set_create_time<T>(mut self, v: T) -> Self
8287 where
8288 T: std::convert::Into<wkt::Timestamp>,
8289 {
8290 self.create_time = std::option::Option::Some(v.into());
8291 self
8292 }
8293
8294 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8296 where
8297 T: std::convert::Into<wkt::Timestamp>,
8298 {
8299 self.create_time = v.map(|x| x.into());
8300 self
8301 }
8302
8303 pub fn set_update_time<T>(mut self, v: T) -> Self
8305 where
8306 T: std::convert::Into<wkt::Timestamp>,
8307 {
8308 self.update_time = std::option::Option::Some(v.into());
8309 self
8310 }
8311
8312 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8314 where
8315 T: std::convert::Into<wkt::Timestamp>,
8316 {
8317 self.update_time = v.map(|x| x.into());
8318 self
8319 }
8320
8321 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
8323 where
8324 T: std::iter::IntoIterator<Item = (K, V)>,
8325 K: std::convert::Into<std::string::String>,
8326 V: std::convert::Into<crate::model::AttributeValues>,
8327 {
8328 use std::iter::Iterator;
8329 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8330 self
8331 }
8332}
8333
8334impl wkt::message::Message for Dependency {
8335 fn typename() -> &'static str {
8336 "type.googleapis.com/google.cloud.apihub.v1.Dependency"
8337 }
8338}
8339
8340pub mod dependency {
8342 #[allow(unused_imports)]
8343 use super::*;
8344
8345 #[derive(Clone, Debug, PartialEq)]
8361 #[non_exhaustive]
8362 pub enum State {
8363 Unspecified,
8365 Proposed,
8368 Validated,
8371 UnknownValue(state::UnknownValue),
8376 }
8377
8378 #[doc(hidden)]
8379 pub mod state {
8380 #[allow(unused_imports)]
8381 use super::*;
8382 #[derive(Clone, Debug, PartialEq)]
8383 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8384 }
8385
8386 impl State {
8387 pub fn value(&self) -> std::option::Option<i32> {
8392 match self {
8393 Self::Unspecified => std::option::Option::Some(0),
8394 Self::Proposed => std::option::Option::Some(1),
8395 Self::Validated => std::option::Option::Some(2),
8396 Self::UnknownValue(u) => u.0.value(),
8397 }
8398 }
8399
8400 pub fn name(&self) -> std::option::Option<&str> {
8405 match self {
8406 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8407 Self::Proposed => std::option::Option::Some("PROPOSED"),
8408 Self::Validated => std::option::Option::Some("VALIDATED"),
8409 Self::UnknownValue(u) => u.0.name(),
8410 }
8411 }
8412 }
8413
8414 impl std::default::Default for State {
8415 fn default() -> Self {
8416 use std::convert::From;
8417 Self::from(0)
8418 }
8419 }
8420
8421 impl std::fmt::Display for State {
8422 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8423 wkt::internal::display_enum(f, self.name(), self.value())
8424 }
8425 }
8426
8427 impl std::convert::From<i32> for State {
8428 fn from(value: i32) -> Self {
8429 match value {
8430 0 => Self::Unspecified,
8431 1 => Self::Proposed,
8432 2 => Self::Validated,
8433 _ => Self::UnknownValue(state::UnknownValue(
8434 wkt::internal::UnknownEnumValue::Integer(value),
8435 )),
8436 }
8437 }
8438 }
8439
8440 impl std::convert::From<&str> for State {
8441 fn from(value: &str) -> Self {
8442 use std::string::ToString;
8443 match value {
8444 "STATE_UNSPECIFIED" => Self::Unspecified,
8445 "PROPOSED" => Self::Proposed,
8446 "VALIDATED" => Self::Validated,
8447 _ => Self::UnknownValue(state::UnknownValue(
8448 wkt::internal::UnknownEnumValue::String(value.to_string()),
8449 )),
8450 }
8451 }
8452 }
8453
8454 impl serde::ser::Serialize for State {
8455 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8456 where
8457 S: serde::Serializer,
8458 {
8459 match self {
8460 Self::Unspecified => serializer.serialize_i32(0),
8461 Self::Proposed => serializer.serialize_i32(1),
8462 Self::Validated => serializer.serialize_i32(2),
8463 Self::UnknownValue(u) => u.0.serialize(serializer),
8464 }
8465 }
8466 }
8467
8468 impl<'de> serde::de::Deserialize<'de> for State {
8469 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8470 where
8471 D: serde::Deserializer<'de>,
8472 {
8473 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8474 ".google.cloud.apihub.v1.Dependency.State",
8475 ))
8476 }
8477 }
8478
8479 #[derive(Clone, Debug, PartialEq)]
8495 #[non_exhaustive]
8496 pub enum DiscoveryMode {
8497 Unspecified,
8499 Manual,
8501 UnknownValue(discovery_mode::UnknownValue),
8506 }
8507
8508 #[doc(hidden)]
8509 pub mod discovery_mode {
8510 #[allow(unused_imports)]
8511 use super::*;
8512 #[derive(Clone, Debug, PartialEq)]
8513 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8514 }
8515
8516 impl DiscoveryMode {
8517 pub fn value(&self) -> std::option::Option<i32> {
8522 match self {
8523 Self::Unspecified => std::option::Option::Some(0),
8524 Self::Manual => std::option::Option::Some(1),
8525 Self::UnknownValue(u) => u.0.value(),
8526 }
8527 }
8528
8529 pub fn name(&self) -> std::option::Option<&str> {
8534 match self {
8535 Self::Unspecified => std::option::Option::Some("DISCOVERY_MODE_UNSPECIFIED"),
8536 Self::Manual => std::option::Option::Some("MANUAL"),
8537 Self::UnknownValue(u) => u.0.name(),
8538 }
8539 }
8540 }
8541
8542 impl std::default::Default for DiscoveryMode {
8543 fn default() -> Self {
8544 use std::convert::From;
8545 Self::from(0)
8546 }
8547 }
8548
8549 impl std::fmt::Display for DiscoveryMode {
8550 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8551 wkt::internal::display_enum(f, self.name(), self.value())
8552 }
8553 }
8554
8555 impl std::convert::From<i32> for DiscoveryMode {
8556 fn from(value: i32) -> Self {
8557 match value {
8558 0 => Self::Unspecified,
8559 1 => Self::Manual,
8560 _ => Self::UnknownValue(discovery_mode::UnknownValue(
8561 wkt::internal::UnknownEnumValue::Integer(value),
8562 )),
8563 }
8564 }
8565 }
8566
8567 impl std::convert::From<&str> for DiscoveryMode {
8568 fn from(value: &str) -> Self {
8569 use std::string::ToString;
8570 match value {
8571 "DISCOVERY_MODE_UNSPECIFIED" => Self::Unspecified,
8572 "MANUAL" => Self::Manual,
8573 _ => Self::UnknownValue(discovery_mode::UnknownValue(
8574 wkt::internal::UnknownEnumValue::String(value.to_string()),
8575 )),
8576 }
8577 }
8578 }
8579
8580 impl serde::ser::Serialize for DiscoveryMode {
8581 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8582 where
8583 S: serde::Serializer,
8584 {
8585 match self {
8586 Self::Unspecified => serializer.serialize_i32(0),
8587 Self::Manual => serializer.serialize_i32(1),
8588 Self::UnknownValue(u) => u.0.serialize(serializer),
8589 }
8590 }
8591 }
8592
8593 impl<'de> serde::de::Deserialize<'de> for DiscoveryMode {
8594 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8595 where
8596 D: serde::Deserializer<'de>,
8597 {
8598 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiscoveryMode>::new(
8599 ".google.cloud.apihub.v1.Dependency.DiscoveryMode",
8600 ))
8601 }
8602 }
8603}
8604
8605#[derive(Clone, Default, PartialEq)]
8607#[non_exhaustive]
8608pub struct DependencyEntityReference {
8609 pub display_name: std::string::String,
8611
8612 pub identifier: std::option::Option<crate::model::dependency_entity_reference::Identifier>,
8614
8615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8616}
8617
8618impl DependencyEntityReference {
8619 pub fn new() -> Self {
8620 std::default::Default::default()
8621 }
8622
8623 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8625 self.display_name = v.into();
8626 self
8627 }
8628
8629 pub fn set_identifier<
8634 T: std::convert::Into<
8635 std::option::Option<crate::model::dependency_entity_reference::Identifier>,
8636 >,
8637 >(
8638 mut self,
8639 v: T,
8640 ) -> Self {
8641 self.identifier = v.into();
8642 self
8643 }
8644
8645 pub fn operation_resource_name(&self) -> std::option::Option<&std::string::String> {
8649 #[allow(unreachable_patterns)]
8650 self.identifier.as_ref().and_then(|v| match v {
8651 crate::model::dependency_entity_reference::Identifier::OperationResourceName(v) => {
8652 std::option::Option::Some(v)
8653 }
8654 _ => std::option::Option::None,
8655 })
8656 }
8657
8658 pub fn set_operation_resource_name<T: std::convert::Into<std::string::String>>(
8664 mut self,
8665 v: T,
8666 ) -> Self {
8667 self.identifier = std::option::Option::Some(
8668 crate::model::dependency_entity_reference::Identifier::OperationResourceName(v.into()),
8669 );
8670 self
8671 }
8672
8673 pub fn external_api_resource_name(&self) -> std::option::Option<&std::string::String> {
8677 #[allow(unreachable_patterns)]
8678 self.identifier.as_ref().and_then(|v| match v {
8679 crate::model::dependency_entity_reference::Identifier::ExternalApiResourceName(v) => {
8680 std::option::Option::Some(v)
8681 }
8682 _ => std::option::Option::None,
8683 })
8684 }
8685
8686 pub fn set_external_api_resource_name<T: std::convert::Into<std::string::String>>(
8692 mut self,
8693 v: T,
8694 ) -> Self {
8695 self.identifier = std::option::Option::Some(
8696 crate::model::dependency_entity_reference::Identifier::ExternalApiResourceName(
8697 v.into(),
8698 ),
8699 );
8700 self
8701 }
8702}
8703
8704impl wkt::message::Message for DependencyEntityReference {
8705 fn typename() -> &'static str {
8706 "type.googleapis.com/google.cloud.apihub.v1.DependencyEntityReference"
8707 }
8708}
8709
8710pub mod dependency_entity_reference {
8712 #[allow(unused_imports)]
8713 use super::*;
8714
8715 #[derive(Clone, Debug, PartialEq)]
8717 #[non_exhaustive]
8718 pub enum Identifier {
8719 OperationResourceName(std::string::String),
8724 ExternalApiResourceName(std::string::String),
8729 }
8730}
8731
8732#[derive(Clone, Default, PartialEq)]
8734#[non_exhaustive]
8735pub struct DependencyErrorDetail {
8736 pub error: crate::model::dependency_error_detail::Error,
8738
8739 pub error_time: std::option::Option<wkt::Timestamp>,
8741
8742 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8743}
8744
8745impl DependencyErrorDetail {
8746 pub fn new() -> Self {
8747 std::default::Default::default()
8748 }
8749
8750 pub fn set_error<T: std::convert::Into<crate::model::dependency_error_detail::Error>>(
8752 mut self,
8753 v: T,
8754 ) -> Self {
8755 self.error = v.into();
8756 self
8757 }
8758
8759 pub fn set_error_time<T>(mut self, v: T) -> Self
8761 where
8762 T: std::convert::Into<wkt::Timestamp>,
8763 {
8764 self.error_time = std::option::Option::Some(v.into());
8765 self
8766 }
8767
8768 pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
8770 where
8771 T: std::convert::Into<wkt::Timestamp>,
8772 {
8773 self.error_time = v.map(|x| x.into());
8774 self
8775 }
8776}
8777
8778impl wkt::message::Message for DependencyErrorDetail {
8779 fn typename() -> &'static str {
8780 "type.googleapis.com/google.cloud.apihub.v1.DependencyErrorDetail"
8781 }
8782}
8783
8784pub mod dependency_error_detail {
8786 #[allow(unused_imports)]
8787 use super::*;
8788
8789 #[derive(Clone, Debug, PartialEq)]
8805 #[non_exhaustive]
8806 pub enum Error {
8807 Unspecified,
8809 SupplierNotFound,
8811 SupplierRecreated,
8813 UnknownValue(error::UnknownValue),
8818 }
8819
8820 #[doc(hidden)]
8821 pub mod error {
8822 #[allow(unused_imports)]
8823 use super::*;
8824 #[derive(Clone, Debug, PartialEq)]
8825 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8826 }
8827
8828 impl Error {
8829 pub fn value(&self) -> std::option::Option<i32> {
8834 match self {
8835 Self::Unspecified => std::option::Option::Some(0),
8836 Self::SupplierNotFound => std::option::Option::Some(1),
8837 Self::SupplierRecreated => std::option::Option::Some(2),
8838 Self::UnknownValue(u) => u.0.value(),
8839 }
8840 }
8841
8842 pub fn name(&self) -> std::option::Option<&str> {
8847 match self {
8848 Self::Unspecified => std::option::Option::Some("ERROR_UNSPECIFIED"),
8849 Self::SupplierNotFound => std::option::Option::Some("SUPPLIER_NOT_FOUND"),
8850 Self::SupplierRecreated => std::option::Option::Some("SUPPLIER_RECREATED"),
8851 Self::UnknownValue(u) => u.0.name(),
8852 }
8853 }
8854 }
8855
8856 impl std::default::Default for Error {
8857 fn default() -> Self {
8858 use std::convert::From;
8859 Self::from(0)
8860 }
8861 }
8862
8863 impl std::fmt::Display for Error {
8864 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8865 wkt::internal::display_enum(f, self.name(), self.value())
8866 }
8867 }
8868
8869 impl std::convert::From<i32> for Error {
8870 fn from(value: i32) -> Self {
8871 match value {
8872 0 => Self::Unspecified,
8873 1 => Self::SupplierNotFound,
8874 2 => Self::SupplierRecreated,
8875 _ => Self::UnknownValue(error::UnknownValue(
8876 wkt::internal::UnknownEnumValue::Integer(value),
8877 )),
8878 }
8879 }
8880 }
8881
8882 impl std::convert::From<&str> for Error {
8883 fn from(value: &str) -> Self {
8884 use std::string::ToString;
8885 match value {
8886 "ERROR_UNSPECIFIED" => Self::Unspecified,
8887 "SUPPLIER_NOT_FOUND" => Self::SupplierNotFound,
8888 "SUPPLIER_RECREATED" => Self::SupplierRecreated,
8889 _ => Self::UnknownValue(error::UnknownValue(
8890 wkt::internal::UnknownEnumValue::String(value.to_string()),
8891 )),
8892 }
8893 }
8894 }
8895
8896 impl serde::ser::Serialize for Error {
8897 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8898 where
8899 S: serde::Serializer,
8900 {
8901 match self {
8902 Self::Unspecified => serializer.serialize_i32(0),
8903 Self::SupplierNotFound => serializer.serialize_i32(1),
8904 Self::SupplierRecreated => serializer.serialize_i32(2),
8905 Self::UnknownValue(u) => u.0.serialize(serializer),
8906 }
8907 }
8908 }
8909
8910 impl<'de> serde::de::Deserialize<'de> for Error {
8911 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8912 where
8913 D: serde::Deserializer<'de>,
8914 {
8915 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Error>::new(
8916 ".google.cloud.apihub.v1.DependencyErrorDetail.Error",
8917 ))
8918 }
8919 }
8920}
8921
8922#[derive(Clone, Default, PartialEq)]
8924#[non_exhaustive]
8925pub struct LintResponse {
8926 pub issues: std::vec::Vec<crate::model::Issue>,
8928
8929 pub summary: std::vec::Vec<crate::model::lint_response::SummaryEntry>,
8931
8932 pub state: crate::model::LintState,
8934
8935 pub source: std::string::String,
8937
8938 pub linter: crate::model::Linter,
8940
8941 pub create_time: std::option::Option<wkt::Timestamp>,
8943
8944 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8945}
8946
8947impl LintResponse {
8948 pub fn new() -> Self {
8949 std::default::Default::default()
8950 }
8951
8952 pub fn set_issues<T, V>(mut self, v: T) -> Self
8954 where
8955 T: std::iter::IntoIterator<Item = V>,
8956 V: std::convert::Into<crate::model::Issue>,
8957 {
8958 use std::iter::Iterator;
8959 self.issues = v.into_iter().map(|i| i.into()).collect();
8960 self
8961 }
8962
8963 pub fn set_summary<T, V>(mut self, v: T) -> Self
8965 where
8966 T: std::iter::IntoIterator<Item = V>,
8967 V: std::convert::Into<crate::model::lint_response::SummaryEntry>,
8968 {
8969 use std::iter::Iterator;
8970 self.summary = v.into_iter().map(|i| i.into()).collect();
8971 self
8972 }
8973
8974 pub fn set_state<T: std::convert::Into<crate::model::LintState>>(mut self, v: T) -> Self {
8976 self.state = v.into();
8977 self
8978 }
8979
8980 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8982 self.source = v.into();
8983 self
8984 }
8985
8986 pub fn set_linter<T: std::convert::Into<crate::model::Linter>>(mut self, v: T) -> Self {
8988 self.linter = v.into();
8989 self
8990 }
8991
8992 pub fn set_create_time<T>(mut self, v: T) -> Self
8994 where
8995 T: std::convert::Into<wkt::Timestamp>,
8996 {
8997 self.create_time = std::option::Option::Some(v.into());
8998 self
8999 }
9000
9001 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9003 where
9004 T: std::convert::Into<wkt::Timestamp>,
9005 {
9006 self.create_time = v.map(|x| x.into());
9007 self
9008 }
9009}
9010
9011impl wkt::message::Message for LintResponse {
9012 fn typename() -> &'static str {
9013 "type.googleapis.com/google.cloud.apihub.v1.LintResponse"
9014 }
9015}
9016
9017pub mod lint_response {
9019 #[allow(unused_imports)]
9020 use super::*;
9021
9022 #[derive(Clone, Default, PartialEq)]
9024 #[non_exhaustive]
9025 pub struct SummaryEntry {
9026 pub severity: crate::model::Severity,
9028
9029 pub count: i32,
9031
9032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9033 }
9034
9035 impl SummaryEntry {
9036 pub fn new() -> Self {
9037 std::default::Default::default()
9038 }
9039
9040 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
9042 self.severity = v.into();
9043 self
9044 }
9045
9046 pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9048 self.count = v.into();
9049 self
9050 }
9051 }
9052
9053 impl wkt::message::Message for SummaryEntry {
9054 fn typename() -> &'static str {
9055 "type.googleapis.com/google.cloud.apihub.v1.LintResponse.SummaryEntry"
9056 }
9057 }
9058}
9059
9060#[derive(Clone, Default, PartialEq)]
9062#[non_exhaustive]
9063pub struct Issue {
9064 pub code: std::string::String,
9066
9067 pub path: std::vec::Vec<std::string::String>,
9070
9071 pub message: std::string::String,
9073
9074 pub severity: crate::model::Severity,
9076
9077 pub range: std::option::Option<crate::model::Range>,
9079
9080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9081}
9082
9083impl Issue {
9084 pub fn new() -> Self {
9085 std::default::Default::default()
9086 }
9087
9088 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9090 self.code = v.into();
9091 self
9092 }
9093
9094 pub fn set_path<T, V>(mut self, v: T) -> Self
9096 where
9097 T: std::iter::IntoIterator<Item = V>,
9098 V: std::convert::Into<std::string::String>,
9099 {
9100 use std::iter::Iterator;
9101 self.path = v.into_iter().map(|i| i.into()).collect();
9102 self
9103 }
9104
9105 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9107 self.message = v.into();
9108 self
9109 }
9110
9111 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
9113 self.severity = v.into();
9114 self
9115 }
9116
9117 pub fn set_range<T>(mut self, v: T) -> Self
9119 where
9120 T: std::convert::Into<crate::model::Range>,
9121 {
9122 self.range = std::option::Option::Some(v.into());
9123 self
9124 }
9125
9126 pub fn set_or_clear_range<T>(mut self, v: std::option::Option<T>) -> Self
9128 where
9129 T: std::convert::Into<crate::model::Range>,
9130 {
9131 self.range = v.map(|x| x.into());
9132 self
9133 }
9134}
9135
9136impl wkt::message::Message for Issue {
9137 fn typename() -> &'static str {
9138 "type.googleapis.com/google.cloud.apihub.v1.Issue"
9139 }
9140}
9141
9142#[derive(Clone, Default, PartialEq)]
9144#[non_exhaustive]
9145pub struct Range {
9146 pub start: std::option::Option<crate::model::Point>,
9148
9149 pub end: std::option::Option<crate::model::Point>,
9151
9152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9153}
9154
9155impl Range {
9156 pub fn new() -> Self {
9157 std::default::Default::default()
9158 }
9159
9160 pub fn set_start<T>(mut self, v: T) -> Self
9162 where
9163 T: std::convert::Into<crate::model::Point>,
9164 {
9165 self.start = std::option::Option::Some(v.into());
9166 self
9167 }
9168
9169 pub fn set_or_clear_start<T>(mut self, v: std::option::Option<T>) -> Self
9171 where
9172 T: std::convert::Into<crate::model::Point>,
9173 {
9174 self.start = v.map(|x| x.into());
9175 self
9176 }
9177
9178 pub fn set_end<T>(mut self, v: T) -> Self
9180 where
9181 T: std::convert::Into<crate::model::Point>,
9182 {
9183 self.end = std::option::Option::Some(v.into());
9184 self
9185 }
9186
9187 pub fn set_or_clear_end<T>(mut self, v: std::option::Option<T>) -> Self
9189 where
9190 T: std::convert::Into<crate::model::Point>,
9191 {
9192 self.end = v.map(|x| x.into());
9193 self
9194 }
9195}
9196
9197impl wkt::message::Message for Range {
9198 fn typename() -> &'static str {
9199 "type.googleapis.com/google.cloud.apihub.v1.Range"
9200 }
9201}
9202
9203#[derive(Clone, Default, PartialEq)]
9205#[non_exhaustive]
9206pub struct Point {
9207 pub line: i32,
9209
9210 pub character: i32,
9212
9213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9214}
9215
9216impl Point {
9217 pub fn new() -> Self {
9218 std::default::Default::default()
9219 }
9220
9221 pub fn set_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9223 self.line = v.into();
9224 self
9225 }
9226
9227 pub fn set_character<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9229 self.character = v.into();
9230 self
9231 }
9232}
9233
9234impl wkt::message::Message for Point {
9235 fn typename() -> &'static str {
9236 "type.googleapis.com/google.cloud.apihub.v1.Point"
9237 }
9238}
9239
9240#[derive(Clone, Default, PartialEq)]
9242#[non_exhaustive]
9243pub struct OperationMetadata {
9244 pub create_time: std::option::Option<wkt::Timestamp>,
9246
9247 pub end_time: std::option::Option<wkt::Timestamp>,
9249
9250 pub target: std::string::String,
9252
9253 pub verb: std::string::String,
9255
9256 pub status_message: std::string::String,
9258
9259 pub requested_cancellation: bool,
9268
9269 pub api_version: std::string::String,
9271
9272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9273}
9274
9275impl OperationMetadata {
9276 pub fn new() -> Self {
9277 std::default::Default::default()
9278 }
9279
9280 pub fn set_create_time<T>(mut self, v: T) -> Self
9282 where
9283 T: std::convert::Into<wkt::Timestamp>,
9284 {
9285 self.create_time = std::option::Option::Some(v.into());
9286 self
9287 }
9288
9289 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9291 where
9292 T: std::convert::Into<wkt::Timestamp>,
9293 {
9294 self.create_time = v.map(|x| x.into());
9295 self
9296 }
9297
9298 pub fn set_end_time<T>(mut self, v: T) -> Self
9300 where
9301 T: std::convert::Into<wkt::Timestamp>,
9302 {
9303 self.end_time = std::option::Option::Some(v.into());
9304 self
9305 }
9306
9307 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9309 where
9310 T: std::convert::Into<wkt::Timestamp>,
9311 {
9312 self.end_time = v.map(|x| x.into());
9313 self
9314 }
9315
9316 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9318 self.target = v.into();
9319 self
9320 }
9321
9322 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9324 self.verb = v.into();
9325 self
9326 }
9327
9328 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9330 self.status_message = v.into();
9331 self
9332 }
9333
9334 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9336 self.requested_cancellation = v.into();
9337 self
9338 }
9339
9340 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9342 self.api_version = v.into();
9343 self
9344 }
9345}
9346
9347impl wkt::message::Message for OperationMetadata {
9348 fn typename() -> &'static str {
9349 "type.googleapis.com/google.cloud.apihub.v1.OperationMetadata"
9350 }
9351}
9352
9353#[derive(Clone, Default, PartialEq)]
9356#[non_exhaustive]
9357pub struct ApiHubInstance {
9358 pub name: std::string::String,
9361
9362 pub create_time: std::option::Option<wkt::Timestamp>,
9364
9365 pub update_time: std::option::Option<wkt::Timestamp>,
9367
9368 pub state: crate::model::api_hub_instance::State,
9370
9371 pub state_message: std::string::String,
9374
9375 pub config: std::option::Option<crate::model::api_hub_instance::Config>,
9377
9378 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9382
9383 pub description: std::string::String,
9385
9386 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9387}
9388
9389impl ApiHubInstance {
9390 pub fn new() -> Self {
9391 std::default::Default::default()
9392 }
9393
9394 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9396 self.name = v.into();
9397 self
9398 }
9399
9400 pub fn set_create_time<T>(mut self, v: T) -> Self
9402 where
9403 T: std::convert::Into<wkt::Timestamp>,
9404 {
9405 self.create_time = std::option::Option::Some(v.into());
9406 self
9407 }
9408
9409 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9411 where
9412 T: std::convert::Into<wkt::Timestamp>,
9413 {
9414 self.create_time = v.map(|x| x.into());
9415 self
9416 }
9417
9418 pub fn set_update_time<T>(mut self, v: T) -> Self
9420 where
9421 T: std::convert::Into<wkt::Timestamp>,
9422 {
9423 self.update_time = std::option::Option::Some(v.into());
9424 self
9425 }
9426
9427 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9429 where
9430 T: std::convert::Into<wkt::Timestamp>,
9431 {
9432 self.update_time = v.map(|x| x.into());
9433 self
9434 }
9435
9436 pub fn set_state<T: std::convert::Into<crate::model::api_hub_instance::State>>(
9438 mut self,
9439 v: T,
9440 ) -> Self {
9441 self.state = v.into();
9442 self
9443 }
9444
9445 pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9447 self.state_message = v.into();
9448 self
9449 }
9450
9451 pub fn set_config<T>(mut self, v: T) -> Self
9453 where
9454 T: std::convert::Into<crate::model::api_hub_instance::Config>,
9455 {
9456 self.config = std::option::Option::Some(v.into());
9457 self
9458 }
9459
9460 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
9462 where
9463 T: std::convert::Into<crate::model::api_hub_instance::Config>,
9464 {
9465 self.config = v.map(|x| x.into());
9466 self
9467 }
9468
9469 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9471 where
9472 T: std::iter::IntoIterator<Item = (K, V)>,
9473 K: std::convert::Into<std::string::String>,
9474 V: std::convert::Into<std::string::String>,
9475 {
9476 use std::iter::Iterator;
9477 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9478 self
9479 }
9480
9481 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9483 self.description = v.into();
9484 self
9485 }
9486}
9487
9488impl wkt::message::Message for ApiHubInstance {
9489 fn typename() -> &'static str {
9490 "type.googleapis.com/google.cloud.apihub.v1.ApiHubInstance"
9491 }
9492}
9493
9494pub mod api_hub_instance {
9496 #[allow(unused_imports)]
9497 use super::*;
9498
9499 #[derive(Clone, Default, PartialEq)]
9501 #[non_exhaustive]
9502 pub struct Config {
9503 pub cmek_key_name: std::string::String,
9509
9510 pub disable_search: bool,
9513
9514 pub vertex_location: std::string::String,
9517
9518 pub encryption_type: crate::model::api_hub_instance::config::EncryptionType,
9522
9523 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9524 }
9525
9526 impl Config {
9527 pub fn new() -> Self {
9528 std::default::Default::default()
9529 }
9530
9531 pub fn set_cmek_key_name<T: std::convert::Into<std::string::String>>(
9533 mut self,
9534 v: T,
9535 ) -> Self {
9536 self.cmek_key_name = v.into();
9537 self
9538 }
9539
9540 pub fn set_disable_search<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9542 self.disable_search = v.into();
9543 self
9544 }
9545
9546 pub fn set_vertex_location<T: std::convert::Into<std::string::String>>(
9548 mut self,
9549 v: T,
9550 ) -> Self {
9551 self.vertex_location = v.into();
9552 self
9553 }
9554
9555 pub fn set_encryption_type<
9557 T: std::convert::Into<crate::model::api_hub_instance::config::EncryptionType>,
9558 >(
9559 mut self,
9560 v: T,
9561 ) -> Self {
9562 self.encryption_type = v.into();
9563 self
9564 }
9565 }
9566
9567 impl wkt::message::Message for Config {
9568 fn typename() -> &'static str {
9569 "type.googleapis.com/google.cloud.apihub.v1.ApiHubInstance.Config"
9570 }
9571 }
9572
9573 pub mod config {
9575 #[allow(unused_imports)]
9576 use super::*;
9577
9578 #[derive(Clone, Debug, PartialEq)]
9594 #[non_exhaustive]
9595 pub enum EncryptionType {
9596 Unspecified,
9598 Gmek,
9600 Cmek,
9602 UnknownValue(encryption_type::UnknownValue),
9607 }
9608
9609 #[doc(hidden)]
9610 pub mod encryption_type {
9611 #[allow(unused_imports)]
9612 use super::*;
9613 #[derive(Clone, Debug, PartialEq)]
9614 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9615 }
9616
9617 impl EncryptionType {
9618 pub fn value(&self) -> std::option::Option<i32> {
9623 match self {
9624 Self::Unspecified => std::option::Option::Some(0),
9625 Self::Gmek => std::option::Option::Some(1),
9626 Self::Cmek => std::option::Option::Some(2),
9627 Self::UnknownValue(u) => u.0.value(),
9628 }
9629 }
9630
9631 pub fn name(&self) -> std::option::Option<&str> {
9636 match self {
9637 Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
9638 Self::Gmek => std::option::Option::Some("GMEK"),
9639 Self::Cmek => std::option::Option::Some("CMEK"),
9640 Self::UnknownValue(u) => u.0.name(),
9641 }
9642 }
9643 }
9644
9645 impl std::default::Default for EncryptionType {
9646 fn default() -> Self {
9647 use std::convert::From;
9648 Self::from(0)
9649 }
9650 }
9651
9652 impl std::fmt::Display for EncryptionType {
9653 fn fmt(
9654 &self,
9655 f: &mut std::fmt::Formatter<'_>,
9656 ) -> std::result::Result<(), std::fmt::Error> {
9657 wkt::internal::display_enum(f, self.name(), self.value())
9658 }
9659 }
9660
9661 impl std::convert::From<i32> for EncryptionType {
9662 fn from(value: i32) -> Self {
9663 match value {
9664 0 => Self::Unspecified,
9665 1 => Self::Gmek,
9666 2 => Self::Cmek,
9667 _ => Self::UnknownValue(encryption_type::UnknownValue(
9668 wkt::internal::UnknownEnumValue::Integer(value),
9669 )),
9670 }
9671 }
9672 }
9673
9674 impl std::convert::From<&str> for EncryptionType {
9675 fn from(value: &str) -> Self {
9676 use std::string::ToString;
9677 match value {
9678 "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
9679 "GMEK" => Self::Gmek,
9680 "CMEK" => Self::Cmek,
9681 _ => Self::UnknownValue(encryption_type::UnknownValue(
9682 wkt::internal::UnknownEnumValue::String(value.to_string()),
9683 )),
9684 }
9685 }
9686 }
9687
9688 impl serde::ser::Serialize for EncryptionType {
9689 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9690 where
9691 S: serde::Serializer,
9692 {
9693 match self {
9694 Self::Unspecified => serializer.serialize_i32(0),
9695 Self::Gmek => serializer.serialize_i32(1),
9696 Self::Cmek => serializer.serialize_i32(2),
9697 Self::UnknownValue(u) => u.0.serialize(serializer),
9698 }
9699 }
9700 }
9701
9702 impl<'de> serde::de::Deserialize<'de> for EncryptionType {
9703 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9704 where
9705 D: serde::Deserializer<'de>,
9706 {
9707 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
9708 ".google.cloud.apihub.v1.ApiHubInstance.Config.EncryptionType",
9709 ))
9710 }
9711 }
9712 }
9713
9714 #[derive(Clone, Debug, PartialEq)]
9730 #[non_exhaustive]
9731 pub enum State {
9732 Unspecified,
9734 Inactive,
9736 Creating,
9738 Active,
9740 Updating,
9742 Deleting,
9744 Failed,
9746 UnknownValue(state::UnknownValue),
9751 }
9752
9753 #[doc(hidden)]
9754 pub mod state {
9755 #[allow(unused_imports)]
9756 use super::*;
9757 #[derive(Clone, Debug, PartialEq)]
9758 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9759 }
9760
9761 impl State {
9762 pub fn value(&self) -> std::option::Option<i32> {
9767 match self {
9768 Self::Unspecified => std::option::Option::Some(0),
9769 Self::Inactive => std::option::Option::Some(1),
9770 Self::Creating => std::option::Option::Some(2),
9771 Self::Active => std::option::Option::Some(3),
9772 Self::Updating => std::option::Option::Some(4),
9773 Self::Deleting => std::option::Option::Some(5),
9774 Self::Failed => std::option::Option::Some(6),
9775 Self::UnknownValue(u) => u.0.value(),
9776 }
9777 }
9778
9779 pub fn name(&self) -> std::option::Option<&str> {
9784 match self {
9785 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9786 Self::Inactive => std::option::Option::Some("INACTIVE"),
9787 Self::Creating => std::option::Option::Some("CREATING"),
9788 Self::Active => std::option::Option::Some("ACTIVE"),
9789 Self::Updating => std::option::Option::Some("UPDATING"),
9790 Self::Deleting => std::option::Option::Some("DELETING"),
9791 Self::Failed => std::option::Option::Some("FAILED"),
9792 Self::UnknownValue(u) => u.0.name(),
9793 }
9794 }
9795 }
9796
9797 impl std::default::Default for State {
9798 fn default() -> Self {
9799 use std::convert::From;
9800 Self::from(0)
9801 }
9802 }
9803
9804 impl std::fmt::Display for State {
9805 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9806 wkt::internal::display_enum(f, self.name(), self.value())
9807 }
9808 }
9809
9810 impl std::convert::From<i32> for State {
9811 fn from(value: i32) -> Self {
9812 match value {
9813 0 => Self::Unspecified,
9814 1 => Self::Inactive,
9815 2 => Self::Creating,
9816 3 => Self::Active,
9817 4 => Self::Updating,
9818 5 => Self::Deleting,
9819 6 => Self::Failed,
9820 _ => Self::UnknownValue(state::UnknownValue(
9821 wkt::internal::UnknownEnumValue::Integer(value),
9822 )),
9823 }
9824 }
9825 }
9826
9827 impl std::convert::From<&str> for State {
9828 fn from(value: &str) -> Self {
9829 use std::string::ToString;
9830 match value {
9831 "STATE_UNSPECIFIED" => Self::Unspecified,
9832 "INACTIVE" => Self::Inactive,
9833 "CREATING" => Self::Creating,
9834 "ACTIVE" => Self::Active,
9835 "UPDATING" => Self::Updating,
9836 "DELETING" => Self::Deleting,
9837 "FAILED" => Self::Failed,
9838 _ => Self::UnknownValue(state::UnknownValue(
9839 wkt::internal::UnknownEnumValue::String(value.to_string()),
9840 )),
9841 }
9842 }
9843 }
9844
9845 impl serde::ser::Serialize for State {
9846 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9847 where
9848 S: serde::Serializer,
9849 {
9850 match self {
9851 Self::Unspecified => serializer.serialize_i32(0),
9852 Self::Inactive => serializer.serialize_i32(1),
9853 Self::Creating => serializer.serialize_i32(2),
9854 Self::Active => serializer.serialize_i32(3),
9855 Self::Updating => serializer.serialize_i32(4),
9856 Self::Deleting => serializer.serialize_i32(5),
9857 Self::Failed => serializer.serialize_i32(6),
9858 Self::UnknownValue(u) => u.0.serialize(serializer),
9859 }
9860 }
9861 }
9862
9863 impl<'de> serde::de::Deserialize<'de> for State {
9864 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9865 where
9866 D: serde::Deserializer<'de>,
9867 {
9868 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9869 ".google.cloud.apihub.v1.ApiHubInstance.State",
9870 ))
9871 }
9872 }
9873}
9874
9875#[derive(Clone, Default, PartialEq)]
9878#[non_exhaustive]
9879pub struct ExternalApi {
9880 pub name: std::string::String,
9883
9884 pub display_name: std::string::String,
9887
9888 pub description: std::string::String,
9891
9892 pub endpoints: std::vec::Vec<std::string::String>,
9894
9895 pub paths: std::vec::Vec<std::string::String>,
9897
9898 pub documentation: std::option::Option<crate::model::Documentation>,
9900
9901 pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,
9906
9907 pub create_time: std::option::Option<wkt::Timestamp>,
9909
9910 pub update_time: std::option::Option<wkt::Timestamp>,
9912
9913 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9914}
9915
9916impl ExternalApi {
9917 pub fn new() -> Self {
9918 std::default::Default::default()
9919 }
9920
9921 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9923 self.name = v.into();
9924 self
9925 }
9926
9927 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9929 self.display_name = v.into();
9930 self
9931 }
9932
9933 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9935 self.description = v.into();
9936 self
9937 }
9938
9939 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
9941 where
9942 T: std::iter::IntoIterator<Item = V>,
9943 V: std::convert::Into<std::string::String>,
9944 {
9945 use std::iter::Iterator;
9946 self.endpoints = v.into_iter().map(|i| i.into()).collect();
9947 self
9948 }
9949
9950 pub fn set_paths<T, V>(mut self, v: T) -> Self
9952 where
9953 T: std::iter::IntoIterator<Item = V>,
9954 V: std::convert::Into<std::string::String>,
9955 {
9956 use std::iter::Iterator;
9957 self.paths = v.into_iter().map(|i| i.into()).collect();
9958 self
9959 }
9960
9961 pub fn set_documentation<T>(mut self, v: T) -> Self
9963 where
9964 T: std::convert::Into<crate::model::Documentation>,
9965 {
9966 self.documentation = std::option::Option::Some(v.into());
9967 self
9968 }
9969
9970 pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
9972 where
9973 T: std::convert::Into<crate::model::Documentation>,
9974 {
9975 self.documentation = v.map(|x| x.into());
9976 self
9977 }
9978
9979 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
9981 where
9982 T: std::iter::IntoIterator<Item = (K, V)>,
9983 K: std::convert::Into<std::string::String>,
9984 V: std::convert::Into<crate::model::AttributeValues>,
9985 {
9986 use std::iter::Iterator;
9987 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9988 self
9989 }
9990
9991 pub fn set_create_time<T>(mut self, v: T) -> Self
9993 where
9994 T: std::convert::Into<wkt::Timestamp>,
9995 {
9996 self.create_time = std::option::Option::Some(v.into());
9997 self
9998 }
9999
10000 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10002 where
10003 T: std::convert::Into<wkt::Timestamp>,
10004 {
10005 self.create_time = v.map(|x| x.into());
10006 self
10007 }
10008
10009 pub fn set_update_time<T>(mut self, v: T) -> Self
10011 where
10012 T: std::convert::Into<wkt::Timestamp>,
10013 {
10014 self.update_time = std::option::Option::Some(v.into());
10015 self
10016 }
10017
10018 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10020 where
10021 T: std::convert::Into<wkt::Timestamp>,
10022 {
10023 self.update_time = v.map(|x| x.into());
10024 self
10025 }
10026}
10027
10028impl wkt::message::Message for ExternalApi {
10029 fn typename() -> &'static str {
10030 "type.googleapis.com/google.cloud.apihub.v1.ExternalApi"
10031 }
10032}
10033
10034#[derive(Clone, Default, PartialEq)]
10037#[non_exhaustive]
10038pub struct ConfigValueOption {
10039 pub id: std::string::String,
10041
10042 pub display_name: std::string::String,
10044
10045 pub description: std::string::String,
10047
10048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10049}
10050
10051impl ConfigValueOption {
10052 pub fn new() -> Self {
10053 std::default::Default::default()
10054 }
10055
10056 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10058 self.id = v.into();
10059 self
10060 }
10061
10062 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10064 self.display_name = v.into();
10065 self
10066 }
10067
10068 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10070 self.description = v.into();
10071 self
10072 }
10073}
10074
10075impl wkt::message::Message for ConfigValueOption {
10076 fn typename() -> &'static str {
10077 "type.googleapis.com/google.cloud.apihub.v1.ConfigValueOption"
10078 }
10079}
10080
10081#[derive(Clone, Default, PartialEq)]
10083#[non_exhaustive]
10084pub struct Secret {
10085 pub secret_version: std::string::String,
10088
10089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10090}
10091
10092impl Secret {
10093 pub fn new() -> Self {
10094 std::default::Default::default()
10095 }
10096
10097 pub fn set_secret_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10099 self.secret_version = v.into();
10100 self
10101 }
10102}
10103
10104impl wkt::message::Message for Secret {
10105 fn typename() -> &'static str {
10106 "type.googleapis.com/google.cloud.apihub.v1.Secret"
10107 }
10108}
10109
10110#[derive(Clone, Default, PartialEq)]
10113#[non_exhaustive]
10114pub struct ConfigVariableTemplate {
10115 pub id: std::string::String,
10118
10119 pub value_type: crate::model::config_variable_template::ValueType,
10121
10122 pub description: std::string::String,
10124
10125 pub validation_regex: std::string::String,
10128
10129 pub required: bool,
10132
10133 pub enum_options: std::vec::Vec<crate::model::ConfigValueOption>,
10135
10136 pub multi_select_options: std::vec::Vec<crate::model::ConfigValueOption>,
10139
10140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10141}
10142
10143impl ConfigVariableTemplate {
10144 pub fn new() -> Self {
10145 std::default::Default::default()
10146 }
10147
10148 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10150 self.id = v.into();
10151 self
10152 }
10153
10154 pub fn set_value_type<
10156 T: std::convert::Into<crate::model::config_variable_template::ValueType>,
10157 >(
10158 mut self,
10159 v: T,
10160 ) -> Self {
10161 self.value_type = v.into();
10162 self
10163 }
10164
10165 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10167 self.description = v.into();
10168 self
10169 }
10170
10171 pub fn set_validation_regex<T: std::convert::Into<std::string::String>>(
10173 mut self,
10174 v: T,
10175 ) -> Self {
10176 self.validation_regex = v.into();
10177 self
10178 }
10179
10180 pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10182 self.required = v.into();
10183 self
10184 }
10185
10186 pub fn set_enum_options<T, V>(mut self, v: T) -> Self
10188 where
10189 T: std::iter::IntoIterator<Item = V>,
10190 V: std::convert::Into<crate::model::ConfigValueOption>,
10191 {
10192 use std::iter::Iterator;
10193 self.enum_options = v.into_iter().map(|i| i.into()).collect();
10194 self
10195 }
10196
10197 pub fn set_multi_select_options<T, V>(mut self, v: T) -> Self
10199 where
10200 T: std::iter::IntoIterator<Item = V>,
10201 V: std::convert::Into<crate::model::ConfigValueOption>,
10202 {
10203 use std::iter::Iterator;
10204 self.multi_select_options = v.into_iter().map(|i| i.into()).collect();
10205 self
10206 }
10207}
10208
10209impl wkt::message::Message for ConfigVariableTemplate {
10210 fn typename() -> &'static str {
10211 "type.googleapis.com/google.cloud.apihub.v1.ConfigVariableTemplate"
10212 }
10213}
10214
10215pub mod config_variable_template {
10217 #[allow(unused_imports)]
10218 use super::*;
10219
10220 #[derive(Clone, Debug, PartialEq)]
10236 #[non_exhaustive]
10237 pub enum ValueType {
10238 Unspecified,
10240 String,
10242 Int,
10244 Bool,
10246 Secret,
10248 Enum,
10250 MultiSelect,
10252 MultiString,
10254 MultiInt,
10256 UnknownValue(value_type::UnknownValue),
10261 }
10262
10263 #[doc(hidden)]
10264 pub mod value_type {
10265 #[allow(unused_imports)]
10266 use super::*;
10267 #[derive(Clone, Debug, PartialEq)]
10268 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10269 }
10270
10271 impl ValueType {
10272 pub fn value(&self) -> std::option::Option<i32> {
10277 match self {
10278 Self::Unspecified => std::option::Option::Some(0),
10279 Self::String => std::option::Option::Some(1),
10280 Self::Int => std::option::Option::Some(2),
10281 Self::Bool => std::option::Option::Some(3),
10282 Self::Secret => std::option::Option::Some(4),
10283 Self::Enum => std::option::Option::Some(5),
10284 Self::MultiSelect => std::option::Option::Some(6),
10285 Self::MultiString => std::option::Option::Some(7),
10286 Self::MultiInt => std::option::Option::Some(8),
10287 Self::UnknownValue(u) => u.0.value(),
10288 }
10289 }
10290
10291 pub fn name(&self) -> std::option::Option<&str> {
10296 match self {
10297 Self::Unspecified => std::option::Option::Some("VALUE_TYPE_UNSPECIFIED"),
10298 Self::String => std::option::Option::Some("STRING"),
10299 Self::Int => std::option::Option::Some("INT"),
10300 Self::Bool => std::option::Option::Some("BOOL"),
10301 Self::Secret => std::option::Option::Some("SECRET"),
10302 Self::Enum => std::option::Option::Some("ENUM"),
10303 Self::MultiSelect => std::option::Option::Some("MULTI_SELECT"),
10304 Self::MultiString => std::option::Option::Some("MULTI_STRING"),
10305 Self::MultiInt => std::option::Option::Some("MULTI_INT"),
10306 Self::UnknownValue(u) => u.0.name(),
10307 }
10308 }
10309 }
10310
10311 impl std::default::Default for ValueType {
10312 fn default() -> Self {
10313 use std::convert::From;
10314 Self::from(0)
10315 }
10316 }
10317
10318 impl std::fmt::Display for ValueType {
10319 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10320 wkt::internal::display_enum(f, self.name(), self.value())
10321 }
10322 }
10323
10324 impl std::convert::From<i32> for ValueType {
10325 fn from(value: i32) -> Self {
10326 match value {
10327 0 => Self::Unspecified,
10328 1 => Self::String,
10329 2 => Self::Int,
10330 3 => Self::Bool,
10331 4 => Self::Secret,
10332 5 => Self::Enum,
10333 6 => Self::MultiSelect,
10334 7 => Self::MultiString,
10335 8 => Self::MultiInt,
10336 _ => Self::UnknownValue(value_type::UnknownValue(
10337 wkt::internal::UnknownEnumValue::Integer(value),
10338 )),
10339 }
10340 }
10341 }
10342
10343 impl std::convert::From<&str> for ValueType {
10344 fn from(value: &str) -> Self {
10345 use std::string::ToString;
10346 match value {
10347 "VALUE_TYPE_UNSPECIFIED" => Self::Unspecified,
10348 "STRING" => Self::String,
10349 "INT" => Self::Int,
10350 "BOOL" => Self::Bool,
10351 "SECRET" => Self::Secret,
10352 "ENUM" => Self::Enum,
10353 "MULTI_SELECT" => Self::MultiSelect,
10354 "MULTI_STRING" => Self::MultiString,
10355 "MULTI_INT" => Self::MultiInt,
10356 _ => Self::UnknownValue(value_type::UnknownValue(
10357 wkt::internal::UnknownEnumValue::String(value.to_string()),
10358 )),
10359 }
10360 }
10361 }
10362
10363 impl serde::ser::Serialize for ValueType {
10364 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10365 where
10366 S: serde::Serializer,
10367 {
10368 match self {
10369 Self::Unspecified => serializer.serialize_i32(0),
10370 Self::String => serializer.serialize_i32(1),
10371 Self::Int => serializer.serialize_i32(2),
10372 Self::Bool => serializer.serialize_i32(3),
10373 Self::Secret => serializer.serialize_i32(4),
10374 Self::Enum => serializer.serialize_i32(5),
10375 Self::MultiSelect => serializer.serialize_i32(6),
10376 Self::MultiString => serializer.serialize_i32(7),
10377 Self::MultiInt => serializer.serialize_i32(8),
10378 Self::UnknownValue(u) => u.0.serialize(serializer),
10379 }
10380 }
10381 }
10382
10383 impl<'de> serde::de::Deserialize<'de> for ValueType {
10384 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10385 where
10386 D: serde::Deserializer<'de>,
10387 {
10388 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
10389 ".google.cloud.apihub.v1.ConfigVariableTemplate.ValueType",
10390 ))
10391 }
10392 }
10393}
10394
10395#[derive(Clone, Default, PartialEq)]
10398#[non_exhaustive]
10399pub struct ConfigVariable {
10400 pub key: std::string::String,
10406
10407 pub value: std::option::Option<crate::model::config_variable::Value>,
10409
10410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10411}
10412
10413impl ConfigVariable {
10414 pub fn new() -> Self {
10415 std::default::Default::default()
10416 }
10417
10418 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10420 self.key = v.into();
10421 self
10422 }
10423
10424 pub fn set_value<
10429 T: std::convert::Into<std::option::Option<crate::model::config_variable::Value>>,
10430 >(
10431 mut self,
10432 v: T,
10433 ) -> Self {
10434 self.value = v.into();
10435 self
10436 }
10437
10438 pub fn string_value(&self) -> std::option::Option<&std::string::String> {
10442 #[allow(unreachable_patterns)]
10443 self.value.as_ref().and_then(|v| match v {
10444 crate::model::config_variable::Value::StringValue(v) => std::option::Option::Some(v),
10445 _ => std::option::Option::None,
10446 })
10447 }
10448
10449 pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10455 self.value =
10456 std::option::Option::Some(crate::model::config_variable::Value::StringValue(v.into()));
10457 self
10458 }
10459
10460 pub fn int_value(&self) -> std::option::Option<&i64> {
10464 #[allow(unreachable_patterns)]
10465 self.value.as_ref().and_then(|v| match v {
10466 crate::model::config_variable::Value::IntValue(v) => std::option::Option::Some(v),
10467 _ => std::option::Option::None,
10468 })
10469 }
10470
10471 pub fn set_int_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10477 self.value =
10478 std::option::Option::Some(crate::model::config_variable::Value::IntValue(v.into()));
10479 self
10480 }
10481
10482 pub fn bool_value(&self) -> std::option::Option<&bool> {
10486 #[allow(unreachable_patterns)]
10487 self.value.as_ref().and_then(|v| match v {
10488 crate::model::config_variable::Value::BoolValue(v) => std::option::Option::Some(v),
10489 _ => std::option::Option::None,
10490 })
10491 }
10492
10493 pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10499 self.value =
10500 std::option::Option::Some(crate::model::config_variable::Value::BoolValue(v.into()));
10501 self
10502 }
10503
10504 pub fn secret_value(&self) -> std::option::Option<&std::boxed::Box<crate::model::Secret>> {
10508 #[allow(unreachable_patterns)]
10509 self.value.as_ref().and_then(|v| match v {
10510 crate::model::config_variable::Value::SecretValue(v) => std::option::Option::Some(v),
10511 _ => std::option::Option::None,
10512 })
10513 }
10514
10515 pub fn set_secret_value<T: std::convert::Into<std::boxed::Box<crate::model::Secret>>>(
10521 mut self,
10522 v: T,
10523 ) -> Self {
10524 self.value =
10525 std::option::Option::Some(crate::model::config_variable::Value::SecretValue(v.into()));
10526 self
10527 }
10528
10529 pub fn enum_value(
10533 &self,
10534 ) -> std::option::Option<&std::boxed::Box<crate::model::ConfigValueOption>> {
10535 #[allow(unreachable_patterns)]
10536 self.value.as_ref().and_then(|v| match v {
10537 crate::model::config_variable::Value::EnumValue(v) => std::option::Option::Some(v),
10538 _ => std::option::Option::None,
10539 })
10540 }
10541
10542 pub fn set_enum_value<
10548 T: std::convert::Into<std::boxed::Box<crate::model::ConfigValueOption>>,
10549 >(
10550 mut self,
10551 v: T,
10552 ) -> Self {
10553 self.value =
10554 std::option::Option::Some(crate::model::config_variable::Value::EnumValue(v.into()));
10555 self
10556 }
10557
10558 pub fn multi_select_values(
10562 &self,
10563 ) -> std::option::Option<&std::boxed::Box<crate::model::config_variable::MultiSelectValues>>
10564 {
10565 #[allow(unreachable_patterns)]
10566 self.value.as_ref().and_then(|v| match v {
10567 crate::model::config_variable::Value::MultiSelectValues(v) => {
10568 std::option::Option::Some(v)
10569 }
10570 _ => std::option::Option::None,
10571 })
10572 }
10573
10574 pub fn set_multi_select_values<
10580 T: std::convert::Into<std::boxed::Box<crate::model::config_variable::MultiSelectValues>>,
10581 >(
10582 mut self,
10583 v: T,
10584 ) -> Self {
10585 self.value = std::option::Option::Some(
10586 crate::model::config_variable::Value::MultiSelectValues(v.into()),
10587 );
10588 self
10589 }
10590
10591 pub fn multi_string_values(
10595 &self,
10596 ) -> std::option::Option<&std::boxed::Box<crate::model::config_variable::MultiStringValues>>
10597 {
10598 #[allow(unreachable_patterns)]
10599 self.value.as_ref().and_then(|v| match v {
10600 crate::model::config_variable::Value::MultiStringValues(v) => {
10601 std::option::Option::Some(v)
10602 }
10603 _ => std::option::Option::None,
10604 })
10605 }
10606
10607 pub fn set_multi_string_values<
10613 T: std::convert::Into<std::boxed::Box<crate::model::config_variable::MultiStringValues>>,
10614 >(
10615 mut self,
10616 v: T,
10617 ) -> Self {
10618 self.value = std::option::Option::Some(
10619 crate::model::config_variable::Value::MultiStringValues(v.into()),
10620 );
10621 self
10622 }
10623
10624 pub fn multi_int_values(
10628 &self,
10629 ) -> std::option::Option<&std::boxed::Box<crate::model::config_variable::MultiIntValues>> {
10630 #[allow(unreachable_patterns)]
10631 self.value.as_ref().and_then(|v| match v {
10632 crate::model::config_variable::Value::MultiIntValues(v) => std::option::Option::Some(v),
10633 _ => std::option::Option::None,
10634 })
10635 }
10636
10637 pub fn set_multi_int_values<
10643 T: std::convert::Into<std::boxed::Box<crate::model::config_variable::MultiIntValues>>,
10644 >(
10645 mut self,
10646 v: T,
10647 ) -> Self {
10648 self.value = std::option::Option::Some(
10649 crate::model::config_variable::Value::MultiIntValues(v.into()),
10650 );
10651 self
10652 }
10653}
10654
10655impl wkt::message::Message for ConfigVariable {
10656 fn typename() -> &'static str {
10657 "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable"
10658 }
10659}
10660
10661pub mod config_variable {
10663 #[allow(unused_imports)]
10664 use super::*;
10665
10666 #[derive(Clone, Default, PartialEq)]
10668 #[non_exhaustive]
10669 pub struct MultiSelectValues {
10670 pub values: std::vec::Vec<crate::model::ConfigValueOption>,
10672
10673 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10674 }
10675
10676 impl MultiSelectValues {
10677 pub fn new() -> Self {
10678 std::default::Default::default()
10679 }
10680
10681 pub fn set_values<T, V>(mut self, v: T) -> Self
10683 where
10684 T: std::iter::IntoIterator<Item = V>,
10685 V: std::convert::Into<crate::model::ConfigValueOption>,
10686 {
10687 use std::iter::Iterator;
10688 self.values = v.into_iter().map(|i| i.into()).collect();
10689 self
10690 }
10691 }
10692
10693 impl wkt::message::Message for MultiSelectValues {
10694 fn typename() -> &'static str {
10695 "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable.MultiSelectValues"
10696 }
10697 }
10698
10699 #[derive(Clone, Default, PartialEq)]
10701 #[non_exhaustive]
10702 pub struct MultiStringValues {
10703 pub values: std::vec::Vec<std::string::String>,
10705
10706 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10707 }
10708
10709 impl MultiStringValues {
10710 pub fn new() -> Self {
10711 std::default::Default::default()
10712 }
10713
10714 pub fn set_values<T, V>(mut self, v: T) -> Self
10716 where
10717 T: std::iter::IntoIterator<Item = V>,
10718 V: std::convert::Into<std::string::String>,
10719 {
10720 use std::iter::Iterator;
10721 self.values = v.into_iter().map(|i| i.into()).collect();
10722 self
10723 }
10724 }
10725
10726 impl wkt::message::Message for MultiStringValues {
10727 fn typename() -> &'static str {
10728 "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable.MultiStringValues"
10729 }
10730 }
10731
10732 #[derive(Clone, Default, PartialEq)]
10734 #[non_exhaustive]
10735 pub struct MultiIntValues {
10736 pub values: std::vec::Vec<i32>,
10738
10739 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10740 }
10741
10742 impl MultiIntValues {
10743 pub fn new() -> Self {
10744 std::default::Default::default()
10745 }
10746
10747 pub fn set_values<T, V>(mut self, v: T) -> Self
10749 where
10750 T: std::iter::IntoIterator<Item = V>,
10751 V: std::convert::Into<i32>,
10752 {
10753 use std::iter::Iterator;
10754 self.values = v.into_iter().map(|i| i.into()).collect();
10755 self
10756 }
10757 }
10758
10759 impl wkt::message::Message for MultiIntValues {
10760 fn typename() -> &'static str {
10761 "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable.MultiIntValues"
10762 }
10763 }
10764
10765 #[derive(Clone, Debug, PartialEq)]
10767 #[non_exhaustive]
10768 pub enum Value {
10769 StringValue(std::string::String),
10772 IntValue(i64),
10775 BoolValue(bool),
10778 SecretValue(std::boxed::Box<crate::model::Secret>),
10781 EnumValue(std::boxed::Box<crate::model::ConfigValueOption>),
10784 MultiSelectValues(std::boxed::Box<crate::model::config_variable::MultiSelectValues>),
10787 MultiStringValues(std::boxed::Box<crate::model::config_variable::MultiStringValues>),
10790 MultiIntValues(std::boxed::Box<crate::model::config_variable::MultiIntValues>),
10793 }
10794}
10795
10796#[derive(Clone, Default, PartialEq)]
10798#[non_exhaustive]
10799pub struct GoogleServiceAccountConfig {
10800 pub service_account: std::string::String,
10805
10806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10807}
10808
10809impl GoogleServiceAccountConfig {
10810 pub fn new() -> Self {
10811 std::default::Default::default()
10812 }
10813
10814 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10816 self.service_account = v.into();
10817 self
10818 }
10819}
10820
10821impl wkt::message::Message for GoogleServiceAccountConfig {
10822 fn typename() -> &'static str {
10823 "type.googleapis.com/google.cloud.apihub.v1.GoogleServiceAccountConfig"
10824 }
10825}
10826
10827#[derive(Clone, Default, PartialEq)]
10829#[non_exhaustive]
10830pub struct AuthConfig {
10831 pub auth_type: crate::model::AuthType,
10833
10834 pub config: std::option::Option<crate::model::auth_config::Config>,
10836
10837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10838}
10839
10840impl AuthConfig {
10841 pub fn new() -> Self {
10842 std::default::Default::default()
10843 }
10844
10845 pub fn set_auth_type<T: std::convert::Into<crate::model::AuthType>>(mut self, v: T) -> Self {
10847 self.auth_type = v.into();
10848 self
10849 }
10850
10851 pub fn set_config<
10856 T: std::convert::Into<std::option::Option<crate::model::auth_config::Config>>,
10857 >(
10858 mut self,
10859 v: T,
10860 ) -> Self {
10861 self.config = v.into();
10862 self
10863 }
10864
10865 pub fn google_service_account_config(
10869 &self,
10870 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleServiceAccountConfig>> {
10871 #[allow(unreachable_patterns)]
10872 self.config.as_ref().and_then(|v| match v {
10873 crate::model::auth_config::Config::GoogleServiceAccountConfig(v) => {
10874 std::option::Option::Some(v)
10875 }
10876 _ => std::option::Option::None,
10877 })
10878 }
10879
10880 pub fn set_google_service_account_config<
10886 T: std::convert::Into<std::boxed::Box<crate::model::GoogleServiceAccountConfig>>,
10887 >(
10888 mut self,
10889 v: T,
10890 ) -> Self {
10891 self.config = std::option::Option::Some(
10892 crate::model::auth_config::Config::GoogleServiceAccountConfig(v.into()),
10893 );
10894 self
10895 }
10896
10897 pub fn user_password_config(
10901 &self,
10902 ) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::UserPasswordConfig>> {
10903 #[allow(unreachable_patterns)]
10904 self.config.as_ref().and_then(|v| match v {
10905 crate::model::auth_config::Config::UserPasswordConfig(v) => {
10906 std::option::Option::Some(v)
10907 }
10908 _ => std::option::Option::None,
10909 })
10910 }
10911
10912 pub fn set_user_password_config<
10918 T: std::convert::Into<std::boxed::Box<crate::model::auth_config::UserPasswordConfig>>,
10919 >(
10920 mut self,
10921 v: T,
10922 ) -> Self {
10923 self.config = std::option::Option::Some(
10924 crate::model::auth_config::Config::UserPasswordConfig(v.into()),
10925 );
10926 self
10927 }
10928
10929 pub fn api_key_config(
10933 &self,
10934 ) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::ApiKeyConfig>> {
10935 #[allow(unreachable_patterns)]
10936 self.config.as_ref().and_then(|v| match v {
10937 crate::model::auth_config::Config::ApiKeyConfig(v) => std::option::Option::Some(v),
10938 _ => std::option::Option::None,
10939 })
10940 }
10941
10942 pub fn set_api_key_config<
10948 T: std::convert::Into<std::boxed::Box<crate::model::auth_config::ApiKeyConfig>>,
10949 >(
10950 mut self,
10951 v: T,
10952 ) -> Self {
10953 self.config =
10954 std::option::Option::Some(crate::model::auth_config::Config::ApiKeyConfig(v.into()));
10955 self
10956 }
10957
10958 pub fn oauth2_client_credentials_config(
10962 &self,
10963 ) -> std::option::Option<
10964 &std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentialsConfig>,
10965 > {
10966 #[allow(unreachable_patterns)]
10967 self.config.as_ref().and_then(|v| match v {
10968 crate::model::auth_config::Config::Oauth2ClientCredentialsConfig(v) => {
10969 std::option::Option::Some(v)
10970 }
10971 _ => std::option::Option::None,
10972 })
10973 }
10974
10975 pub fn set_oauth2_client_credentials_config<
10981 T: std::convert::Into<
10982 std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentialsConfig>,
10983 >,
10984 >(
10985 mut self,
10986 v: T,
10987 ) -> Self {
10988 self.config = std::option::Option::Some(
10989 crate::model::auth_config::Config::Oauth2ClientCredentialsConfig(v.into()),
10990 );
10991 self
10992 }
10993}
10994
10995impl wkt::message::Message for AuthConfig {
10996 fn typename() -> &'static str {
10997 "type.googleapis.com/google.cloud.apihub.v1.AuthConfig"
10998 }
10999}
11000
11001pub mod auth_config {
11003 #[allow(unused_imports)]
11004 use super::*;
11005
11006 #[derive(Clone, Default, PartialEq)]
11008 #[non_exhaustive]
11009 pub struct UserPasswordConfig {
11010 pub username: std::string::String,
11012
11013 pub password: std::option::Option<crate::model::Secret>,
11017
11018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11019 }
11020
11021 impl UserPasswordConfig {
11022 pub fn new() -> Self {
11023 std::default::Default::default()
11024 }
11025
11026 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11028 self.username = v.into();
11029 self
11030 }
11031
11032 pub fn set_password<T>(mut self, v: T) -> Self
11034 where
11035 T: std::convert::Into<crate::model::Secret>,
11036 {
11037 self.password = std::option::Option::Some(v.into());
11038 self
11039 }
11040
11041 pub fn set_or_clear_password<T>(mut self, v: std::option::Option<T>) -> Self
11043 where
11044 T: std::convert::Into<crate::model::Secret>,
11045 {
11046 self.password = v.map(|x| x.into());
11047 self
11048 }
11049 }
11050
11051 impl wkt::message::Message for UserPasswordConfig {
11052 fn typename() -> &'static str {
11053 "type.googleapis.com/google.cloud.apihub.v1.AuthConfig.UserPasswordConfig"
11054 }
11055 }
11056
11057 #[derive(Clone, Default, PartialEq)]
11060 #[non_exhaustive]
11061 pub struct Oauth2ClientCredentialsConfig {
11062 pub client_id: std::string::String,
11064
11065 pub client_secret: std::option::Option<crate::model::Secret>,
11069
11070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11071 }
11072
11073 impl Oauth2ClientCredentialsConfig {
11074 pub fn new() -> Self {
11075 std::default::Default::default()
11076 }
11077
11078 pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11080 self.client_id = v.into();
11081 self
11082 }
11083
11084 pub fn set_client_secret<T>(mut self, v: T) -> Self
11086 where
11087 T: std::convert::Into<crate::model::Secret>,
11088 {
11089 self.client_secret = std::option::Option::Some(v.into());
11090 self
11091 }
11092
11093 pub fn set_or_clear_client_secret<T>(mut self, v: std::option::Option<T>) -> Self
11095 where
11096 T: std::convert::Into<crate::model::Secret>,
11097 {
11098 self.client_secret = v.map(|x| x.into());
11099 self
11100 }
11101 }
11102
11103 impl wkt::message::Message for Oauth2ClientCredentialsConfig {
11104 fn typename() -> &'static str {
11105 "type.googleapis.com/google.cloud.apihub.v1.AuthConfig.Oauth2ClientCredentialsConfig"
11106 }
11107 }
11108
11109 #[derive(Clone, Default, PartialEq)]
11111 #[non_exhaustive]
11112 pub struct ApiKeyConfig {
11113 pub name: std::string::String,
11117
11118 pub api_key: std::option::Option<crate::model::Secret>,
11124
11125 pub http_element_location: crate::model::auth_config::api_key_config::HttpElementLocation,
11128
11129 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11130 }
11131
11132 impl ApiKeyConfig {
11133 pub fn new() -> Self {
11134 std::default::Default::default()
11135 }
11136
11137 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11139 self.name = v.into();
11140 self
11141 }
11142
11143 pub fn set_api_key<T>(mut self, v: T) -> Self
11145 where
11146 T: std::convert::Into<crate::model::Secret>,
11147 {
11148 self.api_key = std::option::Option::Some(v.into());
11149 self
11150 }
11151
11152 pub fn set_or_clear_api_key<T>(mut self, v: std::option::Option<T>) -> Self
11154 where
11155 T: std::convert::Into<crate::model::Secret>,
11156 {
11157 self.api_key = v.map(|x| x.into());
11158 self
11159 }
11160
11161 pub fn set_http_element_location<
11163 T: std::convert::Into<crate::model::auth_config::api_key_config::HttpElementLocation>,
11164 >(
11165 mut self,
11166 v: T,
11167 ) -> Self {
11168 self.http_element_location = v.into();
11169 self
11170 }
11171 }
11172
11173 impl wkt::message::Message for ApiKeyConfig {
11174 fn typename() -> &'static str {
11175 "type.googleapis.com/google.cloud.apihub.v1.AuthConfig.ApiKeyConfig"
11176 }
11177 }
11178
11179 pub mod api_key_config {
11181 #[allow(unused_imports)]
11182 use super::*;
11183
11184 #[derive(Clone, Debug, PartialEq)]
11200 #[non_exhaustive]
11201 pub enum HttpElementLocation {
11202 Unspecified,
11204 Query,
11206 Header,
11208 Path,
11210 Body,
11212 Cookie,
11214 UnknownValue(http_element_location::UnknownValue),
11219 }
11220
11221 #[doc(hidden)]
11222 pub mod http_element_location {
11223 #[allow(unused_imports)]
11224 use super::*;
11225 #[derive(Clone, Debug, PartialEq)]
11226 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11227 }
11228
11229 impl HttpElementLocation {
11230 pub fn value(&self) -> std::option::Option<i32> {
11235 match self {
11236 Self::Unspecified => std::option::Option::Some(0),
11237 Self::Query => std::option::Option::Some(1),
11238 Self::Header => std::option::Option::Some(2),
11239 Self::Path => std::option::Option::Some(3),
11240 Self::Body => std::option::Option::Some(4),
11241 Self::Cookie => std::option::Option::Some(5),
11242 Self::UnknownValue(u) => u.0.value(),
11243 }
11244 }
11245
11246 pub fn name(&self) -> std::option::Option<&str> {
11251 match self {
11252 Self::Unspecified => {
11253 std::option::Option::Some("HTTP_ELEMENT_LOCATION_UNSPECIFIED")
11254 }
11255 Self::Query => std::option::Option::Some("QUERY"),
11256 Self::Header => std::option::Option::Some("HEADER"),
11257 Self::Path => std::option::Option::Some("PATH"),
11258 Self::Body => std::option::Option::Some("BODY"),
11259 Self::Cookie => std::option::Option::Some("COOKIE"),
11260 Self::UnknownValue(u) => u.0.name(),
11261 }
11262 }
11263 }
11264
11265 impl std::default::Default for HttpElementLocation {
11266 fn default() -> Self {
11267 use std::convert::From;
11268 Self::from(0)
11269 }
11270 }
11271
11272 impl std::fmt::Display for HttpElementLocation {
11273 fn fmt(
11274 &self,
11275 f: &mut std::fmt::Formatter<'_>,
11276 ) -> std::result::Result<(), std::fmt::Error> {
11277 wkt::internal::display_enum(f, self.name(), self.value())
11278 }
11279 }
11280
11281 impl std::convert::From<i32> for HttpElementLocation {
11282 fn from(value: i32) -> Self {
11283 match value {
11284 0 => Self::Unspecified,
11285 1 => Self::Query,
11286 2 => Self::Header,
11287 3 => Self::Path,
11288 4 => Self::Body,
11289 5 => Self::Cookie,
11290 _ => Self::UnknownValue(http_element_location::UnknownValue(
11291 wkt::internal::UnknownEnumValue::Integer(value),
11292 )),
11293 }
11294 }
11295 }
11296
11297 impl std::convert::From<&str> for HttpElementLocation {
11298 fn from(value: &str) -> Self {
11299 use std::string::ToString;
11300 match value {
11301 "HTTP_ELEMENT_LOCATION_UNSPECIFIED" => Self::Unspecified,
11302 "QUERY" => Self::Query,
11303 "HEADER" => Self::Header,
11304 "PATH" => Self::Path,
11305 "BODY" => Self::Body,
11306 "COOKIE" => Self::Cookie,
11307 _ => Self::UnknownValue(http_element_location::UnknownValue(
11308 wkt::internal::UnknownEnumValue::String(value.to_string()),
11309 )),
11310 }
11311 }
11312 }
11313
11314 impl serde::ser::Serialize for HttpElementLocation {
11315 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11316 where
11317 S: serde::Serializer,
11318 {
11319 match self {
11320 Self::Unspecified => serializer.serialize_i32(0),
11321 Self::Query => serializer.serialize_i32(1),
11322 Self::Header => serializer.serialize_i32(2),
11323 Self::Path => serializer.serialize_i32(3),
11324 Self::Body => serializer.serialize_i32(4),
11325 Self::Cookie => serializer.serialize_i32(5),
11326 Self::UnknownValue(u) => u.0.serialize(serializer),
11327 }
11328 }
11329 }
11330
11331 impl<'de> serde::de::Deserialize<'de> for HttpElementLocation {
11332 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11333 where
11334 D: serde::Deserializer<'de>,
11335 {
11336 deserializer.deserialize_any(
11337 wkt::internal::EnumVisitor::<HttpElementLocation>::new(
11338 ".google.cloud.apihub.v1.AuthConfig.ApiKeyConfig.HttpElementLocation",
11339 ),
11340 )
11341 }
11342 }
11343 }
11344
11345 #[derive(Clone, Debug, PartialEq)]
11347 #[non_exhaustive]
11348 pub enum Config {
11349 GoogleServiceAccountConfig(std::boxed::Box<crate::model::GoogleServiceAccountConfig>),
11351 UserPasswordConfig(std::boxed::Box<crate::model::auth_config::UserPasswordConfig>),
11353 ApiKeyConfig(std::boxed::Box<crate::model::auth_config::ApiKeyConfig>),
11355 Oauth2ClientCredentialsConfig(
11357 std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentialsConfig>,
11358 ),
11359 }
11360}
11361
11362#[derive(Clone, Default, PartialEq)]
11364#[non_exhaustive]
11365pub struct SourceMetadata {
11366 pub source_type: crate::model::source_metadata::SourceType,
11368
11369 pub original_resource_id: std::string::String,
11371
11372 pub original_resource_create_time: std::option::Option<wkt::Timestamp>,
11374
11375 pub original_resource_update_time: std::option::Option<wkt::Timestamp>,
11377
11378 pub source: std::option::Option<crate::model::source_metadata::Source>,
11380
11381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11382}
11383
11384impl SourceMetadata {
11385 pub fn new() -> Self {
11386 std::default::Default::default()
11387 }
11388
11389 pub fn set_source_type<T: std::convert::Into<crate::model::source_metadata::SourceType>>(
11391 mut self,
11392 v: T,
11393 ) -> Self {
11394 self.source_type = v.into();
11395 self
11396 }
11397
11398 pub fn set_original_resource_id<T: std::convert::Into<std::string::String>>(
11400 mut self,
11401 v: T,
11402 ) -> Self {
11403 self.original_resource_id = v.into();
11404 self
11405 }
11406
11407 pub fn set_original_resource_create_time<T>(mut self, v: T) -> Self
11409 where
11410 T: std::convert::Into<wkt::Timestamp>,
11411 {
11412 self.original_resource_create_time = std::option::Option::Some(v.into());
11413 self
11414 }
11415
11416 pub fn set_or_clear_original_resource_create_time<T>(
11418 mut self,
11419 v: std::option::Option<T>,
11420 ) -> Self
11421 where
11422 T: std::convert::Into<wkt::Timestamp>,
11423 {
11424 self.original_resource_create_time = v.map(|x| x.into());
11425 self
11426 }
11427
11428 pub fn set_original_resource_update_time<T>(mut self, v: T) -> Self
11430 where
11431 T: std::convert::Into<wkt::Timestamp>,
11432 {
11433 self.original_resource_update_time = std::option::Option::Some(v.into());
11434 self
11435 }
11436
11437 pub fn set_or_clear_original_resource_update_time<T>(
11439 mut self,
11440 v: std::option::Option<T>,
11441 ) -> Self
11442 where
11443 T: std::convert::Into<wkt::Timestamp>,
11444 {
11445 self.original_resource_update_time = v.map(|x| x.into());
11446 self
11447 }
11448
11449 pub fn set_source<
11454 T: std::convert::Into<std::option::Option<crate::model::source_metadata::Source>>,
11455 >(
11456 mut self,
11457 v: T,
11458 ) -> Self {
11459 self.source = v.into();
11460 self
11461 }
11462
11463 pub fn plugin_instance_action_source(
11467 &self,
11468 ) -> std::option::Option<
11469 &std::boxed::Box<crate::model::source_metadata::PluginInstanceActionSource>,
11470 > {
11471 #[allow(unreachable_patterns)]
11472 self.source.as_ref().and_then(|v| match v {
11473 crate::model::source_metadata::Source::PluginInstanceActionSource(v) => {
11474 std::option::Option::Some(v)
11475 }
11476 _ => std::option::Option::None,
11477 })
11478 }
11479
11480 pub fn set_plugin_instance_action_source<
11486 T: std::convert::Into<
11487 std::boxed::Box<crate::model::source_metadata::PluginInstanceActionSource>,
11488 >,
11489 >(
11490 mut self,
11491 v: T,
11492 ) -> Self {
11493 self.source = std::option::Option::Some(
11494 crate::model::source_metadata::Source::PluginInstanceActionSource(v.into()),
11495 );
11496 self
11497 }
11498}
11499
11500impl wkt::message::Message for SourceMetadata {
11501 fn typename() -> &'static str {
11502 "type.googleapis.com/google.cloud.apihub.v1.SourceMetadata"
11503 }
11504}
11505
11506pub mod source_metadata {
11508 #[allow(unused_imports)]
11509 use super::*;
11510
11511 #[derive(Clone, Default, PartialEq)]
11513 #[non_exhaustive]
11514 pub struct PluginInstanceActionSource {
11515 pub plugin_instance: std::string::String,
11519
11520 pub action_id: std::string::String,
11522
11523 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11524 }
11525
11526 impl PluginInstanceActionSource {
11527 pub fn new() -> Self {
11528 std::default::Default::default()
11529 }
11530
11531 pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(
11533 mut self,
11534 v: T,
11535 ) -> Self {
11536 self.plugin_instance = v.into();
11537 self
11538 }
11539
11540 pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11542 self.action_id = v.into();
11543 self
11544 }
11545 }
11546
11547 impl wkt::message::Message for PluginInstanceActionSource {
11548 fn typename() -> &'static str {
11549 "type.googleapis.com/google.cloud.apihub.v1.SourceMetadata.PluginInstanceActionSource"
11550 }
11551 }
11552
11553 #[derive(Clone, Debug, PartialEq)]
11569 #[non_exhaustive]
11570 pub enum SourceType {
11571 Unspecified,
11573 Plugin,
11575 UnknownValue(source_type::UnknownValue),
11580 }
11581
11582 #[doc(hidden)]
11583 pub mod source_type {
11584 #[allow(unused_imports)]
11585 use super::*;
11586 #[derive(Clone, Debug, PartialEq)]
11587 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11588 }
11589
11590 impl SourceType {
11591 pub fn value(&self) -> std::option::Option<i32> {
11596 match self {
11597 Self::Unspecified => std::option::Option::Some(0),
11598 Self::Plugin => std::option::Option::Some(1),
11599 Self::UnknownValue(u) => u.0.value(),
11600 }
11601 }
11602
11603 pub fn name(&self) -> std::option::Option<&str> {
11608 match self {
11609 Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
11610 Self::Plugin => std::option::Option::Some("PLUGIN"),
11611 Self::UnknownValue(u) => u.0.name(),
11612 }
11613 }
11614 }
11615
11616 impl std::default::Default for SourceType {
11617 fn default() -> Self {
11618 use std::convert::From;
11619 Self::from(0)
11620 }
11621 }
11622
11623 impl std::fmt::Display for SourceType {
11624 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11625 wkt::internal::display_enum(f, self.name(), self.value())
11626 }
11627 }
11628
11629 impl std::convert::From<i32> for SourceType {
11630 fn from(value: i32) -> Self {
11631 match value {
11632 0 => Self::Unspecified,
11633 1 => Self::Plugin,
11634 _ => Self::UnknownValue(source_type::UnknownValue(
11635 wkt::internal::UnknownEnumValue::Integer(value),
11636 )),
11637 }
11638 }
11639 }
11640
11641 impl std::convert::From<&str> for SourceType {
11642 fn from(value: &str) -> Self {
11643 use std::string::ToString;
11644 match value {
11645 "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
11646 "PLUGIN" => Self::Plugin,
11647 _ => Self::UnknownValue(source_type::UnknownValue(
11648 wkt::internal::UnknownEnumValue::String(value.to_string()),
11649 )),
11650 }
11651 }
11652 }
11653
11654 impl serde::ser::Serialize for SourceType {
11655 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11656 where
11657 S: serde::Serializer,
11658 {
11659 match self {
11660 Self::Unspecified => serializer.serialize_i32(0),
11661 Self::Plugin => serializer.serialize_i32(1),
11662 Self::UnknownValue(u) => u.0.serialize(serializer),
11663 }
11664 }
11665 }
11666
11667 impl<'de> serde::de::Deserialize<'de> for SourceType {
11668 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11669 where
11670 D: serde::Deserializer<'de>,
11671 {
11672 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
11673 ".google.cloud.apihub.v1.SourceMetadata.SourceType",
11674 ))
11675 }
11676 }
11677
11678 #[derive(Clone, Debug, PartialEq)]
11680 #[non_exhaustive]
11681 pub enum Source {
11682 PluginInstanceActionSource(
11684 std::boxed::Box<crate::model::source_metadata::PluginInstanceActionSource>,
11685 ),
11686 }
11687}
11688
11689#[derive(Clone, Default, PartialEq)]
11691#[non_exhaustive]
11692pub struct DiscoveredApiObservation {
11693 pub name: std::string::String,
11698
11699 pub style: crate::model::discovered_api_observation::Style,
11701
11702 pub server_ips: std::vec::Vec<std::string::String>,
11706
11707 pub hostname: std::string::String,
11709
11710 pub last_event_detected_time: std::option::Option<wkt::Timestamp>,
11712
11713 pub source_locations: std::vec::Vec<std::string::String>,
11715
11716 pub api_operation_count: i64,
11718
11719 pub origin: std::string::String,
11722
11723 pub source_types: std::vec::Vec<crate::model::discovered_api_observation::SourceType>,
11725
11726 pub known_operations_count: i64,
11728
11729 pub unknown_operations_count: i64,
11731
11732 pub create_time: std::option::Option<wkt::Timestamp>,
11734
11735 pub update_time: std::option::Option<wkt::Timestamp>,
11737
11738 pub source_metadata: std::option::Option<crate::model::SourceMetadata>,
11741
11742 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11743}
11744
11745impl DiscoveredApiObservation {
11746 pub fn new() -> Self {
11747 std::default::Default::default()
11748 }
11749
11750 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11752 self.name = v.into();
11753 self
11754 }
11755
11756 pub fn set_style<T: std::convert::Into<crate::model::discovered_api_observation::Style>>(
11758 mut self,
11759 v: T,
11760 ) -> Self {
11761 self.style = v.into();
11762 self
11763 }
11764
11765 pub fn set_server_ips<T, V>(mut self, v: T) -> Self
11767 where
11768 T: std::iter::IntoIterator<Item = V>,
11769 V: std::convert::Into<std::string::String>,
11770 {
11771 use std::iter::Iterator;
11772 self.server_ips = v.into_iter().map(|i| i.into()).collect();
11773 self
11774 }
11775
11776 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11778 self.hostname = v.into();
11779 self
11780 }
11781
11782 pub fn set_last_event_detected_time<T>(mut self, v: T) -> Self
11784 where
11785 T: std::convert::Into<wkt::Timestamp>,
11786 {
11787 self.last_event_detected_time = std::option::Option::Some(v.into());
11788 self
11789 }
11790
11791 pub fn set_or_clear_last_event_detected_time<T>(mut self, v: std::option::Option<T>) -> Self
11793 where
11794 T: std::convert::Into<wkt::Timestamp>,
11795 {
11796 self.last_event_detected_time = v.map(|x| x.into());
11797 self
11798 }
11799
11800 pub fn set_source_locations<T, V>(mut self, v: T) -> Self
11802 where
11803 T: std::iter::IntoIterator<Item = V>,
11804 V: std::convert::Into<std::string::String>,
11805 {
11806 use std::iter::Iterator;
11807 self.source_locations = v.into_iter().map(|i| i.into()).collect();
11808 self
11809 }
11810
11811 pub fn set_api_operation_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11813 self.api_operation_count = v.into();
11814 self
11815 }
11816
11817 pub fn set_origin<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11819 self.origin = v.into();
11820 self
11821 }
11822
11823 pub fn set_source_types<T, V>(mut self, v: T) -> Self
11825 where
11826 T: std::iter::IntoIterator<Item = V>,
11827 V: std::convert::Into<crate::model::discovered_api_observation::SourceType>,
11828 {
11829 use std::iter::Iterator;
11830 self.source_types = v.into_iter().map(|i| i.into()).collect();
11831 self
11832 }
11833
11834 pub fn set_known_operations_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11836 self.known_operations_count = v.into();
11837 self
11838 }
11839
11840 pub fn set_unknown_operations_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11842 self.unknown_operations_count = v.into();
11843 self
11844 }
11845
11846 pub fn set_create_time<T>(mut self, v: T) -> Self
11848 where
11849 T: std::convert::Into<wkt::Timestamp>,
11850 {
11851 self.create_time = std::option::Option::Some(v.into());
11852 self
11853 }
11854
11855 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11857 where
11858 T: std::convert::Into<wkt::Timestamp>,
11859 {
11860 self.create_time = v.map(|x| x.into());
11861 self
11862 }
11863
11864 pub fn set_update_time<T>(mut self, v: T) -> Self
11866 where
11867 T: std::convert::Into<wkt::Timestamp>,
11868 {
11869 self.update_time = std::option::Option::Some(v.into());
11870 self
11871 }
11872
11873 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11875 where
11876 T: std::convert::Into<wkt::Timestamp>,
11877 {
11878 self.update_time = v.map(|x| x.into());
11879 self
11880 }
11881
11882 pub fn set_source_metadata<T>(mut self, v: T) -> Self
11884 where
11885 T: std::convert::Into<crate::model::SourceMetadata>,
11886 {
11887 self.source_metadata = std::option::Option::Some(v.into());
11888 self
11889 }
11890
11891 pub fn set_or_clear_source_metadata<T>(mut self, v: std::option::Option<T>) -> Self
11893 where
11894 T: std::convert::Into<crate::model::SourceMetadata>,
11895 {
11896 self.source_metadata = v.map(|x| x.into());
11897 self
11898 }
11899}
11900
11901impl wkt::message::Message for DiscoveredApiObservation {
11902 fn typename() -> &'static str {
11903 "type.googleapis.com/google.cloud.apihub.v1.DiscoveredApiObservation"
11904 }
11905}
11906
11907pub mod discovered_api_observation {
11909 #[allow(unused_imports)]
11910 use super::*;
11911
11912 #[derive(Clone, Debug, PartialEq)]
11928 #[non_exhaustive]
11929 pub enum Style {
11930 Unspecified,
11932 Rest,
11934 Grpc,
11936 Graphql,
11938 UnknownValue(style::UnknownValue),
11943 }
11944
11945 #[doc(hidden)]
11946 pub mod style {
11947 #[allow(unused_imports)]
11948 use super::*;
11949 #[derive(Clone, Debug, PartialEq)]
11950 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11951 }
11952
11953 impl Style {
11954 pub fn value(&self) -> std::option::Option<i32> {
11959 match self {
11960 Self::Unspecified => std::option::Option::Some(0),
11961 Self::Rest => std::option::Option::Some(1),
11962 Self::Grpc => std::option::Option::Some(2),
11963 Self::Graphql => std::option::Option::Some(3),
11964 Self::UnknownValue(u) => u.0.value(),
11965 }
11966 }
11967
11968 pub fn name(&self) -> std::option::Option<&str> {
11973 match self {
11974 Self::Unspecified => std::option::Option::Some("STYLE_UNSPECIFIED"),
11975 Self::Rest => std::option::Option::Some("REST"),
11976 Self::Grpc => std::option::Option::Some("GRPC"),
11977 Self::Graphql => std::option::Option::Some("GRAPHQL"),
11978 Self::UnknownValue(u) => u.0.name(),
11979 }
11980 }
11981 }
11982
11983 impl std::default::Default for Style {
11984 fn default() -> Self {
11985 use std::convert::From;
11986 Self::from(0)
11987 }
11988 }
11989
11990 impl std::fmt::Display for Style {
11991 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11992 wkt::internal::display_enum(f, self.name(), self.value())
11993 }
11994 }
11995
11996 impl std::convert::From<i32> for Style {
11997 fn from(value: i32) -> Self {
11998 match value {
11999 0 => Self::Unspecified,
12000 1 => Self::Rest,
12001 2 => Self::Grpc,
12002 3 => Self::Graphql,
12003 _ => Self::UnknownValue(style::UnknownValue(
12004 wkt::internal::UnknownEnumValue::Integer(value),
12005 )),
12006 }
12007 }
12008 }
12009
12010 impl std::convert::From<&str> for Style {
12011 fn from(value: &str) -> Self {
12012 use std::string::ToString;
12013 match value {
12014 "STYLE_UNSPECIFIED" => Self::Unspecified,
12015 "REST" => Self::Rest,
12016 "GRPC" => Self::Grpc,
12017 "GRAPHQL" => Self::Graphql,
12018 _ => Self::UnknownValue(style::UnknownValue(
12019 wkt::internal::UnknownEnumValue::String(value.to_string()),
12020 )),
12021 }
12022 }
12023 }
12024
12025 impl serde::ser::Serialize for Style {
12026 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12027 where
12028 S: serde::Serializer,
12029 {
12030 match self {
12031 Self::Unspecified => serializer.serialize_i32(0),
12032 Self::Rest => serializer.serialize_i32(1),
12033 Self::Grpc => serializer.serialize_i32(2),
12034 Self::Graphql => serializer.serialize_i32(3),
12035 Self::UnknownValue(u) => u.0.serialize(serializer),
12036 }
12037 }
12038 }
12039
12040 impl<'de> serde::de::Deserialize<'de> for Style {
12041 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12042 where
12043 D: serde::Deserializer<'de>,
12044 {
12045 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Style>::new(
12046 ".google.cloud.apihub.v1.DiscoveredApiObservation.Style",
12047 ))
12048 }
12049 }
12050
12051 #[derive(Clone, Debug, PartialEq)]
12067 #[non_exhaustive]
12068 pub enum SourceType {
12069 Unspecified,
12071 GcpXlb,
12073 GcpIlb,
12075 UnknownValue(source_type::UnknownValue),
12080 }
12081
12082 #[doc(hidden)]
12083 pub mod source_type {
12084 #[allow(unused_imports)]
12085 use super::*;
12086 #[derive(Clone, Debug, PartialEq)]
12087 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12088 }
12089
12090 impl SourceType {
12091 pub fn value(&self) -> std::option::Option<i32> {
12096 match self {
12097 Self::Unspecified => std::option::Option::Some(0),
12098 Self::GcpXlb => std::option::Option::Some(1),
12099 Self::GcpIlb => std::option::Option::Some(2),
12100 Self::UnknownValue(u) => u.0.value(),
12101 }
12102 }
12103
12104 pub fn name(&self) -> std::option::Option<&str> {
12109 match self {
12110 Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
12111 Self::GcpXlb => std::option::Option::Some("GCP_XLB"),
12112 Self::GcpIlb => std::option::Option::Some("GCP_ILB"),
12113 Self::UnknownValue(u) => u.0.name(),
12114 }
12115 }
12116 }
12117
12118 impl std::default::Default for SourceType {
12119 fn default() -> Self {
12120 use std::convert::From;
12121 Self::from(0)
12122 }
12123 }
12124
12125 impl std::fmt::Display for SourceType {
12126 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12127 wkt::internal::display_enum(f, self.name(), self.value())
12128 }
12129 }
12130
12131 impl std::convert::From<i32> for SourceType {
12132 fn from(value: i32) -> Self {
12133 match value {
12134 0 => Self::Unspecified,
12135 1 => Self::GcpXlb,
12136 2 => Self::GcpIlb,
12137 _ => Self::UnknownValue(source_type::UnknownValue(
12138 wkt::internal::UnknownEnumValue::Integer(value),
12139 )),
12140 }
12141 }
12142 }
12143
12144 impl std::convert::From<&str> for SourceType {
12145 fn from(value: &str) -> Self {
12146 use std::string::ToString;
12147 match value {
12148 "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
12149 "GCP_XLB" => Self::GcpXlb,
12150 "GCP_ILB" => Self::GcpIlb,
12151 _ => Self::UnknownValue(source_type::UnknownValue(
12152 wkt::internal::UnknownEnumValue::String(value.to_string()),
12153 )),
12154 }
12155 }
12156 }
12157
12158 impl serde::ser::Serialize for SourceType {
12159 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12160 where
12161 S: serde::Serializer,
12162 {
12163 match self {
12164 Self::Unspecified => serializer.serialize_i32(0),
12165 Self::GcpXlb => serializer.serialize_i32(1),
12166 Self::GcpIlb => serializer.serialize_i32(2),
12167 Self::UnknownValue(u) => u.0.serialize(serializer),
12168 }
12169 }
12170 }
12171
12172 impl<'de> serde::de::Deserialize<'de> for SourceType {
12173 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12174 where
12175 D: serde::Deserializer<'de>,
12176 {
12177 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
12178 ".google.cloud.apihub.v1.DiscoveredApiObservation.SourceType",
12179 ))
12180 }
12181 }
12182}
12183
12184#[derive(Clone, Default, PartialEq)]
12187#[non_exhaustive]
12188pub struct DiscoveredApiOperation {
12189 pub name: std::string::String,
12194
12195 pub first_seen_time: std::option::Option<wkt::Timestamp>,
12197
12198 pub last_seen_time: std::option::Option<wkt::Timestamp>,
12200
12201 pub count: i64,
12203
12204 pub classification: crate::model::discovered_api_operation::Classification,
12206
12207 pub match_results: std::vec::Vec<crate::model::discovered_api_operation::MatchResult>,
12212
12213 pub source_metadata: std::option::Option<crate::model::SourceMetadata>,
12216
12217 pub create_time: std::option::Option<wkt::Timestamp>,
12219
12220 pub update_time: std::option::Option<wkt::Timestamp>,
12222
12223 pub operation: std::option::Option<crate::model::discovered_api_operation::Operation>,
12225
12226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12227}
12228
12229impl DiscoveredApiOperation {
12230 pub fn new() -> Self {
12231 std::default::Default::default()
12232 }
12233
12234 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12236 self.name = v.into();
12237 self
12238 }
12239
12240 pub fn set_first_seen_time<T>(mut self, v: T) -> Self
12242 where
12243 T: std::convert::Into<wkt::Timestamp>,
12244 {
12245 self.first_seen_time = std::option::Option::Some(v.into());
12246 self
12247 }
12248
12249 pub fn set_or_clear_first_seen_time<T>(mut self, v: std::option::Option<T>) -> Self
12251 where
12252 T: std::convert::Into<wkt::Timestamp>,
12253 {
12254 self.first_seen_time = v.map(|x| x.into());
12255 self
12256 }
12257
12258 pub fn set_last_seen_time<T>(mut self, v: T) -> Self
12260 where
12261 T: std::convert::Into<wkt::Timestamp>,
12262 {
12263 self.last_seen_time = std::option::Option::Some(v.into());
12264 self
12265 }
12266
12267 pub fn set_or_clear_last_seen_time<T>(mut self, v: std::option::Option<T>) -> Self
12269 where
12270 T: std::convert::Into<wkt::Timestamp>,
12271 {
12272 self.last_seen_time = v.map(|x| x.into());
12273 self
12274 }
12275
12276 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12278 self.count = v.into();
12279 self
12280 }
12281
12282 pub fn set_classification<
12284 T: std::convert::Into<crate::model::discovered_api_operation::Classification>,
12285 >(
12286 mut self,
12287 v: T,
12288 ) -> Self {
12289 self.classification = v.into();
12290 self
12291 }
12292
12293 pub fn set_match_results<T, V>(mut self, v: T) -> Self
12295 where
12296 T: std::iter::IntoIterator<Item = V>,
12297 V: std::convert::Into<crate::model::discovered_api_operation::MatchResult>,
12298 {
12299 use std::iter::Iterator;
12300 self.match_results = v.into_iter().map(|i| i.into()).collect();
12301 self
12302 }
12303
12304 pub fn set_source_metadata<T>(mut self, v: T) -> Self
12306 where
12307 T: std::convert::Into<crate::model::SourceMetadata>,
12308 {
12309 self.source_metadata = std::option::Option::Some(v.into());
12310 self
12311 }
12312
12313 pub fn set_or_clear_source_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12315 where
12316 T: std::convert::Into<crate::model::SourceMetadata>,
12317 {
12318 self.source_metadata = v.map(|x| x.into());
12319 self
12320 }
12321
12322 pub fn set_create_time<T>(mut self, v: T) -> Self
12324 where
12325 T: std::convert::Into<wkt::Timestamp>,
12326 {
12327 self.create_time = std::option::Option::Some(v.into());
12328 self
12329 }
12330
12331 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12333 where
12334 T: std::convert::Into<wkt::Timestamp>,
12335 {
12336 self.create_time = v.map(|x| x.into());
12337 self
12338 }
12339
12340 pub fn set_update_time<T>(mut self, v: T) -> Self
12342 where
12343 T: std::convert::Into<wkt::Timestamp>,
12344 {
12345 self.update_time = std::option::Option::Some(v.into());
12346 self
12347 }
12348
12349 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12351 where
12352 T: std::convert::Into<wkt::Timestamp>,
12353 {
12354 self.update_time = v.map(|x| x.into());
12355 self
12356 }
12357
12358 pub fn set_operation<
12363 T: std::convert::Into<std::option::Option<crate::model::discovered_api_operation::Operation>>,
12364 >(
12365 mut self,
12366 v: T,
12367 ) -> Self {
12368 self.operation = v.into();
12369 self
12370 }
12371
12372 pub fn http_operation(
12376 &self,
12377 ) -> std::option::Option<&std::boxed::Box<crate::model::HttpOperationDetails>> {
12378 #[allow(unreachable_patterns)]
12379 self.operation.as_ref().and_then(|v| match v {
12380 crate::model::discovered_api_operation::Operation::HttpOperation(v) => {
12381 std::option::Option::Some(v)
12382 }
12383 _ => std::option::Option::None,
12384 })
12385 }
12386
12387 pub fn set_http_operation<
12393 T: std::convert::Into<std::boxed::Box<crate::model::HttpOperationDetails>>,
12394 >(
12395 mut self,
12396 v: T,
12397 ) -> Self {
12398 self.operation = std::option::Option::Some(
12399 crate::model::discovered_api_operation::Operation::HttpOperation(v.into()),
12400 );
12401 self
12402 }
12403}
12404
12405impl wkt::message::Message for DiscoveredApiOperation {
12406 fn typename() -> &'static str {
12407 "type.googleapis.com/google.cloud.apihub.v1.DiscoveredApiOperation"
12408 }
12409}
12410
12411pub mod discovered_api_operation {
12413 #[allow(unused_imports)]
12414 use super::*;
12415
12416 #[derive(Clone, Default, PartialEq)]
12419 #[non_exhaustive]
12420 pub struct MatchResult {
12421 pub name: std::string::String,
12426
12427 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12428 }
12429
12430 impl MatchResult {
12431 pub fn new() -> Self {
12432 std::default::Default::default()
12433 }
12434
12435 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12437 self.name = v.into();
12438 self
12439 }
12440 }
12441
12442 impl wkt::message::Message for MatchResult {
12443 fn typename() -> &'static str {
12444 "type.googleapis.com/google.cloud.apihub.v1.DiscoveredApiOperation.MatchResult"
12445 }
12446 }
12447
12448 #[derive(Clone, Debug, PartialEq)]
12464 #[non_exhaustive]
12465 pub enum Classification {
12466 Unspecified,
12468 Known,
12470 Unknown,
12472 UnknownValue(classification::UnknownValue),
12477 }
12478
12479 #[doc(hidden)]
12480 pub mod classification {
12481 #[allow(unused_imports)]
12482 use super::*;
12483 #[derive(Clone, Debug, PartialEq)]
12484 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12485 }
12486
12487 impl Classification {
12488 pub fn value(&self) -> std::option::Option<i32> {
12493 match self {
12494 Self::Unspecified => std::option::Option::Some(0),
12495 Self::Known => std::option::Option::Some(1),
12496 Self::Unknown => std::option::Option::Some(2),
12497 Self::UnknownValue(u) => u.0.value(),
12498 }
12499 }
12500
12501 pub fn name(&self) -> std::option::Option<&str> {
12506 match self {
12507 Self::Unspecified => std::option::Option::Some("CLASSIFICATION_UNSPECIFIED"),
12508 Self::Known => std::option::Option::Some("KNOWN"),
12509 Self::Unknown => std::option::Option::Some("UNKNOWN"),
12510 Self::UnknownValue(u) => u.0.name(),
12511 }
12512 }
12513 }
12514
12515 impl std::default::Default for Classification {
12516 fn default() -> Self {
12517 use std::convert::From;
12518 Self::from(0)
12519 }
12520 }
12521
12522 impl std::fmt::Display for Classification {
12523 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12524 wkt::internal::display_enum(f, self.name(), self.value())
12525 }
12526 }
12527
12528 impl std::convert::From<i32> for Classification {
12529 fn from(value: i32) -> Self {
12530 match value {
12531 0 => Self::Unspecified,
12532 1 => Self::Known,
12533 2 => Self::Unknown,
12534 _ => Self::UnknownValue(classification::UnknownValue(
12535 wkt::internal::UnknownEnumValue::Integer(value),
12536 )),
12537 }
12538 }
12539 }
12540
12541 impl std::convert::From<&str> for Classification {
12542 fn from(value: &str) -> Self {
12543 use std::string::ToString;
12544 match value {
12545 "CLASSIFICATION_UNSPECIFIED" => Self::Unspecified,
12546 "KNOWN" => Self::Known,
12547 "UNKNOWN" => Self::Unknown,
12548 _ => Self::UnknownValue(classification::UnknownValue(
12549 wkt::internal::UnknownEnumValue::String(value.to_string()),
12550 )),
12551 }
12552 }
12553 }
12554
12555 impl serde::ser::Serialize for Classification {
12556 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12557 where
12558 S: serde::Serializer,
12559 {
12560 match self {
12561 Self::Unspecified => serializer.serialize_i32(0),
12562 Self::Known => serializer.serialize_i32(1),
12563 Self::Unknown => serializer.serialize_i32(2),
12564 Self::UnknownValue(u) => u.0.serialize(serializer),
12565 }
12566 }
12567 }
12568
12569 impl<'de> serde::de::Deserialize<'de> for Classification {
12570 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12571 where
12572 D: serde::Deserializer<'de>,
12573 {
12574 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Classification>::new(
12575 ".google.cloud.apihub.v1.DiscoveredApiOperation.Classification",
12576 ))
12577 }
12578 }
12579
12580 #[derive(Clone, Debug, PartialEq)]
12582 #[non_exhaustive]
12583 pub enum Operation {
12584 HttpOperation(std::boxed::Box<crate::model::HttpOperationDetails>),
12586 }
12587}
12588
12589#[derive(Clone, Default, PartialEq)]
12591#[non_exhaustive]
12592pub struct HttpOperationDetails {
12593 pub http_operation: std::option::Option<crate::model::HttpOperation>,
12595
12596 pub path_params: std::vec::Vec<crate::model::http_operation_details::PathParam>,
12598
12599 pub query_params: std::collections::HashMap<
12601 std::string::String,
12602 crate::model::http_operation_details::QueryParam,
12603 >,
12604
12605 pub request: std::option::Option<crate::model::http_operation_details::HttpRequest>,
12607
12608 pub response: std::option::Option<crate::model::http_operation_details::HttpResponse>,
12610
12611 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12612}
12613
12614impl HttpOperationDetails {
12615 pub fn new() -> Self {
12616 std::default::Default::default()
12617 }
12618
12619 pub fn set_http_operation<T>(mut self, v: T) -> Self
12621 where
12622 T: std::convert::Into<crate::model::HttpOperation>,
12623 {
12624 self.http_operation = std::option::Option::Some(v.into());
12625 self
12626 }
12627
12628 pub fn set_or_clear_http_operation<T>(mut self, v: std::option::Option<T>) -> Self
12630 where
12631 T: std::convert::Into<crate::model::HttpOperation>,
12632 {
12633 self.http_operation = v.map(|x| x.into());
12634 self
12635 }
12636
12637 pub fn set_path_params<T, V>(mut self, v: T) -> Self
12639 where
12640 T: std::iter::IntoIterator<Item = V>,
12641 V: std::convert::Into<crate::model::http_operation_details::PathParam>,
12642 {
12643 use std::iter::Iterator;
12644 self.path_params = v.into_iter().map(|i| i.into()).collect();
12645 self
12646 }
12647
12648 pub fn set_query_params<T, K, V>(mut self, v: T) -> Self
12650 where
12651 T: std::iter::IntoIterator<Item = (K, V)>,
12652 K: std::convert::Into<std::string::String>,
12653 V: std::convert::Into<crate::model::http_operation_details::QueryParam>,
12654 {
12655 use std::iter::Iterator;
12656 self.query_params = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12657 self
12658 }
12659
12660 pub fn set_request<T>(mut self, v: T) -> Self
12662 where
12663 T: std::convert::Into<crate::model::http_operation_details::HttpRequest>,
12664 {
12665 self.request = std::option::Option::Some(v.into());
12666 self
12667 }
12668
12669 pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
12671 where
12672 T: std::convert::Into<crate::model::http_operation_details::HttpRequest>,
12673 {
12674 self.request = v.map(|x| x.into());
12675 self
12676 }
12677
12678 pub fn set_response<T>(mut self, v: T) -> Self
12680 where
12681 T: std::convert::Into<crate::model::http_operation_details::HttpResponse>,
12682 {
12683 self.response = std::option::Option::Some(v.into());
12684 self
12685 }
12686
12687 pub fn set_or_clear_response<T>(mut self, v: std::option::Option<T>) -> Self
12689 where
12690 T: std::convert::Into<crate::model::http_operation_details::HttpResponse>,
12691 {
12692 self.response = v.map(|x| x.into());
12693 self
12694 }
12695}
12696
12697impl wkt::message::Message for HttpOperationDetails {
12698 fn typename() -> &'static str {
12699 "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails"
12700 }
12701}
12702
12703pub mod http_operation_details {
12705 #[allow(unused_imports)]
12706 use super::*;
12707
12708 #[derive(Clone, Default, PartialEq)]
12710 #[non_exhaustive]
12711 pub struct PathParam {
12712 pub position: i32,
12714
12715 pub data_type: crate::model::http_operation_details::DataType,
12717
12718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12719 }
12720
12721 impl PathParam {
12722 pub fn new() -> Self {
12723 std::default::Default::default()
12724 }
12725
12726 pub fn set_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12728 self.position = v.into();
12729 self
12730 }
12731
12732 pub fn set_data_type<
12734 T: std::convert::Into<crate::model::http_operation_details::DataType>,
12735 >(
12736 mut self,
12737 v: T,
12738 ) -> Self {
12739 self.data_type = v.into();
12740 self
12741 }
12742 }
12743
12744 impl wkt::message::Message for PathParam {
12745 fn typename() -> &'static str {
12746 "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.PathParam"
12747 }
12748 }
12749
12750 #[derive(Clone, Default, PartialEq)]
12752 #[non_exhaustive]
12753 pub struct QueryParam {
12754 pub name: std::string::String,
12756
12757 pub count: i64,
12760
12761 pub data_type: crate::model::http_operation_details::DataType,
12763
12764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12765 }
12766
12767 impl QueryParam {
12768 pub fn new() -> Self {
12769 std::default::Default::default()
12770 }
12771
12772 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12774 self.name = v.into();
12775 self
12776 }
12777
12778 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12780 self.count = v.into();
12781 self
12782 }
12783
12784 pub fn set_data_type<
12786 T: std::convert::Into<crate::model::http_operation_details::DataType>,
12787 >(
12788 mut self,
12789 v: T,
12790 ) -> Self {
12791 self.data_type = v.into();
12792 self
12793 }
12794 }
12795
12796 impl wkt::message::Message for QueryParam {
12797 fn typename() -> &'static str {
12798 "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.QueryParam"
12799 }
12800 }
12801
12802 #[derive(Clone, Default, PartialEq)]
12804 #[non_exhaustive]
12805 pub struct Header {
12806 pub name: std::string::String,
12808
12809 pub count: i64,
12811
12812 pub data_type: crate::model::http_operation_details::DataType,
12814
12815 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12816 }
12817
12818 impl Header {
12819 pub fn new() -> Self {
12820 std::default::Default::default()
12821 }
12822
12823 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12825 self.name = v.into();
12826 self
12827 }
12828
12829 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12831 self.count = v.into();
12832 self
12833 }
12834
12835 pub fn set_data_type<
12837 T: std::convert::Into<crate::model::http_operation_details::DataType>,
12838 >(
12839 mut self,
12840 v: T,
12841 ) -> Self {
12842 self.data_type = v.into();
12843 self
12844 }
12845 }
12846
12847 impl wkt::message::Message for Header {
12848 fn typename() -> &'static str {
12849 "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.Header"
12850 }
12851 }
12852
12853 #[derive(Clone, Default, PartialEq)]
12855 #[non_exhaustive]
12856 pub struct HttpRequest {
12857 pub headers: std::collections::HashMap<
12859 std::string::String,
12860 crate::model::http_operation_details::Header,
12861 >,
12862
12863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12864 }
12865
12866 impl HttpRequest {
12867 pub fn new() -> Self {
12868 std::default::Default::default()
12869 }
12870
12871 pub fn set_headers<T, K, V>(mut self, v: T) -> Self
12873 where
12874 T: std::iter::IntoIterator<Item = (K, V)>,
12875 K: std::convert::Into<std::string::String>,
12876 V: std::convert::Into<crate::model::http_operation_details::Header>,
12877 {
12878 use std::iter::Iterator;
12879 self.headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12880 self
12881 }
12882 }
12883
12884 impl wkt::message::Message for HttpRequest {
12885 fn typename() -> &'static str {
12886 "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.HttpRequest"
12887 }
12888 }
12889
12890 #[derive(Clone, Default, PartialEq)]
12892 #[non_exhaustive]
12893 pub struct HttpResponse {
12894 pub headers: std::collections::HashMap<
12896 std::string::String,
12897 crate::model::http_operation_details::Header,
12898 >,
12899
12900 pub response_codes: std::collections::HashMap<i32, i64>,
12902
12903 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12904 }
12905
12906 impl HttpResponse {
12907 pub fn new() -> Self {
12908 std::default::Default::default()
12909 }
12910
12911 pub fn set_headers<T, K, V>(mut self, v: T) -> Self
12913 where
12914 T: std::iter::IntoIterator<Item = (K, V)>,
12915 K: std::convert::Into<std::string::String>,
12916 V: std::convert::Into<crate::model::http_operation_details::Header>,
12917 {
12918 use std::iter::Iterator;
12919 self.headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12920 self
12921 }
12922
12923 pub fn set_response_codes<T, K, V>(mut self, v: T) -> Self
12925 where
12926 T: std::iter::IntoIterator<Item = (K, V)>,
12927 K: std::convert::Into<i32>,
12928 V: std::convert::Into<i64>,
12929 {
12930 use std::iter::Iterator;
12931 self.response_codes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12932 self
12933 }
12934 }
12935
12936 impl wkt::message::Message for HttpResponse {
12937 fn typename() -> &'static str {
12938 "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.HttpResponse"
12939 }
12940 }
12941
12942 #[derive(Clone, Debug, PartialEq)]
12958 #[non_exhaustive]
12959 pub enum DataType {
12960 Unspecified,
12962 Bool,
12964 Integer,
12966 Float,
12968 String,
12970 Uuid,
12972 UnknownValue(data_type::UnknownValue),
12977 }
12978
12979 #[doc(hidden)]
12980 pub mod data_type {
12981 #[allow(unused_imports)]
12982 use super::*;
12983 #[derive(Clone, Debug, PartialEq)]
12984 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12985 }
12986
12987 impl DataType {
12988 pub fn value(&self) -> std::option::Option<i32> {
12993 match self {
12994 Self::Unspecified => std::option::Option::Some(0),
12995 Self::Bool => std::option::Option::Some(1),
12996 Self::Integer => std::option::Option::Some(2),
12997 Self::Float => std::option::Option::Some(3),
12998 Self::String => std::option::Option::Some(4),
12999 Self::Uuid => std::option::Option::Some(5),
13000 Self::UnknownValue(u) => u.0.value(),
13001 }
13002 }
13003
13004 pub fn name(&self) -> std::option::Option<&str> {
13009 match self {
13010 Self::Unspecified => std::option::Option::Some("DATA_TYPE_UNSPECIFIED"),
13011 Self::Bool => std::option::Option::Some("BOOL"),
13012 Self::Integer => std::option::Option::Some("INTEGER"),
13013 Self::Float => std::option::Option::Some("FLOAT"),
13014 Self::String => std::option::Option::Some("STRING"),
13015 Self::Uuid => std::option::Option::Some("UUID"),
13016 Self::UnknownValue(u) => u.0.name(),
13017 }
13018 }
13019 }
13020
13021 impl std::default::Default for DataType {
13022 fn default() -> Self {
13023 use std::convert::From;
13024 Self::from(0)
13025 }
13026 }
13027
13028 impl std::fmt::Display for DataType {
13029 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13030 wkt::internal::display_enum(f, self.name(), self.value())
13031 }
13032 }
13033
13034 impl std::convert::From<i32> for DataType {
13035 fn from(value: i32) -> Self {
13036 match value {
13037 0 => Self::Unspecified,
13038 1 => Self::Bool,
13039 2 => Self::Integer,
13040 3 => Self::Float,
13041 4 => Self::String,
13042 5 => Self::Uuid,
13043 _ => Self::UnknownValue(data_type::UnknownValue(
13044 wkt::internal::UnknownEnumValue::Integer(value),
13045 )),
13046 }
13047 }
13048 }
13049
13050 impl std::convert::From<&str> for DataType {
13051 fn from(value: &str) -> Self {
13052 use std::string::ToString;
13053 match value {
13054 "DATA_TYPE_UNSPECIFIED" => Self::Unspecified,
13055 "BOOL" => Self::Bool,
13056 "INTEGER" => Self::Integer,
13057 "FLOAT" => Self::Float,
13058 "STRING" => Self::String,
13059 "UUID" => Self::Uuid,
13060 _ => Self::UnknownValue(data_type::UnknownValue(
13061 wkt::internal::UnknownEnumValue::String(value.to_string()),
13062 )),
13063 }
13064 }
13065 }
13066
13067 impl serde::ser::Serialize for DataType {
13068 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13069 where
13070 S: serde::Serializer,
13071 {
13072 match self {
13073 Self::Unspecified => serializer.serialize_i32(0),
13074 Self::Bool => serializer.serialize_i32(1),
13075 Self::Integer => serializer.serialize_i32(2),
13076 Self::Float => serializer.serialize_i32(3),
13077 Self::String => serializer.serialize_i32(4),
13078 Self::Uuid => serializer.serialize_i32(5),
13079 Self::UnknownValue(u) => u.0.serialize(serializer),
13080 }
13081 }
13082 }
13083
13084 impl<'de> serde::de::Deserialize<'de> for DataType {
13085 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13086 where
13087 D: serde::Deserializer<'de>,
13088 {
13089 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataType>::new(
13090 ".google.cloud.apihub.v1.HttpOperationDetails.DataType",
13091 ))
13092 }
13093 }
13094}
13095
13096#[derive(Clone, Default, PartialEq)]
13098#[non_exhaustive]
13099pub struct CreateCurationRequest {
13100 pub parent: std::string::String,
13103
13104 pub curation_id: std::string::String,
13115
13116 pub curation: std::option::Option<crate::model::Curation>,
13118
13119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13120}
13121
13122impl CreateCurationRequest {
13123 pub fn new() -> Self {
13124 std::default::Default::default()
13125 }
13126
13127 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13129 self.parent = v.into();
13130 self
13131 }
13132
13133 pub fn set_curation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13135 self.curation_id = v.into();
13136 self
13137 }
13138
13139 pub fn set_curation<T>(mut self, v: T) -> Self
13141 where
13142 T: std::convert::Into<crate::model::Curation>,
13143 {
13144 self.curation = std::option::Option::Some(v.into());
13145 self
13146 }
13147
13148 pub fn set_or_clear_curation<T>(mut self, v: std::option::Option<T>) -> Self
13150 where
13151 T: std::convert::Into<crate::model::Curation>,
13152 {
13153 self.curation = v.map(|x| x.into());
13154 self
13155 }
13156}
13157
13158impl wkt::message::Message for CreateCurationRequest {
13159 fn typename() -> &'static str {
13160 "type.googleapis.com/google.cloud.apihub.v1.CreateCurationRequest"
13161 }
13162}
13163
13164#[derive(Clone, Default, PartialEq)]
13166#[non_exhaustive]
13167pub struct GetCurationRequest {
13168 pub name: std::string::String,
13171
13172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13173}
13174
13175impl GetCurationRequest {
13176 pub fn new() -> Self {
13177 std::default::Default::default()
13178 }
13179
13180 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13182 self.name = v.into();
13183 self
13184 }
13185}
13186
13187impl wkt::message::Message for GetCurationRequest {
13188 fn typename() -> &'static str {
13189 "type.googleapis.com/google.cloud.apihub.v1.GetCurationRequest"
13190 }
13191}
13192
13193#[derive(Clone, Default, PartialEq)]
13195#[non_exhaustive]
13196pub struct UpdateCurationRequest {
13197 pub curation: std::option::Option<crate::model::Curation>,
13203
13204 pub update_mask: std::option::Option<wkt::FieldMask>,
13206
13207 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13208}
13209
13210impl UpdateCurationRequest {
13211 pub fn new() -> Self {
13212 std::default::Default::default()
13213 }
13214
13215 pub fn set_curation<T>(mut self, v: T) -> Self
13217 where
13218 T: std::convert::Into<crate::model::Curation>,
13219 {
13220 self.curation = std::option::Option::Some(v.into());
13221 self
13222 }
13223
13224 pub fn set_or_clear_curation<T>(mut self, v: std::option::Option<T>) -> Self
13226 where
13227 T: std::convert::Into<crate::model::Curation>,
13228 {
13229 self.curation = v.map(|x| x.into());
13230 self
13231 }
13232
13233 pub fn set_update_mask<T>(mut self, v: T) -> Self
13235 where
13236 T: std::convert::Into<wkt::FieldMask>,
13237 {
13238 self.update_mask = std::option::Option::Some(v.into());
13239 self
13240 }
13241
13242 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13244 where
13245 T: std::convert::Into<wkt::FieldMask>,
13246 {
13247 self.update_mask = v.map(|x| x.into());
13248 self
13249 }
13250}
13251
13252impl wkt::message::Message for UpdateCurationRequest {
13253 fn typename() -> &'static str {
13254 "type.googleapis.com/google.cloud.apihub.v1.UpdateCurationRequest"
13255 }
13256}
13257
13258#[derive(Clone, Default, PartialEq)]
13260#[non_exhaustive]
13261pub struct DeleteCurationRequest {
13262 pub name: std::string::String,
13265
13266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13267}
13268
13269impl DeleteCurationRequest {
13270 pub fn new() -> Self {
13271 std::default::Default::default()
13272 }
13273
13274 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13276 self.name = v.into();
13277 self
13278 }
13279}
13280
13281impl wkt::message::Message for DeleteCurationRequest {
13282 fn typename() -> &'static str {
13283 "type.googleapis.com/google.cloud.apihub.v1.DeleteCurationRequest"
13284 }
13285}
13286
13287#[derive(Clone, Default, PartialEq)]
13289#[non_exhaustive]
13290pub struct ListCurationsRequest {
13291 pub parent: std::string::String,
13294
13295 pub filter: std::string::String,
13325
13326 pub page_size: i32,
13331
13332 pub page_token: std::string::String,
13338
13339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13340}
13341
13342impl ListCurationsRequest {
13343 pub fn new() -> Self {
13344 std::default::Default::default()
13345 }
13346
13347 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13349 self.parent = v.into();
13350 self
13351 }
13352
13353 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13355 self.filter = v.into();
13356 self
13357 }
13358
13359 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13361 self.page_size = v.into();
13362 self
13363 }
13364
13365 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13367 self.page_token = v.into();
13368 self
13369 }
13370}
13371
13372impl wkt::message::Message for ListCurationsRequest {
13373 fn typename() -> &'static str {
13374 "type.googleapis.com/google.cloud.apihub.v1.ListCurationsRequest"
13375 }
13376}
13377
13378#[derive(Clone, Default, PartialEq)]
13380#[non_exhaustive]
13381pub struct ListCurationsResponse {
13382 pub curations: std::vec::Vec<crate::model::Curation>,
13384
13385 pub next_page_token: std::string::String,
13388
13389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13390}
13391
13392impl ListCurationsResponse {
13393 pub fn new() -> Self {
13394 std::default::Default::default()
13395 }
13396
13397 pub fn set_curations<T, V>(mut self, v: T) -> Self
13399 where
13400 T: std::iter::IntoIterator<Item = V>,
13401 V: std::convert::Into<crate::model::Curation>,
13402 {
13403 use std::iter::Iterator;
13404 self.curations = v.into_iter().map(|i| i.into()).collect();
13405 self
13406 }
13407
13408 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13410 self.next_page_token = v.into();
13411 self
13412 }
13413}
13414
13415impl wkt::message::Message for ListCurationsResponse {
13416 fn typename() -> &'static str {
13417 "type.googleapis.com/google.cloud.apihub.v1.ListCurationsResponse"
13418 }
13419}
13420
13421#[doc(hidden)]
13422impl gax::paginator::internal::PageableResponse for ListCurationsResponse {
13423 type PageItem = crate::model::Curation;
13424
13425 fn items(self) -> std::vec::Vec<Self::PageItem> {
13426 self.curations
13427 }
13428
13429 fn next_page_token(&self) -> std::string::String {
13430 use std::clone::Clone;
13431 self.next_page_token.clone()
13432 }
13433}
13434
13435#[derive(Clone, Default, PartialEq)]
13437#[non_exhaustive]
13438pub struct Curation {
13439 pub name: std::string::String,
13444
13445 pub display_name: std::string::String,
13447
13448 pub description: std::string::String,
13450
13451 pub endpoint: std::option::Option<crate::model::Endpoint>,
13453
13454 pub plugin_instance_actions: std::vec::Vec<crate::model::curation::PluginInstanceActionID>,
13458
13459 pub last_execution_state: crate::model::curation::LastExecutionState,
13461
13462 pub last_execution_error_code: crate::model::curation::ErrorCode,
13465
13466 pub last_execution_error_message: std::string::String,
13469
13470 pub create_time: std::option::Option<wkt::Timestamp>,
13472
13473 pub update_time: std::option::Option<wkt::Timestamp>,
13475
13476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13477}
13478
13479impl Curation {
13480 pub fn new() -> Self {
13481 std::default::Default::default()
13482 }
13483
13484 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13486 self.name = v.into();
13487 self
13488 }
13489
13490 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13492 self.display_name = v.into();
13493 self
13494 }
13495
13496 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13498 self.description = v.into();
13499 self
13500 }
13501
13502 pub fn set_endpoint<T>(mut self, v: T) -> Self
13504 where
13505 T: std::convert::Into<crate::model::Endpoint>,
13506 {
13507 self.endpoint = std::option::Option::Some(v.into());
13508 self
13509 }
13510
13511 pub fn set_or_clear_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
13513 where
13514 T: std::convert::Into<crate::model::Endpoint>,
13515 {
13516 self.endpoint = v.map(|x| x.into());
13517 self
13518 }
13519
13520 pub fn set_plugin_instance_actions<T, V>(mut self, v: T) -> Self
13522 where
13523 T: std::iter::IntoIterator<Item = V>,
13524 V: std::convert::Into<crate::model::curation::PluginInstanceActionID>,
13525 {
13526 use std::iter::Iterator;
13527 self.plugin_instance_actions = v.into_iter().map(|i| i.into()).collect();
13528 self
13529 }
13530
13531 pub fn set_last_execution_state<
13533 T: std::convert::Into<crate::model::curation::LastExecutionState>,
13534 >(
13535 mut self,
13536 v: T,
13537 ) -> Self {
13538 self.last_execution_state = v.into();
13539 self
13540 }
13541
13542 pub fn set_last_execution_error_code<
13544 T: std::convert::Into<crate::model::curation::ErrorCode>,
13545 >(
13546 mut self,
13547 v: T,
13548 ) -> Self {
13549 self.last_execution_error_code = v.into();
13550 self
13551 }
13552
13553 pub fn set_last_execution_error_message<T: std::convert::Into<std::string::String>>(
13555 mut self,
13556 v: T,
13557 ) -> Self {
13558 self.last_execution_error_message = v.into();
13559 self
13560 }
13561
13562 pub fn set_create_time<T>(mut self, v: T) -> Self
13564 where
13565 T: std::convert::Into<wkt::Timestamp>,
13566 {
13567 self.create_time = std::option::Option::Some(v.into());
13568 self
13569 }
13570
13571 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13573 where
13574 T: std::convert::Into<wkt::Timestamp>,
13575 {
13576 self.create_time = v.map(|x| x.into());
13577 self
13578 }
13579
13580 pub fn set_update_time<T>(mut self, v: T) -> Self
13582 where
13583 T: std::convert::Into<wkt::Timestamp>,
13584 {
13585 self.update_time = std::option::Option::Some(v.into());
13586 self
13587 }
13588
13589 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13591 where
13592 T: std::convert::Into<wkt::Timestamp>,
13593 {
13594 self.update_time = v.map(|x| x.into());
13595 self
13596 }
13597}
13598
13599impl wkt::message::Message for Curation {
13600 fn typename() -> &'static str {
13601 "type.googleapis.com/google.cloud.apihub.v1.Curation"
13602 }
13603}
13604
13605pub mod curation {
13607 #[allow(unused_imports)]
13608 use super::*;
13609
13610 #[derive(Clone, Default, PartialEq)]
13612 #[non_exhaustive]
13613 pub struct PluginInstanceActionID {
13614 pub plugin_instance: std::string::String,
13618
13619 pub action_id: std::string::String,
13623
13624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13625 }
13626
13627 impl PluginInstanceActionID {
13628 pub fn new() -> Self {
13629 std::default::Default::default()
13630 }
13631
13632 pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(
13634 mut self,
13635 v: T,
13636 ) -> Self {
13637 self.plugin_instance = v.into();
13638 self
13639 }
13640
13641 pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13643 self.action_id = v.into();
13644 self
13645 }
13646 }
13647
13648 impl wkt::message::Message for PluginInstanceActionID {
13649 fn typename() -> &'static str {
13650 "type.googleapis.com/google.cloud.apihub.v1.Curation.PluginInstanceActionID"
13651 }
13652 }
13653
13654 #[derive(Clone, Debug, PartialEq)]
13670 #[non_exhaustive]
13671 pub enum LastExecutionState {
13672 Unspecified,
13674 Succeeded,
13676 Failed,
13678 UnknownValue(last_execution_state::UnknownValue),
13683 }
13684
13685 #[doc(hidden)]
13686 pub mod last_execution_state {
13687 #[allow(unused_imports)]
13688 use super::*;
13689 #[derive(Clone, Debug, PartialEq)]
13690 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13691 }
13692
13693 impl LastExecutionState {
13694 pub fn value(&self) -> std::option::Option<i32> {
13699 match self {
13700 Self::Unspecified => std::option::Option::Some(0),
13701 Self::Succeeded => std::option::Option::Some(1),
13702 Self::Failed => std::option::Option::Some(2),
13703 Self::UnknownValue(u) => u.0.value(),
13704 }
13705 }
13706
13707 pub fn name(&self) -> std::option::Option<&str> {
13712 match self {
13713 Self::Unspecified => std::option::Option::Some("LAST_EXECUTION_STATE_UNSPECIFIED"),
13714 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13715 Self::Failed => std::option::Option::Some("FAILED"),
13716 Self::UnknownValue(u) => u.0.name(),
13717 }
13718 }
13719 }
13720
13721 impl std::default::Default for LastExecutionState {
13722 fn default() -> Self {
13723 use std::convert::From;
13724 Self::from(0)
13725 }
13726 }
13727
13728 impl std::fmt::Display for LastExecutionState {
13729 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13730 wkt::internal::display_enum(f, self.name(), self.value())
13731 }
13732 }
13733
13734 impl std::convert::From<i32> for LastExecutionState {
13735 fn from(value: i32) -> Self {
13736 match value {
13737 0 => Self::Unspecified,
13738 1 => Self::Succeeded,
13739 2 => Self::Failed,
13740 _ => Self::UnknownValue(last_execution_state::UnknownValue(
13741 wkt::internal::UnknownEnumValue::Integer(value),
13742 )),
13743 }
13744 }
13745 }
13746
13747 impl std::convert::From<&str> for LastExecutionState {
13748 fn from(value: &str) -> Self {
13749 use std::string::ToString;
13750 match value {
13751 "LAST_EXECUTION_STATE_UNSPECIFIED" => Self::Unspecified,
13752 "SUCCEEDED" => Self::Succeeded,
13753 "FAILED" => Self::Failed,
13754 _ => Self::UnknownValue(last_execution_state::UnknownValue(
13755 wkt::internal::UnknownEnumValue::String(value.to_string()),
13756 )),
13757 }
13758 }
13759 }
13760
13761 impl serde::ser::Serialize for LastExecutionState {
13762 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13763 where
13764 S: serde::Serializer,
13765 {
13766 match self {
13767 Self::Unspecified => serializer.serialize_i32(0),
13768 Self::Succeeded => serializer.serialize_i32(1),
13769 Self::Failed => serializer.serialize_i32(2),
13770 Self::UnknownValue(u) => u.0.serialize(serializer),
13771 }
13772 }
13773 }
13774
13775 impl<'de> serde::de::Deserialize<'de> for LastExecutionState {
13776 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13777 where
13778 D: serde::Deserializer<'de>,
13779 {
13780 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LastExecutionState>::new(
13781 ".google.cloud.apihub.v1.Curation.LastExecutionState",
13782 ))
13783 }
13784 }
13785
13786 #[derive(Clone, Debug, PartialEq)]
13802 #[non_exhaustive]
13803 pub enum ErrorCode {
13804 Unspecified,
13806 InternalError,
13808 Unauthorized,
13810 UnknownValue(error_code::UnknownValue),
13815 }
13816
13817 #[doc(hidden)]
13818 pub mod error_code {
13819 #[allow(unused_imports)]
13820 use super::*;
13821 #[derive(Clone, Debug, PartialEq)]
13822 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13823 }
13824
13825 impl ErrorCode {
13826 pub fn value(&self) -> std::option::Option<i32> {
13831 match self {
13832 Self::Unspecified => std::option::Option::Some(0),
13833 Self::InternalError => std::option::Option::Some(1),
13834 Self::Unauthorized => std::option::Option::Some(2),
13835 Self::UnknownValue(u) => u.0.value(),
13836 }
13837 }
13838
13839 pub fn name(&self) -> std::option::Option<&str> {
13844 match self {
13845 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
13846 Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
13847 Self::Unauthorized => std::option::Option::Some("UNAUTHORIZED"),
13848 Self::UnknownValue(u) => u.0.name(),
13849 }
13850 }
13851 }
13852
13853 impl std::default::Default for ErrorCode {
13854 fn default() -> Self {
13855 use std::convert::From;
13856 Self::from(0)
13857 }
13858 }
13859
13860 impl std::fmt::Display for ErrorCode {
13861 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13862 wkt::internal::display_enum(f, self.name(), self.value())
13863 }
13864 }
13865
13866 impl std::convert::From<i32> for ErrorCode {
13867 fn from(value: i32) -> Self {
13868 match value {
13869 0 => Self::Unspecified,
13870 1 => Self::InternalError,
13871 2 => Self::Unauthorized,
13872 _ => Self::UnknownValue(error_code::UnknownValue(
13873 wkt::internal::UnknownEnumValue::Integer(value),
13874 )),
13875 }
13876 }
13877 }
13878
13879 impl std::convert::From<&str> for ErrorCode {
13880 fn from(value: &str) -> Self {
13881 use std::string::ToString;
13882 match value {
13883 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
13884 "INTERNAL_ERROR" => Self::InternalError,
13885 "UNAUTHORIZED" => Self::Unauthorized,
13886 _ => Self::UnknownValue(error_code::UnknownValue(
13887 wkt::internal::UnknownEnumValue::String(value.to_string()),
13888 )),
13889 }
13890 }
13891 }
13892
13893 impl serde::ser::Serialize for ErrorCode {
13894 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13895 where
13896 S: serde::Serializer,
13897 {
13898 match self {
13899 Self::Unspecified => serializer.serialize_i32(0),
13900 Self::InternalError => serializer.serialize_i32(1),
13901 Self::Unauthorized => serializer.serialize_i32(2),
13902 Self::UnknownValue(u) => u.0.serialize(serializer),
13903 }
13904 }
13905 }
13906
13907 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
13908 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13909 where
13910 D: serde::Deserializer<'de>,
13911 {
13912 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
13913 ".google.cloud.apihub.v1.Curation.ErrorCode",
13914 ))
13915 }
13916 }
13917}
13918
13919#[derive(Clone, Default, PartialEq)]
13925#[non_exhaustive]
13926pub struct Endpoint {
13927 pub endpoint_details: std::option::Option<crate::model::endpoint::EndpointDetails>,
13929
13930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13931}
13932
13933impl Endpoint {
13934 pub fn new() -> Self {
13935 std::default::Default::default()
13936 }
13937
13938 pub fn set_endpoint_details<
13943 T: std::convert::Into<std::option::Option<crate::model::endpoint::EndpointDetails>>,
13944 >(
13945 mut self,
13946 v: T,
13947 ) -> Self {
13948 self.endpoint_details = v.into();
13949 self
13950 }
13951
13952 pub fn application_integration_endpoint_details(
13956 &self,
13957 ) -> std::option::Option<&std::boxed::Box<crate::model::ApplicationIntegrationEndpointDetails>>
13958 {
13959 #[allow(unreachable_patterns)]
13960 self.endpoint_details.as_ref().and_then(|v| match v {
13961 crate::model::endpoint::EndpointDetails::ApplicationIntegrationEndpointDetails(v) => {
13962 std::option::Option::Some(v)
13963 }
13964 _ => std::option::Option::None,
13965 })
13966 }
13967
13968 pub fn set_application_integration_endpoint_details<
13974 T: std::convert::Into<std::boxed::Box<crate::model::ApplicationIntegrationEndpointDetails>>,
13975 >(
13976 mut self,
13977 v: T,
13978 ) -> Self {
13979 self.endpoint_details = std::option::Option::Some(
13980 crate::model::endpoint::EndpointDetails::ApplicationIntegrationEndpointDetails(
13981 v.into(),
13982 ),
13983 );
13984 self
13985 }
13986}
13987
13988impl wkt::message::Message for Endpoint {
13989 fn typename() -> &'static str {
13990 "type.googleapis.com/google.cloud.apihub.v1.Endpoint"
13991 }
13992}
13993
13994pub mod endpoint {
13996 #[allow(unused_imports)]
13997 use super::*;
13998
13999 #[derive(Clone, Debug, PartialEq)]
14001 #[non_exhaustive]
14002 pub enum EndpointDetails {
14003 ApplicationIntegrationEndpointDetails(
14006 std::boxed::Box<crate::model::ApplicationIntegrationEndpointDetails>,
14007 ),
14008 }
14009}
14010
14011#[derive(Clone, Default, PartialEq)]
14014#[non_exhaustive]
14015pub struct ApplicationIntegrationEndpointDetails {
14016 pub uri: std::string::String,
14022
14023 pub trigger_id: std::string::String,
14025
14026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14027}
14028
14029impl ApplicationIntegrationEndpointDetails {
14030 pub fn new() -> Self {
14031 std::default::Default::default()
14032 }
14033
14034 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14036 self.uri = v.into();
14037 self
14038 }
14039
14040 pub fn set_trigger_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14042 self.trigger_id = v.into();
14043 self
14044 }
14045}
14046
14047impl wkt::message::Message for ApplicationIntegrationEndpointDetails {
14048 fn typename() -> &'static str {
14049 "type.googleapis.com/google.cloud.apihub.v1.ApplicationIntegrationEndpointDetails"
14050 }
14051}
14052
14053#[derive(Clone, Default, PartialEq)]
14055#[non_exhaustive]
14056pub struct ListDiscoveredApiObservationsRequest {
14057 pub parent: std::string::String,
14061
14062 pub page_size: i32,
14067
14068 pub page_token: std::string::String,
14075
14076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14077}
14078
14079impl ListDiscoveredApiObservationsRequest {
14080 pub fn new() -> Self {
14081 std::default::Default::default()
14082 }
14083
14084 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14086 self.parent = v.into();
14087 self
14088 }
14089
14090 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14092 self.page_size = v.into();
14093 self
14094 }
14095
14096 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14098 self.page_token = v.into();
14099 self
14100 }
14101}
14102
14103impl wkt::message::Message for ListDiscoveredApiObservationsRequest {
14104 fn typename() -> &'static str {
14105 "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiObservationsRequest"
14106 }
14107}
14108
14109#[derive(Clone, Default, PartialEq)]
14111#[non_exhaustive]
14112pub struct ListDiscoveredApiObservationsResponse {
14113 pub discovered_api_observations: std::vec::Vec<crate::model::DiscoveredApiObservation>,
14115
14116 pub next_page_token: std::string::String,
14119
14120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14121}
14122
14123impl ListDiscoveredApiObservationsResponse {
14124 pub fn new() -> Self {
14125 std::default::Default::default()
14126 }
14127
14128 pub fn set_discovered_api_observations<T, V>(mut self, v: T) -> Self
14130 where
14131 T: std::iter::IntoIterator<Item = V>,
14132 V: std::convert::Into<crate::model::DiscoveredApiObservation>,
14133 {
14134 use std::iter::Iterator;
14135 self.discovered_api_observations = v.into_iter().map(|i| i.into()).collect();
14136 self
14137 }
14138
14139 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14141 self.next_page_token = v.into();
14142 self
14143 }
14144}
14145
14146impl wkt::message::Message for ListDiscoveredApiObservationsResponse {
14147 fn typename() -> &'static str {
14148 "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiObservationsResponse"
14149 }
14150}
14151
14152#[doc(hidden)]
14153impl gax::paginator::internal::PageableResponse for ListDiscoveredApiObservationsResponse {
14154 type PageItem = crate::model::DiscoveredApiObservation;
14155
14156 fn items(self) -> std::vec::Vec<Self::PageItem> {
14157 self.discovered_api_observations
14158 }
14159
14160 fn next_page_token(&self) -> std::string::String {
14161 use std::clone::Clone;
14162 self.next_page_token.clone()
14163 }
14164}
14165
14166#[derive(Clone, Default, PartialEq)]
14168#[non_exhaustive]
14169pub struct ListDiscoveredApiOperationsRequest {
14170 pub parent: std::string::String,
14174
14175 pub page_size: i32,
14178
14179 pub page_token: std::string::String,
14187
14188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14189}
14190
14191impl ListDiscoveredApiOperationsRequest {
14192 pub fn new() -> Self {
14193 std::default::Default::default()
14194 }
14195
14196 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14198 self.parent = v.into();
14199 self
14200 }
14201
14202 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14204 self.page_size = v.into();
14205 self
14206 }
14207
14208 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14210 self.page_token = v.into();
14211 self
14212 }
14213}
14214
14215impl wkt::message::Message for ListDiscoveredApiOperationsRequest {
14216 fn typename() -> &'static str {
14217 "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiOperationsRequest"
14218 }
14219}
14220
14221#[derive(Clone, Default, PartialEq)]
14223#[non_exhaustive]
14224pub struct ListDiscoveredApiOperationsResponse {
14225 pub discovered_api_operations: std::vec::Vec<crate::model::DiscoveredApiOperation>,
14228
14229 pub next_page_token: std::string::String,
14232
14233 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14234}
14235
14236impl ListDiscoveredApiOperationsResponse {
14237 pub fn new() -> Self {
14238 std::default::Default::default()
14239 }
14240
14241 pub fn set_discovered_api_operations<T, V>(mut self, v: T) -> Self
14243 where
14244 T: std::iter::IntoIterator<Item = V>,
14245 V: std::convert::Into<crate::model::DiscoveredApiOperation>,
14246 {
14247 use std::iter::Iterator;
14248 self.discovered_api_operations = v.into_iter().map(|i| i.into()).collect();
14249 self
14250 }
14251
14252 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14254 self.next_page_token = v.into();
14255 self
14256 }
14257}
14258
14259impl wkt::message::Message for ListDiscoveredApiOperationsResponse {
14260 fn typename() -> &'static str {
14261 "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiOperationsResponse"
14262 }
14263}
14264
14265#[doc(hidden)]
14266impl gax::paginator::internal::PageableResponse for ListDiscoveredApiOperationsResponse {
14267 type PageItem = crate::model::DiscoveredApiOperation;
14268
14269 fn items(self) -> std::vec::Vec<Self::PageItem> {
14270 self.discovered_api_operations
14271 }
14272
14273 fn next_page_token(&self) -> std::string::String {
14274 use std::clone::Clone;
14275 self.next_page_token.clone()
14276 }
14277}
14278
14279#[derive(Clone, Default, PartialEq)]
14281#[non_exhaustive]
14282pub struct GetDiscoveredApiObservationRequest {
14283 pub name: std::string::String,
14287
14288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14289}
14290
14291impl GetDiscoveredApiObservationRequest {
14292 pub fn new() -> Self {
14293 std::default::Default::default()
14294 }
14295
14296 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14298 self.name = v.into();
14299 self
14300 }
14301}
14302
14303impl wkt::message::Message for GetDiscoveredApiObservationRequest {
14304 fn typename() -> &'static str {
14305 "type.googleapis.com/google.cloud.apihub.v1.GetDiscoveredApiObservationRequest"
14306 }
14307}
14308
14309#[derive(Clone, Default, PartialEq)]
14311#[non_exhaustive]
14312pub struct GetDiscoveredApiOperationRequest {
14313 pub name: std::string::String,
14317
14318 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14319}
14320
14321impl GetDiscoveredApiOperationRequest {
14322 pub fn new() -> Self {
14323 std::default::Default::default()
14324 }
14325
14326 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14328 self.name = v.into();
14329 self
14330 }
14331}
14332
14333impl wkt::message::Message for GetDiscoveredApiOperationRequest {
14334 fn typename() -> &'static str {
14335 "type.googleapis.com/google.cloud.apihub.v1.GetDiscoveredApiOperationRequest"
14336 }
14337}
14338
14339#[derive(Clone, Default, PartialEq)]
14345#[non_exhaustive]
14346pub struct CreateHostProjectRegistrationRequest {
14347 pub parent: std::string::String,
14350
14351 pub host_project_registration_id: std::string::String,
14356
14357 pub host_project_registration: std::option::Option<crate::model::HostProjectRegistration>,
14359
14360 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14361}
14362
14363impl CreateHostProjectRegistrationRequest {
14364 pub fn new() -> Self {
14365 std::default::Default::default()
14366 }
14367
14368 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14370 self.parent = v.into();
14371 self
14372 }
14373
14374 pub fn set_host_project_registration_id<T: std::convert::Into<std::string::String>>(
14376 mut self,
14377 v: T,
14378 ) -> Self {
14379 self.host_project_registration_id = v.into();
14380 self
14381 }
14382
14383 pub fn set_host_project_registration<T>(mut self, v: T) -> Self
14385 where
14386 T: std::convert::Into<crate::model::HostProjectRegistration>,
14387 {
14388 self.host_project_registration = std::option::Option::Some(v.into());
14389 self
14390 }
14391
14392 pub fn set_or_clear_host_project_registration<T>(mut self, v: std::option::Option<T>) -> Self
14394 where
14395 T: std::convert::Into<crate::model::HostProjectRegistration>,
14396 {
14397 self.host_project_registration = v.map(|x| x.into());
14398 self
14399 }
14400}
14401
14402impl wkt::message::Message for CreateHostProjectRegistrationRequest {
14403 fn typename() -> &'static str {
14404 "type.googleapis.com/google.cloud.apihub.v1.CreateHostProjectRegistrationRequest"
14405 }
14406}
14407
14408#[derive(Clone, Default, PartialEq)]
14414#[non_exhaustive]
14415pub struct GetHostProjectRegistrationRequest {
14416 pub name: std::string::String,
14419
14420 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14421}
14422
14423impl GetHostProjectRegistrationRequest {
14424 pub fn new() -> Self {
14425 std::default::Default::default()
14426 }
14427
14428 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14430 self.name = v.into();
14431 self
14432 }
14433}
14434
14435impl wkt::message::Message for GetHostProjectRegistrationRequest {
14436 fn typename() -> &'static str {
14437 "type.googleapis.com/google.cloud.apihub.v1.GetHostProjectRegistrationRequest"
14438 }
14439}
14440
14441#[derive(Clone, Default, PartialEq)]
14447#[non_exhaustive]
14448pub struct ListHostProjectRegistrationsRequest {
14449 pub parent: std::string::String,
14452
14453 pub page_size: i32,
14458
14459 pub page_token: std::string::String,
14467
14468 pub filter: std::string::String,
14485
14486 pub order_by: std::string::String,
14488
14489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14490}
14491
14492impl ListHostProjectRegistrationsRequest {
14493 pub fn new() -> Self {
14494 std::default::Default::default()
14495 }
14496
14497 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14499 self.parent = v.into();
14500 self
14501 }
14502
14503 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14505 self.page_size = v.into();
14506 self
14507 }
14508
14509 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14511 self.page_token = v.into();
14512 self
14513 }
14514
14515 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14517 self.filter = v.into();
14518 self
14519 }
14520
14521 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14523 self.order_by = v.into();
14524 self
14525 }
14526}
14527
14528impl wkt::message::Message for ListHostProjectRegistrationsRequest {
14529 fn typename() -> &'static str {
14530 "type.googleapis.com/google.cloud.apihub.v1.ListHostProjectRegistrationsRequest"
14531 }
14532}
14533
14534#[derive(Clone, Default, PartialEq)]
14540#[non_exhaustive]
14541pub struct ListHostProjectRegistrationsResponse {
14542 pub host_project_registrations: std::vec::Vec<crate::model::HostProjectRegistration>,
14544
14545 pub next_page_token: std::string::String,
14548
14549 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14550}
14551
14552impl ListHostProjectRegistrationsResponse {
14553 pub fn new() -> Self {
14554 std::default::Default::default()
14555 }
14556
14557 pub fn set_host_project_registrations<T, V>(mut self, v: T) -> Self
14559 where
14560 T: std::iter::IntoIterator<Item = V>,
14561 V: std::convert::Into<crate::model::HostProjectRegistration>,
14562 {
14563 use std::iter::Iterator;
14564 self.host_project_registrations = v.into_iter().map(|i| i.into()).collect();
14565 self
14566 }
14567
14568 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14570 self.next_page_token = v.into();
14571 self
14572 }
14573}
14574
14575impl wkt::message::Message for ListHostProjectRegistrationsResponse {
14576 fn typename() -> &'static str {
14577 "type.googleapis.com/google.cloud.apihub.v1.ListHostProjectRegistrationsResponse"
14578 }
14579}
14580
14581#[doc(hidden)]
14582impl gax::paginator::internal::PageableResponse for ListHostProjectRegistrationsResponse {
14583 type PageItem = crate::model::HostProjectRegistration;
14584
14585 fn items(self) -> std::vec::Vec<Self::PageItem> {
14586 self.host_project_registrations
14587 }
14588
14589 fn next_page_token(&self) -> std::string::String {
14590 use std::clone::Clone;
14591 self.next_page_token.clone()
14592 }
14593}
14594
14595#[derive(Clone, Default, PartialEq)]
14601#[non_exhaustive]
14602pub struct HostProjectRegistration {
14603 pub name: std::string::String,
14607
14608 pub gcp_project: std::string::String,
14613
14614 pub create_time: std::option::Option<wkt::Timestamp>,
14616
14617 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14618}
14619
14620impl HostProjectRegistration {
14621 pub fn new() -> Self {
14622 std::default::Default::default()
14623 }
14624
14625 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14627 self.name = v.into();
14628 self
14629 }
14630
14631 pub fn set_gcp_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14633 self.gcp_project = v.into();
14634 self
14635 }
14636
14637 pub fn set_create_time<T>(mut self, v: T) -> Self
14639 where
14640 T: std::convert::Into<wkt::Timestamp>,
14641 {
14642 self.create_time = std::option::Option::Some(v.into());
14643 self
14644 }
14645
14646 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14648 where
14649 T: std::convert::Into<wkt::Timestamp>,
14650 {
14651 self.create_time = v.map(|x| x.into());
14652 self
14653 }
14654}
14655
14656impl wkt::message::Message for HostProjectRegistration {
14657 fn typename() -> &'static str {
14658 "type.googleapis.com/google.cloud.apihub.v1.HostProjectRegistration"
14659 }
14660}
14661
14662#[derive(Clone, Default, PartialEq)]
14667#[non_exhaustive]
14668pub struct GetStyleGuideRequest {
14669 pub name: std::string::String,
14673
14674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14675}
14676
14677impl GetStyleGuideRequest {
14678 pub fn new() -> Self {
14679 std::default::Default::default()
14680 }
14681
14682 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14684 self.name = v.into();
14685 self
14686 }
14687}
14688
14689impl wkt::message::Message for GetStyleGuideRequest {
14690 fn typename() -> &'static str {
14691 "type.googleapis.com/google.cloud.apihub.v1.GetStyleGuideRequest"
14692 }
14693}
14694
14695#[derive(Clone, Default, PartialEq)]
14701#[non_exhaustive]
14702pub struct UpdateStyleGuideRequest {
14703 pub style_guide: std::option::Option<crate::model::StyleGuide>,
14705
14706 pub update_mask: std::option::Option<wkt::FieldMask>,
14708
14709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14710}
14711
14712impl UpdateStyleGuideRequest {
14713 pub fn new() -> Self {
14714 std::default::Default::default()
14715 }
14716
14717 pub fn set_style_guide<T>(mut self, v: T) -> Self
14719 where
14720 T: std::convert::Into<crate::model::StyleGuide>,
14721 {
14722 self.style_guide = std::option::Option::Some(v.into());
14723 self
14724 }
14725
14726 pub fn set_or_clear_style_guide<T>(mut self, v: std::option::Option<T>) -> Self
14728 where
14729 T: std::convert::Into<crate::model::StyleGuide>,
14730 {
14731 self.style_guide = v.map(|x| x.into());
14732 self
14733 }
14734
14735 pub fn set_update_mask<T>(mut self, v: T) -> Self
14737 where
14738 T: std::convert::Into<wkt::FieldMask>,
14739 {
14740 self.update_mask = std::option::Option::Some(v.into());
14741 self
14742 }
14743
14744 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14746 where
14747 T: std::convert::Into<wkt::FieldMask>,
14748 {
14749 self.update_mask = v.map(|x| x.into());
14750 self
14751 }
14752}
14753
14754impl wkt::message::Message for UpdateStyleGuideRequest {
14755 fn typename() -> &'static str {
14756 "type.googleapis.com/google.cloud.apihub.v1.UpdateStyleGuideRequest"
14757 }
14758}
14759
14760#[derive(Clone, Default, PartialEq)]
14766#[non_exhaustive]
14767pub struct GetStyleGuideContentsRequest {
14768 pub name: std::string::String,
14773
14774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14775}
14776
14777impl GetStyleGuideContentsRequest {
14778 pub fn new() -> Self {
14779 std::default::Default::default()
14780 }
14781
14782 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14784 self.name = v.into();
14785 self
14786 }
14787}
14788
14789impl wkt::message::Message for GetStyleGuideContentsRequest {
14790 fn typename() -> &'static str {
14791 "type.googleapis.com/google.cloud.apihub.v1.GetStyleGuideContentsRequest"
14792 }
14793}
14794
14795#[derive(Clone, Default, PartialEq)]
14800#[non_exhaustive]
14801pub struct LintSpecRequest {
14802 pub name: std::string::String,
14806
14807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14808}
14809
14810impl LintSpecRequest {
14811 pub fn new() -> Self {
14812 std::default::Default::default()
14813 }
14814
14815 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14817 self.name = v.into();
14818 self
14819 }
14820}
14821
14822impl wkt::message::Message for LintSpecRequest {
14823 fn typename() -> &'static str {
14824 "type.googleapis.com/google.cloud.apihub.v1.LintSpecRequest"
14825 }
14826}
14827
14828#[derive(Clone, Default, PartialEq)]
14830#[non_exhaustive]
14831pub struct StyleGuideContents {
14832 pub contents: ::bytes::Bytes,
14834
14835 pub mime_type: std::string::String,
14837
14838 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14839}
14840
14841impl StyleGuideContents {
14842 pub fn new() -> Self {
14843 std::default::Default::default()
14844 }
14845
14846 pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
14848 self.contents = v.into();
14849 self
14850 }
14851
14852 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14854 self.mime_type = v.into();
14855 self
14856 }
14857}
14858
14859impl wkt::message::Message for StyleGuideContents {
14860 fn typename() -> &'static str {
14861 "type.googleapis.com/google.cloud.apihub.v1.StyleGuideContents"
14862 }
14863}
14864
14865#[derive(Clone, Default, PartialEq)]
14868#[non_exhaustive]
14869pub struct StyleGuide {
14870 pub name: std::string::String,
14875
14876 pub linter: crate::model::Linter,
14878
14879 pub contents: std::option::Option<crate::model::StyleGuideContents>,
14881
14882 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14883}
14884
14885impl StyleGuide {
14886 pub fn new() -> Self {
14887 std::default::Default::default()
14888 }
14889
14890 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14892 self.name = v.into();
14893 self
14894 }
14895
14896 pub fn set_linter<T: std::convert::Into<crate::model::Linter>>(mut self, v: T) -> Self {
14898 self.linter = v.into();
14899 self
14900 }
14901
14902 pub fn set_contents<T>(mut self, v: T) -> Self
14904 where
14905 T: std::convert::Into<crate::model::StyleGuideContents>,
14906 {
14907 self.contents = std::option::Option::Some(v.into());
14908 self
14909 }
14910
14911 pub fn set_or_clear_contents<T>(mut self, v: std::option::Option<T>) -> Self
14913 where
14914 T: std::convert::Into<crate::model::StyleGuideContents>,
14915 {
14916 self.contents = v.map(|x| x.into());
14917 self
14918 }
14919}
14920
14921impl wkt::message::Message for StyleGuide {
14922 fn typename() -> &'static str {
14923 "type.googleapis.com/google.cloud.apihub.v1.StyleGuide"
14924 }
14925}
14926
14927#[derive(Clone, Default, PartialEq)]
14929#[non_exhaustive]
14930pub struct Plugin {
14931 pub name: std::string::String,
14934
14935 pub display_name: std::string::String,
14938
14939 pub r#type: std::option::Option<crate::model::AttributeValues>,
14949
14950 pub description: std::string::String,
14953
14954 pub state: crate::model::plugin::State,
14958
14959 pub ownership_type: crate::model::plugin::OwnershipType,
14962
14963 pub hosting_service: std::option::Option<crate::model::plugin::HostingService>,
14978
14979 pub actions_config: std::vec::Vec<crate::model::PluginActionConfig>,
14983
14984 pub documentation: std::option::Option<crate::model::Documentation>,
14987
14988 pub plugin_category: crate::model::PluginCategory,
14991
14992 pub config_template: std::option::Option<crate::model::plugin::ConfigTemplate>,
14994
14995 pub create_time: std::option::Option<wkt::Timestamp>,
14997
14998 pub update_time: std::option::Option<wkt::Timestamp>,
15000
15001 pub gateway_type: crate::model::GatewayType,
15003
15004 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15005}
15006
15007impl Plugin {
15008 pub fn new() -> Self {
15009 std::default::Default::default()
15010 }
15011
15012 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15014 self.name = v.into();
15015 self
15016 }
15017
15018 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15020 self.display_name = v.into();
15021 self
15022 }
15023
15024 pub fn set_type<T>(mut self, v: T) -> Self
15026 where
15027 T: std::convert::Into<crate::model::AttributeValues>,
15028 {
15029 self.r#type = std::option::Option::Some(v.into());
15030 self
15031 }
15032
15033 pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
15035 where
15036 T: std::convert::Into<crate::model::AttributeValues>,
15037 {
15038 self.r#type = v.map(|x| x.into());
15039 self
15040 }
15041
15042 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15044 self.description = v.into();
15045 self
15046 }
15047
15048 pub fn set_state<T: std::convert::Into<crate::model::plugin::State>>(mut self, v: T) -> Self {
15050 self.state = v.into();
15051 self
15052 }
15053
15054 pub fn set_ownership_type<T: std::convert::Into<crate::model::plugin::OwnershipType>>(
15056 mut self,
15057 v: T,
15058 ) -> Self {
15059 self.ownership_type = v.into();
15060 self
15061 }
15062
15063 pub fn set_hosting_service<T>(mut self, v: T) -> Self
15065 where
15066 T: std::convert::Into<crate::model::plugin::HostingService>,
15067 {
15068 self.hosting_service = std::option::Option::Some(v.into());
15069 self
15070 }
15071
15072 pub fn set_or_clear_hosting_service<T>(mut self, v: std::option::Option<T>) -> Self
15074 where
15075 T: std::convert::Into<crate::model::plugin::HostingService>,
15076 {
15077 self.hosting_service = v.map(|x| x.into());
15078 self
15079 }
15080
15081 pub fn set_actions_config<T, V>(mut self, v: T) -> Self
15083 where
15084 T: std::iter::IntoIterator<Item = V>,
15085 V: std::convert::Into<crate::model::PluginActionConfig>,
15086 {
15087 use std::iter::Iterator;
15088 self.actions_config = v.into_iter().map(|i| i.into()).collect();
15089 self
15090 }
15091
15092 pub fn set_documentation<T>(mut self, v: T) -> Self
15094 where
15095 T: std::convert::Into<crate::model::Documentation>,
15096 {
15097 self.documentation = std::option::Option::Some(v.into());
15098 self
15099 }
15100
15101 pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
15103 where
15104 T: std::convert::Into<crate::model::Documentation>,
15105 {
15106 self.documentation = v.map(|x| x.into());
15107 self
15108 }
15109
15110 pub fn set_plugin_category<T: std::convert::Into<crate::model::PluginCategory>>(
15112 mut self,
15113 v: T,
15114 ) -> Self {
15115 self.plugin_category = v.into();
15116 self
15117 }
15118
15119 pub fn set_config_template<T>(mut self, v: T) -> Self
15121 where
15122 T: std::convert::Into<crate::model::plugin::ConfigTemplate>,
15123 {
15124 self.config_template = std::option::Option::Some(v.into());
15125 self
15126 }
15127
15128 pub fn set_or_clear_config_template<T>(mut self, v: std::option::Option<T>) -> Self
15130 where
15131 T: std::convert::Into<crate::model::plugin::ConfigTemplate>,
15132 {
15133 self.config_template = v.map(|x| x.into());
15134 self
15135 }
15136
15137 pub fn set_create_time<T>(mut self, v: T) -> Self
15139 where
15140 T: std::convert::Into<wkt::Timestamp>,
15141 {
15142 self.create_time = std::option::Option::Some(v.into());
15143 self
15144 }
15145
15146 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15148 where
15149 T: std::convert::Into<wkt::Timestamp>,
15150 {
15151 self.create_time = v.map(|x| x.into());
15152 self
15153 }
15154
15155 pub fn set_update_time<T>(mut self, v: T) -> Self
15157 where
15158 T: std::convert::Into<wkt::Timestamp>,
15159 {
15160 self.update_time = std::option::Option::Some(v.into());
15161 self
15162 }
15163
15164 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15166 where
15167 T: std::convert::Into<wkt::Timestamp>,
15168 {
15169 self.update_time = v.map(|x| x.into());
15170 self
15171 }
15172
15173 pub fn set_gateway_type<T: std::convert::Into<crate::model::GatewayType>>(
15175 mut self,
15176 v: T,
15177 ) -> Self {
15178 self.gateway_type = v.into();
15179 self
15180 }
15181}
15182
15183impl wkt::message::Message for Plugin {
15184 fn typename() -> &'static str {
15185 "type.googleapis.com/google.cloud.apihub.v1.Plugin"
15186 }
15187}
15188
15189pub mod plugin {
15191 #[allow(unused_imports)]
15192 use super::*;
15193
15194 #[derive(Clone, Default, PartialEq)]
15197 #[non_exhaustive]
15198 pub struct HostingService {
15199 pub service_uri: std::string::String,
15203
15204 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15205 }
15206
15207 impl HostingService {
15208 pub fn new() -> Self {
15209 std::default::Default::default()
15210 }
15211
15212 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15214 self.service_uri = v.into();
15215 self
15216 }
15217 }
15218
15219 impl wkt::message::Message for HostingService {
15220 fn typename() -> &'static str {
15221 "type.googleapis.com/google.cloud.apihub.v1.Plugin.HostingService"
15222 }
15223 }
15224
15225 #[derive(Clone, Default, PartialEq)]
15227 #[non_exhaustive]
15228 pub struct ConfigTemplate {
15229 pub auth_config_template:
15231 std::option::Option<crate::model::plugin::config_template::AuthConfigTemplate>,
15232
15233 pub additional_config_template: std::vec::Vec<crate::model::ConfigVariableTemplate>,
15236
15237 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15238 }
15239
15240 impl ConfigTemplate {
15241 pub fn new() -> Self {
15242 std::default::Default::default()
15243 }
15244
15245 pub fn set_auth_config_template<T>(mut self, v: T) -> Self
15247 where
15248 T: std::convert::Into<crate::model::plugin::config_template::AuthConfigTemplate>,
15249 {
15250 self.auth_config_template = std::option::Option::Some(v.into());
15251 self
15252 }
15253
15254 pub fn set_or_clear_auth_config_template<T>(mut self, v: std::option::Option<T>) -> Self
15256 where
15257 T: std::convert::Into<crate::model::plugin::config_template::AuthConfigTemplate>,
15258 {
15259 self.auth_config_template = v.map(|x| x.into());
15260 self
15261 }
15262
15263 pub fn set_additional_config_template<T, V>(mut self, v: T) -> Self
15265 where
15266 T: std::iter::IntoIterator<Item = V>,
15267 V: std::convert::Into<crate::model::ConfigVariableTemplate>,
15268 {
15269 use std::iter::Iterator;
15270 self.additional_config_template = v.into_iter().map(|i| i.into()).collect();
15271 self
15272 }
15273 }
15274
15275 impl wkt::message::Message for ConfigTemplate {
15276 fn typename() -> &'static str {
15277 "type.googleapis.com/google.cloud.apihub.v1.Plugin.ConfigTemplate"
15278 }
15279 }
15280
15281 pub mod config_template {
15283 #[allow(unused_imports)]
15284 use super::*;
15285
15286 #[derive(Clone, Default, PartialEq)]
15288 #[non_exhaustive]
15289 pub struct AuthConfigTemplate {
15290 pub supported_auth_types: std::vec::Vec<crate::model::AuthType>,
15292
15293 pub service_account: std::option::Option<crate::model::GoogleServiceAccountConfig>,
15306
15307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15308 }
15309
15310 impl AuthConfigTemplate {
15311 pub fn new() -> Self {
15312 std::default::Default::default()
15313 }
15314
15315 pub fn set_supported_auth_types<T, V>(mut self, v: T) -> Self
15317 where
15318 T: std::iter::IntoIterator<Item = V>,
15319 V: std::convert::Into<crate::model::AuthType>,
15320 {
15321 use std::iter::Iterator;
15322 self.supported_auth_types = v.into_iter().map(|i| i.into()).collect();
15323 self
15324 }
15325
15326 pub fn set_service_account<T>(mut self, v: T) -> Self
15328 where
15329 T: std::convert::Into<crate::model::GoogleServiceAccountConfig>,
15330 {
15331 self.service_account = std::option::Option::Some(v.into());
15332 self
15333 }
15334
15335 pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
15337 where
15338 T: std::convert::Into<crate::model::GoogleServiceAccountConfig>,
15339 {
15340 self.service_account = v.map(|x| x.into());
15341 self
15342 }
15343 }
15344
15345 impl wkt::message::Message for AuthConfigTemplate {
15346 fn typename() -> &'static str {
15347 "type.googleapis.com/google.cloud.apihub.v1.Plugin.ConfigTemplate.AuthConfigTemplate"
15348 }
15349 }
15350 }
15351
15352 #[derive(Clone, Debug, PartialEq)]
15370 #[non_exhaustive]
15371 pub enum State {
15372 Unspecified,
15374 Enabled,
15376 Disabled,
15378 UnknownValue(state::UnknownValue),
15383 }
15384
15385 #[doc(hidden)]
15386 pub mod state {
15387 #[allow(unused_imports)]
15388 use super::*;
15389 #[derive(Clone, Debug, PartialEq)]
15390 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15391 }
15392
15393 impl State {
15394 pub fn value(&self) -> std::option::Option<i32> {
15399 match self {
15400 Self::Unspecified => std::option::Option::Some(0),
15401 Self::Enabled => std::option::Option::Some(1),
15402 Self::Disabled => std::option::Option::Some(2),
15403 Self::UnknownValue(u) => u.0.value(),
15404 }
15405 }
15406
15407 pub fn name(&self) -> std::option::Option<&str> {
15412 match self {
15413 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15414 Self::Enabled => std::option::Option::Some("ENABLED"),
15415 Self::Disabled => std::option::Option::Some("DISABLED"),
15416 Self::UnknownValue(u) => u.0.name(),
15417 }
15418 }
15419 }
15420
15421 impl std::default::Default for State {
15422 fn default() -> Self {
15423 use std::convert::From;
15424 Self::from(0)
15425 }
15426 }
15427
15428 impl std::fmt::Display for State {
15429 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15430 wkt::internal::display_enum(f, self.name(), self.value())
15431 }
15432 }
15433
15434 impl std::convert::From<i32> for State {
15435 fn from(value: i32) -> Self {
15436 match value {
15437 0 => Self::Unspecified,
15438 1 => Self::Enabled,
15439 2 => Self::Disabled,
15440 _ => Self::UnknownValue(state::UnknownValue(
15441 wkt::internal::UnknownEnumValue::Integer(value),
15442 )),
15443 }
15444 }
15445 }
15446
15447 impl std::convert::From<&str> for State {
15448 fn from(value: &str) -> Self {
15449 use std::string::ToString;
15450 match value {
15451 "STATE_UNSPECIFIED" => Self::Unspecified,
15452 "ENABLED" => Self::Enabled,
15453 "DISABLED" => Self::Disabled,
15454 _ => Self::UnknownValue(state::UnknownValue(
15455 wkt::internal::UnknownEnumValue::String(value.to_string()),
15456 )),
15457 }
15458 }
15459 }
15460
15461 impl serde::ser::Serialize for State {
15462 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15463 where
15464 S: serde::Serializer,
15465 {
15466 match self {
15467 Self::Unspecified => serializer.serialize_i32(0),
15468 Self::Enabled => serializer.serialize_i32(1),
15469 Self::Disabled => serializer.serialize_i32(2),
15470 Self::UnknownValue(u) => u.0.serialize(serializer),
15471 }
15472 }
15473 }
15474
15475 impl<'de> serde::de::Deserialize<'de> for State {
15476 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15477 where
15478 D: serde::Deserializer<'de>,
15479 {
15480 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15481 ".google.cloud.apihub.v1.Plugin.State",
15482 ))
15483 }
15484 }
15485
15486 #[derive(Clone, Debug, PartialEq)]
15502 #[non_exhaustive]
15503 pub enum OwnershipType {
15504 Unspecified,
15506 SystemOwned,
15509 UserOwned,
15515 UnknownValue(ownership_type::UnknownValue),
15520 }
15521
15522 #[doc(hidden)]
15523 pub mod ownership_type {
15524 #[allow(unused_imports)]
15525 use super::*;
15526 #[derive(Clone, Debug, PartialEq)]
15527 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15528 }
15529
15530 impl OwnershipType {
15531 pub fn value(&self) -> std::option::Option<i32> {
15536 match self {
15537 Self::Unspecified => std::option::Option::Some(0),
15538 Self::SystemOwned => std::option::Option::Some(1),
15539 Self::UserOwned => std::option::Option::Some(2),
15540 Self::UnknownValue(u) => u.0.value(),
15541 }
15542 }
15543
15544 pub fn name(&self) -> std::option::Option<&str> {
15549 match self {
15550 Self::Unspecified => std::option::Option::Some("OWNERSHIP_TYPE_UNSPECIFIED"),
15551 Self::SystemOwned => std::option::Option::Some("SYSTEM_OWNED"),
15552 Self::UserOwned => std::option::Option::Some("USER_OWNED"),
15553 Self::UnknownValue(u) => u.0.name(),
15554 }
15555 }
15556 }
15557
15558 impl std::default::Default for OwnershipType {
15559 fn default() -> Self {
15560 use std::convert::From;
15561 Self::from(0)
15562 }
15563 }
15564
15565 impl std::fmt::Display for OwnershipType {
15566 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15567 wkt::internal::display_enum(f, self.name(), self.value())
15568 }
15569 }
15570
15571 impl std::convert::From<i32> for OwnershipType {
15572 fn from(value: i32) -> Self {
15573 match value {
15574 0 => Self::Unspecified,
15575 1 => Self::SystemOwned,
15576 2 => Self::UserOwned,
15577 _ => Self::UnknownValue(ownership_type::UnknownValue(
15578 wkt::internal::UnknownEnumValue::Integer(value),
15579 )),
15580 }
15581 }
15582 }
15583
15584 impl std::convert::From<&str> for OwnershipType {
15585 fn from(value: &str) -> Self {
15586 use std::string::ToString;
15587 match value {
15588 "OWNERSHIP_TYPE_UNSPECIFIED" => Self::Unspecified,
15589 "SYSTEM_OWNED" => Self::SystemOwned,
15590 "USER_OWNED" => Self::UserOwned,
15591 _ => Self::UnknownValue(ownership_type::UnknownValue(
15592 wkt::internal::UnknownEnumValue::String(value.to_string()),
15593 )),
15594 }
15595 }
15596 }
15597
15598 impl serde::ser::Serialize for OwnershipType {
15599 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15600 where
15601 S: serde::Serializer,
15602 {
15603 match self {
15604 Self::Unspecified => serializer.serialize_i32(0),
15605 Self::SystemOwned => serializer.serialize_i32(1),
15606 Self::UserOwned => serializer.serialize_i32(2),
15607 Self::UnknownValue(u) => u.0.serialize(serializer),
15608 }
15609 }
15610 }
15611
15612 impl<'de> serde::de::Deserialize<'de> for OwnershipType {
15613 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15614 where
15615 D: serde::Deserializer<'de>,
15616 {
15617 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OwnershipType>::new(
15618 ".google.cloud.apihub.v1.Plugin.OwnershipType",
15619 ))
15620 }
15621 }
15622}
15623
15624#[derive(Clone, Default, PartialEq)]
15627#[non_exhaustive]
15628pub struct PluginActionConfig {
15629 pub id: std::string::String,
15631
15632 pub display_name: std::string::String,
15634
15635 pub description: std::string::String,
15637
15638 pub trigger_mode: crate::model::plugin_action_config::TriggerMode,
15640
15641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15642}
15643
15644impl PluginActionConfig {
15645 pub fn new() -> Self {
15646 std::default::Default::default()
15647 }
15648
15649 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15651 self.id = v.into();
15652 self
15653 }
15654
15655 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15657 self.display_name = v.into();
15658 self
15659 }
15660
15661 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15663 self.description = v.into();
15664 self
15665 }
15666
15667 pub fn set_trigger_mode<
15669 T: std::convert::Into<crate::model::plugin_action_config::TriggerMode>,
15670 >(
15671 mut self,
15672 v: T,
15673 ) -> Self {
15674 self.trigger_mode = v.into();
15675 self
15676 }
15677}
15678
15679impl wkt::message::Message for PluginActionConfig {
15680 fn typename() -> &'static str {
15681 "type.googleapis.com/google.cloud.apihub.v1.PluginActionConfig"
15682 }
15683}
15684
15685pub mod plugin_action_config {
15687 #[allow(unused_imports)]
15688 use super::*;
15689
15690 #[derive(Clone, Debug, PartialEq)]
15706 #[non_exhaustive]
15707 pub enum TriggerMode {
15708 Unspecified,
15710 ApiHubOnDemandTrigger,
15717 ApiHubScheduleTrigger,
15729 NonApiHubManaged,
15733 UnknownValue(trigger_mode::UnknownValue),
15738 }
15739
15740 #[doc(hidden)]
15741 pub mod trigger_mode {
15742 #[allow(unused_imports)]
15743 use super::*;
15744 #[derive(Clone, Debug, PartialEq)]
15745 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15746 }
15747
15748 impl TriggerMode {
15749 pub fn value(&self) -> std::option::Option<i32> {
15754 match self {
15755 Self::Unspecified => std::option::Option::Some(0),
15756 Self::ApiHubOnDemandTrigger => std::option::Option::Some(1),
15757 Self::ApiHubScheduleTrigger => std::option::Option::Some(2),
15758 Self::NonApiHubManaged => std::option::Option::Some(3),
15759 Self::UnknownValue(u) => u.0.value(),
15760 }
15761 }
15762
15763 pub fn name(&self) -> std::option::Option<&str> {
15768 match self {
15769 Self::Unspecified => std::option::Option::Some("TRIGGER_MODE_UNSPECIFIED"),
15770 Self::ApiHubOnDemandTrigger => {
15771 std::option::Option::Some("API_HUB_ON_DEMAND_TRIGGER")
15772 }
15773 Self::ApiHubScheduleTrigger => {
15774 std::option::Option::Some("API_HUB_SCHEDULE_TRIGGER")
15775 }
15776 Self::NonApiHubManaged => std::option::Option::Some("NON_API_HUB_MANAGED"),
15777 Self::UnknownValue(u) => u.0.name(),
15778 }
15779 }
15780 }
15781
15782 impl std::default::Default for TriggerMode {
15783 fn default() -> Self {
15784 use std::convert::From;
15785 Self::from(0)
15786 }
15787 }
15788
15789 impl std::fmt::Display for TriggerMode {
15790 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15791 wkt::internal::display_enum(f, self.name(), self.value())
15792 }
15793 }
15794
15795 impl std::convert::From<i32> for TriggerMode {
15796 fn from(value: i32) -> Self {
15797 match value {
15798 0 => Self::Unspecified,
15799 1 => Self::ApiHubOnDemandTrigger,
15800 2 => Self::ApiHubScheduleTrigger,
15801 3 => Self::NonApiHubManaged,
15802 _ => Self::UnknownValue(trigger_mode::UnknownValue(
15803 wkt::internal::UnknownEnumValue::Integer(value),
15804 )),
15805 }
15806 }
15807 }
15808
15809 impl std::convert::From<&str> for TriggerMode {
15810 fn from(value: &str) -> Self {
15811 use std::string::ToString;
15812 match value {
15813 "TRIGGER_MODE_UNSPECIFIED" => Self::Unspecified,
15814 "API_HUB_ON_DEMAND_TRIGGER" => Self::ApiHubOnDemandTrigger,
15815 "API_HUB_SCHEDULE_TRIGGER" => Self::ApiHubScheduleTrigger,
15816 "NON_API_HUB_MANAGED" => Self::NonApiHubManaged,
15817 _ => Self::UnknownValue(trigger_mode::UnknownValue(
15818 wkt::internal::UnknownEnumValue::String(value.to_string()),
15819 )),
15820 }
15821 }
15822 }
15823
15824 impl serde::ser::Serialize for TriggerMode {
15825 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15826 where
15827 S: serde::Serializer,
15828 {
15829 match self {
15830 Self::Unspecified => serializer.serialize_i32(0),
15831 Self::ApiHubOnDemandTrigger => serializer.serialize_i32(1),
15832 Self::ApiHubScheduleTrigger => serializer.serialize_i32(2),
15833 Self::NonApiHubManaged => serializer.serialize_i32(3),
15834 Self::UnknownValue(u) => u.0.serialize(serializer),
15835 }
15836 }
15837 }
15838
15839 impl<'de> serde::de::Deserialize<'de> for TriggerMode {
15840 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15841 where
15842 D: serde::Deserializer<'de>,
15843 {
15844 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TriggerMode>::new(
15845 ".google.cloud.apihub.v1.PluginActionConfig.TriggerMode",
15846 ))
15847 }
15848 }
15849}
15850
15851#[derive(Clone, Default, PartialEq)]
15856#[non_exhaustive]
15857pub struct GetPluginRequest {
15858 pub name: std::string::String,
15861
15862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15863}
15864
15865impl GetPluginRequest {
15866 pub fn new() -> Self {
15867 std::default::Default::default()
15868 }
15869
15870 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15872 self.name = v.into();
15873 self
15874 }
15875}
15876
15877impl wkt::message::Message for GetPluginRequest {
15878 fn typename() -> &'static str {
15879 "type.googleapis.com/google.cloud.apihub.v1.GetPluginRequest"
15880 }
15881}
15882
15883#[derive(Clone, Default, PartialEq)]
15888#[non_exhaustive]
15889pub struct EnablePluginRequest {
15890 pub name: std::string::String,
15893
15894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15895}
15896
15897impl EnablePluginRequest {
15898 pub fn new() -> Self {
15899 std::default::Default::default()
15900 }
15901
15902 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15904 self.name = v.into();
15905 self
15906 }
15907}
15908
15909impl wkt::message::Message for EnablePluginRequest {
15910 fn typename() -> &'static str {
15911 "type.googleapis.com/google.cloud.apihub.v1.EnablePluginRequest"
15912 }
15913}
15914
15915#[derive(Clone, Default, PartialEq)]
15920#[non_exhaustive]
15921pub struct DisablePluginRequest {
15922 pub name: std::string::String,
15925
15926 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15927}
15928
15929impl DisablePluginRequest {
15930 pub fn new() -> Self {
15931 std::default::Default::default()
15932 }
15933
15934 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15936 self.name = v.into();
15937 self
15938 }
15939}
15940
15941impl wkt::message::Message for DisablePluginRequest {
15942 fn typename() -> &'static str {
15943 "type.googleapis.com/google.cloud.apihub.v1.DisablePluginRequest"
15944 }
15945}
15946
15947#[derive(Clone, Default, PartialEq)]
15950#[non_exhaustive]
15951pub struct PluginInstanceAction {
15952 pub action_id: std::string::String,
15960
15961 pub state: crate::model::plugin_instance_action::State,
15963
15964 pub schedule_cron_expression: std::string::String,
15967
15968 pub curation_config: std::option::Option<crate::model::CurationConfig>,
15971
15972 pub schedule_time_zone: std::string::String,
15975
15976 pub service_account: std::string::String,
15979
15980 pub resource_config: std::option::Option<crate::model::plugin_instance_action::ResourceConfig>,
15984
15985 pub action_status: std::option::Option<crate::model::plugin_instance_action::ActionStatus>,
15987
15988 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15989}
15990
15991impl PluginInstanceAction {
15992 pub fn new() -> Self {
15993 std::default::Default::default()
15994 }
15995
15996 pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15998 self.action_id = v.into();
15999 self
16000 }
16001
16002 pub fn set_state<T: std::convert::Into<crate::model::plugin_instance_action::State>>(
16004 mut self,
16005 v: T,
16006 ) -> Self {
16007 self.state = v.into();
16008 self
16009 }
16010
16011 pub fn set_schedule_cron_expression<T: std::convert::Into<std::string::String>>(
16013 mut self,
16014 v: T,
16015 ) -> Self {
16016 self.schedule_cron_expression = v.into();
16017 self
16018 }
16019
16020 pub fn set_curation_config<T>(mut self, v: T) -> Self
16022 where
16023 T: std::convert::Into<crate::model::CurationConfig>,
16024 {
16025 self.curation_config = std::option::Option::Some(v.into());
16026 self
16027 }
16028
16029 pub fn set_or_clear_curation_config<T>(mut self, v: std::option::Option<T>) -> Self
16031 where
16032 T: std::convert::Into<crate::model::CurationConfig>,
16033 {
16034 self.curation_config = v.map(|x| x.into());
16035 self
16036 }
16037
16038 pub fn set_schedule_time_zone<T: std::convert::Into<std::string::String>>(
16040 mut self,
16041 v: T,
16042 ) -> Self {
16043 self.schedule_time_zone = v.into();
16044 self
16045 }
16046
16047 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16049 self.service_account = v.into();
16050 self
16051 }
16052
16053 pub fn set_resource_config<T>(mut self, v: T) -> Self
16055 where
16056 T: std::convert::Into<crate::model::plugin_instance_action::ResourceConfig>,
16057 {
16058 self.resource_config = std::option::Option::Some(v.into());
16059 self
16060 }
16061
16062 pub fn set_or_clear_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
16064 where
16065 T: std::convert::Into<crate::model::plugin_instance_action::ResourceConfig>,
16066 {
16067 self.resource_config = v.map(|x| x.into());
16068 self
16069 }
16070
16071 pub fn set_action_status<
16076 T: std::convert::Into<std::option::Option<crate::model::plugin_instance_action::ActionStatus>>,
16077 >(
16078 mut self,
16079 v: T,
16080 ) -> Self {
16081 self.action_status = v.into();
16082 self
16083 }
16084
16085 pub fn hub_instance_action(
16089 &self,
16090 ) -> std::option::Option<&std::boxed::Box<crate::model::ExecutionStatus>> {
16091 #[allow(unreachable_patterns)]
16092 self.action_status.as_ref().and_then(|v| match v {
16093 crate::model::plugin_instance_action::ActionStatus::HubInstanceAction(v) => {
16094 std::option::Option::Some(v)
16095 }
16096 _ => std::option::Option::None,
16097 })
16098 }
16099
16100 pub fn set_hub_instance_action<
16106 T: std::convert::Into<std::boxed::Box<crate::model::ExecutionStatus>>,
16107 >(
16108 mut self,
16109 v: T,
16110 ) -> Self {
16111 self.action_status = std::option::Option::Some(
16112 crate::model::plugin_instance_action::ActionStatus::HubInstanceAction(v.into()),
16113 );
16114 self
16115 }
16116}
16117
16118impl wkt::message::Message for PluginInstanceAction {
16119 fn typename() -> &'static str {
16120 "type.googleapis.com/google.cloud.apihub.v1.PluginInstanceAction"
16121 }
16122}
16123
16124pub mod plugin_instance_action {
16126 #[allow(unused_imports)]
16127 use super::*;
16128
16129 #[derive(Clone, Default, PartialEq)]
16131 #[non_exhaustive]
16132 pub struct ResourceConfig {
16133 pub action_type: crate::model::ActionType,
16135
16136 pub pubsub_topic: std::string::String,
16139
16140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16141 }
16142
16143 impl ResourceConfig {
16144 pub fn new() -> Self {
16145 std::default::Default::default()
16146 }
16147
16148 pub fn set_action_type<T: std::convert::Into<crate::model::ActionType>>(
16150 mut self,
16151 v: T,
16152 ) -> Self {
16153 self.action_type = v.into();
16154 self
16155 }
16156
16157 pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(
16159 mut self,
16160 v: T,
16161 ) -> Self {
16162 self.pubsub_topic = v.into();
16163 self
16164 }
16165 }
16166
16167 impl wkt::message::Message for ResourceConfig {
16168 fn typename() -> &'static str {
16169 "type.googleapis.com/google.cloud.apihub.v1.PluginInstanceAction.ResourceConfig"
16170 }
16171 }
16172
16173 #[derive(Clone, Debug, PartialEq)]
16189 #[non_exhaustive]
16190 pub enum State {
16191 Unspecified,
16193 Enabled,
16196 Disabled,
16201 Enabling,
16203 Disabling,
16205 Error,
16216 UnknownValue(state::UnknownValue),
16221 }
16222
16223 #[doc(hidden)]
16224 pub mod state {
16225 #[allow(unused_imports)]
16226 use super::*;
16227 #[derive(Clone, Debug, PartialEq)]
16228 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16229 }
16230
16231 impl State {
16232 pub fn value(&self) -> std::option::Option<i32> {
16237 match self {
16238 Self::Unspecified => std::option::Option::Some(0),
16239 Self::Enabled => std::option::Option::Some(1),
16240 Self::Disabled => std::option::Option::Some(2),
16241 Self::Enabling => std::option::Option::Some(3),
16242 Self::Disabling => std::option::Option::Some(4),
16243 Self::Error => std::option::Option::Some(5),
16244 Self::UnknownValue(u) => u.0.value(),
16245 }
16246 }
16247
16248 pub fn name(&self) -> std::option::Option<&str> {
16253 match self {
16254 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16255 Self::Enabled => std::option::Option::Some("ENABLED"),
16256 Self::Disabled => std::option::Option::Some("DISABLED"),
16257 Self::Enabling => std::option::Option::Some("ENABLING"),
16258 Self::Disabling => std::option::Option::Some("DISABLING"),
16259 Self::Error => std::option::Option::Some("ERROR"),
16260 Self::UnknownValue(u) => u.0.name(),
16261 }
16262 }
16263 }
16264
16265 impl std::default::Default for State {
16266 fn default() -> Self {
16267 use std::convert::From;
16268 Self::from(0)
16269 }
16270 }
16271
16272 impl std::fmt::Display for State {
16273 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16274 wkt::internal::display_enum(f, self.name(), self.value())
16275 }
16276 }
16277
16278 impl std::convert::From<i32> for State {
16279 fn from(value: i32) -> Self {
16280 match value {
16281 0 => Self::Unspecified,
16282 1 => Self::Enabled,
16283 2 => Self::Disabled,
16284 3 => Self::Enabling,
16285 4 => Self::Disabling,
16286 5 => Self::Error,
16287 _ => Self::UnknownValue(state::UnknownValue(
16288 wkt::internal::UnknownEnumValue::Integer(value),
16289 )),
16290 }
16291 }
16292 }
16293
16294 impl std::convert::From<&str> for State {
16295 fn from(value: &str) -> Self {
16296 use std::string::ToString;
16297 match value {
16298 "STATE_UNSPECIFIED" => Self::Unspecified,
16299 "ENABLED" => Self::Enabled,
16300 "DISABLED" => Self::Disabled,
16301 "ENABLING" => Self::Enabling,
16302 "DISABLING" => Self::Disabling,
16303 "ERROR" => Self::Error,
16304 _ => Self::UnknownValue(state::UnknownValue(
16305 wkt::internal::UnknownEnumValue::String(value.to_string()),
16306 )),
16307 }
16308 }
16309 }
16310
16311 impl serde::ser::Serialize for State {
16312 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16313 where
16314 S: serde::Serializer,
16315 {
16316 match self {
16317 Self::Unspecified => serializer.serialize_i32(0),
16318 Self::Enabled => serializer.serialize_i32(1),
16319 Self::Disabled => serializer.serialize_i32(2),
16320 Self::Enabling => serializer.serialize_i32(3),
16321 Self::Disabling => serializer.serialize_i32(4),
16322 Self::Error => serializer.serialize_i32(5),
16323 Self::UnknownValue(u) => u.0.serialize(serializer),
16324 }
16325 }
16326 }
16327
16328 impl<'de> serde::de::Deserialize<'de> for State {
16329 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16330 where
16331 D: serde::Deserializer<'de>,
16332 {
16333 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16334 ".google.cloud.apihub.v1.PluginInstanceAction.State",
16335 ))
16336 }
16337 }
16338
16339 #[derive(Clone, Debug, PartialEq)]
16341 #[non_exhaustive]
16342 pub enum ActionStatus {
16343 HubInstanceAction(std::boxed::Box<crate::model::ExecutionStatus>),
16346 }
16347}
16348
16349#[derive(Clone, Default, PartialEq)]
16353#[non_exhaustive]
16354pub struct PluginInstance {
16355 pub name: std::string::String,
16359
16360 pub display_name: std::string::String,
16363
16364 pub auth_config: std::option::Option<crate::model::AuthConfig>,
16366
16367 pub additional_config:
16373 std::collections::HashMap<std::string::String, crate::model::ConfigVariable>,
16374
16375 pub state: crate::model::plugin_instance::State,
16378
16379 pub error_message: std::string::String,
16384
16385 pub actions: std::vec::Vec<crate::model::PluginInstanceAction>,
16387
16388 pub create_time: std::option::Option<wkt::Timestamp>,
16390
16391 pub update_time: std::option::Option<wkt::Timestamp>,
16394
16395 pub source_project_id: std::string::String,
16400
16401 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16402}
16403
16404impl PluginInstance {
16405 pub fn new() -> Self {
16406 std::default::Default::default()
16407 }
16408
16409 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16411 self.name = v.into();
16412 self
16413 }
16414
16415 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16417 self.display_name = v.into();
16418 self
16419 }
16420
16421 pub fn set_auth_config<T>(mut self, v: T) -> Self
16423 where
16424 T: std::convert::Into<crate::model::AuthConfig>,
16425 {
16426 self.auth_config = std::option::Option::Some(v.into());
16427 self
16428 }
16429
16430 pub fn set_or_clear_auth_config<T>(mut self, v: std::option::Option<T>) -> Self
16432 where
16433 T: std::convert::Into<crate::model::AuthConfig>,
16434 {
16435 self.auth_config = v.map(|x| x.into());
16436 self
16437 }
16438
16439 pub fn set_additional_config<T, K, V>(mut self, v: T) -> Self
16441 where
16442 T: std::iter::IntoIterator<Item = (K, V)>,
16443 K: std::convert::Into<std::string::String>,
16444 V: std::convert::Into<crate::model::ConfigVariable>,
16445 {
16446 use std::iter::Iterator;
16447 self.additional_config = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16448 self
16449 }
16450
16451 pub fn set_state<T: std::convert::Into<crate::model::plugin_instance::State>>(
16453 mut self,
16454 v: T,
16455 ) -> Self {
16456 self.state = v.into();
16457 self
16458 }
16459
16460 pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16462 self.error_message = v.into();
16463 self
16464 }
16465
16466 pub fn set_actions<T, V>(mut self, v: T) -> Self
16468 where
16469 T: std::iter::IntoIterator<Item = V>,
16470 V: std::convert::Into<crate::model::PluginInstanceAction>,
16471 {
16472 use std::iter::Iterator;
16473 self.actions = v.into_iter().map(|i| i.into()).collect();
16474 self
16475 }
16476
16477 pub fn set_create_time<T>(mut self, v: T) -> Self
16479 where
16480 T: std::convert::Into<wkt::Timestamp>,
16481 {
16482 self.create_time = std::option::Option::Some(v.into());
16483 self
16484 }
16485
16486 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16488 where
16489 T: std::convert::Into<wkt::Timestamp>,
16490 {
16491 self.create_time = v.map(|x| x.into());
16492 self
16493 }
16494
16495 pub fn set_update_time<T>(mut self, v: T) -> Self
16497 where
16498 T: std::convert::Into<wkt::Timestamp>,
16499 {
16500 self.update_time = std::option::Option::Some(v.into());
16501 self
16502 }
16503
16504 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16506 where
16507 T: std::convert::Into<wkt::Timestamp>,
16508 {
16509 self.update_time = v.map(|x| x.into());
16510 self
16511 }
16512
16513 pub fn set_source_project_id<T: std::convert::Into<std::string::String>>(
16515 mut self,
16516 v: T,
16517 ) -> Self {
16518 self.source_project_id = v.into();
16519 self
16520 }
16521}
16522
16523impl wkt::message::Message for PluginInstance {
16524 fn typename() -> &'static str {
16525 "type.googleapis.com/google.cloud.apihub.v1.PluginInstance"
16526 }
16527}
16528
16529pub mod plugin_instance {
16531 #[allow(unused_imports)]
16532 use super::*;
16533
16534 #[derive(Clone, Debug, PartialEq)]
16550 #[non_exhaustive]
16551 pub enum State {
16552 Unspecified,
16554 Creating,
16556 Active,
16559 ApplyingConfig,
16567 Error,
16576 Failed,
16580 Deleting,
16584 UnknownValue(state::UnknownValue),
16589 }
16590
16591 #[doc(hidden)]
16592 pub mod state {
16593 #[allow(unused_imports)]
16594 use super::*;
16595 #[derive(Clone, Debug, PartialEq)]
16596 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16597 }
16598
16599 impl State {
16600 pub fn value(&self) -> std::option::Option<i32> {
16605 match self {
16606 Self::Unspecified => std::option::Option::Some(0),
16607 Self::Creating => std::option::Option::Some(1),
16608 Self::Active => std::option::Option::Some(2),
16609 Self::ApplyingConfig => std::option::Option::Some(3),
16610 Self::Error => std::option::Option::Some(4),
16611 Self::Failed => std::option::Option::Some(5),
16612 Self::Deleting => std::option::Option::Some(6),
16613 Self::UnknownValue(u) => u.0.value(),
16614 }
16615 }
16616
16617 pub fn name(&self) -> std::option::Option<&str> {
16622 match self {
16623 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16624 Self::Creating => std::option::Option::Some("CREATING"),
16625 Self::Active => std::option::Option::Some("ACTIVE"),
16626 Self::ApplyingConfig => std::option::Option::Some("APPLYING_CONFIG"),
16627 Self::Error => std::option::Option::Some("ERROR"),
16628 Self::Failed => std::option::Option::Some("FAILED"),
16629 Self::Deleting => std::option::Option::Some("DELETING"),
16630 Self::UnknownValue(u) => u.0.name(),
16631 }
16632 }
16633 }
16634
16635 impl std::default::Default for State {
16636 fn default() -> Self {
16637 use std::convert::From;
16638 Self::from(0)
16639 }
16640 }
16641
16642 impl std::fmt::Display for State {
16643 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16644 wkt::internal::display_enum(f, self.name(), self.value())
16645 }
16646 }
16647
16648 impl std::convert::From<i32> for State {
16649 fn from(value: i32) -> Self {
16650 match value {
16651 0 => Self::Unspecified,
16652 1 => Self::Creating,
16653 2 => Self::Active,
16654 3 => Self::ApplyingConfig,
16655 4 => Self::Error,
16656 5 => Self::Failed,
16657 6 => Self::Deleting,
16658 _ => Self::UnknownValue(state::UnknownValue(
16659 wkt::internal::UnknownEnumValue::Integer(value),
16660 )),
16661 }
16662 }
16663 }
16664
16665 impl std::convert::From<&str> for State {
16666 fn from(value: &str) -> Self {
16667 use std::string::ToString;
16668 match value {
16669 "STATE_UNSPECIFIED" => Self::Unspecified,
16670 "CREATING" => Self::Creating,
16671 "ACTIVE" => Self::Active,
16672 "APPLYING_CONFIG" => Self::ApplyingConfig,
16673 "ERROR" => Self::Error,
16674 "FAILED" => Self::Failed,
16675 "DELETING" => Self::Deleting,
16676 _ => Self::UnknownValue(state::UnknownValue(
16677 wkt::internal::UnknownEnumValue::String(value.to_string()),
16678 )),
16679 }
16680 }
16681 }
16682
16683 impl serde::ser::Serialize for State {
16684 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16685 where
16686 S: serde::Serializer,
16687 {
16688 match self {
16689 Self::Unspecified => serializer.serialize_i32(0),
16690 Self::Creating => serializer.serialize_i32(1),
16691 Self::Active => serializer.serialize_i32(2),
16692 Self::ApplyingConfig => serializer.serialize_i32(3),
16693 Self::Error => serializer.serialize_i32(4),
16694 Self::Failed => serializer.serialize_i32(5),
16695 Self::Deleting => serializer.serialize_i32(6),
16696 Self::UnknownValue(u) => u.0.serialize(serializer),
16697 }
16698 }
16699 }
16700
16701 impl<'de> serde::de::Deserialize<'de> for State {
16702 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16703 where
16704 D: serde::Deserializer<'de>,
16705 {
16706 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16707 ".google.cloud.apihub.v1.PluginInstance.State",
16708 ))
16709 }
16710 }
16711}
16712
16713#[derive(Clone, Default, PartialEq)]
16715#[non_exhaustive]
16716pub struct CurationConfig {
16717 pub curation_type: crate::model::CurationType,
16719
16720 pub curation_config: std::option::Option<crate::model::curation_config::CurationConfig>,
16722
16723 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16724}
16725
16726impl CurationConfig {
16727 pub fn new() -> Self {
16728 std::default::Default::default()
16729 }
16730
16731 pub fn set_curation_type<T: std::convert::Into<crate::model::CurationType>>(
16733 mut self,
16734 v: T,
16735 ) -> Self {
16736 self.curation_type = v.into();
16737 self
16738 }
16739
16740 pub fn set_curation_config<
16745 T: std::convert::Into<std::option::Option<crate::model::curation_config::CurationConfig>>,
16746 >(
16747 mut self,
16748 v: T,
16749 ) -> Self {
16750 self.curation_config = v.into();
16751 self
16752 }
16753
16754 pub fn custom_curation(
16758 &self,
16759 ) -> std::option::Option<&std::boxed::Box<crate::model::curation_config::CustomCuration>> {
16760 #[allow(unreachable_patterns)]
16761 self.curation_config.as_ref().and_then(|v| match v {
16762 crate::model::curation_config::CurationConfig::CustomCuration(v) => {
16763 std::option::Option::Some(v)
16764 }
16765 _ => std::option::Option::None,
16766 })
16767 }
16768
16769 pub fn set_custom_curation<
16775 T: std::convert::Into<std::boxed::Box<crate::model::curation_config::CustomCuration>>,
16776 >(
16777 mut self,
16778 v: T,
16779 ) -> Self {
16780 self.curation_config = std::option::Option::Some(
16781 crate::model::curation_config::CurationConfig::CustomCuration(v.into()),
16782 );
16783 self
16784 }
16785}
16786
16787impl wkt::message::Message for CurationConfig {
16788 fn typename() -> &'static str {
16789 "type.googleapis.com/google.cloud.apihub.v1.CurationConfig"
16790 }
16791}
16792
16793pub mod curation_config {
16795 #[allow(unused_imports)]
16796 use super::*;
16797
16798 #[derive(Clone, Default, PartialEq)]
16800 #[non_exhaustive]
16801 pub struct CustomCuration {
16802 pub curation: std::string::String,
16806
16807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16808 }
16809
16810 impl CustomCuration {
16811 pub fn new() -> Self {
16812 std::default::Default::default()
16813 }
16814
16815 pub fn set_curation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16817 self.curation = v.into();
16818 self
16819 }
16820 }
16821
16822 impl wkt::message::Message for CustomCuration {
16823 fn typename() -> &'static str {
16824 "type.googleapis.com/google.cloud.apihub.v1.CurationConfig.CustomCuration"
16825 }
16826 }
16827
16828 #[derive(Clone, Debug, PartialEq)]
16830 #[non_exhaustive]
16831 pub enum CurationConfig {
16832 CustomCuration(std::boxed::Box<crate::model::curation_config::CustomCuration>),
16834 }
16835}
16836
16837#[derive(Clone, Default, PartialEq)]
16839#[non_exhaustive]
16840pub struct ExecutionStatus {
16841 pub current_execution_state: crate::model::execution_status::CurrentExecutionState,
16843
16844 pub last_execution: std::option::Option<crate::model::execution_status::LastExecution>,
16846
16847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16848}
16849
16850impl ExecutionStatus {
16851 pub fn new() -> Self {
16852 std::default::Default::default()
16853 }
16854
16855 pub fn set_current_execution_state<
16857 T: std::convert::Into<crate::model::execution_status::CurrentExecutionState>,
16858 >(
16859 mut self,
16860 v: T,
16861 ) -> Self {
16862 self.current_execution_state = v.into();
16863 self
16864 }
16865
16866 pub fn set_last_execution<T>(mut self, v: T) -> Self
16868 where
16869 T: std::convert::Into<crate::model::execution_status::LastExecution>,
16870 {
16871 self.last_execution = std::option::Option::Some(v.into());
16872 self
16873 }
16874
16875 pub fn set_or_clear_last_execution<T>(mut self, v: std::option::Option<T>) -> Self
16877 where
16878 T: std::convert::Into<crate::model::execution_status::LastExecution>,
16879 {
16880 self.last_execution = v.map(|x| x.into());
16881 self
16882 }
16883}
16884
16885impl wkt::message::Message for ExecutionStatus {
16886 fn typename() -> &'static str {
16887 "type.googleapis.com/google.cloud.apihub.v1.ExecutionStatus"
16888 }
16889}
16890
16891pub mod execution_status {
16893 #[allow(unused_imports)]
16894 use super::*;
16895
16896 #[derive(Clone, Default, PartialEq)]
16898 #[non_exhaustive]
16899 pub struct LastExecution {
16900 pub result: crate::model::execution_status::last_execution::Result,
16902
16903 pub error_message: std::string::String,
16906
16907 pub start_time: std::option::Option<wkt::Timestamp>,
16909
16910 pub end_time: std::option::Option<wkt::Timestamp>,
16912
16913 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16914 }
16915
16916 impl LastExecution {
16917 pub fn new() -> Self {
16918 std::default::Default::default()
16919 }
16920
16921 pub fn set_result<
16923 T: std::convert::Into<crate::model::execution_status::last_execution::Result>,
16924 >(
16925 mut self,
16926 v: T,
16927 ) -> Self {
16928 self.result = v.into();
16929 self
16930 }
16931
16932 pub fn set_error_message<T: std::convert::Into<std::string::String>>(
16934 mut self,
16935 v: T,
16936 ) -> Self {
16937 self.error_message = v.into();
16938 self
16939 }
16940
16941 pub fn set_start_time<T>(mut self, v: T) -> Self
16943 where
16944 T: std::convert::Into<wkt::Timestamp>,
16945 {
16946 self.start_time = std::option::Option::Some(v.into());
16947 self
16948 }
16949
16950 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
16952 where
16953 T: std::convert::Into<wkt::Timestamp>,
16954 {
16955 self.start_time = v.map(|x| x.into());
16956 self
16957 }
16958
16959 pub fn set_end_time<T>(mut self, v: T) -> Self
16961 where
16962 T: std::convert::Into<wkt::Timestamp>,
16963 {
16964 self.end_time = std::option::Option::Some(v.into());
16965 self
16966 }
16967
16968 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
16970 where
16971 T: std::convert::Into<wkt::Timestamp>,
16972 {
16973 self.end_time = v.map(|x| x.into());
16974 self
16975 }
16976 }
16977
16978 impl wkt::message::Message for LastExecution {
16979 fn typename() -> &'static str {
16980 "type.googleapis.com/google.cloud.apihub.v1.ExecutionStatus.LastExecution"
16981 }
16982 }
16983
16984 pub mod last_execution {
16986 #[allow(unused_imports)]
16987 use super::*;
16988
16989 #[derive(Clone, Debug, PartialEq)]
17005 #[non_exhaustive]
17006 pub enum Result {
17007 Unspecified,
17009 Succeeded,
17011 Failed,
17013 UnknownValue(result::UnknownValue),
17018 }
17019
17020 #[doc(hidden)]
17021 pub mod result {
17022 #[allow(unused_imports)]
17023 use super::*;
17024 #[derive(Clone, Debug, PartialEq)]
17025 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17026 }
17027
17028 impl Result {
17029 pub fn value(&self) -> std::option::Option<i32> {
17034 match self {
17035 Self::Unspecified => std::option::Option::Some(0),
17036 Self::Succeeded => std::option::Option::Some(1),
17037 Self::Failed => std::option::Option::Some(2),
17038 Self::UnknownValue(u) => u.0.value(),
17039 }
17040 }
17041
17042 pub fn name(&self) -> std::option::Option<&str> {
17047 match self {
17048 Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
17049 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
17050 Self::Failed => std::option::Option::Some("FAILED"),
17051 Self::UnknownValue(u) => u.0.name(),
17052 }
17053 }
17054 }
17055
17056 impl std::default::Default for Result {
17057 fn default() -> Self {
17058 use std::convert::From;
17059 Self::from(0)
17060 }
17061 }
17062
17063 impl std::fmt::Display for Result {
17064 fn fmt(
17065 &self,
17066 f: &mut std::fmt::Formatter<'_>,
17067 ) -> std::result::Result<(), std::fmt::Error> {
17068 wkt::internal::display_enum(f, self.name(), self.value())
17069 }
17070 }
17071
17072 impl std::convert::From<i32> for Result {
17073 fn from(value: i32) -> Self {
17074 match value {
17075 0 => Self::Unspecified,
17076 1 => Self::Succeeded,
17077 2 => Self::Failed,
17078 _ => Self::UnknownValue(result::UnknownValue(
17079 wkt::internal::UnknownEnumValue::Integer(value),
17080 )),
17081 }
17082 }
17083 }
17084
17085 impl std::convert::From<&str> for Result {
17086 fn from(value: &str) -> Self {
17087 use std::string::ToString;
17088 match value {
17089 "RESULT_UNSPECIFIED" => Self::Unspecified,
17090 "SUCCEEDED" => Self::Succeeded,
17091 "FAILED" => Self::Failed,
17092 _ => Self::UnknownValue(result::UnknownValue(
17093 wkt::internal::UnknownEnumValue::String(value.to_string()),
17094 )),
17095 }
17096 }
17097 }
17098
17099 impl serde::ser::Serialize for Result {
17100 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17101 where
17102 S: serde::Serializer,
17103 {
17104 match self {
17105 Self::Unspecified => serializer.serialize_i32(0),
17106 Self::Succeeded => serializer.serialize_i32(1),
17107 Self::Failed => serializer.serialize_i32(2),
17108 Self::UnknownValue(u) => u.0.serialize(serializer),
17109 }
17110 }
17111 }
17112
17113 impl<'de> serde::de::Deserialize<'de> for Result {
17114 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17115 where
17116 D: serde::Deserializer<'de>,
17117 {
17118 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
17119 ".google.cloud.apihub.v1.ExecutionStatus.LastExecution.Result",
17120 ))
17121 }
17122 }
17123 }
17124
17125 #[derive(Clone, Debug, PartialEq)]
17141 #[non_exhaustive]
17142 pub enum CurrentExecutionState {
17143 Unspecified,
17145 Running,
17147 NotRunning,
17149 UnknownValue(current_execution_state::UnknownValue),
17154 }
17155
17156 #[doc(hidden)]
17157 pub mod current_execution_state {
17158 #[allow(unused_imports)]
17159 use super::*;
17160 #[derive(Clone, Debug, PartialEq)]
17161 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17162 }
17163
17164 impl CurrentExecutionState {
17165 pub fn value(&self) -> std::option::Option<i32> {
17170 match self {
17171 Self::Unspecified => std::option::Option::Some(0),
17172 Self::Running => std::option::Option::Some(1),
17173 Self::NotRunning => std::option::Option::Some(2),
17174 Self::UnknownValue(u) => u.0.value(),
17175 }
17176 }
17177
17178 pub fn name(&self) -> std::option::Option<&str> {
17183 match self {
17184 Self::Unspecified => {
17185 std::option::Option::Some("CURRENT_EXECUTION_STATE_UNSPECIFIED")
17186 }
17187 Self::Running => std::option::Option::Some("RUNNING"),
17188 Self::NotRunning => std::option::Option::Some("NOT_RUNNING"),
17189 Self::UnknownValue(u) => u.0.name(),
17190 }
17191 }
17192 }
17193
17194 impl std::default::Default for CurrentExecutionState {
17195 fn default() -> Self {
17196 use std::convert::From;
17197 Self::from(0)
17198 }
17199 }
17200
17201 impl std::fmt::Display for CurrentExecutionState {
17202 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17203 wkt::internal::display_enum(f, self.name(), self.value())
17204 }
17205 }
17206
17207 impl std::convert::From<i32> for CurrentExecutionState {
17208 fn from(value: i32) -> Self {
17209 match value {
17210 0 => Self::Unspecified,
17211 1 => Self::Running,
17212 2 => Self::NotRunning,
17213 _ => Self::UnknownValue(current_execution_state::UnknownValue(
17214 wkt::internal::UnknownEnumValue::Integer(value),
17215 )),
17216 }
17217 }
17218 }
17219
17220 impl std::convert::From<&str> for CurrentExecutionState {
17221 fn from(value: &str) -> Self {
17222 use std::string::ToString;
17223 match value {
17224 "CURRENT_EXECUTION_STATE_UNSPECIFIED" => Self::Unspecified,
17225 "RUNNING" => Self::Running,
17226 "NOT_RUNNING" => Self::NotRunning,
17227 _ => Self::UnknownValue(current_execution_state::UnknownValue(
17228 wkt::internal::UnknownEnumValue::String(value.to_string()),
17229 )),
17230 }
17231 }
17232 }
17233
17234 impl serde::ser::Serialize for CurrentExecutionState {
17235 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17236 where
17237 S: serde::Serializer,
17238 {
17239 match self {
17240 Self::Unspecified => serializer.serialize_i32(0),
17241 Self::Running => serializer.serialize_i32(1),
17242 Self::NotRunning => serializer.serialize_i32(2),
17243 Self::UnknownValue(u) => u.0.serialize(serializer),
17244 }
17245 }
17246 }
17247
17248 impl<'de> serde::de::Deserialize<'de> for CurrentExecutionState {
17249 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17250 where
17251 D: serde::Deserializer<'de>,
17252 {
17253 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CurrentExecutionState>::new(
17254 ".google.cloud.apihub.v1.ExecutionStatus.CurrentExecutionState",
17255 ))
17256 }
17257 }
17258}
17259
17260#[derive(Clone, Default, PartialEq)]
17265#[non_exhaustive]
17266pub struct CreatePluginRequest {
17267 pub parent: std::string::String,
17270
17271 pub plugin_id: std::string::String,
17285
17286 pub plugin: std::option::Option<crate::model::Plugin>,
17288
17289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17290}
17291
17292impl CreatePluginRequest {
17293 pub fn new() -> Self {
17294 std::default::Default::default()
17295 }
17296
17297 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17299 self.parent = v.into();
17300 self
17301 }
17302
17303 pub fn set_plugin_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17305 self.plugin_id = v.into();
17306 self
17307 }
17308
17309 pub fn set_plugin<T>(mut self, v: T) -> Self
17311 where
17312 T: std::convert::Into<crate::model::Plugin>,
17313 {
17314 self.plugin = std::option::Option::Some(v.into());
17315 self
17316 }
17317
17318 pub fn set_or_clear_plugin<T>(mut self, v: std::option::Option<T>) -> Self
17320 where
17321 T: std::convert::Into<crate::model::Plugin>,
17322 {
17323 self.plugin = v.map(|x| x.into());
17324 self
17325 }
17326}
17327
17328impl wkt::message::Message for CreatePluginRequest {
17329 fn typename() -> &'static str {
17330 "type.googleapis.com/google.cloud.apihub.v1.CreatePluginRequest"
17331 }
17332}
17333
17334#[derive(Clone, Default, PartialEq)]
17336#[non_exhaustive]
17337pub struct DeletePluginRequest {
17338 pub name: std::string::String,
17341
17342 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17343}
17344
17345impl DeletePluginRequest {
17346 pub fn new() -> Self {
17347 std::default::Default::default()
17348 }
17349
17350 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17352 self.name = v.into();
17353 self
17354 }
17355}
17356
17357impl wkt::message::Message for DeletePluginRequest {
17358 fn typename() -> &'static str {
17359 "type.googleapis.com/google.cloud.apihub.v1.DeletePluginRequest"
17360 }
17361}
17362
17363#[derive(Clone, Default, PartialEq)]
17368#[non_exhaustive]
17369pub struct ListPluginsRequest {
17370 pub parent: std::string::String,
17373
17374 pub filter: std::string::String,
17398
17399 pub page_size: i32,
17404
17405 pub page_token: std::string::String,
17411
17412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17413}
17414
17415impl ListPluginsRequest {
17416 pub fn new() -> Self {
17417 std::default::Default::default()
17418 }
17419
17420 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17422 self.parent = v.into();
17423 self
17424 }
17425
17426 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17428 self.filter = v.into();
17429 self
17430 }
17431
17432 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17434 self.page_size = v.into();
17435 self
17436 }
17437
17438 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17440 self.page_token = v.into();
17441 self
17442 }
17443}
17444
17445impl wkt::message::Message for ListPluginsRequest {
17446 fn typename() -> &'static str {
17447 "type.googleapis.com/google.cloud.apihub.v1.ListPluginsRequest"
17448 }
17449}
17450
17451#[derive(Clone, Default, PartialEq)]
17456#[non_exhaustive]
17457pub struct ListPluginsResponse {
17458 pub plugins: std::vec::Vec<crate::model::Plugin>,
17460
17461 pub next_page_token: std::string::String,
17464
17465 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17466}
17467
17468impl ListPluginsResponse {
17469 pub fn new() -> Self {
17470 std::default::Default::default()
17471 }
17472
17473 pub fn set_plugins<T, V>(mut self, v: T) -> Self
17475 where
17476 T: std::iter::IntoIterator<Item = V>,
17477 V: std::convert::Into<crate::model::Plugin>,
17478 {
17479 use std::iter::Iterator;
17480 self.plugins = v.into_iter().map(|i| i.into()).collect();
17481 self
17482 }
17483
17484 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17486 self.next_page_token = v.into();
17487 self
17488 }
17489}
17490
17491impl wkt::message::Message for ListPluginsResponse {
17492 fn typename() -> &'static str {
17493 "type.googleapis.com/google.cloud.apihub.v1.ListPluginsResponse"
17494 }
17495}
17496
17497#[doc(hidden)]
17498impl gax::paginator::internal::PageableResponse for ListPluginsResponse {
17499 type PageItem = crate::model::Plugin;
17500
17501 fn items(self) -> std::vec::Vec<Self::PageItem> {
17502 self.plugins
17503 }
17504
17505 fn next_page_token(&self) -> std::string::String {
17506 use std::clone::Clone;
17507 self.next_page_token.clone()
17508 }
17509}
17510
17511#[derive(Clone, Default, PartialEq)]
17517#[non_exhaustive]
17518pub struct CreatePluginInstanceRequest {
17519 pub parent: std::string::String,
17522
17523 pub plugin_instance_id: std::string::String,
17535
17536 pub plugin_instance: std::option::Option<crate::model::PluginInstance>,
17538
17539 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17540}
17541
17542impl CreatePluginInstanceRequest {
17543 pub fn new() -> Self {
17544 std::default::Default::default()
17545 }
17546
17547 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17549 self.parent = v.into();
17550 self
17551 }
17552
17553 pub fn set_plugin_instance_id<T: std::convert::Into<std::string::String>>(
17555 mut self,
17556 v: T,
17557 ) -> Self {
17558 self.plugin_instance_id = v.into();
17559 self
17560 }
17561
17562 pub fn set_plugin_instance<T>(mut self, v: T) -> Self
17564 where
17565 T: std::convert::Into<crate::model::PluginInstance>,
17566 {
17567 self.plugin_instance = std::option::Option::Some(v.into());
17568 self
17569 }
17570
17571 pub fn set_or_clear_plugin_instance<T>(mut self, v: std::option::Option<T>) -> Self
17573 where
17574 T: std::convert::Into<crate::model::PluginInstance>,
17575 {
17576 self.plugin_instance = v.map(|x| x.into());
17577 self
17578 }
17579}
17580
17581impl wkt::message::Message for CreatePluginInstanceRequest {
17582 fn typename() -> &'static str {
17583 "type.googleapis.com/google.cloud.apihub.v1.CreatePluginInstanceRequest"
17584 }
17585}
17586
17587#[derive(Clone, Default, PartialEq)]
17593#[non_exhaustive]
17594pub struct ExecutePluginInstanceActionRequest {
17595 pub name: std::string::String,
17599
17600 pub action_execution_detail: std::option::Option<crate::model::ActionExecutionDetail>,
17602
17603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17604}
17605
17606impl ExecutePluginInstanceActionRequest {
17607 pub fn new() -> Self {
17608 std::default::Default::default()
17609 }
17610
17611 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17613 self.name = v.into();
17614 self
17615 }
17616
17617 pub fn set_action_execution_detail<T>(mut self, v: T) -> Self
17619 where
17620 T: std::convert::Into<crate::model::ActionExecutionDetail>,
17621 {
17622 self.action_execution_detail = std::option::Option::Some(v.into());
17623 self
17624 }
17625
17626 pub fn set_or_clear_action_execution_detail<T>(mut self, v: std::option::Option<T>) -> Self
17628 where
17629 T: std::convert::Into<crate::model::ActionExecutionDetail>,
17630 {
17631 self.action_execution_detail = v.map(|x| x.into());
17632 self
17633 }
17634}
17635
17636impl wkt::message::Message for ExecutePluginInstanceActionRequest {
17637 fn typename() -> &'static str {
17638 "type.googleapis.com/google.cloud.apihub.v1.ExecutePluginInstanceActionRequest"
17639 }
17640}
17641
17642#[derive(Clone, Default, PartialEq)]
17644#[non_exhaustive]
17645pub struct ActionExecutionDetail {
17646 pub action_id: std::string::String,
17648
17649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17650}
17651
17652impl ActionExecutionDetail {
17653 pub fn new() -> Self {
17654 std::default::Default::default()
17655 }
17656
17657 pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17659 self.action_id = v.into();
17660 self
17661 }
17662}
17663
17664impl wkt::message::Message for ActionExecutionDetail {
17665 fn typename() -> &'static str {
17666 "type.googleapis.com/google.cloud.apihub.v1.ActionExecutionDetail"
17667 }
17668}
17669
17670#[derive(Clone, Default, PartialEq)]
17676#[non_exhaustive]
17677pub struct ExecutePluginInstanceActionResponse {
17678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17679}
17680
17681impl ExecutePluginInstanceActionResponse {
17682 pub fn new() -> Self {
17683 std::default::Default::default()
17684 }
17685}
17686
17687impl wkt::message::Message for ExecutePluginInstanceActionResponse {
17688 fn typename() -> &'static str {
17689 "type.googleapis.com/google.cloud.apihub.v1.ExecutePluginInstanceActionResponse"
17690 }
17691}
17692
17693#[derive(Clone, Default, PartialEq)]
17699#[non_exhaustive]
17700pub struct GetPluginInstanceRequest {
17701 pub name: std::string::String,
17705
17706 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17707}
17708
17709impl GetPluginInstanceRequest {
17710 pub fn new() -> Self {
17711 std::default::Default::default()
17712 }
17713
17714 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17716 self.name = v.into();
17717 self
17718 }
17719}
17720
17721impl wkt::message::Message for GetPluginInstanceRequest {
17722 fn typename() -> &'static str {
17723 "type.googleapis.com/google.cloud.apihub.v1.GetPluginInstanceRequest"
17724 }
17725}
17726
17727#[derive(Clone, Default, PartialEq)]
17733#[non_exhaustive]
17734pub struct ListPluginInstancesRequest {
17735 pub parent: std::string::String,
17740
17741 pub filter: std::string::String,
17772
17773 pub page_size: i32,
17778
17779 pub page_token: std::string::String,
17785
17786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17787}
17788
17789impl ListPluginInstancesRequest {
17790 pub fn new() -> Self {
17791 std::default::Default::default()
17792 }
17793
17794 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17796 self.parent = v.into();
17797 self
17798 }
17799
17800 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17802 self.filter = v.into();
17803 self
17804 }
17805
17806 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17808 self.page_size = v.into();
17809 self
17810 }
17811
17812 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17814 self.page_token = v.into();
17815 self
17816 }
17817}
17818
17819impl wkt::message::Message for ListPluginInstancesRequest {
17820 fn typename() -> &'static str {
17821 "type.googleapis.com/google.cloud.apihub.v1.ListPluginInstancesRequest"
17822 }
17823}
17824
17825#[derive(Clone, Default, PartialEq)]
17831#[non_exhaustive]
17832pub struct ListPluginInstancesResponse {
17833 pub plugin_instances: std::vec::Vec<crate::model::PluginInstance>,
17835
17836 pub next_page_token: std::string::String,
17839
17840 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17841}
17842
17843impl ListPluginInstancesResponse {
17844 pub fn new() -> Self {
17845 std::default::Default::default()
17846 }
17847
17848 pub fn set_plugin_instances<T, V>(mut self, v: T) -> Self
17850 where
17851 T: std::iter::IntoIterator<Item = V>,
17852 V: std::convert::Into<crate::model::PluginInstance>,
17853 {
17854 use std::iter::Iterator;
17855 self.plugin_instances = v.into_iter().map(|i| i.into()).collect();
17856 self
17857 }
17858
17859 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17861 self.next_page_token = v.into();
17862 self
17863 }
17864}
17865
17866impl wkt::message::Message for ListPluginInstancesResponse {
17867 fn typename() -> &'static str {
17868 "type.googleapis.com/google.cloud.apihub.v1.ListPluginInstancesResponse"
17869 }
17870}
17871
17872#[doc(hidden)]
17873impl gax::paginator::internal::PageableResponse for ListPluginInstancesResponse {
17874 type PageItem = crate::model::PluginInstance;
17875
17876 fn items(self) -> std::vec::Vec<Self::PageItem> {
17877 self.plugin_instances
17878 }
17879
17880 fn next_page_token(&self) -> std::string::String {
17881 use std::clone::Clone;
17882 self.next_page_token.clone()
17883 }
17884}
17885
17886#[derive(Clone, Default, PartialEq)]
17892#[non_exhaustive]
17893pub struct EnablePluginInstanceActionRequest {
17894 pub name: std::string::String,
17898
17899 pub action_id: std::string::String,
17901
17902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17903}
17904
17905impl EnablePluginInstanceActionRequest {
17906 pub fn new() -> Self {
17907 std::default::Default::default()
17908 }
17909
17910 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17912 self.name = v.into();
17913 self
17914 }
17915
17916 pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17918 self.action_id = v.into();
17919 self
17920 }
17921}
17922
17923impl wkt::message::Message for EnablePluginInstanceActionRequest {
17924 fn typename() -> &'static str {
17925 "type.googleapis.com/google.cloud.apihub.v1.EnablePluginInstanceActionRequest"
17926 }
17927}
17928
17929#[derive(Clone, Default, PartialEq)]
17935#[non_exhaustive]
17936pub struct EnablePluginInstanceActionResponse {
17937 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17938}
17939
17940impl EnablePluginInstanceActionResponse {
17941 pub fn new() -> Self {
17942 std::default::Default::default()
17943 }
17944}
17945
17946impl wkt::message::Message for EnablePluginInstanceActionResponse {
17947 fn typename() -> &'static str {
17948 "type.googleapis.com/google.cloud.apihub.v1.EnablePluginInstanceActionResponse"
17949 }
17950}
17951
17952#[derive(Clone, Default, PartialEq)]
17958#[non_exhaustive]
17959pub struct DisablePluginInstanceActionRequest {
17960 pub name: std::string::String,
17964
17965 pub action_id: std::string::String,
17967
17968 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17969}
17970
17971impl DisablePluginInstanceActionRequest {
17972 pub fn new() -> Self {
17973 std::default::Default::default()
17974 }
17975
17976 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17978 self.name = v.into();
17979 self
17980 }
17981
17982 pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17984 self.action_id = v.into();
17985 self
17986 }
17987}
17988
17989impl wkt::message::Message for DisablePluginInstanceActionRequest {
17990 fn typename() -> &'static str {
17991 "type.googleapis.com/google.cloud.apihub.v1.DisablePluginInstanceActionRequest"
17992 }
17993}
17994
17995#[derive(Clone, Default, PartialEq)]
18001#[non_exhaustive]
18002pub struct DisablePluginInstanceActionResponse {
18003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18004}
18005
18006impl DisablePluginInstanceActionResponse {
18007 pub fn new() -> Self {
18008 std::default::Default::default()
18009 }
18010}
18011
18012impl wkt::message::Message for DisablePluginInstanceActionResponse {
18013 fn typename() -> &'static str {
18014 "type.googleapis.com/google.cloud.apihub.v1.DisablePluginInstanceActionResponse"
18015 }
18016}
18017
18018#[derive(Clone, Default, PartialEq)]
18024#[non_exhaustive]
18025pub struct UpdatePluginInstanceRequest {
18026 pub plugin_instance: std::option::Option<crate::model::PluginInstance>,
18028
18029 pub update_mask: std::option::Option<wkt::FieldMask>,
18031
18032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18033}
18034
18035impl UpdatePluginInstanceRequest {
18036 pub fn new() -> Self {
18037 std::default::Default::default()
18038 }
18039
18040 pub fn set_plugin_instance<T>(mut self, v: T) -> Self
18042 where
18043 T: std::convert::Into<crate::model::PluginInstance>,
18044 {
18045 self.plugin_instance = std::option::Option::Some(v.into());
18046 self
18047 }
18048
18049 pub fn set_or_clear_plugin_instance<T>(mut self, v: std::option::Option<T>) -> Self
18051 where
18052 T: std::convert::Into<crate::model::PluginInstance>,
18053 {
18054 self.plugin_instance = v.map(|x| x.into());
18055 self
18056 }
18057
18058 pub fn set_update_mask<T>(mut self, v: T) -> Self
18060 where
18061 T: std::convert::Into<wkt::FieldMask>,
18062 {
18063 self.update_mask = std::option::Option::Some(v.into());
18064 self
18065 }
18066
18067 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18069 where
18070 T: std::convert::Into<wkt::FieldMask>,
18071 {
18072 self.update_mask = v.map(|x| x.into());
18073 self
18074 }
18075}
18076
18077impl wkt::message::Message for UpdatePluginInstanceRequest {
18078 fn typename() -> &'static str {
18079 "type.googleapis.com/google.cloud.apihub.v1.UpdatePluginInstanceRequest"
18080 }
18081}
18082
18083#[derive(Clone, Default, PartialEq)]
18089#[non_exhaustive]
18090pub struct DeletePluginInstanceRequest {
18091 pub name: std::string::String,
18095
18096 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18097}
18098
18099impl DeletePluginInstanceRequest {
18100 pub fn new() -> Self {
18101 std::default::Default::default()
18102 }
18103
18104 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18106 self.name = v.into();
18107 self
18108 }
18109}
18110
18111impl wkt::message::Message for DeletePluginInstanceRequest {
18112 fn typename() -> &'static str {
18113 "type.googleapis.com/google.cloud.apihub.v1.DeletePluginInstanceRequest"
18114 }
18115}
18116
18117#[derive(Clone, Default, PartialEq)]
18123#[non_exhaustive]
18124pub struct CreateApiHubInstanceRequest {
18125 pub parent: std::string::String,
18128
18129 pub api_hub_instance_id: std::string::String,
18136
18137 pub api_hub_instance: std::option::Option<crate::model::ApiHubInstance>,
18139
18140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18141}
18142
18143impl CreateApiHubInstanceRequest {
18144 pub fn new() -> Self {
18145 std::default::Default::default()
18146 }
18147
18148 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18150 self.parent = v.into();
18151 self
18152 }
18153
18154 pub fn set_api_hub_instance_id<T: std::convert::Into<std::string::String>>(
18156 mut self,
18157 v: T,
18158 ) -> Self {
18159 self.api_hub_instance_id = v.into();
18160 self
18161 }
18162
18163 pub fn set_api_hub_instance<T>(mut self, v: T) -> Self
18165 where
18166 T: std::convert::Into<crate::model::ApiHubInstance>,
18167 {
18168 self.api_hub_instance = std::option::Option::Some(v.into());
18169 self
18170 }
18171
18172 pub fn set_or_clear_api_hub_instance<T>(mut self, v: std::option::Option<T>) -> Self
18174 where
18175 T: std::convert::Into<crate::model::ApiHubInstance>,
18176 {
18177 self.api_hub_instance = v.map(|x| x.into());
18178 self
18179 }
18180}
18181
18182impl wkt::message::Message for CreateApiHubInstanceRequest {
18183 fn typename() -> &'static str {
18184 "type.googleapis.com/google.cloud.apihub.v1.CreateApiHubInstanceRequest"
18185 }
18186}
18187
18188#[derive(Clone, Default, PartialEq)]
18194#[non_exhaustive]
18195pub struct DeleteApiHubInstanceRequest {
18196 pub name: std::string::String,
18200
18201 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18202}
18203
18204impl DeleteApiHubInstanceRequest {
18205 pub fn new() -> Self {
18206 std::default::Default::default()
18207 }
18208
18209 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18211 self.name = v.into();
18212 self
18213 }
18214}
18215
18216impl wkt::message::Message for DeleteApiHubInstanceRequest {
18217 fn typename() -> &'static str {
18218 "type.googleapis.com/google.cloud.apihub.v1.DeleteApiHubInstanceRequest"
18219 }
18220}
18221
18222#[derive(Clone, Default, PartialEq)]
18228#[non_exhaustive]
18229pub struct GetApiHubInstanceRequest {
18230 pub name: std::string::String,
18234
18235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18236}
18237
18238impl GetApiHubInstanceRequest {
18239 pub fn new() -> Self {
18240 std::default::Default::default()
18241 }
18242
18243 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18245 self.name = v.into();
18246 self
18247 }
18248}
18249
18250impl wkt::message::Message for GetApiHubInstanceRequest {
18251 fn typename() -> &'static str {
18252 "type.googleapis.com/google.cloud.apihub.v1.GetApiHubInstanceRequest"
18253 }
18254}
18255
18256#[derive(Clone, Default, PartialEq)]
18262#[non_exhaustive]
18263pub struct LookupApiHubInstanceRequest {
18264 pub parent: std::string::String,
18269
18270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18271}
18272
18273impl LookupApiHubInstanceRequest {
18274 pub fn new() -> Self {
18275 std::default::Default::default()
18276 }
18277
18278 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18280 self.parent = v.into();
18281 self
18282 }
18283}
18284
18285impl wkt::message::Message for LookupApiHubInstanceRequest {
18286 fn typename() -> &'static str {
18287 "type.googleapis.com/google.cloud.apihub.v1.LookupApiHubInstanceRequest"
18288 }
18289}
18290
18291#[derive(Clone, Default, PartialEq)]
18297#[non_exhaustive]
18298pub struct LookupApiHubInstanceResponse {
18299 pub api_hub_instance: std::option::Option<crate::model::ApiHubInstance>,
18301
18302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18303}
18304
18305impl LookupApiHubInstanceResponse {
18306 pub fn new() -> Self {
18307 std::default::Default::default()
18308 }
18309
18310 pub fn set_api_hub_instance<T>(mut self, v: T) -> Self
18312 where
18313 T: std::convert::Into<crate::model::ApiHubInstance>,
18314 {
18315 self.api_hub_instance = std::option::Option::Some(v.into());
18316 self
18317 }
18318
18319 pub fn set_or_clear_api_hub_instance<T>(mut self, v: std::option::Option<T>) -> Self
18321 where
18322 T: std::convert::Into<crate::model::ApiHubInstance>,
18323 {
18324 self.api_hub_instance = v.map(|x| x.into());
18325 self
18326 }
18327}
18328
18329impl wkt::message::Message for LookupApiHubInstanceResponse {
18330 fn typename() -> &'static str {
18331 "type.googleapis.com/google.cloud.apihub.v1.LookupApiHubInstanceResponse"
18332 }
18333}
18334
18335#[derive(Clone, Default, PartialEq)]
18341#[non_exhaustive]
18342pub struct CreateRuntimeProjectAttachmentRequest {
18343 pub parent: std::string::String,
18346
18347 pub runtime_project_attachment_id: std::string::String,
18352
18353 pub runtime_project_attachment: std::option::Option<crate::model::RuntimeProjectAttachment>,
18355
18356 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18357}
18358
18359impl CreateRuntimeProjectAttachmentRequest {
18360 pub fn new() -> Self {
18361 std::default::Default::default()
18362 }
18363
18364 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18366 self.parent = v.into();
18367 self
18368 }
18369
18370 pub fn set_runtime_project_attachment_id<T: std::convert::Into<std::string::String>>(
18372 mut self,
18373 v: T,
18374 ) -> Self {
18375 self.runtime_project_attachment_id = v.into();
18376 self
18377 }
18378
18379 pub fn set_runtime_project_attachment<T>(mut self, v: T) -> Self
18381 where
18382 T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
18383 {
18384 self.runtime_project_attachment = std::option::Option::Some(v.into());
18385 self
18386 }
18387
18388 pub fn set_or_clear_runtime_project_attachment<T>(mut self, v: std::option::Option<T>) -> Self
18390 where
18391 T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
18392 {
18393 self.runtime_project_attachment = v.map(|x| x.into());
18394 self
18395 }
18396}
18397
18398impl wkt::message::Message for CreateRuntimeProjectAttachmentRequest {
18399 fn typename() -> &'static str {
18400 "type.googleapis.com/google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest"
18401 }
18402}
18403
18404#[derive(Clone, Default, PartialEq)]
18410#[non_exhaustive]
18411pub struct GetRuntimeProjectAttachmentRequest {
18412 pub name: std::string::String,
18416
18417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18418}
18419
18420impl GetRuntimeProjectAttachmentRequest {
18421 pub fn new() -> Self {
18422 std::default::Default::default()
18423 }
18424
18425 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18427 self.name = v.into();
18428 self
18429 }
18430}
18431
18432impl wkt::message::Message for GetRuntimeProjectAttachmentRequest {
18433 fn typename() -> &'static str {
18434 "type.googleapis.com/google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest"
18435 }
18436}
18437
18438#[derive(Clone, Default, PartialEq)]
18444#[non_exhaustive]
18445pub struct ListRuntimeProjectAttachmentsRequest {
18446 pub parent: std::string::String,
18449
18450 pub page_size: i32,
18455
18456 pub page_token: std::string::String,
18464
18465 pub filter: std::string::String,
18482
18483 pub order_by: std::string::String,
18485
18486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18487}
18488
18489impl ListRuntimeProjectAttachmentsRequest {
18490 pub fn new() -> Self {
18491 std::default::Default::default()
18492 }
18493
18494 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18496 self.parent = v.into();
18497 self
18498 }
18499
18500 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18502 self.page_size = v.into();
18503 self
18504 }
18505
18506 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18508 self.page_token = v.into();
18509 self
18510 }
18511
18512 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18514 self.filter = v.into();
18515 self
18516 }
18517
18518 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18520 self.order_by = v.into();
18521 self
18522 }
18523}
18524
18525impl wkt::message::Message for ListRuntimeProjectAttachmentsRequest {
18526 fn typename() -> &'static str {
18527 "type.googleapis.com/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest"
18528 }
18529}
18530
18531#[derive(Clone, Default, PartialEq)]
18537#[non_exhaustive]
18538pub struct ListRuntimeProjectAttachmentsResponse {
18539 pub runtime_project_attachments: std::vec::Vec<crate::model::RuntimeProjectAttachment>,
18541
18542 pub next_page_token: std::string::String,
18545
18546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18547}
18548
18549impl ListRuntimeProjectAttachmentsResponse {
18550 pub fn new() -> Self {
18551 std::default::Default::default()
18552 }
18553
18554 pub fn set_runtime_project_attachments<T, V>(mut self, v: T) -> Self
18556 where
18557 T: std::iter::IntoIterator<Item = V>,
18558 V: std::convert::Into<crate::model::RuntimeProjectAttachment>,
18559 {
18560 use std::iter::Iterator;
18561 self.runtime_project_attachments = v.into_iter().map(|i| i.into()).collect();
18562 self
18563 }
18564
18565 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18567 self.next_page_token = v.into();
18568 self
18569 }
18570}
18571
18572impl wkt::message::Message for ListRuntimeProjectAttachmentsResponse {
18573 fn typename() -> &'static str {
18574 "type.googleapis.com/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse"
18575 }
18576}
18577
18578#[doc(hidden)]
18579impl gax::paginator::internal::PageableResponse for ListRuntimeProjectAttachmentsResponse {
18580 type PageItem = crate::model::RuntimeProjectAttachment;
18581
18582 fn items(self) -> std::vec::Vec<Self::PageItem> {
18583 self.runtime_project_attachments
18584 }
18585
18586 fn next_page_token(&self) -> std::string::String {
18587 use std::clone::Clone;
18588 self.next_page_token.clone()
18589 }
18590}
18591
18592#[derive(Clone, Default, PartialEq)]
18598#[non_exhaustive]
18599pub struct DeleteRuntimeProjectAttachmentRequest {
18600 pub name: std::string::String,
18604
18605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18606}
18607
18608impl DeleteRuntimeProjectAttachmentRequest {
18609 pub fn new() -> Self {
18610 std::default::Default::default()
18611 }
18612
18613 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18615 self.name = v.into();
18616 self
18617 }
18618}
18619
18620impl wkt::message::Message for DeleteRuntimeProjectAttachmentRequest {
18621 fn typename() -> &'static str {
18622 "type.googleapis.com/google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest"
18623 }
18624}
18625
18626#[derive(Clone, Default, PartialEq)]
18632#[non_exhaustive]
18633pub struct LookupRuntimeProjectAttachmentRequest {
18634 pub name: std::string::String,
18638
18639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18640}
18641
18642impl LookupRuntimeProjectAttachmentRequest {
18643 pub fn new() -> Self {
18644 std::default::Default::default()
18645 }
18646
18647 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18649 self.name = v.into();
18650 self
18651 }
18652}
18653
18654impl wkt::message::Message for LookupRuntimeProjectAttachmentRequest {
18655 fn typename() -> &'static str {
18656 "type.googleapis.com/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest"
18657 }
18658}
18659
18660#[derive(Clone, Default, PartialEq)]
18666#[non_exhaustive]
18667pub struct LookupRuntimeProjectAttachmentResponse {
18668 pub runtime_project_attachment: std::option::Option<crate::model::RuntimeProjectAttachment>,
18670
18671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18672}
18673
18674impl LookupRuntimeProjectAttachmentResponse {
18675 pub fn new() -> Self {
18676 std::default::Default::default()
18677 }
18678
18679 pub fn set_runtime_project_attachment<T>(mut self, v: T) -> Self
18681 where
18682 T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
18683 {
18684 self.runtime_project_attachment = std::option::Option::Some(v.into());
18685 self
18686 }
18687
18688 pub fn set_or_clear_runtime_project_attachment<T>(mut self, v: std::option::Option<T>) -> Self
18690 where
18691 T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
18692 {
18693 self.runtime_project_attachment = v.map(|x| x.into());
18694 self
18695 }
18696}
18697
18698impl wkt::message::Message for LookupRuntimeProjectAttachmentResponse {
18699 fn typename() -> &'static str {
18700 "type.googleapis.com/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse"
18701 }
18702}
18703
18704#[derive(Clone, Default, PartialEq)]
18709#[non_exhaustive]
18710pub struct RuntimeProjectAttachment {
18711 pub name: std::string::String,
18714
18715 pub runtime_project: std::string::String,
18720
18721 pub create_time: std::option::Option<wkt::Timestamp>,
18723
18724 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18725}
18726
18727impl RuntimeProjectAttachment {
18728 pub fn new() -> Self {
18729 std::default::Default::default()
18730 }
18731
18732 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18734 self.name = v.into();
18735 self
18736 }
18737
18738 pub fn set_runtime_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18740 self.runtime_project = v.into();
18741 self
18742 }
18743
18744 pub fn set_create_time<T>(mut self, v: T) -> Self
18746 where
18747 T: std::convert::Into<wkt::Timestamp>,
18748 {
18749 self.create_time = std::option::Option::Some(v.into());
18750 self
18751 }
18752
18753 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18755 where
18756 T: std::convert::Into<wkt::Timestamp>,
18757 {
18758 self.create_time = v.map(|x| x.into());
18759 self
18760 }
18761}
18762
18763impl wkt::message::Message for RuntimeProjectAttachment {
18764 fn typename() -> &'static str {
18765 "type.googleapis.com/google.cloud.apihub.v1.RuntimeProjectAttachment"
18766 }
18767}
18768
18769#[derive(Clone, Debug, PartialEq)]
18785#[non_exhaustive]
18786pub enum CollectionType {
18787 Unspecified,
18789 Upsert,
18792 Delete,
18795 UnknownValue(collection_type::UnknownValue),
18800}
18801
18802#[doc(hidden)]
18803pub mod collection_type {
18804 #[allow(unused_imports)]
18805 use super::*;
18806 #[derive(Clone, Debug, PartialEq)]
18807 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18808}
18809
18810impl CollectionType {
18811 pub fn value(&self) -> std::option::Option<i32> {
18816 match self {
18817 Self::Unspecified => std::option::Option::Some(0),
18818 Self::Upsert => std::option::Option::Some(1),
18819 Self::Delete => std::option::Option::Some(2),
18820 Self::UnknownValue(u) => u.0.value(),
18821 }
18822 }
18823
18824 pub fn name(&self) -> std::option::Option<&str> {
18829 match self {
18830 Self::Unspecified => std::option::Option::Some("COLLECTION_TYPE_UNSPECIFIED"),
18831 Self::Upsert => std::option::Option::Some("COLLECTION_TYPE_UPSERT"),
18832 Self::Delete => std::option::Option::Some("COLLECTION_TYPE_DELETE"),
18833 Self::UnknownValue(u) => u.0.name(),
18834 }
18835 }
18836}
18837
18838impl std::default::Default for CollectionType {
18839 fn default() -> Self {
18840 use std::convert::From;
18841 Self::from(0)
18842 }
18843}
18844
18845impl std::fmt::Display for CollectionType {
18846 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18847 wkt::internal::display_enum(f, self.name(), self.value())
18848 }
18849}
18850
18851impl std::convert::From<i32> for CollectionType {
18852 fn from(value: i32) -> Self {
18853 match value {
18854 0 => Self::Unspecified,
18855 1 => Self::Upsert,
18856 2 => Self::Delete,
18857 _ => Self::UnknownValue(collection_type::UnknownValue(
18858 wkt::internal::UnknownEnumValue::Integer(value),
18859 )),
18860 }
18861 }
18862}
18863
18864impl std::convert::From<&str> for CollectionType {
18865 fn from(value: &str) -> Self {
18866 use std::string::ToString;
18867 match value {
18868 "COLLECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
18869 "COLLECTION_TYPE_UPSERT" => Self::Upsert,
18870 "COLLECTION_TYPE_DELETE" => Self::Delete,
18871 _ => Self::UnknownValue(collection_type::UnknownValue(
18872 wkt::internal::UnknownEnumValue::String(value.to_string()),
18873 )),
18874 }
18875 }
18876}
18877
18878impl serde::ser::Serialize for CollectionType {
18879 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18880 where
18881 S: serde::Serializer,
18882 {
18883 match self {
18884 Self::Unspecified => serializer.serialize_i32(0),
18885 Self::Upsert => serializer.serialize_i32(1),
18886 Self::Delete => serializer.serialize_i32(2),
18887 Self::UnknownValue(u) => u.0.serialize(serializer),
18888 }
18889 }
18890}
18891
18892impl<'de> serde::de::Deserialize<'de> for CollectionType {
18893 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18894 where
18895 D: serde::Deserializer<'de>,
18896 {
18897 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CollectionType>::new(
18898 ".google.cloud.apihub.v1.CollectionType",
18899 ))
18900 }
18901}
18902
18903#[derive(Clone, Debug, PartialEq)]
18919#[non_exhaustive]
18920pub enum LintState {
18921 Unspecified,
18923 Success,
18925 Error,
18927 UnknownValue(lint_state::UnknownValue),
18932}
18933
18934#[doc(hidden)]
18935pub mod lint_state {
18936 #[allow(unused_imports)]
18937 use super::*;
18938 #[derive(Clone, Debug, PartialEq)]
18939 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18940}
18941
18942impl LintState {
18943 pub fn value(&self) -> std::option::Option<i32> {
18948 match self {
18949 Self::Unspecified => std::option::Option::Some(0),
18950 Self::Success => std::option::Option::Some(1),
18951 Self::Error => std::option::Option::Some(2),
18952 Self::UnknownValue(u) => u.0.value(),
18953 }
18954 }
18955
18956 pub fn name(&self) -> std::option::Option<&str> {
18961 match self {
18962 Self::Unspecified => std::option::Option::Some("LINT_STATE_UNSPECIFIED"),
18963 Self::Success => std::option::Option::Some("LINT_STATE_SUCCESS"),
18964 Self::Error => std::option::Option::Some("LINT_STATE_ERROR"),
18965 Self::UnknownValue(u) => u.0.name(),
18966 }
18967 }
18968}
18969
18970impl std::default::Default for LintState {
18971 fn default() -> Self {
18972 use std::convert::From;
18973 Self::from(0)
18974 }
18975}
18976
18977impl std::fmt::Display for LintState {
18978 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18979 wkt::internal::display_enum(f, self.name(), self.value())
18980 }
18981}
18982
18983impl std::convert::From<i32> for LintState {
18984 fn from(value: i32) -> Self {
18985 match value {
18986 0 => Self::Unspecified,
18987 1 => Self::Success,
18988 2 => Self::Error,
18989 _ => Self::UnknownValue(lint_state::UnknownValue(
18990 wkt::internal::UnknownEnumValue::Integer(value),
18991 )),
18992 }
18993 }
18994}
18995
18996impl std::convert::From<&str> for LintState {
18997 fn from(value: &str) -> Self {
18998 use std::string::ToString;
18999 match value {
19000 "LINT_STATE_UNSPECIFIED" => Self::Unspecified,
19001 "LINT_STATE_SUCCESS" => Self::Success,
19002 "LINT_STATE_ERROR" => Self::Error,
19003 _ => Self::UnknownValue(lint_state::UnknownValue(
19004 wkt::internal::UnknownEnumValue::String(value.to_string()),
19005 )),
19006 }
19007 }
19008}
19009
19010impl serde::ser::Serialize for LintState {
19011 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19012 where
19013 S: serde::Serializer,
19014 {
19015 match self {
19016 Self::Unspecified => serializer.serialize_i32(0),
19017 Self::Success => serializer.serialize_i32(1),
19018 Self::Error => serializer.serialize_i32(2),
19019 Self::UnknownValue(u) => u.0.serialize(serializer),
19020 }
19021 }
19022}
19023
19024impl<'de> serde::de::Deserialize<'de> for LintState {
19025 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19026 where
19027 D: serde::Deserializer<'de>,
19028 {
19029 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LintState>::new(
19030 ".google.cloud.apihub.v1.LintState",
19031 ))
19032 }
19033}
19034
19035#[derive(Clone, Debug, PartialEq)]
19051#[non_exhaustive]
19052pub enum Linter {
19053 Unspecified,
19055 Spectral,
19057 Other,
19059 UnknownValue(linter::UnknownValue),
19064}
19065
19066#[doc(hidden)]
19067pub mod linter {
19068 #[allow(unused_imports)]
19069 use super::*;
19070 #[derive(Clone, Debug, PartialEq)]
19071 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19072}
19073
19074impl Linter {
19075 pub fn value(&self) -> std::option::Option<i32> {
19080 match self {
19081 Self::Unspecified => std::option::Option::Some(0),
19082 Self::Spectral => std::option::Option::Some(1),
19083 Self::Other => std::option::Option::Some(2),
19084 Self::UnknownValue(u) => u.0.value(),
19085 }
19086 }
19087
19088 pub fn name(&self) -> std::option::Option<&str> {
19093 match self {
19094 Self::Unspecified => std::option::Option::Some("LINTER_UNSPECIFIED"),
19095 Self::Spectral => std::option::Option::Some("SPECTRAL"),
19096 Self::Other => std::option::Option::Some("OTHER"),
19097 Self::UnknownValue(u) => u.0.name(),
19098 }
19099 }
19100}
19101
19102impl std::default::Default for Linter {
19103 fn default() -> Self {
19104 use std::convert::From;
19105 Self::from(0)
19106 }
19107}
19108
19109impl std::fmt::Display for Linter {
19110 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19111 wkt::internal::display_enum(f, self.name(), self.value())
19112 }
19113}
19114
19115impl std::convert::From<i32> for Linter {
19116 fn from(value: i32) -> Self {
19117 match value {
19118 0 => Self::Unspecified,
19119 1 => Self::Spectral,
19120 2 => Self::Other,
19121 _ => Self::UnknownValue(linter::UnknownValue(
19122 wkt::internal::UnknownEnumValue::Integer(value),
19123 )),
19124 }
19125 }
19126}
19127
19128impl std::convert::From<&str> for Linter {
19129 fn from(value: &str) -> Self {
19130 use std::string::ToString;
19131 match value {
19132 "LINTER_UNSPECIFIED" => Self::Unspecified,
19133 "SPECTRAL" => Self::Spectral,
19134 "OTHER" => Self::Other,
19135 _ => Self::UnknownValue(linter::UnknownValue(
19136 wkt::internal::UnknownEnumValue::String(value.to_string()),
19137 )),
19138 }
19139 }
19140}
19141
19142impl serde::ser::Serialize for Linter {
19143 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19144 where
19145 S: serde::Serializer,
19146 {
19147 match self {
19148 Self::Unspecified => serializer.serialize_i32(0),
19149 Self::Spectral => serializer.serialize_i32(1),
19150 Self::Other => serializer.serialize_i32(2),
19151 Self::UnknownValue(u) => u.0.serialize(serializer),
19152 }
19153 }
19154}
19155
19156impl<'de> serde::de::Deserialize<'de> for Linter {
19157 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19158 where
19159 D: serde::Deserializer<'de>,
19160 {
19161 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Linter>::new(
19162 ".google.cloud.apihub.v1.Linter",
19163 ))
19164 }
19165}
19166
19167#[derive(Clone, Debug, PartialEq)]
19183#[non_exhaustive]
19184pub enum Severity {
19185 Unspecified,
19187 Error,
19189 Warning,
19191 Info,
19193 Hint,
19195 UnknownValue(severity::UnknownValue),
19200}
19201
19202#[doc(hidden)]
19203pub mod severity {
19204 #[allow(unused_imports)]
19205 use super::*;
19206 #[derive(Clone, Debug, PartialEq)]
19207 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19208}
19209
19210impl Severity {
19211 pub fn value(&self) -> std::option::Option<i32> {
19216 match self {
19217 Self::Unspecified => std::option::Option::Some(0),
19218 Self::Error => std::option::Option::Some(1),
19219 Self::Warning => std::option::Option::Some(2),
19220 Self::Info => std::option::Option::Some(3),
19221 Self::Hint => std::option::Option::Some(4),
19222 Self::UnknownValue(u) => u.0.value(),
19223 }
19224 }
19225
19226 pub fn name(&self) -> std::option::Option<&str> {
19231 match self {
19232 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
19233 Self::Error => std::option::Option::Some("SEVERITY_ERROR"),
19234 Self::Warning => std::option::Option::Some("SEVERITY_WARNING"),
19235 Self::Info => std::option::Option::Some("SEVERITY_INFO"),
19236 Self::Hint => std::option::Option::Some("SEVERITY_HINT"),
19237 Self::UnknownValue(u) => u.0.name(),
19238 }
19239 }
19240}
19241
19242impl std::default::Default for Severity {
19243 fn default() -> Self {
19244 use std::convert::From;
19245 Self::from(0)
19246 }
19247}
19248
19249impl std::fmt::Display for Severity {
19250 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19251 wkt::internal::display_enum(f, self.name(), self.value())
19252 }
19253}
19254
19255impl std::convert::From<i32> for Severity {
19256 fn from(value: i32) -> Self {
19257 match value {
19258 0 => Self::Unspecified,
19259 1 => Self::Error,
19260 2 => Self::Warning,
19261 3 => Self::Info,
19262 4 => Self::Hint,
19263 _ => Self::UnknownValue(severity::UnknownValue(
19264 wkt::internal::UnknownEnumValue::Integer(value),
19265 )),
19266 }
19267 }
19268}
19269
19270impl std::convert::From<&str> for Severity {
19271 fn from(value: &str) -> Self {
19272 use std::string::ToString;
19273 match value {
19274 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
19275 "SEVERITY_ERROR" => Self::Error,
19276 "SEVERITY_WARNING" => Self::Warning,
19277 "SEVERITY_INFO" => Self::Info,
19278 "SEVERITY_HINT" => Self::Hint,
19279 _ => Self::UnknownValue(severity::UnknownValue(
19280 wkt::internal::UnknownEnumValue::String(value.to_string()),
19281 )),
19282 }
19283 }
19284}
19285
19286impl serde::ser::Serialize for Severity {
19287 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19288 where
19289 S: serde::Serializer,
19290 {
19291 match self {
19292 Self::Unspecified => serializer.serialize_i32(0),
19293 Self::Error => serializer.serialize_i32(1),
19294 Self::Warning => serializer.serialize_i32(2),
19295 Self::Info => serializer.serialize_i32(3),
19296 Self::Hint => serializer.serialize_i32(4),
19297 Self::UnknownValue(u) => u.0.serialize(serializer),
19298 }
19299 }
19300}
19301
19302impl<'de> serde::de::Deserialize<'de> for Severity {
19303 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19304 where
19305 D: serde::Deserializer<'de>,
19306 {
19307 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
19308 ".google.cloud.apihub.v1.Severity",
19309 ))
19310 }
19311}
19312
19313#[derive(Clone, Debug, PartialEq)]
19329#[non_exhaustive]
19330pub enum AuthType {
19331 Unspecified,
19333 NoAuth,
19335 GoogleServiceAccount,
19337 UserPassword,
19339 ApiKey,
19341 Oauth2ClientCredentials,
19343 UnknownValue(auth_type::UnknownValue),
19348}
19349
19350#[doc(hidden)]
19351pub mod auth_type {
19352 #[allow(unused_imports)]
19353 use super::*;
19354 #[derive(Clone, Debug, PartialEq)]
19355 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19356}
19357
19358impl AuthType {
19359 pub fn value(&self) -> std::option::Option<i32> {
19364 match self {
19365 Self::Unspecified => std::option::Option::Some(0),
19366 Self::NoAuth => std::option::Option::Some(1),
19367 Self::GoogleServiceAccount => std::option::Option::Some(2),
19368 Self::UserPassword => std::option::Option::Some(3),
19369 Self::ApiKey => std::option::Option::Some(4),
19370 Self::Oauth2ClientCredentials => std::option::Option::Some(5),
19371 Self::UnknownValue(u) => u.0.value(),
19372 }
19373 }
19374
19375 pub fn name(&self) -> std::option::Option<&str> {
19380 match self {
19381 Self::Unspecified => std::option::Option::Some("AUTH_TYPE_UNSPECIFIED"),
19382 Self::NoAuth => std::option::Option::Some("NO_AUTH"),
19383 Self::GoogleServiceAccount => std::option::Option::Some("GOOGLE_SERVICE_ACCOUNT"),
19384 Self::UserPassword => std::option::Option::Some("USER_PASSWORD"),
19385 Self::ApiKey => std::option::Option::Some("API_KEY"),
19386 Self::Oauth2ClientCredentials => std::option::Option::Some("OAUTH2_CLIENT_CREDENTIALS"),
19387 Self::UnknownValue(u) => u.0.name(),
19388 }
19389 }
19390}
19391
19392impl std::default::Default for AuthType {
19393 fn default() -> Self {
19394 use std::convert::From;
19395 Self::from(0)
19396 }
19397}
19398
19399impl std::fmt::Display for AuthType {
19400 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19401 wkt::internal::display_enum(f, self.name(), self.value())
19402 }
19403}
19404
19405impl std::convert::From<i32> for AuthType {
19406 fn from(value: i32) -> Self {
19407 match value {
19408 0 => Self::Unspecified,
19409 1 => Self::NoAuth,
19410 2 => Self::GoogleServiceAccount,
19411 3 => Self::UserPassword,
19412 4 => Self::ApiKey,
19413 5 => Self::Oauth2ClientCredentials,
19414 _ => Self::UnknownValue(auth_type::UnknownValue(
19415 wkt::internal::UnknownEnumValue::Integer(value),
19416 )),
19417 }
19418 }
19419}
19420
19421impl std::convert::From<&str> for AuthType {
19422 fn from(value: &str) -> Self {
19423 use std::string::ToString;
19424 match value {
19425 "AUTH_TYPE_UNSPECIFIED" => Self::Unspecified,
19426 "NO_AUTH" => Self::NoAuth,
19427 "GOOGLE_SERVICE_ACCOUNT" => Self::GoogleServiceAccount,
19428 "USER_PASSWORD" => Self::UserPassword,
19429 "API_KEY" => Self::ApiKey,
19430 "OAUTH2_CLIENT_CREDENTIALS" => Self::Oauth2ClientCredentials,
19431 _ => Self::UnknownValue(auth_type::UnknownValue(
19432 wkt::internal::UnknownEnumValue::String(value.to_string()),
19433 )),
19434 }
19435 }
19436}
19437
19438impl serde::ser::Serialize for AuthType {
19439 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19440 where
19441 S: serde::Serializer,
19442 {
19443 match self {
19444 Self::Unspecified => serializer.serialize_i32(0),
19445 Self::NoAuth => serializer.serialize_i32(1),
19446 Self::GoogleServiceAccount => serializer.serialize_i32(2),
19447 Self::UserPassword => serializer.serialize_i32(3),
19448 Self::ApiKey => serializer.serialize_i32(4),
19449 Self::Oauth2ClientCredentials => serializer.serialize_i32(5),
19450 Self::UnknownValue(u) => u.0.serialize(serializer),
19451 }
19452 }
19453}
19454
19455impl<'de> serde::de::Deserialize<'de> for AuthType {
19456 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19457 where
19458 D: serde::Deserializer<'de>,
19459 {
19460 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthType>::new(
19461 ".google.cloud.apihub.v1.AuthType",
19462 ))
19463 }
19464}
19465
19466#[derive(Clone, Debug, PartialEq)]
19482#[non_exhaustive]
19483pub enum PluginCategory {
19484 Unspecified,
19486 ApiGateway,
19488 ApiProducer,
19491 UnknownValue(plugin_category::UnknownValue),
19496}
19497
19498#[doc(hidden)]
19499pub mod plugin_category {
19500 #[allow(unused_imports)]
19501 use super::*;
19502 #[derive(Clone, Debug, PartialEq)]
19503 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19504}
19505
19506impl PluginCategory {
19507 pub fn value(&self) -> std::option::Option<i32> {
19512 match self {
19513 Self::Unspecified => std::option::Option::Some(0),
19514 Self::ApiGateway => std::option::Option::Some(1),
19515 Self::ApiProducer => std::option::Option::Some(2),
19516 Self::UnknownValue(u) => u.0.value(),
19517 }
19518 }
19519
19520 pub fn name(&self) -> std::option::Option<&str> {
19525 match self {
19526 Self::Unspecified => std::option::Option::Some("PLUGIN_CATEGORY_UNSPECIFIED"),
19527 Self::ApiGateway => std::option::Option::Some("API_GATEWAY"),
19528 Self::ApiProducer => std::option::Option::Some("API_PRODUCER"),
19529 Self::UnknownValue(u) => u.0.name(),
19530 }
19531 }
19532}
19533
19534impl std::default::Default for PluginCategory {
19535 fn default() -> Self {
19536 use std::convert::From;
19537 Self::from(0)
19538 }
19539}
19540
19541impl std::fmt::Display for PluginCategory {
19542 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19543 wkt::internal::display_enum(f, self.name(), self.value())
19544 }
19545}
19546
19547impl std::convert::From<i32> for PluginCategory {
19548 fn from(value: i32) -> Self {
19549 match value {
19550 0 => Self::Unspecified,
19551 1 => Self::ApiGateway,
19552 2 => Self::ApiProducer,
19553 _ => Self::UnknownValue(plugin_category::UnknownValue(
19554 wkt::internal::UnknownEnumValue::Integer(value),
19555 )),
19556 }
19557 }
19558}
19559
19560impl std::convert::From<&str> for PluginCategory {
19561 fn from(value: &str) -> Self {
19562 use std::string::ToString;
19563 match value {
19564 "PLUGIN_CATEGORY_UNSPECIFIED" => Self::Unspecified,
19565 "API_GATEWAY" => Self::ApiGateway,
19566 "API_PRODUCER" => Self::ApiProducer,
19567 _ => Self::UnknownValue(plugin_category::UnknownValue(
19568 wkt::internal::UnknownEnumValue::String(value.to_string()),
19569 )),
19570 }
19571 }
19572}
19573
19574impl serde::ser::Serialize for PluginCategory {
19575 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19576 where
19577 S: serde::Serializer,
19578 {
19579 match self {
19580 Self::Unspecified => serializer.serialize_i32(0),
19581 Self::ApiGateway => serializer.serialize_i32(1),
19582 Self::ApiProducer => serializer.serialize_i32(2),
19583 Self::UnknownValue(u) => u.0.serialize(serializer),
19584 }
19585 }
19586}
19587
19588impl<'de> serde::de::Deserialize<'de> for PluginCategory {
19589 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19590 where
19591 D: serde::Deserializer<'de>,
19592 {
19593 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PluginCategory>::new(
19594 ".google.cloud.apihub.v1.PluginCategory",
19595 ))
19596 }
19597}
19598
19599#[derive(Clone, Debug, PartialEq)]
19615#[non_exhaustive]
19616pub enum ActionType {
19617 Unspecified,
19619 SyncMetadata,
19621 SyncRuntimeData,
19623 UnknownValue(action_type::UnknownValue),
19628}
19629
19630#[doc(hidden)]
19631pub mod action_type {
19632 #[allow(unused_imports)]
19633 use super::*;
19634 #[derive(Clone, Debug, PartialEq)]
19635 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19636}
19637
19638impl ActionType {
19639 pub fn value(&self) -> std::option::Option<i32> {
19644 match self {
19645 Self::Unspecified => std::option::Option::Some(0),
19646 Self::SyncMetadata => std::option::Option::Some(1),
19647 Self::SyncRuntimeData => std::option::Option::Some(2),
19648 Self::UnknownValue(u) => u.0.value(),
19649 }
19650 }
19651
19652 pub fn name(&self) -> std::option::Option<&str> {
19657 match self {
19658 Self::Unspecified => std::option::Option::Some("ACTION_TYPE_UNSPECIFIED"),
19659 Self::SyncMetadata => std::option::Option::Some("SYNC_METADATA"),
19660 Self::SyncRuntimeData => std::option::Option::Some("SYNC_RUNTIME_DATA"),
19661 Self::UnknownValue(u) => u.0.name(),
19662 }
19663 }
19664}
19665
19666impl std::default::Default for ActionType {
19667 fn default() -> Self {
19668 use std::convert::From;
19669 Self::from(0)
19670 }
19671}
19672
19673impl std::fmt::Display for ActionType {
19674 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19675 wkt::internal::display_enum(f, self.name(), self.value())
19676 }
19677}
19678
19679impl std::convert::From<i32> for ActionType {
19680 fn from(value: i32) -> Self {
19681 match value {
19682 0 => Self::Unspecified,
19683 1 => Self::SyncMetadata,
19684 2 => Self::SyncRuntimeData,
19685 _ => Self::UnknownValue(action_type::UnknownValue(
19686 wkt::internal::UnknownEnumValue::Integer(value),
19687 )),
19688 }
19689 }
19690}
19691
19692impl std::convert::From<&str> for ActionType {
19693 fn from(value: &str) -> Self {
19694 use std::string::ToString;
19695 match value {
19696 "ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
19697 "SYNC_METADATA" => Self::SyncMetadata,
19698 "SYNC_RUNTIME_DATA" => Self::SyncRuntimeData,
19699 _ => Self::UnknownValue(action_type::UnknownValue(
19700 wkt::internal::UnknownEnumValue::String(value.to_string()),
19701 )),
19702 }
19703 }
19704}
19705
19706impl serde::ser::Serialize for ActionType {
19707 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19708 where
19709 S: serde::Serializer,
19710 {
19711 match self {
19712 Self::Unspecified => serializer.serialize_i32(0),
19713 Self::SyncMetadata => serializer.serialize_i32(1),
19714 Self::SyncRuntimeData => serializer.serialize_i32(2),
19715 Self::UnknownValue(u) => u.0.serialize(serializer),
19716 }
19717 }
19718}
19719
19720impl<'de> serde::de::Deserialize<'de> for ActionType {
19721 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19722 where
19723 D: serde::Deserializer<'de>,
19724 {
19725 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActionType>::new(
19726 ".google.cloud.apihub.v1.ActionType",
19727 ))
19728 }
19729}
19730
19731#[derive(Clone, Debug, PartialEq)]
19747#[non_exhaustive]
19748pub enum GatewayType {
19749 Unspecified,
19751 ApigeeXAndHybrid,
19753 ApigeeEdgePublicCloud,
19755 ApigeeEdgePrivateCloud,
19757 CloudApiGateway,
19759 CloudEndpoints,
19761 ApiDiscovery,
19763 Others,
19765 UnknownValue(gateway_type::UnknownValue),
19770}
19771
19772#[doc(hidden)]
19773pub mod gateway_type {
19774 #[allow(unused_imports)]
19775 use super::*;
19776 #[derive(Clone, Debug, PartialEq)]
19777 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19778}
19779
19780impl GatewayType {
19781 pub fn value(&self) -> std::option::Option<i32> {
19786 match self {
19787 Self::Unspecified => std::option::Option::Some(0),
19788 Self::ApigeeXAndHybrid => std::option::Option::Some(1),
19789 Self::ApigeeEdgePublicCloud => std::option::Option::Some(2),
19790 Self::ApigeeEdgePrivateCloud => std::option::Option::Some(3),
19791 Self::CloudApiGateway => std::option::Option::Some(4),
19792 Self::CloudEndpoints => std::option::Option::Some(5),
19793 Self::ApiDiscovery => std::option::Option::Some(6),
19794 Self::Others => std::option::Option::Some(7),
19795 Self::UnknownValue(u) => u.0.value(),
19796 }
19797 }
19798
19799 pub fn name(&self) -> std::option::Option<&str> {
19804 match self {
19805 Self::Unspecified => std::option::Option::Some("GATEWAY_TYPE_UNSPECIFIED"),
19806 Self::ApigeeXAndHybrid => std::option::Option::Some("APIGEE_X_AND_HYBRID"),
19807 Self::ApigeeEdgePublicCloud => std::option::Option::Some("APIGEE_EDGE_PUBLIC_CLOUD"),
19808 Self::ApigeeEdgePrivateCloud => std::option::Option::Some("APIGEE_EDGE_PRIVATE_CLOUD"),
19809 Self::CloudApiGateway => std::option::Option::Some("CLOUD_API_GATEWAY"),
19810 Self::CloudEndpoints => std::option::Option::Some("CLOUD_ENDPOINTS"),
19811 Self::ApiDiscovery => std::option::Option::Some("API_DISCOVERY"),
19812 Self::Others => std::option::Option::Some("OTHERS"),
19813 Self::UnknownValue(u) => u.0.name(),
19814 }
19815 }
19816}
19817
19818impl std::default::Default for GatewayType {
19819 fn default() -> Self {
19820 use std::convert::From;
19821 Self::from(0)
19822 }
19823}
19824
19825impl std::fmt::Display for GatewayType {
19826 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19827 wkt::internal::display_enum(f, self.name(), self.value())
19828 }
19829}
19830
19831impl std::convert::From<i32> for GatewayType {
19832 fn from(value: i32) -> Self {
19833 match value {
19834 0 => Self::Unspecified,
19835 1 => Self::ApigeeXAndHybrid,
19836 2 => Self::ApigeeEdgePublicCloud,
19837 3 => Self::ApigeeEdgePrivateCloud,
19838 4 => Self::CloudApiGateway,
19839 5 => Self::CloudEndpoints,
19840 6 => Self::ApiDiscovery,
19841 7 => Self::Others,
19842 _ => Self::UnknownValue(gateway_type::UnknownValue(
19843 wkt::internal::UnknownEnumValue::Integer(value),
19844 )),
19845 }
19846 }
19847}
19848
19849impl std::convert::From<&str> for GatewayType {
19850 fn from(value: &str) -> Self {
19851 use std::string::ToString;
19852 match value {
19853 "GATEWAY_TYPE_UNSPECIFIED" => Self::Unspecified,
19854 "APIGEE_X_AND_HYBRID" => Self::ApigeeXAndHybrid,
19855 "APIGEE_EDGE_PUBLIC_CLOUD" => Self::ApigeeEdgePublicCloud,
19856 "APIGEE_EDGE_PRIVATE_CLOUD" => Self::ApigeeEdgePrivateCloud,
19857 "CLOUD_API_GATEWAY" => Self::CloudApiGateway,
19858 "CLOUD_ENDPOINTS" => Self::CloudEndpoints,
19859 "API_DISCOVERY" => Self::ApiDiscovery,
19860 "OTHERS" => Self::Others,
19861 _ => Self::UnknownValue(gateway_type::UnknownValue(
19862 wkt::internal::UnknownEnumValue::String(value.to_string()),
19863 )),
19864 }
19865 }
19866}
19867
19868impl serde::ser::Serialize for GatewayType {
19869 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19870 where
19871 S: serde::Serializer,
19872 {
19873 match self {
19874 Self::Unspecified => serializer.serialize_i32(0),
19875 Self::ApigeeXAndHybrid => serializer.serialize_i32(1),
19876 Self::ApigeeEdgePublicCloud => serializer.serialize_i32(2),
19877 Self::ApigeeEdgePrivateCloud => serializer.serialize_i32(3),
19878 Self::CloudApiGateway => serializer.serialize_i32(4),
19879 Self::CloudEndpoints => serializer.serialize_i32(5),
19880 Self::ApiDiscovery => serializer.serialize_i32(6),
19881 Self::Others => serializer.serialize_i32(7),
19882 Self::UnknownValue(u) => u.0.serialize(serializer),
19883 }
19884 }
19885}
19886
19887impl<'de> serde::de::Deserialize<'de> for GatewayType {
19888 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19889 where
19890 D: serde::Deserializer<'de>,
19891 {
19892 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GatewayType>::new(
19893 ".google.cloud.apihub.v1.GatewayType",
19894 ))
19895 }
19896}
19897
19898#[derive(Clone, Debug, PartialEq)]
19914#[non_exhaustive]
19915pub enum CurationType {
19916 Unspecified,
19918 DefaultCurationForApiMetadata,
19920 CustomCurationForApiMetadata,
19922 UnknownValue(curation_type::UnknownValue),
19927}
19928
19929#[doc(hidden)]
19930pub mod curation_type {
19931 #[allow(unused_imports)]
19932 use super::*;
19933 #[derive(Clone, Debug, PartialEq)]
19934 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19935}
19936
19937impl CurationType {
19938 pub fn value(&self) -> std::option::Option<i32> {
19943 match self {
19944 Self::Unspecified => std::option::Option::Some(0),
19945 Self::DefaultCurationForApiMetadata => std::option::Option::Some(1),
19946 Self::CustomCurationForApiMetadata => std::option::Option::Some(2),
19947 Self::UnknownValue(u) => u.0.value(),
19948 }
19949 }
19950
19951 pub fn name(&self) -> std::option::Option<&str> {
19956 match self {
19957 Self::Unspecified => std::option::Option::Some("CURATION_TYPE_UNSPECIFIED"),
19958 Self::DefaultCurationForApiMetadata => {
19959 std::option::Option::Some("DEFAULT_CURATION_FOR_API_METADATA")
19960 }
19961 Self::CustomCurationForApiMetadata => {
19962 std::option::Option::Some("CUSTOM_CURATION_FOR_API_METADATA")
19963 }
19964 Self::UnknownValue(u) => u.0.name(),
19965 }
19966 }
19967}
19968
19969impl std::default::Default for CurationType {
19970 fn default() -> Self {
19971 use std::convert::From;
19972 Self::from(0)
19973 }
19974}
19975
19976impl std::fmt::Display for CurationType {
19977 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19978 wkt::internal::display_enum(f, self.name(), self.value())
19979 }
19980}
19981
19982impl std::convert::From<i32> for CurationType {
19983 fn from(value: i32) -> Self {
19984 match value {
19985 0 => Self::Unspecified,
19986 1 => Self::DefaultCurationForApiMetadata,
19987 2 => Self::CustomCurationForApiMetadata,
19988 _ => Self::UnknownValue(curation_type::UnknownValue(
19989 wkt::internal::UnknownEnumValue::Integer(value),
19990 )),
19991 }
19992 }
19993}
19994
19995impl std::convert::From<&str> for CurationType {
19996 fn from(value: &str) -> Self {
19997 use std::string::ToString;
19998 match value {
19999 "CURATION_TYPE_UNSPECIFIED" => Self::Unspecified,
20000 "DEFAULT_CURATION_FOR_API_METADATA" => Self::DefaultCurationForApiMetadata,
20001 "CUSTOM_CURATION_FOR_API_METADATA" => Self::CustomCurationForApiMetadata,
20002 _ => Self::UnknownValue(curation_type::UnknownValue(
20003 wkt::internal::UnknownEnumValue::String(value.to_string()),
20004 )),
20005 }
20006 }
20007}
20008
20009impl serde::ser::Serialize for CurationType {
20010 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20011 where
20012 S: serde::Serializer,
20013 {
20014 match self {
20015 Self::Unspecified => serializer.serialize_i32(0),
20016 Self::DefaultCurationForApiMetadata => serializer.serialize_i32(1),
20017 Self::CustomCurationForApiMetadata => serializer.serialize_i32(2),
20018 Self::UnknownValue(u) => u.0.serialize(serializer),
20019 }
20020 }
20021}
20022
20023impl<'de> serde::de::Deserialize<'de> for CurationType {
20024 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20025 where
20026 D: serde::Deserializer<'de>,
20027 {
20028 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CurationType>::new(
20029 ".google.cloud.apihub.v1.CurationType",
20030 ))
20031 }
20032}