1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate gtype;
25extern crate iam_v1;
26extern crate lazy_static;
27extern crate reqwest;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct AuditData {
45 pub permission_delta: std::option::Option<crate::model::audit_data::PermissionDelta>,
47
48 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
49}
50
51impl AuditData {
52 pub fn new() -> Self {
53 std::default::Default::default()
54 }
55
56 pub fn set_permission_delta<T>(mut self, v: T) -> Self
58 where
59 T: std::convert::Into<crate::model::audit_data::PermissionDelta>,
60 {
61 self.permission_delta = std::option::Option::Some(v.into());
62 self
63 }
64
65 pub fn set_or_clear_permission_delta<T>(mut self, v: std::option::Option<T>) -> Self
67 where
68 T: std::convert::Into<crate::model::audit_data::PermissionDelta>,
69 {
70 self.permission_delta = v.map(|x| x.into());
71 self
72 }
73}
74
75impl wkt::message::Message for AuditData {
76 fn typename() -> &'static str {
77 "type.googleapis.com/google.iam.admin.v1.AuditData"
78 }
79}
80
81pub mod audit_data {
83 #[allow(unused_imports)]
84 use super::*;
85
86 #[derive(Clone, Default, PartialEq)]
89 #[non_exhaustive]
90 pub struct PermissionDelta {
91 pub added_permissions: std::vec::Vec<std::string::String>,
93
94 pub removed_permissions: std::vec::Vec<std::string::String>,
96
97 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
98 }
99
100 impl PermissionDelta {
101 pub fn new() -> Self {
102 std::default::Default::default()
103 }
104
105 pub fn set_added_permissions<T, V>(mut self, v: T) -> Self
107 where
108 T: std::iter::IntoIterator<Item = V>,
109 V: std::convert::Into<std::string::String>,
110 {
111 use std::iter::Iterator;
112 self.added_permissions = v.into_iter().map(|i| i.into()).collect();
113 self
114 }
115
116 pub fn set_removed_permissions<T, V>(mut self, v: T) -> Self
118 where
119 T: std::iter::IntoIterator<Item = V>,
120 V: std::convert::Into<std::string::String>,
121 {
122 use std::iter::Iterator;
123 self.removed_permissions = v.into_iter().map(|i| i.into()).collect();
124 self
125 }
126 }
127
128 impl wkt::message::Message for PermissionDelta {
129 fn typename() -> &'static str {
130 "type.googleapis.com/google.iam.admin.v1.AuditData.PermissionDelta"
131 }
132 }
133}
134
135#[derive(Clone, Default, PartialEq)]
147#[non_exhaustive]
148pub struct ServiceAccount {
149 pub name: std::string::String,
169
170 pub project_id: std::string::String,
172
173 pub unique_id: std::string::String,
180
181 pub email: std::string::String,
183
184 pub display_name: std::string::String,
187
188 #[deprecated]
190 pub etag: ::bytes::Bytes,
191
192 pub description: std::string::String,
195
196 pub oauth2_client_id: std::string::String,
198
199 pub disabled: bool,
201
202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
203}
204
205impl ServiceAccount {
206 pub fn new() -> Self {
207 std::default::Default::default()
208 }
209
210 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
212 self.name = v.into();
213 self
214 }
215
216 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
218 self.project_id = v.into();
219 self
220 }
221
222 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
224 self.unique_id = v.into();
225 self
226 }
227
228 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
230 self.email = v.into();
231 self
232 }
233
234 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
236 self.display_name = v.into();
237 self
238 }
239
240 #[deprecated]
242 pub fn set_etag<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
243 self.etag = v.into();
244 self
245 }
246
247 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
249 self.description = v.into();
250 self
251 }
252
253 pub fn set_oauth2_client_id<T: std::convert::Into<std::string::String>>(
255 mut self,
256 v: T,
257 ) -> Self {
258 self.oauth2_client_id = v.into();
259 self
260 }
261
262 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
264 self.disabled = v.into();
265 self
266 }
267}
268
269impl wkt::message::Message for ServiceAccount {
270 fn typename() -> &'static str {
271 "type.googleapis.com/google.iam.admin.v1.ServiceAccount"
272 }
273}
274
275#[derive(Clone, Default, PartialEq)]
277#[non_exhaustive]
278pub struct CreateServiceAccountRequest {
279 pub name: std::string::String,
282
283 pub account_id: std::string::String,
288
289 pub service_account: std::option::Option<crate::model::ServiceAccount>,
295
296 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
297}
298
299impl CreateServiceAccountRequest {
300 pub fn new() -> Self {
301 std::default::Default::default()
302 }
303
304 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
306 self.name = v.into();
307 self
308 }
309
310 pub fn set_account_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
312 self.account_id = v.into();
313 self
314 }
315
316 pub fn set_service_account<T>(mut self, v: T) -> Self
318 where
319 T: std::convert::Into<crate::model::ServiceAccount>,
320 {
321 self.service_account = std::option::Option::Some(v.into());
322 self
323 }
324
325 pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
327 where
328 T: std::convert::Into<crate::model::ServiceAccount>,
329 {
330 self.service_account = v.map(|x| x.into());
331 self
332 }
333}
334
335impl wkt::message::Message for CreateServiceAccountRequest {
336 fn typename() -> &'static str {
337 "type.googleapis.com/google.iam.admin.v1.CreateServiceAccountRequest"
338 }
339}
340
341#[derive(Clone, Default, PartialEq)]
343#[non_exhaustive]
344pub struct ListServiceAccountsRequest {
345 pub name: std::string::String,
348
349 pub page_size: i32,
358
359 pub page_token: std::string::String,
364
365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
366}
367
368impl ListServiceAccountsRequest {
369 pub fn new() -> Self {
370 std::default::Default::default()
371 }
372
373 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
375 self.name = v.into();
376 self
377 }
378
379 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
381 self.page_size = v.into();
382 self
383 }
384
385 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
387 self.page_token = v.into();
388 self
389 }
390}
391
392impl wkt::message::Message for ListServiceAccountsRequest {
393 fn typename() -> &'static str {
394 "type.googleapis.com/google.iam.admin.v1.ListServiceAccountsRequest"
395 }
396}
397
398#[derive(Clone, Default, PartialEq)]
400#[non_exhaustive]
401pub struct ListServiceAccountsResponse {
402 pub accounts: std::vec::Vec<crate::model::ServiceAccount>,
404
405 pub next_page_token: std::string::String,
411
412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
413}
414
415impl ListServiceAccountsResponse {
416 pub fn new() -> Self {
417 std::default::Default::default()
418 }
419
420 pub fn set_accounts<T, V>(mut self, v: T) -> Self
422 where
423 T: std::iter::IntoIterator<Item = V>,
424 V: std::convert::Into<crate::model::ServiceAccount>,
425 {
426 use std::iter::Iterator;
427 self.accounts = v.into_iter().map(|i| i.into()).collect();
428 self
429 }
430
431 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
433 self.next_page_token = v.into();
434 self
435 }
436}
437
438impl wkt::message::Message for ListServiceAccountsResponse {
439 fn typename() -> &'static str {
440 "type.googleapis.com/google.iam.admin.v1.ListServiceAccountsResponse"
441 }
442}
443
444#[doc(hidden)]
445impl gax::paginator::internal::PageableResponse for ListServiceAccountsResponse {
446 type PageItem = crate::model::ServiceAccount;
447
448 fn items(self) -> std::vec::Vec<Self::PageItem> {
449 self.accounts
450 }
451
452 fn next_page_token(&self) -> std::string::String {
453 use std::clone::Clone;
454 self.next_page_token.clone()
455 }
456}
457
458#[derive(Clone, Default, PartialEq)]
460#[non_exhaustive]
461pub struct GetServiceAccountRequest {
462 pub name: std::string::String,
468
469 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
470}
471
472impl GetServiceAccountRequest {
473 pub fn new() -> Self {
474 std::default::Default::default()
475 }
476
477 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
479 self.name = v.into();
480 self
481 }
482}
483
484impl wkt::message::Message for GetServiceAccountRequest {
485 fn typename() -> &'static str {
486 "type.googleapis.com/google.iam.admin.v1.GetServiceAccountRequest"
487 }
488}
489
490#[derive(Clone, Default, PartialEq)]
492#[non_exhaustive]
493pub struct DeleteServiceAccountRequest {
494 pub name: std::string::String,
500
501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
502}
503
504impl DeleteServiceAccountRequest {
505 pub fn new() -> Self {
506 std::default::Default::default()
507 }
508
509 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
511 self.name = v.into();
512 self
513 }
514}
515
516impl wkt::message::Message for DeleteServiceAccountRequest {
517 fn typename() -> &'static str {
518 "type.googleapis.com/google.iam.admin.v1.DeleteServiceAccountRequest"
519 }
520}
521
522#[derive(Clone, Default, PartialEq)]
530#[non_exhaustive]
531pub struct PatchServiceAccountRequest {
532 pub service_account: std::option::Option<crate::model::ServiceAccount>,
533
534 pub update_mask: std::option::Option<wkt::FieldMask>,
535
536 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
537}
538
539impl PatchServiceAccountRequest {
540 pub fn new() -> Self {
541 std::default::Default::default()
542 }
543
544 pub fn set_service_account<T>(mut self, v: T) -> Self
546 where
547 T: std::convert::Into<crate::model::ServiceAccount>,
548 {
549 self.service_account = std::option::Option::Some(v.into());
550 self
551 }
552
553 pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
555 where
556 T: std::convert::Into<crate::model::ServiceAccount>,
557 {
558 self.service_account = v.map(|x| x.into());
559 self
560 }
561
562 pub fn set_update_mask<T>(mut self, v: T) -> Self
564 where
565 T: std::convert::Into<wkt::FieldMask>,
566 {
567 self.update_mask = std::option::Option::Some(v.into());
568 self
569 }
570
571 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
573 where
574 T: std::convert::Into<wkt::FieldMask>,
575 {
576 self.update_mask = v.map(|x| x.into());
577 self
578 }
579}
580
581impl wkt::message::Message for PatchServiceAccountRequest {
582 fn typename() -> &'static str {
583 "type.googleapis.com/google.iam.admin.v1.PatchServiceAccountRequest"
584 }
585}
586
587#[derive(Clone, Default, PartialEq)]
589#[non_exhaustive]
590pub struct UndeleteServiceAccountRequest {
591 pub name: std::string::String,
596
597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
598}
599
600impl UndeleteServiceAccountRequest {
601 pub fn new() -> Self {
602 std::default::Default::default()
603 }
604
605 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
607 self.name = v.into();
608 self
609 }
610}
611
612impl wkt::message::Message for UndeleteServiceAccountRequest {
613 fn typename() -> &'static str {
614 "type.googleapis.com/google.iam.admin.v1.UndeleteServiceAccountRequest"
615 }
616}
617
618#[derive(Clone, Default, PartialEq)]
619#[non_exhaustive]
620pub struct UndeleteServiceAccountResponse {
621 pub restored_account: std::option::Option<crate::model::ServiceAccount>,
623
624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
625}
626
627impl UndeleteServiceAccountResponse {
628 pub fn new() -> Self {
629 std::default::Default::default()
630 }
631
632 pub fn set_restored_account<T>(mut self, v: T) -> Self
634 where
635 T: std::convert::Into<crate::model::ServiceAccount>,
636 {
637 self.restored_account = std::option::Option::Some(v.into());
638 self
639 }
640
641 pub fn set_or_clear_restored_account<T>(mut self, v: std::option::Option<T>) -> Self
643 where
644 T: std::convert::Into<crate::model::ServiceAccount>,
645 {
646 self.restored_account = v.map(|x| x.into());
647 self
648 }
649}
650
651impl wkt::message::Message for UndeleteServiceAccountResponse {
652 fn typename() -> &'static str {
653 "type.googleapis.com/google.iam.admin.v1.UndeleteServiceAccountResponse"
654 }
655}
656
657#[derive(Clone, Default, PartialEq)]
659#[non_exhaustive]
660pub struct EnableServiceAccountRequest {
661 pub name: std::string::String,
667
668 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
669}
670
671impl EnableServiceAccountRequest {
672 pub fn new() -> Self {
673 std::default::Default::default()
674 }
675
676 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
678 self.name = v.into();
679 self
680 }
681}
682
683impl wkt::message::Message for EnableServiceAccountRequest {
684 fn typename() -> &'static str {
685 "type.googleapis.com/google.iam.admin.v1.EnableServiceAccountRequest"
686 }
687}
688
689#[derive(Clone, Default, PartialEq)]
691#[non_exhaustive]
692pub struct DisableServiceAccountRequest {
693 pub name: std::string::String,
699
700 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
701}
702
703impl DisableServiceAccountRequest {
704 pub fn new() -> Self {
705 std::default::Default::default()
706 }
707
708 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
710 self.name = v.into();
711 self
712 }
713}
714
715impl wkt::message::Message for DisableServiceAccountRequest {
716 fn typename() -> &'static str {
717 "type.googleapis.com/google.iam.admin.v1.DisableServiceAccountRequest"
718 }
719}
720
721#[derive(Clone, Default, PartialEq)]
723#[non_exhaustive]
724pub struct ListServiceAccountKeysRequest {
725 pub name: std::string::String,
732
733 pub key_types: std::vec::Vec<crate::model::list_service_account_keys_request::KeyType>,
737
738 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
739}
740
741impl ListServiceAccountKeysRequest {
742 pub fn new() -> Self {
743 std::default::Default::default()
744 }
745
746 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
748 self.name = v.into();
749 self
750 }
751
752 pub fn set_key_types<T, V>(mut self, v: T) -> Self
754 where
755 T: std::iter::IntoIterator<Item = V>,
756 V: std::convert::Into<crate::model::list_service_account_keys_request::KeyType>,
757 {
758 use std::iter::Iterator;
759 self.key_types = v.into_iter().map(|i| i.into()).collect();
760 self
761 }
762}
763
764impl wkt::message::Message for ListServiceAccountKeysRequest {
765 fn typename() -> &'static str {
766 "type.googleapis.com/google.iam.admin.v1.ListServiceAccountKeysRequest"
767 }
768}
769
770pub mod list_service_account_keys_request {
772 #[allow(unused_imports)]
773 use super::*;
774
775 #[derive(Clone, Debug, PartialEq)]
792 #[non_exhaustive]
793 pub enum KeyType {
794 Unspecified,
797 UserManaged,
799 SystemManaged,
801 UnknownValue(key_type::UnknownValue),
806 }
807
808 #[doc(hidden)]
809 pub mod key_type {
810 #[allow(unused_imports)]
811 use super::*;
812 #[derive(Clone, Debug, PartialEq)]
813 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
814 }
815
816 impl KeyType {
817 pub fn value(&self) -> std::option::Option<i32> {
822 match self {
823 Self::Unspecified => std::option::Option::Some(0),
824 Self::UserManaged => std::option::Option::Some(1),
825 Self::SystemManaged => std::option::Option::Some(2),
826 Self::UnknownValue(u) => u.0.value(),
827 }
828 }
829
830 pub fn name(&self) -> std::option::Option<&str> {
835 match self {
836 Self::Unspecified => std::option::Option::Some("KEY_TYPE_UNSPECIFIED"),
837 Self::UserManaged => std::option::Option::Some("USER_MANAGED"),
838 Self::SystemManaged => std::option::Option::Some("SYSTEM_MANAGED"),
839 Self::UnknownValue(u) => u.0.name(),
840 }
841 }
842 }
843
844 impl std::default::Default for KeyType {
845 fn default() -> Self {
846 use std::convert::From;
847 Self::from(0)
848 }
849 }
850
851 impl std::fmt::Display for KeyType {
852 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
853 wkt::internal::display_enum(f, self.name(), self.value())
854 }
855 }
856
857 impl std::convert::From<i32> for KeyType {
858 fn from(value: i32) -> Self {
859 match value {
860 0 => Self::Unspecified,
861 1 => Self::UserManaged,
862 2 => Self::SystemManaged,
863 _ => Self::UnknownValue(key_type::UnknownValue(
864 wkt::internal::UnknownEnumValue::Integer(value),
865 )),
866 }
867 }
868 }
869
870 impl std::convert::From<&str> for KeyType {
871 fn from(value: &str) -> Self {
872 use std::string::ToString;
873 match value {
874 "KEY_TYPE_UNSPECIFIED" => Self::Unspecified,
875 "USER_MANAGED" => Self::UserManaged,
876 "SYSTEM_MANAGED" => Self::SystemManaged,
877 _ => Self::UnknownValue(key_type::UnknownValue(
878 wkt::internal::UnknownEnumValue::String(value.to_string()),
879 )),
880 }
881 }
882 }
883
884 impl serde::ser::Serialize for KeyType {
885 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
886 where
887 S: serde::Serializer,
888 {
889 match self {
890 Self::Unspecified => serializer.serialize_i32(0),
891 Self::UserManaged => serializer.serialize_i32(1),
892 Self::SystemManaged => serializer.serialize_i32(2),
893 Self::UnknownValue(u) => u.0.serialize(serializer),
894 }
895 }
896 }
897
898 impl<'de> serde::de::Deserialize<'de> for KeyType {
899 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
900 where
901 D: serde::Deserializer<'de>,
902 {
903 deserializer.deserialize_any(wkt::internal::EnumVisitor::<KeyType>::new(
904 ".google.iam.admin.v1.ListServiceAccountKeysRequest.KeyType",
905 ))
906 }
907 }
908}
909
910#[derive(Clone, Default, PartialEq)]
912#[non_exhaustive]
913pub struct ListServiceAccountKeysResponse {
914 pub keys: std::vec::Vec<crate::model::ServiceAccountKey>,
916
917 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
918}
919
920impl ListServiceAccountKeysResponse {
921 pub fn new() -> Self {
922 std::default::Default::default()
923 }
924
925 pub fn set_keys<T, V>(mut self, v: T) -> Self
927 where
928 T: std::iter::IntoIterator<Item = V>,
929 V: std::convert::Into<crate::model::ServiceAccountKey>,
930 {
931 use std::iter::Iterator;
932 self.keys = v.into_iter().map(|i| i.into()).collect();
933 self
934 }
935}
936
937impl wkt::message::Message for ListServiceAccountKeysResponse {
938 fn typename() -> &'static str {
939 "type.googleapis.com/google.iam.admin.v1.ListServiceAccountKeysResponse"
940 }
941}
942
943#[derive(Clone, Default, PartialEq)]
945#[non_exhaustive]
946pub struct GetServiceAccountKeyRequest {
947 pub name: std::string::String,
954
955 pub public_key_type: crate::model::ServiceAccountPublicKeyType,
958
959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
960}
961
962impl GetServiceAccountKeyRequest {
963 pub fn new() -> Self {
964 std::default::Default::default()
965 }
966
967 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
969 self.name = v.into();
970 self
971 }
972
973 pub fn set_public_key_type<T: std::convert::Into<crate::model::ServiceAccountPublicKeyType>>(
975 mut self,
976 v: T,
977 ) -> Self {
978 self.public_key_type = v.into();
979 self
980 }
981}
982
983impl wkt::message::Message for GetServiceAccountKeyRequest {
984 fn typename() -> &'static str {
985 "type.googleapis.com/google.iam.admin.v1.GetServiceAccountKeyRequest"
986 }
987}
988
989#[derive(Clone, Default, PartialEq)]
1014#[non_exhaustive]
1015pub struct ServiceAccountKey {
1016 pub name: std::string::String,
1019
1020 pub private_key_type: crate::model::ServiceAccountPrivateKeyType,
1027
1028 pub key_algorithm: crate::model::ServiceAccountKeyAlgorithm,
1030
1031 pub private_key_data: ::bytes::Bytes,
1039
1040 pub public_key_data: ::bytes::Bytes,
1042
1043 pub valid_after_time: std::option::Option<wkt::Timestamp>,
1045
1046 pub valid_before_time: std::option::Option<wkt::Timestamp>,
1051
1052 pub key_origin: crate::model::ServiceAccountKeyOrigin,
1054
1055 pub key_type: crate::model::list_service_account_keys_request::KeyType,
1057
1058 pub disabled: bool,
1060
1061 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1062}
1063
1064impl ServiceAccountKey {
1065 pub fn new() -> Self {
1066 std::default::Default::default()
1067 }
1068
1069 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1071 self.name = v.into();
1072 self
1073 }
1074
1075 pub fn set_private_key_type<
1077 T: std::convert::Into<crate::model::ServiceAccountPrivateKeyType>,
1078 >(
1079 mut self,
1080 v: T,
1081 ) -> Self {
1082 self.private_key_type = v.into();
1083 self
1084 }
1085
1086 pub fn set_key_algorithm<T: std::convert::Into<crate::model::ServiceAccountKeyAlgorithm>>(
1088 mut self,
1089 v: T,
1090 ) -> Self {
1091 self.key_algorithm = v.into();
1092 self
1093 }
1094
1095 pub fn set_private_key_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1097 self.private_key_data = v.into();
1098 self
1099 }
1100
1101 pub fn set_public_key_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1103 self.public_key_data = v.into();
1104 self
1105 }
1106
1107 pub fn set_valid_after_time<T>(mut self, v: T) -> Self
1109 where
1110 T: std::convert::Into<wkt::Timestamp>,
1111 {
1112 self.valid_after_time = std::option::Option::Some(v.into());
1113 self
1114 }
1115
1116 pub fn set_or_clear_valid_after_time<T>(mut self, v: std::option::Option<T>) -> Self
1118 where
1119 T: std::convert::Into<wkt::Timestamp>,
1120 {
1121 self.valid_after_time = v.map(|x| x.into());
1122 self
1123 }
1124
1125 pub fn set_valid_before_time<T>(mut self, v: T) -> Self
1127 where
1128 T: std::convert::Into<wkt::Timestamp>,
1129 {
1130 self.valid_before_time = std::option::Option::Some(v.into());
1131 self
1132 }
1133
1134 pub fn set_or_clear_valid_before_time<T>(mut self, v: std::option::Option<T>) -> Self
1136 where
1137 T: std::convert::Into<wkt::Timestamp>,
1138 {
1139 self.valid_before_time = v.map(|x| x.into());
1140 self
1141 }
1142
1143 pub fn set_key_origin<T: std::convert::Into<crate::model::ServiceAccountKeyOrigin>>(
1145 mut self,
1146 v: T,
1147 ) -> Self {
1148 self.key_origin = v.into();
1149 self
1150 }
1151
1152 pub fn set_key_type<
1154 T: std::convert::Into<crate::model::list_service_account_keys_request::KeyType>,
1155 >(
1156 mut self,
1157 v: T,
1158 ) -> Self {
1159 self.key_type = v.into();
1160 self
1161 }
1162
1163 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1165 self.disabled = v.into();
1166 self
1167 }
1168}
1169
1170impl wkt::message::Message for ServiceAccountKey {
1171 fn typename() -> &'static str {
1172 "type.googleapis.com/google.iam.admin.v1.ServiceAccountKey"
1173 }
1174}
1175
1176#[derive(Clone, Default, PartialEq)]
1178#[non_exhaustive]
1179pub struct CreateServiceAccountKeyRequest {
1180 pub name: std::string::String,
1186
1187 pub private_key_type: crate::model::ServiceAccountPrivateKeyType,
1191
1192 pub key_algorithm: crate::model::ServiceAccountKeyAlgorithm,
1196
1197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1198}
1199
1200impl CreateServiceAccountKeyRequest {
1201 pub fn new() -> Self {
1202 std::default::Default::default()
1203 }
1204
1205 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1207 self.name = v.into();
1208 self
1209 }
1210
1211 pub fn set_private_key_type<
1213 T: std::convert::Into<crate::model::ServiceAccountPrivateKeyType>,
1214 >(
1215 mut self,
1216 v: T,
1217 ) -> Self {
1218 self.private_key_type = v.into();
1219 self
1220 }
1221
1222 pub fn set_key_algorithm<T: std::convert::Into<crate::model::ServiceAccountKeyAlgorithm>>(
1224 mut self,
1225 v: T,
1226 ) -> Self {
1227 self.key_algorithm = v.into();
1228 self
1229 }
1230}
1231
1232impl wkt::message::Message for CreateServiceAccountKeyRequest {
1233 fn typename() -> &'static str {
1234 "type.googleapis.com/google.iam.admin.v1.CreateServiceAccountKeyRequest"
1235 }
1236}
1237
1238#[derive(Clone, Default, PartialEq)]
1240#[non_exhaustive]
1241pub struct UploadServiceAccountKeyRequest {
1242 pub name: std::string::String,
1248
1249 pub public_key_data: ::bytes::Bytes,
1254
1255 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1256}
1257
1258impl UploadServiceAccountKeyRequest {
1259 pub fn new() -> Self {
1260 std::default::Default::default()
1261 }
1262
1263 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1265 self.name = v.into();
1266 self
1267 }
1268
1269 pub fn set_public_key_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1271 self.public_key_data = v.into();
1272 self
1273 }
1274}
1275
1276impl wkt::message::Message for UploadServiceAccountKeyRequest {
1277 fn typename() -> &'static str {
1278 "type.googleapis.com/google.iam.admin.v1.UploadServiceAccountKeyRequest"
1279 }
1280}
1281
1282#[derive(Clone, Default, PartialEq)]
1284#[non_exhaustive]
1285pub struct DeleteServiceAccountKeyRequest {
1286 pub name: std::string::String,
1292
1293 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1294}
1295
1296impl DeleteServiceAccountKeyRequest {
1297 pub fn new() -> Self {
1298 std::default::Default::default()
1299 }
1300
1301 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1303 self.name = v.into();
1304 self
1305 }
1306}
1307
1308impl wkt::message::Message for DeleteServiceAccountKeyRequest {
1309 fn typename() -> &'static str {
1310 "type.googleapis.com/google.iam.admin.v1.DeleteServiceAccountKeyRequest"
1311 }
1312}
1313
1314#[derive(Clone, Default, PartialEq)]
1316#[non_exhaustive]
1317pub struct DisableServiceAccountKeyRequest {
1318 pub name: std::string::String,
1325
1326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1327}
1328
1329impl DisableServiceAccountKeyRequest {
1330 pub fn new() -> Self {
1331 std::default::Default::default()
1332 }
1333
1334 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.name = v.into();
1337 self
1338 }
1339}
1340
1341impl wkt::message::Message for DisableServiceAccountKeyRequest {
1342 fn typename() -> &'static str {
1343 "type.googleapis.com/google.iam.admin.v1.DisableServiceAccountKeyRequest"
1344 }
1345}
1346
1347#[derive(Clone, Default, PartialEq)]
1349#[non_exhaustive]
1350pub struct EnableServiceAccountKeyRequest {
1351 pub name: std::string::String,
1358
1359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1360}
1361
1362impl EnableServiceAccountKeyRequest {
1363 pub fn new() -> Self {
1364 std::default::Default::default()
1365 }
1366
1367 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1369 self.name = v.into();
1370 self
1371 }
1372}
1373
1374impl wkt::message::Message for EnableServiceAccountKeyRequest {
1375 fn typename() -> &'static str {
1376 "type.googleapis.com/google.iam.admin.v1.EnableServiceAccountKeyRequest"
1377 }
1378}
1379
1380#[derive(Clone, Default, PartialEq)]
1385#[non_exhaustive]
1386pub struct SignBlobRequest {
1387 #[deprecated]
1396 pub name: std::string::String,
1397
1398 #[deprecated]
1403 pub bytes_to_sign: ::bytes::Bytes,
1404
1405 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1406}
1407
1408impl SignBlobRequest {
1409 pub fn new() -> Self {
1410 std::default::Default::default()
1411 }
1412
1413 #[deprecated]
1415 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1416 self.name = v.into();
1417 self
1418 }
1419
1420 #[deprecated]
1422 pub fn set_bytes_to_sign<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1423 self.bytes_to_sign = v.into();
1424 self
1425 }
1426}
1427
1428impl wkt::message::Message for SignBlobRequest {
1429 fn typename() -> &'static str {
1430 "type.googleapis.com/google.iam.admin.v1.SignBlobRequest"
1431 }
1432}
1433
1434#[derive(Clone, Default, PartialEq)]
1439#[non_exhaustive]
1440pub struct SignBlobResponse {
1441 #[deprecated]
1446 pub key_id: std::string::String,
1447
1448 #[deprecated]
1453 pub signature: ::bytes::Bytes,
1454
1455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1456}
1457
1458impl SignBlobResponse {
1459 pub fn new() -> Self {
1460 std::default::Default::default()
1461 }
1462
1463 #[deprecated]
1465 pub fn set_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1466 self.key_id = v.into();
1467 self
1468 }
1469
1470 #[deprecated]
1472 pub fn set_signature<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1473 self.signature = v.into();
1474 self
1475 }
1476}
1477
1478impl wkt::message::Message for SignBlobResponse {
1479 fn typename() -> &'static str {
1480 "type.googleapis.com/google.iam.admin.v1.SignBlobResponse"
1481 }
1482}
1483
1484#[derive(Clone, Default, PartialEq)]
1489#[non_exhaustive]
1490pub struct SignJwtRequest {
1491 #[deprecated]
1500 pub name: std::string::String,
1501
1502 #[deprecated]
1516 pub payload: std::string::String,
1517
1518 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1519}
1520
1521impl SignJwtRequest {
1522 pub fn new() -> Self {
1523 std::default::Default::default()
1524 }
1525
1526 #[deprecated]
1528 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1529 self.name = v.into();
1530 self
1531 }
1532
1533 #[deprecated]
1535 pub fn set_payload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1536 self.payload = v.into();
1537 self
1538 }
1539}
1540
1541impl wkt::message::Message for SignJwtRequest {
1542 fn typename() -> &'static str {
1543 "type.googleapis.com/google.iam.admin.v1.SignJwtRequest"
1544 }
1545}
1546
1547#[derive(Clone, Default, PartialEq)]
1552#[non_exhaustive]
1553pub struct SignJwtResponse {
1554 #[deprecated]
1559 pub key_id: std::string::String,
1560
1561 #[deprecated]
1566 pub signed_jwt: std::string::String,
1567
1568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1569}
1570
1571impl SignJwtResponse {
1572 pub fn new() -> Self {
1573 std::default::Default::default()
1574 }
1575
1576 #[deprecated]
1578 pub fn set_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1579 self.key_id = v.into();
1580 self
1581 }
1582
1583 #[deprecated]
1585 pub fn set_signed_jwt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1586 self.signed_jwt = v.into();
1587 self
1588 }
1589}
1590
1591impl wkt::message::Message for SignJwtResponse {
1592 fn typename() -> &'static str {
1593 "type.googleapis.com/google.iam.admin.v1.SignJwtResponse"
1594 }
1595}
1596
1597#[derive(Clone, Default, PartialEq)]
1599#[non_exhaustive]
1600pub struct Role {
1601 pub name: std::string::String,
1609
1610 pub title: std::string::String,
1613
1614 pub description: std::string::String,
1616
1617 pub included_permissions: std::vec::Vec<std::string::String>,
1619
1620 pub stage: crate::model::role::RoleLaunchStage,
1624
1625 pub etag: ::bytes::Bytes,
1627
1628 pub deleted: bool,
1631
1632 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1633}
1634
1635impl Role {
1636 pub fn new() -> Self {
1637 std::default::Default::default()
1638 }
1639
1640 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1642 self.name = v.into();
1643 self
1644 }
1645
1646 pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1648 self.title = v.into();
1649 self
1650 }
1651
1652 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1654 self.description = v.into();
1655 self
1656 }
1657
1658 pub fn set_included_permissions<T, V>(mut self, v: T) -> Self
1660 where
1661 T: std::iter::IntoIterator<Item = V>,
1662 V: std::convert::Into<std::string::String>,
1663 {
1664 use std::iter::Iterator;
1665 self.included_permissions = v.into_iter().map(|i| i.into()).collect();
1666 self
1667 }
1668
1669 pub fn set_stage<T: std::convert::Into<crate::model::role::RoleLaunchStage>>(
1671 mut self,
1672 v: T,
1673 ) -> Self {
1674 self.stage = v.into();
1675 self
1676 }
1677
1678 pub fn set_etag<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1680 self.etag = v.into();
1681 self
1682 }
1683
1684 pub fn set_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1686 self.deleted = v.into();
1687 self
1688 }
1689}
1690
1691impl wkt::message::Message for Role {
1692 fn typename() -> &'static str {
1693 "type.googleapis.com/google.iam.admin.v1.Role"
1694 }
1695}
1696
1697pub mod role {
1699 #[allow(unused_imports)]
1700 use super::*;
1701
1702 #[derive(Clone, Debug, PartialEq)]
1718 #[non_exhaustive]
1719 pub enum RoleLaunchStage {
1720 Alpha,
1724 Beta,
1726 Ga,
1728 Deprecated,
1730 Disabled,
1733 Eap,
1735 UnknownValue(role_launch_stage::UnknownValue),
1740 }
1741
1742 #[doc(hidden)]
1743 pub mod role_launch_stage {
1744 #[allow(unused_imports)]
1745 use super::*;
1746 #[derive(Clone, Debug, PartialEq)]
1747 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1748 }
1749
1750 impl RoleLaunchStage {
1751 pub fn value(&self) -> std::option::Option<i32> {
1756 match self {
1757 Self::Alpha => std::option::Option::Some(0),
1758 Self::Beta => std::option::Option::Some(1),
1759 Self::Ga => std::option::Option::Some(2),
1760 Self::Deprecated => std::option::Option::Some(4),
1761 Self::Disabled => std::option::Option::Some(5),
1762 Self::Eap => std::option::Option::Some(6),
1763 Self::UnknownValue(u) => u.0.value(),
1764 }
1765 }
1766
1767 pub fn name(&self) -> std::option::Option<&str> {
1772 match self {
1773 Self::Alpha => std::option::Option::Some("ALPHA"),
1774 Self::Beta => std::option::Option::Some("BETA"),
1775 Self::Ga => std::option::Option::Some("GA"),
1776 Self::Deprecated => std::option::Option::Some("DEPRECATED"),
1777 Self::Disabled => std::option::Option::Some("DISABLED"),
1778 Self::Eap => std::option::Option::Some("EAP"),
1779 Self::UnknownValue(u) => u.0.name(),
1780 }
1781 }
1782 }
1783
1784 impl std::default::Default for RoleLaunchStage {
1785 fn default() -> Self {
1786 use std::convert::From;
1787 Self::from(0)
1788 }
1789 }
1790
1791 impl std::fmt::Display for RoleLaunchStage {
1792 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1793 wkt::internal::display_enum(f, self.name(), self.value())
1794 }
1795 }
1796
1797 impl std::convert::From<i32> for RoleLaunchStage {
1798 fn from(value: i32) -> Self {
1799 match value {
1800 0 => Self::Alpha,
1801 1 => Self::Beta,
1802 2 => Self::Ga,
1803 4 => Self::Deprecated,
1804 5 => Self::Disabled,
1805 6 => Self::Eap,
1806 _ => Self::UnknownValue(role_launch_stage::UnknownValue(
1807 wkt::internal::UnknownEnumValue::Integer(value),
1808 )),
1809 }
1810 }
1811 }
1812
1813 impl std::convert::From<&str> for RoleLaunchStage {
1814 fn from(value: &str) -> Self {
1815 use std::string::ToString;
1816 match value {
1817 "ALPHA" => Self::Alpha,
1818 "BETA" => Self::Beta,
1819 "GA" => Self::Ga,
1820 "DEPRECATED" => Self::Deprecated,
1821 "DISABLED" => Self::Disabled,
1822 "EAP" => Self::Eap,
1823 _ => Self::UnknownValue(role_launch_stage::UnknownValue(
1824 wkt::internal::UnknownEnumValue::String(value.to_string()),
1825 )),
1826 }
1827 }
1828 }
1829
1830 impl serde::ser::Serialize for RoleLaunchStage {
1831 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1832 where
1833 S: serde::Serializer,
1834 {
1835 match self {
1836 Self::Alpha => serializer.serialize_i32(0),
1837 Self::Beta => serializer.serialize_i32(1),
1838 Self::Ga => serializer.serialize_i32(2),
1839 Self::Deprecated => serializer.serialize_i32(4),
1840 Self::Disabled => serializer.serialize_i32(5),
1841 Self::Eap => serializer.serialize_i32(6),
1842 Self::UnknownValue(u) => u.0.serialize(serializer),
1843 }
1844 }
1845 }
1846
1847 impl<'de> serde::de::Deserialize<'de> for RoleLaunchStage {
1848 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1849 where
1850 D: serde::Deserializer<'de>,
1851 {
1852 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoleLaunchStage>::new(
1853 ".google.iam.admin.v1.Role.RoleLaunchStage",
1854 ))
1855 }
1856 }
1857}
1858
1859#[derive(Clone, Default, PartialEq)]
1861#[non_exhaustive]
1862pub struct QueryGrantableRolesRequest {
1863 pub full_resource_name: std::string::String,
1869
1870 pub view: crate::model::RoleView,
1871
1872 pub page_size: i32,
1876
1877 pub page_token: std::string::String,
1880
1881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1882}
1883
1884impl QueryGrantableRolesRequest {
1885 pub fn new() -> Self {
1886 std::default::Default::default()
1887 }
1888
1889 pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
1891 mut self,
1892 v: T,
1893 ) -> Self {
1894 self.full_resource_name = v.into();
1895 self
1896 }
1897
1898 pub fn set_view<T: std::convert::Into<crate::model::RoleView>>(mut self, v: T) -> Self {
1900 self.view = v.into();
1901 self
1902 }
1903
1904 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1906 self.page_size = v.into();
1907 self
1908 }
1909
1910 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1912 self.page_token = v.into();
1913 self
1914 }
1915}
1916
1917impl wkt::message::Message for QueryGrantableRolesRequest {
1918 fn typename() -> &'static str {
1919 "type.googleapis.com/google.iam.admin.v1.QueryGrantableRolesRequest"
1920 }
1921}
1922
1923#[derive(Clone, Default, PartialEq)]
1925#[non_exhaustive]
1926pub struct QueryGrantableRolesResponse {
1927 pub roles: std::vec::Vec<crate::model::Role>,
1929
1930 pub next_page_token: std::string::String,
1933
1934 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1935}
1936
1937impl QueryGrantableRolesResponse {
1938 pub fn new() -> Self {
1939 std::default::Default::default()
1940 }
1941
1942 pub fn set_roles<T, V>(mut self, v: T) -> Self
1944 where
1945 T: std::iter::IntoIterator<Item = V>,
1946 V: std::convert::Into<crate::model::Role>,
1947 {
1948 use std::iter::Iterator;
1949 self.roles = v.into_iter().map(|i| i.into()).collect();
1950 self
1951 }
1952
1953 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1955 self.next_page_token = v.into();
1956 self
1957 }
1958}
1959
1960impl wkt::message::Message for QueryGrantableRolesResponse {
1961 fn typename() -> &'static str {
1962 "type.googleapis.com/google.iam.admin.v1.QueryGrantableRolesResponse"
1963 }
1964}
1965
1966#[doc(hidden)]
1967impl gax::paginator::internal::PageableResponse for QueryGrantableRolesResponse {
1968 type PageItem = crate::model::Role;
1969
1970 fn items(self) -> std::vec::Vec<Self::PageItem> {
1971 self.roles
1972 }
1973
1974 fn next_page_token(&self) -> std::string::String {
1975 use std::clone::Clone;
1976 self.next_page_token.clone()
1977 }
1978}
1979
1980#[derive(Clone, Default, PartialEq)]
1982#[non_exhaustive]
1983pub struct ListRolesRequest {
1984 pub parent: std::string::String,
2016
2017 pub page_size: i32,
2021
2022 pub page_token: std::string::String,
2024
2025 pub view: crate::model::RoleView,
2030
2031 pub show_deleted: bool,
2033
2034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2035}
2036
2037impl ListRolesRequest {
2038 pub fn new() -> Self {
2039 std::default::Default::default()
2040 }
2041
2042 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2044 self.parent = v.into();
2045 self
2046 }
2047
2048 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2050 self.page_size = v.into();
2051 self
2052 }
2053
2054 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2056 self.page_token = v.into();
2057 self
2058 }
2059
2060 pub fn set_view<T: std::convert::Into<crate::model::RoleView>>(mut self, v: T) -> Self {
2062 self.view = v.into();
2063 self
2064 }
2065
2066 pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2068 self.show_deleted = v.into();
2069 self
2070 }
2071}
2072
2073impl wkt::message::Message for ListRolesRequest {
2074 fn typename() -> &'static str {
2075 "type.googleapis.com/google.iam.admin.v1.ListRolesRequest"
2076 }
2077}
2078
2079#[derive(Clone, Default, PartialEq)]
2081#[non_exhaustive]
2082pub struct ListRolesResponse {
2083 pub roles: std::vec::Vec<crate::model::Role>,
2085
2086 pub next_page_token: std::string::String,
2089
2090 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2091}
2092
2093impl ListRolesResponse {
2094 pub fn new() -> Self {
2095 std::default::Default::default()
2096 }
2097
2098 pub fn set_roles<T, V>(mut self, v: T) -> Self
2100 where
2101 T: std::iter::IntoIterator<Item = V>,
2102 V: std::convert::Into<crate::model::Role>,
2103 {
2104 use std::iter::Iterator;
2105 self.roles = v.into_iter().map(|i| i.into()).collect();
2106 self
2107 }
2108
2109 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2111 self.next_page_token = v.into();
2112 self
2113 }
2114}
2115
2116impl wkt::message::Message for ListRolesResponse {
2117 fn typename() -> &'static str {
2118 "type.googleapis.com/google.iam.admin.v1.ListRolesResponse"
2119 }
2120}
2121
2122#[doc(hidden)]
2123impl gax::paginator::internal::PageableResponse for ListRolesResponse {
2124 type PageItem = crate::model::Role;
2125
2126 fn items(self) -> std::vec::Vec<Self::PageItem> {
2127 self.roles
2128 }
2129
2130 fn next_page_token(&self) -> std::string::String {
2131 use std::clone::Clone;
2132 self.next_page_token.clone()
2133 }
2134}
2135
2136#[derive(Clone, Default, PartialEq)]
2138#[non_exhaustive]
2139pub struct GetRoleRequest {
2140 pub name: std::string::String,
2173
2174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2175}
2176
2177impl GetRoleRequest {
2178 pub fn new() -> Self {
2179 std::default::Default::default()
2180 }
2181
2182 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2184 self.name = v.into();
2185 self
2186 }
2187}
2188
2189impl wkt::message::Message for GetRoleRequest {
2190 fn typename() -> &'static str {
2191 "type.googleapis.com/google.iam.admin.v1.GetRoleRequest"
2192 }
2193}
2194
2195#[derive(Clone, Default, PartialEq)]
2197#[non_exhaustive]
2198pub struct CreateRoleRequest {
2199 pub parent: std::string::String,
2224
2225 pub role_id: std::string::String,
2231
2232 pub role: std::option::Option<crate::model::Role>,
2234
2235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2236}
2237
2238impl CreateRoleRequest {
2239 pub fn new() -> Self {
2240 std::default::Default::default()
2241 }
2242
2243 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2245 self.parent = v.into();
2246 self
2247 }
2248
2249 pub fn set_role_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2251 self.role_id = v.into();
2252 self
2253 }
2254
2255 pub fn set_role<T>(mut self, v: T) -> Self
2257 where
2258 T: std::convert::Into<crate::model::Role>,
2259 {
2260 self.role = std::option::Option::Some(v.into());
2261 self
2262 }
2263
2264 pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
2266 where
2267 T: std::convert::Into<crate::model::Role>,
2268 {
2269 self.role = v.map(|x| x.into());
2270 self
2271 }
2272}
2273
2274impl wkt::message::Message for CreateRoleRequest {
2275 fn typename() -> &'static str {
2276 "type.googleapis.com/google.iam.admin.v1.CreateRoleRequest"
2277 }
2278}
2279
2280#[derive(Clone, Default, PartialEq)]
2282#[non_exhaustive]
2283pub struct UpdateRoleRequest {
2284 pub name: std::string::String,
2309
2310 pub role: std::option::Option<crate::model::Role>,
2312
2313 pub update_mask: std::option::Option<wkt::FieldMask>,
2315
2316 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2317}
2318
2319impl UpdateRoleRequest {
2320 pub fn new() -> Self {
2321 std::default::Default::default()
2322 }
2323
2324 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2326 self.name = v.into();
2327 self
2328 }
2329
2330 pub fn set_role<T>(mut self, v: T) -> Self
2332 where
2333 T: std::convert::Into<crate::model::Role>,
2334 {
2335 self.role = std::option::Option::Some(v.into());
2336 self
2337 }
2338
2339 pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
2341 where
2342 T: std::convert::Into<crate::model::Role>,
2343 {
2344 self.role = v.map(|x| x.into());
2345 self
2346 }
2347
2348 pub fn set_update_mask<T>(mut self, v: T) -> Self
2350 where
2351 T: std::convert::Into<wkt::FieldMask>,
2352 {
2353 self.update_mask = std::option::Option::Some(v.into());
2354 self
2355 }
2356
2357 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2359 where
2360 T: std::convert::Into<wkt::FieldMask>,
2361 {
2362 self.update_mask = v.map(|x| x.into());
2363 self
2364 }
2365}
2366
2367impl wkt::message::Message for UpdateRoleRequest {
2368 fn typename() -> &'static str {
2369 "type.googleapis.com/google.iam.admin.v1.UpdateRoleRequest"
2370 }
2371}
2372
2373#[derive(Clone, Default, PartialEq)]
2375#[non_exhaustive]
2376pub struct DeleteRoleRequest {
2377 pub name: std::string::String,
2402
2403 pub etag: ::bytes::Bytes,
2405
2406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2407}
2408
2409impl DeleteRoleRequest {
2410 pub fn new() -> Self {
2411 std::default::Default::default()
2412 }
2413
2414 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2416 self.name = v.into();
2417 self
2418 }
2419
2420 pub fn set_etag<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2422 self.etag = v.into();
2423 self
2424 }
2425}
2426
2427impl wkt::message::Message for DeleteRoleRequest {
2428 fn typename() -> &'static str {
2429 "type.googleapis.com/google.iam.admin.v1.DeleteRoleRequest"
2430 }
2431}
2432
2433#[derive(Clone, Default, PartialEq)]
2435#[non_exhaustive]
2436pub struct UndeleteRoleRequest {
2437 pub name: std::string::String,
2462
2463 pub etag: ::bytes::Bytes,
2465
2466 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2467}
2468
2469impl UndeleteRoleRequest {
2470 pub fn new() -> Self {
2471 std::default::Default::default()
2472 }
2473
2474 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2476 self.name = v.into();
2477 self
2478 }
2479
2480 pub fn set_etag<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2482 self.etag = v.into();
2483 self
2484 }
2485}
2486
2487impl wkt::message::Message for UndeleteRoleRequest {
2488 fn typename() -> &'static str {
2489 "type.googleapis.com/google.iam.admin.v1.UndeleteRoleRequest"
2490 }
2491}
2492
2493#[derive(Clone, Default, PartialEq)]
2495#[non_exhaustive]
2496pub struct Permission {
2497 pub name: std::string::String,
2499
2500 pub title: std::string::String,
2502
2503 pub description: std::string::String,
2506
2507 #[deprecated]
2508 pub only_in_predefined_roles: bool,
2509
2510 pub stage: crate::model::permission::PermissionLaunchStage,
2512
2513 pub custom_roles_support_level: crate::model::permission::CustomRolesSupportLevel,
2515
2516 pub api_disabled: bool,
2518
2519 pub primary_permission: std::string::String,
2522
2523 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2524}
2525
2526impl Permission {
2527 pub fn new() -> Self {
2528 std::default::Default::default()
2529 }
2530
2531 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2533 self.name = v.into();
2534 self
2535 }
2536
2537 pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2539 self.title = v.into();
2540 self
2541 }
2542
2543 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2545 self.description = v.into();
2546 self
2547 }
2548
2549 #[deprecated]
2551 pub fn set_only_in_predefined_roles<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2552 self.only_in_predefined_roles = v.into();
2553 self
2554 }
2555
2556 pub fn set_stage<T: std::convert::Into<crate::model::permission::PermissionLaunchStage>>(
2558 mut self,
2559 v: T,
2560 ) -> Self {
2561 self.stage = v.into();
2562 self
2563 }
2564
2565 pub fn set_custom_roles_support_level<
2567 T: std::convert::Into<crate::model::permission::CustomRolesSupportLevel>,
2568 >(
2569 mut self,
2570 v: T,
2571 ) -> Self {
2572 self.custom_roles_support_level = v.into();
2573 self
2574 }
2575
2576 pub fn set_api_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2578 self.api_disabled = v.into();
2579 self
2580 }
2581
2582 pub fn set_primary_permission<T: std::convert::Into<std::string::String>>(
2584 mut self,
2585 v: T,
2586 ) -> Self {
2587 self.primary_permission = v.into();
2588 self
2589 }
2590}
2591
2592impl wkt::message::Message for Permission {
2593 fn typename() -> &'static str {
2594 "type.googleapis.com/google.iam.admin.v1.Permission"
2595 }
2596}
2597
2598pub mod permission {
2600 #[allow(unused_imports)]
2601 use super::*;
2602
2603 #[derive(Clone, Debug, PartialEq)]
2619 #[non_exhaustive]
2620 pub enum PermissionLaunchStage {
2621 Alpha,
2623 Beta,
2625 Ga,
2627 Deprecated,
2629 UnknownValue(permission_launch_stage::UnknownValue),
2634 }
2635
2636 #[doc(hidden)]
2637 pub mod permission_launch_stage {
2638 #[allow(unused_imports)]
2639 use super::*;
2640 #[derive(Clone, Debug, PartialEq)]
2641 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2642 }
2643
2644 impl PermissionLaunchStage {
2645 pub fn value(&self) -> std::option::Option<i32> {
2650 match self {
2651 Self::Alpha => std::option::Option::Some(0),
2652 Self::Beta => std::option::Option::Some(1),
2653 Self::Ga => std::option::Option::Some(2),
2654 Self::Deprecated => std::option::Option::Some(3),
2655 Self::UnknownValue(u) => u.0.value(),
2656 }
2657 }
2658
2659 pub fn name(&self) -> std::option::Option<&str> {
2664 match self {
2665 Self::Alpha => std::option::Option::Some("ALPHA"),
2666 Self::Beta => std::option::Option::Some("BETA"),
2667 Self::Ga => std::option::Option::Some("GA"),
2668 Self::Deprecated => std::option::Option::Some("DEPRECATED"),
2669 Self::UnknownValue(u) => u.0.name(),
2670 }
2671 }
2672 }
2673
2674 impl std::default::Default for PermissionLaunchStage {
2675 fn default() -> Self {
2676 use std::convert::From;
2677 Self::from(0)
2678 }
2679 }
2680
2681 impl std::fmt::Display for PermissionLaunchStage {
2682 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2683 wkt::internal::display_enum(f, self.name(), self.value())
2684 }
2685 }
2686
2687 impl std::convert::From<i32> for PermissionLaunchStage {
2688 fn from(value: i32) -> Self {
2689 match value {
2690 0 => Self::Alpha,
2691 1 => Self::Beta,
2692 2 => Self::Ga,
2693 3 => Self::Deprecated,
2694 _ => Self::UnknownValue(permission_launch_stage::UnknownValue(
2695 wkt::internal::UnknownEnumValue::Integer(value),
2696 )),
2697 }
2698 }
2699 }
2700
2701 impl std::convert::From<&str> for PermissionLaunchStage {
2702 fn from(value: &str) -> Self {
2703 use std::string::ToString;
2704 match value {
2705 "ALPHA" => Self::Alpha,
2706 "BETA" => Self::Beta,
2707 "GA" => Self::Ga,
2708 "DEPRECATED" => Self::Deprecated,
2709 _ => Self::UnknownValue(permission_launch_stage::UnknownValue(
2710 wkt::internal::UnknownEnumValue::String(value.to_string()),
2711 )),
2712 }
2713 }
2714 }
2715
2716 impl serde::ser::Serialize for PermissionLaunchStage {
2717 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2718 where
2719 S: serde::Serializer,
2720 {
2721 match self {
2722 Self::Alpha => serializer.serialize_i32(0),
2723 Self::Beta => serializer.serialize_i32(1),
2724 Self::Ga => serializer.serialize_i32(2),
2725 Self::Deprecated => serializer.serialize_i32(3),
2726 Self::UnknownValue(u) => u.0.serialize(serializer),
2727 }
2728 }
2729 }
2730
2731 impl<'de> serde::de::Deserialize<'de> for PermissionLaunchStage {
2732 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2733 where
2734 D: serde::Deserializer<'de>,
2735 {
2736 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PermissionLaunchStage>::new(
2737 ".google.iam.admin.v1.Permission.PermissionLaunchStage",
2738 ))
2739 }
2740 }
2741
2742 #[derive(Clone, Debug, PartialEq)]
2758 #[non_exhaustive]
2759 pub enum CustomRolesSupportLevel {
2760 Supported,
2762 Testing,
2764 NotSupported,
2766 UnknownValue(custom_roles_support_level::UnknownValue),
2771 }
2772
2773 #[doc(hidden)]
2774 pub mod custom_roles_support_level {
2775 #[allow(unused_imports)]
2776 use super::*;
2777 #[derive(Clone, Debug, PartialEq)]
2778 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2779 }
2780
2781 impl CustomRolesSupportLevel {
2782 pub fn value(&self) -> std::option::Option<i32> {
2787 match self {
2788 Self::Supported => std::option::Option::Some(0),
2789 Self::Testing => std::option::Option::Some(1),
2790 Self::NotSupported => std::option::Option::Some(2),
2791 Self::UnknownValue(u) => u.0.value(),
2792 }
2793 }
2794
2795 pub fn name(&self) -> std::option::Option<&str> {
2800 match self {
2801 Self::Supported => std::option::Option::Some("SUPPORTED"),
2802 Self::Testing => std::option::Option::Some("TESTING"),
2803 Self::NotSupported => std::option::Option::Some("NOT_SUPPORTED"),
2804 Self::UnknownValue(u) => u.0.name(),
2805 }
2806 }
2807 }
2808
2809 impl std::default::Default for CustomRolesSupportLevel {
2810 fn default() -> Self {
2811 use std::convert::From;
2812 Self::from(0)
2813 }
2814 }
2815
2816 impl std::fmt::Display for CustomRolesSupportLevel {
2817 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2818 wkt::internal::display_enum(f, self.name(), self.value())
2819 }
2820 }
2821
2822 impl std::convert::From<i32> for CustomRolesSupportLevel {
2823 fn from(value: i32) -> Self {
2824 match value {
2825 0 => Self::Supported,
2826 1 => Self::Testing,
2827 2 => Self::NotSupported,
2828 _ => Self::UnknownValue(custom_roles_support_level::UnknownValue(
2829 wkt::internal::UnknownEnumValue::Integer(value),
2830 )),
2831 }
2832 }
2833 }
2834
2835 impl std::convert::From<&str> for CustomRolesSupportLevel {
2836 fn from(value: &str) -> Self {
2837 use std::string::ToString;
2838 match value {
2839 "SUPPORTED" => Self::Supported,
2840 "TESTING" => Self::Testing,
2841 "NOT_SUPPORTED" => Self::NotSupported,
2842 _ => Self::UnknownValue(custom_roles_support_level::UnknownValue(
2843 wkt::internal::UnknownEnumValue::String(value.to_string()),
2844 )),
2845 }
2846 }
2847 }
2848
2849 impl serde::ser::Serialize for CustomRolesSupportLevel {
2850 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2851 where
2852 S: serde::Serializer,
2853 {
2854 match self {
2855 Self::Supported => serializer.serialize_i32(0),
2856 Self::Testing => serializer.serialize_i32(1),
2857 Self::NotSupported => serializer.serialize_i32(2),
2858 Self::UnknownValue(u) => u.0.serialize(serializer),
2859 }
2860 }
2861 }
2862
2863 impl<'de> serde::de::Deserialize<'de> for CustomRolesSupportLevel {
2864 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2865 where
2866 D: serde::Deserializer<'de>,
2867 {
2868 deserializer.deserialize_any(
2869 wkt::internal::EnumVisitor::<CustomRolesSupportLevel>::new(
2870 ".google.iam.admin.v1.Permission.CustomRolesSupportLevel",
2871 ),
2872 )
2873 }
2874 }
2875}
2876
2877#[derive(Clone, Default, PartialEq)]
2879#[non_exhaustive]
2880pub struct QueryTestablePermissionsRequest {
2881 pub full_resource_name: std::string::String,
2888
2889 pub page_size: i32,
2893
2894 pub page_token: std::string::String,
2897
2898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2899}
2900
2901impl QueryTestablePermissionsRequest {
2902 pub fn new() -> Self {
2903 std::default::Default::default()
2904 }
2905
2906 pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
2908 mut self,
2909 v: T,
2910 ) -> Self {
2911 self.full_resource_name = v.into();
2912 self
2913 }
2914
2915 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2917 self.page_size = v.into();
2918 self
2919 }
2920
2921 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2923 self.page_token = v.into();
2924 self
2925 }
2926}
2927
2928impl wkt::message::Message for QueryTestablePermissionsRequest {
2929 fn typename() -> &'static str {
2930 "type.googleapis.com/google.iam.admin.v1.QueryTestablePermissionsRequest"
2931 }
2932}
2933
2934#[derive(Clone, Default, PartialEq)]
2936#[non_exhaustive]
2937pub struct QueryTestablePermissionsResponse {
2938 pub permissions: std::vec::Vec<crate::model::Permission>,
2940
2941 pub next_page_token: std::string::String,
2944
2945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2946}
2947
2948impl QueryTestablePermissionsResponse {
2949 pub fn new() -> Self {
2950 std::default::Default::default()
2951 }
2952
2953 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2955 where
2956 T: std::iter::IntoIterator<Item = V>,
2957 V: std::convert::Into<crate::model::Permission>,
2958 {
2959 use std::iter::Iterator;
2960 self.permissions = v.into_iter().map(|i| i.into()).collect();
2961 self
2962 }
2963
2964 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2966 self.next_page_token = v.into();
2967 self
2968 }
2969}
2970
2971impl wkt::message::Message for QueryTestablePermissionsResponse {
2972 fn typename() -> &'static str {
2973 "type.googleapis.com/google.iam.admin.v1.QueryTestablePermissionsResponse"
2974 }
2975}
2976
2977#[doc(hidden)]
2978impl gax::paginator::internal::PageableResponse for QueryTestablePermissionsResponse {
2979 type PageItem = crate::model::Permission;
2980
2981 fn items(self) -> std::vec::Vec<Self::PageItem> {
2982 self.permissions
2983 }
2984
2985 fn next_page_token(&self) -> std::string::String {
2986 use std::clone::Clone;
2987 self.next_page_token.clone()
2988 }
2989}
2990
2991#[derive(Clone, Default, PartialEq)]
2993#[non_exhaustive]
2994pub struct QueryAuditableServicesRequest {
2995 pub full_resource_name: std::string::String,
3002
3003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3004}
3005
3006impl QueryAuditableServicesRequest {
3007 pub fn new() -> Self {
3008 std::default::Default::default()
3009 }
3010
3011 pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
3013 mut self,
3014 v: T,
3015 ) -> Self {
3016 self.full_resource_name = v.into();
3017 self
3018 }
3019}
3020
3021impl wkt::message::Message for QueryAuditableServicesRequest {
3022 fn typename() -> &'static str {
3023 "type.googleapis.com/google.iam.admin.v1.QueryAuditableServicesRequest"
3024 }
3025}
3026
3027#[derive(Clone, Default, PartialEq)]
3029#[non_exhaustive]
3030pub struct QueryAuditableServicesResponse {
3031 pub services: std::vec::Vec<crate::model::query_auditable_services_response::AuditableService>,
3033
3034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3035}
3036
3037impl QueryAuditableServicesResponse {
3038 pub fn new() -> Self {
3039 std::default::Default::default()
3040 }
3041
3042 pub fn set_services<T, V>(mut self, v: T) -> Self
3044 where
3045 T: std::iter::IntoIterator<Item = V>,
3046 V: std::convert::Into<crate::model::query_auditable_services_response::AuditableService>,
3047 {
3048 use std::iter::Iterator;
3049 self.services = v.into_iter().map(|i| i.into()).collect();
3050 self
3051 }
3052}
3053
3054impl wkt::message::Message for QueryAuditableServicesResponse {
3055 fn typename() -> &'static str {
3056 "type.googleapis.com/google.iam.admin.v1.QueryAuditableServicesResponse"
3057 }
3058}
3059
3060pub mod query_auditable_services_response {
3062 #[allow(unused_imports)]
3063 use super::*;
3064
3065 #[derive(Clone, Default, PartialEq)]
3067 #[non_exhaustive]
3068 pub struct AuditableService {
3069 pub name: std::string::String,
3072
3073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3074 }
3075
3076 impl AuditableService {
3077 pub fn new() -> Self {
3078 std::default::Default::default()
3079 }
3080
3081 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3083 self.name = v.into();
3084 self
3085 }
3086 }
3087
3088 impl wkt::message::Message for AuditableService {
3089 fn typename() -> &'static str {
3090 "type.googleapis.com/google.iam.admin.v1.QueryAuditableServicesResponse.AuditableService"
3091 }
3092 }
3093}
3094
3095#[derive(Clone, Default, PartialEq)]
3097#[non_exhaustive]
3098pub struct LintPolicyRequest {
3099 pub full_resource_name: std::string::String,
3109
3110 pub lint_object: std::option::Option<crate::model::lint_policy_request::LintObject>,
3112
3113 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3114}
3115
3116impl LintPolicyRequest {
3117 pub fn new() -> Self {
3118 std::default::Default::default()
3119 }
3120
3121 pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
3123 mut self,
3124 v: T,
3125 ) -> Self {
3126 self.full_resource_name = v.into();
3127 self
3128 }
3129
3130 pub fn set_lint_object<
3135 T: std::convert::Into<std::option::Option<crate::model::lint_policy_request::LintObject>>,
3136 >(
3137 mut self,
3138 v: T,
3139 ) -> Self {
3140 self.lint_object = v.into();
3141 self
3142 }
3143
3144 pub fn condition(&self) -> std::option::Option<&std::boxed::Box<gtype::model::Expr>> {
3148 #[allow(unreachable_patterns)]
3149 self.lint_object.as_ref().and_then(|v| match v {
3150 crate::model::lint_policy_request::LintObject::Condition(v) => {
3151 std::option::Option::Some(v)
3152 }
3153 _ => std::option::Option::None,
3154 })
3155 }
3156
3157 pub fn set_condition<T: std::convert::Into<std::boxed::Box<gtype::model::Expr>>>(
3163 mut self,
3164 v: T,
3165 ) -> Self {
3166 self.lint_object = std::option::Option::Some(
3167 crate::model::lint_policy_request::LintObject::Condition(v.into()),
3168 );
3169 self
3170 }
3171}
3172
3173impl wkt::message::Message for LintPolicyRequest {
3174 fn typename() -> &'static str {
3175 "type.googleapis.com/google.iam.admin.v1.LintPolicyRequest"
3176 }
3177}
3178
3179pub mod lint_policy_request {
3181 #[allow(unused_imports)]
3182 use super::*;
3183
3184 #[derive(Clone, Debug, PartialEq)]
3186 #[non_exhaustive]
3187 pub enum LintObject {
3188 Condition(std::boxed::Box<gtype::model::Expr>),
3190 }
3191}
3192
3193#[derive(Clone, Default, PartialEq)]
3195#[non_exhaustive]
3196pub struct LintResult {
3197 pub level: crate::model::lint_result::Level,
3199
3200 pub validation_unit_name: std::string::String,
3203
3204 pub severity: crate::model::lint_result::Severity,
3206
3207 pub field_name: std::string::String,
3215
3216 pub location_offset: i32,
3220
3221 pub debug_message: std::string::String,
3223
3224 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3225}
3226
3227impl LintResult {
3228 pub fn new() -> Self {
3229 std::default::Default::default()
3230 }
3231
3232 pub fn set_level<T: std::convert::Into<crate::model::lint_result::Level>>(
3234 mut self,
3235 v: T,
3236 ) -> Self {
3237 self.level = v.into();
3238 self
3239 }
3240
3241 pub fn set_validation_unit_name<T: std::convert::Into<std::string::String>>(
3243 mut self,
3244 v: T,
3245 ) -> Self {
3246 self.validation_unit_name = v.into();
3247 self
3248 }
3249
3250 pub fn set_severity<T: std::convert::Into<crate::model::lint_result::Severity>>(
3252 mut self,
3253 v: T,
3254 ) -> Self {
3255 self.severity = v.into();
3256 self
3257 }
3258
3259 pub fn set_field_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3261 self.field_name = v.into();
3262 self
3263 }
3264
3265 pub fn set_location_offset<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3267 self.location_offset = v.into();
3268 self
3269 }
3270
3271 pub fn set_debug_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3273 self.debug_message = v.into();
3274 self
3275 }
3276}
3277
3278impl wkt::message::Message for LintResult {
3279 fn typename() -> &'static str {
3280 "type.googleapis.com/google.iam.admin.v1.LintResult"
3281 }
3282}
3283
3284pub mod lint_result {
3286 #[allow(unused_imports)]
3287 use super::*;
3288
3289 #[derive(Clone, Debug, PartialEq)]
3306 #[non_exhaustive]
3307 pub enum Level {
3308 Unspecified,
3310 Condition,
3313 UnknownValue(level::UnknownValue),
3318 }
3319
3320 #[doc(hidden)]
3321 pub mod level {
3322 #[allow(unused_imports)]
3323 use super::*;
3324 #[derive(Clone, Debug, PartialEq)]
3325 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3326 }
3327
3328 impl Level {
3329 pub fn value(&self) -> std::option::Option<i32> {
3334 match self {
3335 Self::Unspecified => std::option::Option::Some(0),
3336 Self::Condition => std::option::Option::Some(3),
3337 Self::UnknownValue(u) => u.0.value(),
3338 }
3339 }
3340
3341 pub fn name(&self) -> std::option::Option<&str> {
3346 match self {
3347 Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
3348 Self::Condition => std::option::Option::Some("CONDITION"),
3349 Self::UnknownValue(u) => u.0.name(),
3350 }
3351 }
3352 }
3353
3354 impl std::default::Default for Level {
3355 fn default() -> Self {
3356 use std::convert::From;
3357 Self::from(0)
3358 }
3359 }
3360
3361 impl std::fmt::Display for Level {
3362 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3363 wkt::internal::display_enum(f, self.name(), self.value())
3364 }
3365 }
3366
3367 impl std::convert::From<i32> for Level {
3368 fn from(value: i32) -> Self {
3369 match value {
3370 0 => Self::Unspecified,
3371 3 => Self::Condition,
3372 _ => Self::UnknownValue(level::UnknownValue(
3373 wkt::internal::UnknownEnumValue::Integer(value),
3374 )),
3375 }
3376 }
3377 }
3378
3379 impl std::convert::From<&str> for Level {
3380 fn from(value: &str) -> Self {
3381 use std::string::ToString;
3382 match value {
3383 "LEVEL_UNSPECIFIED" => Self::Unspecified,
3384 "CONDITION" => Self::Condition,
3385 _ => Self::UnknownValue(level::UnknownValue(
3386 wkt::internal::UnknownEnumValue::String(value.to_string()),
3387 )),
3388 }
3389 }
3390 }
3391
3392 impl serde::ser::Serialize for Level {
3393 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3394 where
3395 S: serde::Serializer,
3396 {
3397 match self {
3398 Self::Unspecified => serializer.serialize_i32(0),
3399 Self::Condition => serializer.serialize_i32(3),
3400 Self::UnknownValue(u) => u.0.serialize(serializer),
3401 }
3402 }
3403 }
3404
3405 impl<'de> serde::de::Deserialize<'de> for Level {
3406 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3407 where
3408 D: serde::Deserializer<'de>,
3409 {
3410 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
3411 ".google.iam.admin.v1.LintResult.Level",
3412 ))
3413 }
3414 }
3415
3416 #[derive(Clone, Debug, PartialEq)]
3432 #[non_exhaustive]
3433 pub enum Severity {
3434 Unspecified,
3436 Error,
3440 Warning,
3450 Notice,
3454 Info,
3459 Deprecated,
3461 UnknownValue(severity::UnknownValue),
3466 }
3467
3468 #[doc(hidden)]
3469 pub mod severity {
3470 #[allow(unused_imports)]
3471 use super::*;
3472 #[derive(Clone, Debug, PartialEq)]
3473 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3474 }
3475
3476 impl Severity {
3477 pub fn value(&self) -> std::option::Option<i32> {
3482 match self {
3483 Self::Unspecified => std::option::Option::Some(0),
3484 Self::Error => std::option::Option::Some(1),
3485 Self::Warning => std::option::Option::Some(2),
3486 Self::Notice => std::option::Option::Some(3),
3487 Self::Info => std::option::Option::Some(4),
3488 Self::Deprecated => std::option::Option::Some(5),
3489 Self::UnknownValue(u) => u.0.value(),
3490 }
3491 }
3492
3493 pub fn name(&self) -> std::option::Option<&str> {
3498 match self {
3499 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
3500 Self::Error => std::option::Option::Some("ERROR"),
3501 Self::Warning => std::option::Option::Some("WARNING"),
3502 Self::Notice => std::option::Option::Some("NOTICE"),
3503 Self::Info => std::option::Option::Some("INFO"),
3504 Self::Deprecated => std::option::Option::Some("DEPRECATED"),
3505 Self::UnknownValue(u) => u.0.name(),
3506 }
3507 }
3508 }
3509
3510 impl std::default::Default for Severity {
3511 fn default() -> Self {
3512 use std::convert::From;
3513 Self::from(0)
3514 }
3515 }
3516
3517 impl std::fmt::Display for Severity {
3518 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3519 wkt::internal::display_enum(f, self.name(), self.value())
3520 }
3521 }
3522
3523 impl std::convert::From<i32> for Severity {
3524 fn from(value: i32) -> Self {
3525 match value {
3526 0 => Self::Unspecified,
3527 1 => Self::Error,
3528 2 => Self::Warning,
3529 3 => Self::Notice,
3530 4 => Self::Info,
3531 5 => Self::Deprecated,
3532 _ => Self::UnknownValue(severity::UnknownValue(
3533 wkt::internal::UnknownEnumValue::Integer(value),
3534 )),
3535 }
3536 }
3537 }
3538
3539 impl std::convert::From<&str> for Severity {
3540 fn from(value: &str) -> Self {
3541 use std::string::ToString;
3542 match value {
3543 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
3544 "ERROR" => Self::Error,
3545 "WARNING" => Self::Warning,
3546 "NOTICE" => Self::Notice,
3547 "INFO" => Self::Info,
3548 "DEPRECATED" => Self::Deprecated,
3549 _ => Self::UnknownValue(severity::UnknownValue(
3550 wkt::internal::UnknownEnumValue::String(value.to_string()),
3551 )),
3552 }
3553 }
3554 }
3555
3556 impl serde::ser::Serialize for Severity {
3557 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3558 where
3559 S: serde::Serializer,
3560 {
3561 match self {
3562 Self::Unspecified => serializer.serialize_i32(0),
3563 Self::Error => serializer.serialize_i32(1),
3564 Self::Warning => serializer.serialize_i32(2),
3565 Self::Notice => serializer.serialize_i32(3),
3566 Self::Info => serializer.serialize_i32(4),
3567 Self::Deprecated => serializer.serialize_i32(5),
3568 Self::UnknownValue(u) => u.0.serialize(serializer),
3569 }
3570 }
3571 }
3572
3573 impl<'de> serde::de::Deserialize<'de> for Severity {
3574 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3575 where
3576 D: serde::Deserializer<'de>,
3577 {
3578 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
3579 ".google.iam.admin.v1.LintResult.Severity",
3580 ))
3581 }
3582 }
3583}
3584
3585#[derive(Clone, Default, PartialEq)]
3588#[non_exhaustive]
3589pub struct LintPolicyResponse {
3590 pub lint_results: std::vec::Vec<crate::model::LintResult>,
3592
3593 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3594}
3595
3596impl LintPolicyResponse {
3597 pub fn new() -> Self {
3598 std::default::Default::default()
3599 }
3600
3601 pub fn set_lint_results<T, V>(mut self, v: T) -> Self
3603 where
3604 T: std::iter::IntoIterator<Item = V>,
3605 V: std::convert::Into<crate::model::LintResult>,
3606 {
3607 use std::iter::Iterator;
3608 self.lint_results = v.into_iter().map(|i| i.into()).collect();
3609 self
3610 }
3611}
3612
3613impl wkt::message::Message for LintPolicyResponse {
3614 fn typename() -> &'static str {
3615 "type.googleapis.com/google.iam.admin.v1.LintPolicyResponse"
3616 }
3617}
3618
3619#[derive(Clone, Debug, PartialEq)]
3635#[non_exhaustive]
3636pub enum ServiceAccountKeyAlgorithm {
3637 KeyAlgUnspecified,
3639 KeyAlgRsa1024,
3641 KeyAlgRsa2048,
3643 UnknownValue(service_account_key_algorithm::UnknownValue),
3648}
3649
3650#[doc(hidden)]
3651pub mod service_account_key_algorithm {
3652 #[allow(unused_imports)]
3653 use super::*;
3654 #[derive(Clone, Debug, PartialEq)]
3655 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3656}
3657
3658impl ServiceAccountKeyAlgorithm {
3659 pub fn value(&self) -> std::option::Option<i32> {
3664 match self {
3665 Self::KeyAlgUnspecified => std::option::Option::Some(0),
3666 Self::KeyAlgRsa1024 => std::option::Option::Some(1),
3667 Self::KeyAlgRsa2048 => std::option::Option::Some(2),
3668 Self::UnknownValue(u) => u.0.value(),
3669 }
3670 }
3671
3672 pub fn name(&self) -> std::option::Option<&str> {
3677 match self {
3678 Self::KeyAlgUnspecified => std::option::Option::Some("KEY_ALG_UNSPECIFIED"),
3679 Self::KeyAlgRsa1024 => std::option::Option::Some("KEY_ALG_RSA_1024"),
3680 Self::KeyAlgRsa2048 => std::option::Option::Some("KEY_ALG_RSA_2048"),
3681 Self::UnknownValue(u) => u.0.name(),
3682 }
3683 }
3684}
3685
3686impl std::default::Default for ServiceAccountKeyAlgorithm {
3687 fn default() -> Self {
3688 use std::convert::From;
3689 Self::from(0)
3690 }
3691}
3692
3693impl std::fmt::Display for ServiceAccountKeyAlgorithm {
3694 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3695 wkt::internal::display_enum(f, self.name(), self.value())
3696 }
3697}
3698
3699impl std::convert::From<i32> for ServiceAccountKeyAlgorithm {
3700 fn from(value: i32) -> Self {
3701 match value {
3702 0 => Self::KeyAlgUnspecified,
3703 1 => Self::KeyAlgRsa1024,
3704 2 => Self::KeyAlgRsa2048,
3705 _ => Self::UnknownValue(service_account_key_algorithm::UnknownValue(
3706 wkt::internal::UnknownEnumValue::Integer(value),
3707 )),
3708 }
3709 }
3710}
3711
3712impl std::convert::From<&str> for ServiceAccountKeyAlgorithm {
3713 fn from(value: &str) -> Self {
3714 use std::string::ToString;
3715 match value {
3716 "KEY_ALG_UNSPECIFIED" => Self::KeyAlgUnspecified,
3717 "KEY_ALG_RSA_1024" => Self::KeyAlgRsa1024,
3718 "KEY_ALG_RSA_2048" => Self::KeyAlgRsa2048,
3719 _ => Self::UnknownValue(service_account_key_algorithm::UnknownValue(
3720 wkt::internal::UnknownEnumValue::String(value.to_string()),
3721 )),
3722 }
3723 }
3724}
3725
3726impl serde::ser::Serialize for ServiceAccountKeyAlgorithm {
3727 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3728 where
3729 S: serde::Serializer,
3730 {
3731 match self {
3732 Self::KeyAlgUnspecified => serializer.serialize_i32(0),
3733 Self::KeyAlgRsa1024 => serializer.serialize_i32(1),
3734 Self::KeyAlgRsa2048 => serializer.serialize_i32(2),
3735 Self::UnknownValue(u) => u.0.serialize(serializer),
3736 }
3737 }
3738}
3739
3740impl<'de> serde::de::Deserialize<'de> for ServiceAccountKeyAlgorithm {
3741 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3742 where
3743 D: serde::Deserializer<'de>,
3744 {
3745 deserializer.deserialize_any(
3746 wkt::internal::EnumVisitor::<ServiceAccountKeyAlgorithm>::new(
3747 ".google.iam.admin.v1.ServiceAccountKeyAlgorithm",
3748 ),
3749 )
3750 }
3751}
3752
3753#[derive(Clone, Debug, PartialEq)]
3769#[non_exhaustive]
3770pub enum ServiceAccountPrivateKeyType {
3771 TypeUnspecified,
3773 TypePkcs12File,
3777 TypeGoogleCredentialsFile,
3779 UnknownValue(service_account_private_key_type::UnknownValue),
3784}
3785
3786#[doc(hidden)]
3787pub mod service_account_private_key_type {
3788 #[allow(unused_imports)]
3789 use super::*;
3790 #[derive(Clone, Debug, PartialEq)]
3791 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3792}
3793
3794impl ServiceAccountPrivateKeyType {
3795 pub fn value(&self) -> std::option::Option<i32> {
3800 match self {
3801 Self::TypeUnspecified => std::option::Option::Some(0),
3802 Self::TypePkcs12File => std::option::Option::Some(1),
3803 Self::TypeGoogleCredentialsFile => std::option::Option::Some(2),
3804 Self::UnknownValue(u) => u.0.value(),
3805 }
3806 }
3807
3808 pub fn name(&self) -> std::option::Option<&str> {
3813 match self {
3814 Self::TypeUnspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
3815 Self::TypePkcs12File => std::option::Option::Some("TYPE_PKCS12_FILE"),
3816 Self::TypeGoogleCredentialsFile => {
3817 std::option::Option::Some("TYPE_GOOGLE_CREDENTIALS_FILE")
3818 }
3819 Self::UnknownValue(u) => u.0.name(),
3820 }
3821 }
3822}
3823
3824impl std::default::Default for ServiceAccountPrivateKeyType {
3825 fn default() -> Self {
3826 use std::convert::From;
3827 Self::from(0)
3828 }
3829}
3830
3831impl std::fmt::Display for ServiceAccountPrivateKeyType {
3832 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3833 wkt::internal::display_enum(f, self.name(), self.value())
3834 }
3835}
3836
3837impl std::convert::From<i32> for ServiceAccountPrivateKeyType {
3838 fn from(value: i32) -> Self {
3839 match value {
3840 0 => Self::TypeUnspecified,
3841 1 => Self::TypePkcs12File,
3842 2 => Self::TypeGoogleCredentialsFile,
3843 _ => Self::UnknownValue(service_account_private_key_type::UnknownValue(
3844 wkt::internal::UnknownEnumValue::Integer(value),
3845 )),
3846 }
3847 }
3848}
3849
3850impl std::convert::From<&str> for ServiceAccountPrivateKeyType {
3851 fn from(value: &str) -> Self {
3852 use std::string::ToString;
3853 match value {
3854 "TYPE_UNSPECIFIED" => Self::TypeUnspecified,
3855 "TYPE_PKCS12_FILE" => Self::TypePkcs12File,
3856 "TYPE_GOOGLE_CREDENTIALS_FILE" => Self::TypeGoogleCredentialsFile,
3857 _ => Self::UnknownValue(service_account_private_key_type::UnknownValue(
3858 wkt::internal::UnknownEnumValue::String(value.to_string()),
3859 )),
3860 }
3861 }
3862}
3863
3864impl serde::ser::Serialize for ServiceAccountPrivateKeyType {
3865 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3866 where
3867 S: serde::Serializer,
3868 {
3869 match self {
3870 Self::TypeUnspecified => serializer.serialize_i32(0),
3871 Self::TypePkcs12File => serializer.serialize_i32(1),
3872 Self::TypeGoogleCredentialsFile => serializer.serialize_i32(2),
3873 Self::UnknownValue(u) => u.0.serialize(serializer),
3874 }
3875 }
3876}
3877
3878impl<'de> serde::de::Deserialize<'de> for ServiceAccountPrivateKeyType {
3879 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3880 where
3881 D: serde::Deserializer<'de>,
3882 {
3883 deserializer.deserialize_any(
3884 wkt::internal::EnumVisitor::<ServiceAccountPrivateKeyType>::new(
3885 ".google.iam.admin.v1.ServiceAccountPrivateKeyType",
3886 ),
3887 )
3888 }
3889}
3890
3891#[derive(Clone, Debug, PartialEq)]
3907#[non_exhaustive]
3908pub enum ServiceAccountPublicKeyType {
3909 TypeNone,
3911 TypeX509PemFile,
3913 TypeRawPublicKey,
3915 UnknownValue(service_account_public_key_type::UnknownValue),
3920}
3921
3922#[doc(hidden)]
3923pub mod service_account_public_key_type {
3924 #[allow(unused_imports)]
3925 use super::*;
3926 #[derive(Clone, Debug, PartialEq)]
3927 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3928}
3929
3930impl ServiceAccountPublicKeyType {
3931 pub fn value(&self) -> std::option::Option<i32> {
3936 match self {
3937 Self::TypeNone => std::option::Option::Some(0),
3938 Self::TypeX509PemFile => std::option::Option::Some(1),
3939 Self::TypeRawPublicKey => std::option::Option::Some(2),
3940 Self::UnknownValue(u) => u.0.value(),
3941 }
3942 }
3943
3944 pub fn name(&self) -> std::option::Option<&str> {
3949 match self {
3950 Self::TypeNone => std::option::Option::Some("TYPE_NONE"),
3951 Self::TypeX509PemFile => std::option::Option::Some("TYPE_X509_PEM_FILE"),
3952 Self::TypeRawPublicKey => std::option::Option::Some("TYPE_RAW_PUBLIC_KEY"),
3953 Self::UnknownValue(u) => u.0.name(),
3954 }
3955 }
3956}
3957
3958impl std::default::Default for ServiceAccountPublicKeyType {
3959 fn default() -> Self {
3960 use std::convert::From;
3961 Self::from(0)
3962 }
3963}
3964
3965impl std::fmt::Display for ServiceAccountPublicKeyType {
3966 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3967 wkt::internal::display_enum(f, self.name(), self.value())
3968 }
3969}
3970
3971impl std::convert::From<i32> for ServiceAccountPublicKeyType {
3972 fn from(value: i32) -> Self {
3973 match value {
3974 0 => Self::TypeNone,
3975 1 => Self::TypeX509PemFile,
3976 2 => Self::TypeRawPublicKey,
3977 _ => Self::UnknownValue(service_account_public_key_type::UnknownValue(
3978 wkt::internal::UnknownEnumValue::Integer(value),
3979 )),
3980 }
3981 }
3982}
3983
3984impl std::convert::From<&str> for ServiceAccountPublicKeyType {
3985 fn from(value: &str) -> Self {
3986 use std::string::ToString;
3987 match value {
3988 "TYPE_NONE" => Self::TypeNone,
3989 "TYPE_X509_PEM_FILE" => Self::TypeX509PemFile,
3990 "TYPE_RAW_PUBLIC_KEY" => Self::TypeRawPublicKey,
3991 _ => Self::UnknownValue(service_account_public_key_type::UnknownValue(
3992 wkt::internal::UnknownEnumValue::String(value.to_string()),
3993 )),
3994 }
3995 }
3996}
3997
3998impl serde::ser::Serialize for ServiceAccountPublicKeyType {
3999 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4000 where
4001 S: serde::Serializer,
4002 {
4003 match self {
4004 Self::TypeNone => serializer.serialize_i32(0),
4005 Self::TypeX509PemFile => serializer.serialize_i32(1),
4006 Self::TypeRawPublicKey => serializer.serialize_i32(2),
4007 Self::UnknownValue(u) => u.0.serialize(serializer),
4008 }
4009 }
4010}
4011
4012impl<'de> serde::de::Deserialize<'de> for ServiceAccountPublicKeyType {
4013 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4014 where
4015 D: serde::Deserializer<'de>,
4016 {
4017 deserializer.deserialize_any(
4018 wkt::internal::EnumVisitor::<ServiceAccountPublicKeyType>::new(
4019 ".google.iam.admin.v1.ServiceAccountPublicKeyType",
4020 ),
4021 )
4022 }
4023}
4024
4025#[derive(Clone, Debug, PartialEq)]
4041#[non_exhaustive]
4042pub enum ServiceAccountKeyOrigin {
4043 OriginUnspecified,
4045 UserProvided,
4047 GoogleProvided,
4049 UnknownValue(service_account_key_origin::UnknownValue),
4054}
4055
4056#[doc(hidden)]
4057pub mod service_account_key_origin {
4058 #[allow(unused_imports)]
4059 use super::*;
4060 #[derive(Clone, Debug, PartialEq)]
4061 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4062}
4063
4064impl ServiceAccountKeyOrigin {
4065 pub fn value(&self) -> std::option::Option<i32> {
4070 match self {
4071 Self::OriginUnspecified => std::option::Option::Some(0),
4072 Self::UserProvided => std::option::Option::Some(1),
4073 Self::GoogleProvided => std::option::Option::Some(2),
4074 Self::UnknownValue(u) => u.0.value(),
4075 }
4076 }
4077
4078 pub fn name(&self) -> std::option::Option<&str> {
4083 match self {
4084 Self::OriginUnspecified => std::option::Option::Some("ORIGIN_UNSPECIFIED"),
4085 Self::UserProvided => std::option::Option::Some("USER_PROVIDED"),
4086 Self::GoogleProvided => std::option::Option::Some("GOOGLE_PROVIDED"),
4087 Self::UnknownValue(u) => u.0.name(),
4088 }
4089 }
4090}
4091
4092impl std::default::Default for ServiceAccountKeyOrigin {
4093 fn default() -> Self {
4094 use std::convert::From;
4095 Self::from(0)
4096 }
4097}
4098
4099impl std::fmt::Display for ServiceAccountKeyOrigin {
4100 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4101 wkt::internal::display_enum(f, self.name(), self.value())
4102 }
4103}
4104
4105impl std::convert::From<i32> for ServiceAccountKeyOrigin {
4106 fn from(value: i32) -> Self {
4107 match value {
4108 0 => Self::OriginUnspecified,
4109 1 => Self::UserProvided,
4110 2 => Self::GoogleProvided,
4111 _ => Self::UnknownValue(service_account_key_origin::UnknownValue(
4112 wkt::internal::UnknownEnumValue::Integer(value),
4113 )),
4114 }
4115 }
4116}
4117
4118impl std::convert::From<&str> for ServiceAccountKeyOrigin {
4119 fn from(value: &str) -> Self {
4120 use std::string::ToString;
4121 match value {
4122 "ORIGIN_UNSPECIFIED" => Self::OriginUnspecified,
4123 "USER_PROVIDED" => Self::UserProvided,
4124 "GOOGLE_PROVIDED" => Self::GoogleProvided,
4125 _ => Self::UnknownValue(service_account_key_origin::UnknownValue(
4126 wkt::internal::UnknownEnumValue::String(value.to_string()),
4127 )),
4128 }
4129 }
4130}
4131
4132impl serde::ser::Serialize for ServiceAccountKeyOrigin {
4133 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4134 where
4135 S: serde::Serializer,
4136 {
4137 match self {
4138 Self::OriginUnspecified => serializer.serialize_i32(0),
4139 Self::UserProvided => serializer.serialize_i32(1),
4140 Self::GoogleProvided => serializer.serialize_i32(2),
4141 Self::UnknownValue(u) => u.0.serialize(serializer),
4142 }
4143 }
4144}
4145
4146impl<'de> serde::de::Deserialize<'de> for ServiceAccountKeyOrigin {
4147 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4148 where
4149 D: serde::Deserializer<'de>,
4150 {
4151 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceAccountKeyOrigin>::new(
4152 ".google.iam.admin.v1.ServiceAccountKeyOrigin",
4153 ))
4154 }
4155}
4156
4157#[derive(Clone, Debug, PartialEq)]
4173#[non_exhaustive]
4174pub enum RoleView {
4175 Basic,
4178 Full,
4180 UnknownValue(role_view::UnknownValue),
4185}
4186
4187#[doc(hidden)]
4188pub mod role_view {
4189 #[allow(unused_imports)]
4190 use super::*;
4191 #[derive(Clone, Debug, PartialEq)]
4192 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4193}
4194
4195impl RoleView {
4196 pub fn value(&self) -> std::option::Option<i32> {
4201 match self {
4202 Self::Basic => std::option::Option::Some(0),
4203 Self::Full => std::option::Option::Some(1),
4204 Self::UnknownValue(u) => u.0.value(),
4205 }
4206 }
4207
4208 pub fn name(&self) -> std::option::Option<&str> {
4213 match self {
4214 Self::Basic => std::option::Option::Some("BASIC"),
4215 Self::Full => std::option::Option::Some("FULL"),
4216 Self::UnknownValue(u) => u.0.name(),
4217 }
4218 }
4219}
4220
4221impl std::default::Default for RoleView {
4222 fn default() -> Self {
4223 use std::convert::From;
4224 Self::from(0)
4225 }
4226}
4227
4228impl std::fmt::Display for RoleView {
4229 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4230 wkt::internal::display_enum(f, self.name(), self.value())
4231 }
4232}
4233
4234impl std::convert::From<i32> for RoleView {
4235 fn from(value: i32) -> Self {
4236 match value {
4237 0 => Self::Basic,
4238 1 => Self::Full,
4239 _ => Self::UnknownValue(role_view::UnknownValue(
4240 wkt::internal::UnknownEnumValue::Integer(value),
4241 )),
4242 }
4243 }
4244}
4245
4246impl std::convert::From<&str> for RoleView {
4247 fn from(value: &str) -> Self {
4248 use std::string::ToString;
4249 match value {
4250 "BASIC" => Self::Basic,
4251 "FULL" => Self::Full,
4252 _ => Self::UnknownValue(role_view::UnknownValue(
4253 wkt::internal::UnknownEnumValue::String(value.to_string()),
4254 )),
4255 }
4256 }
4257}
4258
4259impl serde::ser::Serialize for RoleView {
4260 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4261 where
4262 S: serde::Serializer,
4263 {
4264 match self {
4265 Self::Basic => serializer.serialize_i32(0),
4266 Self::Full => serializer.serialize_i32(1),
4267 Self::UnknownValue(u) => u.0.serialize(serializer),
4268 }
4269 }
4270}
4271
4272impl<'de> serde::de::Deserialize<'de> for RoleView {
4273 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4274 where
4275 D: serde::Deserializer<'de>,
4276 {
4277 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoleView>::new(
4278 ".google.iam.admin.v1.RoleView",
4279 ))
4280 }
4281}