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 gkehub_configmanagement_v1;
25extern crate gkehub_multiclusteringress_v1;
26extern crate lazy_static;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct Feature {
45 pub name: std::string::String,
48
49 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
51
52 pub resource_state: std::option::Option<crate::model::FeatureResourceState>,
54
55 pub spec: std::option::Option<crate::model::CommonFeatureSpec>,
58
59 pub membership_specs:
79 std::collections::HashMap<std::string::String, crate::model::MembershipFeatureSpec>,
80
81 pub state: std::option::Option<crate::model::CommonFeatureState>,
83
84 pub membership_states:
97 std::collections::HashMap<std::string::String, crate::model::MembershipFeatureState>,
98
99 pub create_time: std::option::Option<wkt::Timestamp>,
101
102 pub update_time: std::option::Option<wkt::Timestamp>,
104
105 pub delete_time: std::option::Option<wkt::Timestamp>,
107
108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
109}
110
111impl Feature {
112 pub fn new() -> Self {
113 std::default::Default::default()
114 }
115
116 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
118 self.name = v.into();
119 self
120 }
121
122 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
124 where
125 T: std::iter::IntoIterator<Item = (K, V)>,
126 K: std::convert::Into<std::string::String>,
127 V: std::convert::Into<std::string::String>,
128 {
129 use std::iter::Iterator;
130 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
131 self
132 }
133
134 pub fn set_resource_state<T>(mut self, v: T) -> Self
136 where
137 T: std::convert::Into<crate::model::FeatureResourceState>,
138 {
139 self.resource_state = std::option::Option::Some(v.into());
140 self
141 }
142
143 pub fn set_or_clear_resource_state<T>(mut self, v: std::option::Option<T>) -> Self
145 where
146 T: std::convert::Into<crate::model::FeatureResourceState>,
147 {
148 self.resource_state = v.map(|x| x.into());
149 self
150 }
151
152 pub fn set_spec<T>(mut self, v: T) -> Self
154 where
155 T: std::convert::Into<crate::model::CommonFeatureSpec>,
156 {
157 self.spec = std::option::Option::Some(v.into());
158 self
159 }
160
161 pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
163 where
164 T: std::convert::Into<crate::model::CommonFeatureSpec>,
165 {
166 self.spec = v.map(|x| x.into());
167 self
168 }
169
170 pub fn set_membership_specs<T, K, V>(mut self, v: T) -> Self
172 where
173 T: std::iter::IntoIterator<Item = (K, V)>,
174 K: std::convert::Into<std::string::String>,
175 V: std::convert::Into<crate::model::MembershipFeatureSpec>,
176 {
177 use std::iter::Iterator;
178 self.membership_specs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
179 self
180 }
181
182 pub fn set_state<T>(mut self, v: T) -> Self
184 where
185 T: std::convert::Into<crate::model::CommonFeatureState>,
186 {
187 self.state = std::option::Option::Some(v.into());
188 self
189 }
190
191 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
193 where
194 T: std::convert::Into<crate::model::CommonFeatureState>,
195 {
196 self.state = v.map(|x| x.into());
197 self
198 }
199
200 pub fn set_membership_states<T, K, V>(mut self, v: T) -> Self
202 where
203 T: std::iter::IntoIterator<Item = (K, V)>,
204 K: std::convert::Into<std::string::String>,
205 V: std::convert::Into<crate::model::MembershipFeatureState>,
206 {
207 use std::iter::Iterator;
208 self.membership_states = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
209 self
210 }
211
212 pub fn set_create_time<T>(mut self, v: T) -> Self
214 where
215 T: std::convert::Into<wkt::Timestamp>,
216 {
217 self.create_time = std::option::Option::Some(v.into());
218 self
219 }
220
221 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
223 where
224 T: std::convert::Into<wkt::Timestamp>,
225 {
226 self.create_time = v.map(|x| x.into());
227 self
228 }
229
230 pub fn set_update_time<T>(mut self, v: T) -> Self
232 where
233 T: std::convert::Into<wkt::Timestamp>,
234 {
235 self.update_time = std::option::Option::Some(v.into());
236 self
237 }
238
239 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
241 where
242 T: std::convert::Into<wkt::Timestamp>,
243 {
244 self.update_time = v.map(|x| x.into());
245 self
246 }
247
248 pub fn set_delete_time<T>(mut self, v: T) -> Self
250 where
251 T: std::convert::Into<wkt::Timestamp>,
252 {
253 self.delete_time = std::option::Option::Some(v.into());
254 self
255 }
256
257 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
259 where
260 T: std::convert::Into<wkt::Timestamp>,
261 {
262 self.delete_time = v.map(|x| x.into());
263 self
264 }
265}
266
267impl wkt::message::Message for Feature {
268 fn typename() -> &'static str {
269 "type.googleapis.com/google.cloud.gkehub.v1.Feature"
270 }
271}
272
273#[derive(Clone, Default, PartialEq)]
277#[non_exhaustive]
278pub struct FeatureResourceState {
279 pub state: crate::model::feature_resource_state::State,
281
282 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
283}
284
285impl FeatureResourceState {
286 pub fn new() -> Self {
287 std::default::Default::default()
288 }
289
290 pub fn set_state<T: std::convert::Into<crate::model::feature_resource_state::State>>(
292 mut self,
293 v: T,
294 ) -> Self {
295 self.state = v.into();
296 self
297 }
298}
299
300impl wkt::message::Message for FeatureResourceState {
301 fn typename() -> &'static str {
302 "type.googleapis.com/google.cloud.gkehub.v1.FeatureResourceState"
303 }
304}
305
306pub mod feature_resource_state {
308 #[allow(unused_imports)]
309 use super::*;
310
311 #[derive(Clone, Debug, PartialEq)]
327 #[non_exhaustive]
328 pub enum State {
329 Unspecified,
331 Enabling,
334 Active,
337 Disabling,
340 Updating,
342 ServiceUpdating,
344 UnknownValue(state::UnknownValue),
349 }
350
351 #[doc(hidden)]
352 pub mod state {
353 #[allow(unused_imports)]
354 use super::*;
355 #[derive(Clone, Debug, PartialEq)]
356 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
357 }
358
359 impl State {
360 pub fn value(&self) -> std::option::Option<i32> {
365 match self {
366 Self::Unspecified => std::option::Option::Some(0),
367 Self::Enabling => std::option::Option::Some(1),
368 Self::Active => std::option::Option::Some(2),
369 Self::Disabling => std::option::Option::Some(3),
370 Self::Updating => std::option::Option::Some(4),
371 Self::ServiceUpdating => std::option::Option::Some(5),
372 Self::UnknownValue(u) => u.0.value(),
373 }
374 }
375
376 pub fn name(&self) -> std::option::Option<&str> {
381 match self {
382 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
383 Self::Enabling => std::option::Option::Some("ENABLING"),
384 Self::Active => std::option::Option::Some("ACTIVE"),
385 Self::Disabling => std::option::Option::Some("DISABLING"),
386 Self::Updating => std::option::Option::Some("UPDATING"),
387 Self::ServiceUpdating => std::option::Option::Some("SERVICE_UPDATING"),
388 Self::UnknownValue(u) => u.0.name(),
389 }
390 }
391 }
392
393 impl std::default::Default for State {
394 fn default() -> Self {
395 use std::convert::From;
396 Self::from(0)
397 }
398 }
399
400 impl std::fmt::Display for State {
401 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
402 wkt::internal::display_enum(f, self.name(), self.value())
403 }
404 }
405
406 impl std::convert::From<i32> for State {
407 fn from(value: i32) -> Self {
408 match value {
409 0 => Self::Unspecified,
410 1 => Self::Enabling,
411 2 => Self::Active,
412 3 => Self::Disabling,
413 4 => Self::Updating,
414 5 => Self::ServiceUpdating,
415 _ => Self::UnknownValue(state::UnknownValue(
416 wkt::internal::UnknownEnumValue::Integer(value),
417 )),
418 }
419 }
420 }
421
422 impl std::convert::From<&str> for State {
423 fn from(value: &str) -> Self {
424 use std::string::ToString;
425 match value {
426 "STATE_UNSPECIFIED" => Self::Unspecified,
427 "ENABLING" => Self::Enabling,
428 "ACTIVE" => Self::Active,
429 "DISABLING" => Self::Disabling,
430 "UPDATING" => Self::Updating,
431 "SERVICE_UPDATING" => Self::ServiceUpdating,
432 _ => Self::UnknownValue(state::UnknownValue(
433 wkt::internal::UnknownEnumValue::String(value.to_string()),
434 )),
435 }
436 }
437 }
438
439 impl serde::ser::Serialize for State {
440 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
441 where
442 S: serde::Serializer,
443 {
444 match self {
445 Self::Unspecified => serializer.serialize_i32(0),
446 Self::Enabling => serializer.serialize_i32(1),
447 Self::Active => serializer.serialize_i32(2),
448 Self::Disabling => serializer.serialize_i32(3),
449 Self::Updating => serializer.serialize_i32(4),
450 Self::ServiceUpdating => serializer.serialize_i32(5),
451 Self::UnknownValue(u) => u.0.serialize(serializer),
452 }
453 }
454 }
455
456 impl<'de> serde::de::Deserialize<'de> for State {
457 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
458 where
459 D: serde::Deserializer<'de>,
460 {
461 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
462 ".google.cloud.gkehub.v1.FeatureResourceState.State",
463 ))
464 }
465 }
466}
467
468#[derive(Clone, Default, PartialEq)]
472#[non_exhaustive]
473pub struct FeatureState {
474 pub code: crate::model::feature_state::Code,
476
477 pub description: std::string::String,
479
480 pub update_time: std::option::Option<wkt::Timestamp>,
482
483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
484}
485
486impl FeatureState {
487 pub fn new() -> Self {
488 std::default::Default::default()
489 }
490
491 pub fn set_code<T: std::convert::Into<crate::model::feature_state::Code>>(
493 mut self,
494 v: T,
495 ) -> Self {
496 self.code = v.into();
497 self
498 }
499
500 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
502 self.description = v.into();
503 self
504 }
505
506 pub fn set_update_time<T>(mut self, v: T) -> Self
508 where
509 T: std::convert::Into<wkt::Timestamp>,
510 {
511 self.update_time = std::option::Option::Some(v.into());
512 self
513 }
514
515 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
517 where
518 T: std::convert::Into<wkt::Timestamp>,
519 {
520 self.update_time = v.map(|x| x.into());
521 self
522 }
523}
524
525impl wkt::message::Message for FeatureState {
526 fn typename() -> &'static str {
527 "type.googleapis.com/google.cloud.gkehub.v1.FeatureState"
528 }
529}
530
531pub mod feature_state {
533 #[allow(unused_imports)]
534 use super::*;
535
536 #[derive(Clone, Debug, PartialEq)]
552 #[non_exhaustive]
553 pub enum Code {
554 Unspecified,
556 Ok,
558 Warning,
563 Error,
568 UnknownValue(code::UnknownValue),
573 }
574
575 #[doc(hidden)]
576 pub mod code {
577 #[allow(unused_imports)]
578 use super::*;
579 #[derive(Clone, Debug, PartialEq)]
580 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
581 }
582
583 impl Code {
584 pub fn value(&self) -> std::option::Option<i32> {
589 match self {
590 Self::Unspecified => std::option::Option::Some(0),
591 Self::Ok => std::option::Option::Some(1),
592 Self::Warning => std::option::Option::Some(2),
593 Self::Error => std::option::Option::Some(3),
594 Self::UnknownValue(u) => u.0.value(),
595 }
596 }
597
598 pub fn name(&self) -> std::option::Option<&str> {
603 match self {
604 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
605 Self::Ok => std::option::Option::Some("OK"),
606 Self::Warning => std::option::Option::Some("WARNING"),
607 Self::Error => std::option::Option::Some("ERROR"),
608 Self::UnknownValue(u) => u.0.name(),
609 }
610 }
611 }
612
613 impl std::default::Default for Code {
614 fn default() -> Self {
615 use std::convert::From;
616 Self::from(0)
617 }
618 }
619
620 impl std::fmt::Display for Code {
621 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
622 wkt::internal::display_enum(f, self.name(), self.value())
623 }
624 }
625
626 impl std::convert::From<i32> for Code {
627 fn from(value: i32) -> Self {
628 match value {
629 0 => Self::Unspecified,
630 1 => Self::Ok,
631 2 => Self::Warning,
632 3 => Self::Error,
633 _ => Self::UnknownValue(code::UnknownValue(
634 wkt::internal::UnknownEnumValue::Integer(value),
635 )),
636 }
637 }
638 }
639
640 impl std::convert::From<&str> for Code {
641 fn from(value: &str) -> Self {
642 use std::string::ToString;
643 match value {
644 "CODE_UNSPECIFIED" => Self::Unspecified,
645 "OK" => Self::Ok,
646 "WARNING" => Self::Warning,
647 "ERROR" => Self::Error,
648 _ => Self::UnknownValue(code::UnknownValue(
649 wkt::internal::UnknownEnumValue::String(value.to_string()),
650 )),
651 }
652 }
653 }
654
655 impl serde::ser::Serialize for Code {
656 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
657 where
658 S: serde::Serializer,
659 {
660 match self {
661 Self::Unspecified => serializer.serialize_i32(0),
662 Self::Ok => serializer.serialize_i32(1),
663 Self::Warning => serializer.serialize_i32(2),
664 Self::Error => serializer.serialize_i32(3),
665 Self::UnknownValue(u) => u.0.serialize(serializer),
666 }
667 }
668 }
669
670 impl<'de> serde::de::Deserialize<'de> for Code {
671 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
672 where
673 D: serde::Deserializer<'de>,
674 {
675 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
676 ".google.cloud.gkehub.v1.FeatureState.Code",
677 ))
678 }
679 }
680}
681
682#[derive(Clone, Default, PartialEq)]
684#[non_exhaustive]
685pub struct CommonFeatureSpec {
686 pub feature_spec: std::option::Option<crate::model::common_feature_spec::FeatureSpec>,
687
688 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
689}
690
691impl CommonFeatureSpec {
692 pub fn new() -> Self {
693 std::default::Default::default()
694 }
695
696 pub fn set_feature_spec<
701 T: std::convert::Into<std::option::Option<crate::model::common_feature_spec::FeatureSpec>>,
702 >(
703 mut self,
704 v: T,
705 ) -> Self {
706 self.feature_spec = v.into();
707 self
708 }
709
710 pub fn multiclusteringress(
714 &self,
715 ) -> std::option::Option<&std::boxed::Box<gkehub_multiclusteringress_v1::model::FeatureSpec>>
716 {
717 #[allow(unreachable_patterns)]
718 self.feature_spec.as_ref().and_then(|v| match v {
719 crate::model::common_feature_spec::FeatureSpec::Multiclusteringress(v) => {
720 std::option::Option::Some(v)
721 }
722 _ => std::option::Option::None,
723 })
724 }
725
726 pub fn set_multiclusteringress<
732 T: std::convert::Into<std::boxed::Box<gkehub_multiclusteringress_v1::model::FeatureSpec>>,
733 >(
734 mut self,
735 v: T,
736 ) -> Self {
737 self.feature_spec = std::option::Option::Some(
738 crate::model::common_feature_spec::FeatureSpec::Multiclusteringress(v.into()),
739 );
740 self
741 }
742}
743
744impl wkt::message::Message for CommonFeatureSpec {
745 fn typename() -> &'static str {
746 "type.googleapis.com/google.cloud.gkehub.v1.CommonFeatureSpec"
747 }
748}
749
750pub mod common_feature_spec {
752 #[allow(unused_imports)]
753 use super::*;
754
755 #[derive(Clone, Debug, PartialEq)]
756 #[non_exhaustive]
757 pub enum FeatureSpec {
758 Multiclusteringress(std::boxed::Box<gkehub_multiclusteringress_v1::model::FeatureSpec>),
760 }
761}
762
763#[derive(Clone, Default, PartialEq)]
765#[non_exhaustive]
766pub struct CommonFeatureState {
767 pub state: std::option::Option<crate::model::FeatureState>,
769
770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
771}
772
773impl CommonFeatureState {
774 pub fn new() -> Self {
775 std::default::Default::default()
776 }
777
778 pub fn set_state<T>(mut self, v: T) -> Self
780 where
781 T: std::convert::Into<crate::model::FeatureState>,
782 {
783 self.state = std::option::Option::Some(v.into());
784 self
785 }
786
787 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
789 where
790 T: std::convert::Into<crate::model::FeatureState>,
791 {
792 self.state = v.map(|x| x.into());
793 self
794 }
795}
796
797impl wkt::message::Message for CommonFeatureState {
798 fn typename() -> &'static str {
799 "type.googleapis.com/google.cloud.gkehub.v1.CommonFeatureState"
800 }
801}
802
803#[derive(Clone, Default, PartialEq)]
806#[non_exhaustive]
807pub struct MembershipFeatureSpec {
808 pub feature_spec: std::option::Option<crate::model::membership_feature_spec::FeatureSpec>,
809
810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
811}
812
813impl MembershipFeatureSpec {
814 pub fn new() -> Self {
815 std::default::Default::default()
816 }
817
818 pub fn set_feature_spec<
823 T: std::convert::Into<std::option::Option<crate::model::membership_feature_spec::FeatureSpec>>,
824 >(
825 mut self,
826 v: T,
827 ) -> Self {
828 self.feature_spec = v.into();
829 self
830 }
831
832 pub fn configmanagement(
836 &self,
837 ) -> std::option::Option<&std::boxed::Box<gkehub_configmanagement_v1::model::MembershipSpec>>
838 {
839 #[allow(unreachable_patterns)]
840 self.feature_spec.as_ref().and_then(|v| match v {
841 crate::model::membership_feature_spec::FeatureSpec::Configmanagement(v) => {
842 std::option::Option::Some(v)
843 }
844 _ => std::option::Option::None,
845 })
846 }
847
848 pub fn set_configmanagement<
854 T: std::convert::Into<std::boxed::Box<gkehub_configmanagement_v1::model::MembershipSpec>>,
855 >(
856 mut self,
857 v: T,
858 ) -> Self {
859 self.feature_spec = std::option::Option::Some(
860 crate::model::membership_feature_spec::FeatureSpec::Configmanagement(v.into()),
861 );
862 self
863 }
864}
865
866impl wkt::message::Message for MembershipFeatureSpec {
867 fn typename() -> &'static str {
868 "type.googleapis.com/google.cloud.gkehub.v1.MembershipFeatureSpec"
869 }
870}
871
872pub mod membership_feature_spec {
874 #[allow(unused_imports)]
875 use super::*;
876
877 #[derive(Clone, Debug, PartialEq)]
878 #[non_exhaustive]
879 pub enum FeatureSpec {
880 Configmanagement(std::boxed::Box<gkehub_configmanagement_v1::model::MembershipSpec>),
882 }
883}
884
885#[derive(Clone, Default, PartialEq)]
888#[non_exhaustive]
889pub struct MembershipFeatureState {
890 pub state: std::option::Option<crate::model::FeatureState>,
892
893 pub feature_state: std::option::Option<crate::model::membership_feature_state::FeatureState>,
894
895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
896}
897
898impl MembershipFeatureState {
899 pub fn new() -> Self {
900 std::default::Default::default()
901 }
902
903 pub fn set_state<T>(mut self, v: T) -> Self
905 where
906 T: std::convert::Into<crate::model::FeatureState>,
907 {
908 self.state = std::option::Option::Some(v.into());
909 self
910 }
911
912 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
914 where
915 T: std::convert::Into<crate::model::FeatureState>,
916 {
917 self.state = v.map(|x| x.into());
918 self
919 }
920
921 pub fn set_feature_state<
926 T: std::convert::Into<
927 std::option::Option<crate::model::membership_feature_state::FeatureState>,
928 >,
929 >(
930 mut self,
931 v: T,
932 ) -> Self {
933 self.feature_state = v.into();
934 self
935 }
936
937 pub fn configmanagement(
941 &self,
942 ) -> std::option::Option<&std::boxed::Box<gkehub_configmanagement_v1::model::MembershipState>>
943 {
944 #[allow(unreachable_patterns)]
945 self.feature_state.as_ref().and_then(|v| match v {
946 crate::model::membership_feature_state::FeatureState::Configmanagement(v) => {
947 std::option::Option::Some(v)
948 }
949 _ => std::option::Option::None,
950 })
951 }
952
953 pub fn set_configmanagement<
959 T: std::convert::Into<std::boxed::Box<gkehub_configmanagement_v1::model::MembershipState>>,
960 >(
961 mut self,
962 v: T,
963 ) -> Self {
964 self.feature_state = std::option::Option::Some(
965 crate::model::membership_feature_state::FeatureState::Configmanagement(v.into()),
966 );
967 self
968 }
969}
970
971impl wkt::message::Message for MembershipFeatureState {
972 fn typename() -> &'static str {
973 "type.googleapis.com/google.cloud.gkehub.v1.MembershipFeatureState"
974 }
975}
976
977pub mod membership_feature_state {
979 #[allow(unused_imports)]
980 use super::*;
981
982 #[derive(Clone, Debug, PartialEq)]
983 #[non_exhaustive]
984 pub enum FeatureState {
985 Configmanagement(std::boxed::Box<gkehub_configmanagement_v1::model::MembershipState>),
987 }
988}
989
990#[derive(Clone, Default, PartialEq)]
992#[non_exhaustive]
993pub struct Membership {
994 pub name: std::string::String,
1007
1008 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1010
1011 pub description: std::string::String,
1016
1017 pub state: std::option::Option<crate::model::MembershipState>,
1019
1020 pub create_time: std::option::Option<wkt::Timestamp>,
1022
1023 pub update_time: std::option::Option<wkt::Timestamp>,
1025
1026 pub delete_time: std::option::Option<wkt::Timestamp>,
1028
1029 pub external_id: std::string::String,
1037
1038 pub last_connection_time: std::option::Option<wkt::Timestamp>,
1044
1045 pub unique_id: std::string::String,
1049
1050 pub authority: std::option::Option<crate::model::Authority>,
1054
1055 pub monitoring_config: std::option::Option<crate::model::MonitoringConfig>,
1057
1058 pub r#type: std::option::Option<crate::model::membership::Type>,
1060
1061 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1062}
1063
1064impl Membership {
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_labels<T, K, V>(mut self, v: T) -> Self
1077 where
1078 T: std::iter::IntoIterator<Item = (K, V)>,
1079 K: std::convert::Into<std::string::String>,
1080 V: std::convert::Into<std::string::String>,
1081 {
1082 use std::iter::Iterator;
1083 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1084 self
1085 }
1086
1087 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1089 self.description = v.into();
1090 self
1091 }
1092
1093 pub fn set_state<T>(mut self, v: T) -> Self
1095 where
1096 T: std::convert::Into<crate::model::MembershipState>,
1097 {
1098 self.state = std::option::Option::Some(v.into());
1099 self
1100 }
1101
1102 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
1104 where
1105 T: std::convert::Into<crate::model::MembershipState>,
1106 {
1107 self.state = v.map(|x| x.into());
1108 self
1109 }
1110
1111 pub fn set_create_time<T>(mut self, v: T) -> Self
1113 where
1114 T: std::convert::Into<wkt::Timestamp>,
1115 {
1116 self.create_time = std::option::Option::Some(v.into());
1117 self
1118 }
1119
1120 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1122 where
1123 T: std::convert::Into<wkt::Timestamp>,
1124 {
1125 self.create_time = v.map(|x| x.into());
1126 self
1127 }
1128
1129 pub fn set_update_time<T>(mut self, v: T) -> Self
1131 where
1132 T: std::convert::Into<wkt::Timestamp>,
1133 {
1134 self.update_time = std::option::Option::Some(v.into());
1135 self
1136 }
1137
1138 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1140 where
1141 T: std::convert::Into<wkt::Timestamp>,
1142 {
1143 self.update_time = v.map(|x| x.into());
1144 self
1145 }
1146
1147 pub fn set_delete_time<T>(mut self, v: T) -> Self
1149 where
1150 T: std::convert::Into<wkt::Timestamp>,
1151 {
1152 self.delete_time = std::option::Option::Some(v.into());
1153 self
1154 }
1155
1156 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
1158 where
1159 T: std::convert::Into<wkt::Timestamp>,
1160 {
1161 self.delete_time = v.map(|x| x.into());
1162 self
1163 }
1164
1165 pub fn set_external_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1167 self.external_id = v.into();
1168 self
1169 }
1170
1171 pub fn set_last_connection_time<T>(mut self, v: T) -> Self
1173 where
1174 T: std::convert::Into<wkt::Timestamp>,
1175 {
1176 self.last_connection_time = std::option::Option::Some(v.into());
1177 self
1178 }
1179
1180 pub fn set_or_clear_last_connection_time<T>(mut self, v: std::option::Option<T>) -> Self
1182 where
1183 T: std::convert::Into<wkt::Timestamp>,
1184 {
1185 self.last_connection_time = v.map(|x| x.into());
1186 self
1187 }
1188
1189 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1191 self.unique_id = v.into();
1192 self
1193 }
1194
1195 pub fn set_authority<T>(mut self, v: T) -> Self
1197 where
1198 T: std::convert::Into<crate::model::Authority>,
1199 {
1200 self.authority = std::option::Option::Some(v.into());
1201 self
1202 }
1203
1204 pub fn set_or_clear_authority<T>(mut self, v: std::option::Option<T>) -> Self
1206 where
1207 T: std::convert::Into<crate::model::Authority>,
1208 {
1209 self.authority = v.map(|x| x.into());
1210 self
1211 }
1212
1213 pub fn set_monitoring_config<T>(mut self, v: T) -> Self
1215 where
1216 T: std::convert::Into<crate::model::MonitoringConfig>,
1217 {
1218 self.monitoring_config = std::option::Option::Some(v.into());
1219 self
1220 }
1221
1222 pub fn set_or_clear_monitoring_config<T>(mut self, v: std::option::Option<T>) -> Self
1224 where
1225 T: std::convert::Into<crate::model::MonitoringConfig>,
1226 {
1227 self.monitoring_config = v.map(|x| x.into());
1228 self
1229 }
1230
1231 pub fn set_type<T: std::convert::Into<std::option::Option<crate::model::membership::Type>>>(
1236 mut self,
1237 v: T,
1238 ) -> Self {
1239 self.r#type = v.into();
1240 self
1241 }
1242
1243 pub fn endpoint(
1247 &self,
1248 ) -> std::option::Option<&std::boxed::Box<crate::model::MembershipEndpoint>> {
1249 #[allow(unreachable_patterns)]
1250 self.r#type.as_ref().and_then(|v| match v {
1251 crate::model::membership::Type::Endpoint(v) => std::option::Option::Some(v),
1252 _ => std::option::Option::None,
1253 })
1254 }
1255
1256 pub fn set_endpoint<
1262 T: std::convert::Into<std::boxed::Box<crate::model::MembershipEndpoint>>,
1263 >(
1264 mut self,
1265 v: T,
1266 ) -> Self {
1267 self.r#type = std::option::Option::Some(crate::model::membership::Type::Endpoint(v.into()));
1268 self
1269 }
1270}
1271
1272impl wkt::message::Message for Membership {
1273 fn typename() -> &'static str {
1274 "type.googleapis.com/google.cloud.gkehub.v1.Membership"
1275 }
1276}
1277
1278pub mod membership {
1280 #[allow(unused_imports)]
1281 use super::*;
1282
1283 #[derive(Clone, Debug, PartialEq)]
1285 #[non_exhaustive]
1286 pub enum Type {
1287 Endpoint(std::boxed::Box<crate::model::MembershipEndpoint>),
1289 }
1290}
1291
1292#[derive(Clone, Default, PartialEq)]
1295#[non_exhaustive]
1296pub struct MembershipEndpoint {
1297 pub gke_cluster: std::option::Option<crate::model::GkeCluster>,
1299
1300 pub kubernetes_metadata: std::option::Option<crate::model::KubernetesMetadata>,
1302
1303 pub kubernetes_resource: std::option::Option<crate::model::KubernetesResource>,
1312
1313 pub google_managed: bool,
1316
1317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1318}
1319
1320impl MembershipEndpoint {
1321 pub fn new() -> Self {
1322 std::default::Default::default()
1323 }
1324
1325 pub fn set_gke_cluster<T>(mut self, v: T) -> Self
1327 where
1328 T: std::convert::Into<crate::model::GkeCluster>,
1329 {
1330 self.gke_cluster = std::option::Option::Some(v.into());
1331 self
1332 }
1333
1334 pub fn set_or_clear_gke_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1336 where
1337 T: std::convert::Into<crate::model::GkeCluster>,
1338 {
1339 self.gke_cluster = v.map(|x| x.into());
1340 self
1341 }
1342
1343 pub fn set_kubernetes_metadata<T>(mut self, v: T) -> Self
1345 where
1346 T: std::convert::Into<crate::model::KubernetesMetadata>,
1347 {
1348 self.kubernetes_metadata = std::option::Option::Some(v.into());
1349 self
1350 }
1351
1352 pub fn set_or_clear_kubernetes_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1354 where
1355 T: std::convert::Into<crate::model::KubernetesMetadata>,
1356 {
1357 self.kubernetes_metadata = v.map(|x| x.into());
1358 self
1359 }
1360
1361 pub fn set_kubernetes_resource<T>(mut self, v: T) -> Self
1363 where
1364 T: std::convert::Into<crate::model::KubernetesResource>,
1365 {
1366 self.kubernetes_resource = std::option::Option::Some(v.into());
1367 self
1368 }
1369
1370 pub fn set_or_clear_kubernetes_resource<T>(mut self, v: std::option::Option<T>) -> Self
1372 where
1373 T: std::convert::Into<crate::model::KubernetesResource>,
1374 {
1375 self.kubernetes_resource = v.map(|x| x.into());
1376 self
1377 }
1378
1379 pub fn set_google_managed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1381 self.google_managed = v.into();
1382 self
1383 }
1384}
1385
1386impl wkt::message::Message for MembershipEndpoint {
1387 fn typename() -> &'static str {
1388 "type.googleapis.com/google.cloud.gkehub.v1.MembershipEndpoint"
1389 }
1390}
1391
1392#[derive(Clone, Default, PartialEq)]
1396#[non_exhaustive]
1397pub struct KubernetesResource {
1398 pub membership_cr_manifest: std::string::String,
1406
1407 pub membership_resources: std::vec::Vec<crate::model::ResourceManifest>,
1416
1417 pub connect_resources: std::vec::Vec<crate::model::ResourceManifest>,
1425
1426 pub resource_options: std::option::Option<crate::model::ResourceOptions>,
1428
1429 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1430}
1431
1432impl KubernetesResource {
1433 pub fn new() -> Self {
1434 std::default::Default::default()
1435 }
1436
1437 pub fn set_membership_cr_manifest<T: std::convert::Into<std::string::String>>(
1439 mut self,
1440 v: T,
1441 ) -> Self {
1442 self.membership_cr_manifest = v.into();
1443 self
1444 }
1445
1446 pub fn set_membership_resources<T, V>(mut self, v: T) -> Self
1448 where
1449 T: std::iter::IntoIterator<Item = V>,
1450 V: std::convert::Into<crate::model::ResourceManifest>,
1451 {
1452 use std::iter::Iterator;
1453 self.membership_resources = v.into_iter().map(|i| i.into()).collect();
1454 self
1455 }
1456
1457 pub fn set_connect_resources<T, V>(mut self, v: T) -> Self
1459 where
1460 T: std::iter::IntoIterator<Item = V>,
1461 V: std::convert::Into<crate::model::ResourceManifest>,
1462 {
1463 use std::iter::Iterator;
1464 self.connect_resources = v.into_iter().map(|i| i.into()).collect();
1465 self
1466 }
1467
1468 pub fn set_resource_options<T>(mut self, v: T) -> Self
1470 where
1471 T: std::convert::Into<crate::model::ResourceOptions>,
1472 {
1473 self.resource_options = std::option::Option::Some(v.into());
1474 self
1475 }
1476
1477 pub fn set_or_clear_resource_options<T>(mut self, v: std::option::Option<T>) -> Self
1479 where
1480 T: std::convert::Into<crate::model::ResourceOptions>,
1481 {
1482 self.resource_options = v.map(|x| x.into());
1483 self
1484 }
1485}
1486
1487impl wkt::message::Message for KubernetesResource {
1488 fn typename() -> &'static str {
1489 "type.googleapis.com/google.cloud.gkehub.v1.KubernetesResource"
1490 }
1491}
1492
1493#[derive(Clone, Default, PartialEq)]
1495#[non_exhaustive]
1496pub struct ResourceOptions {
1497 pub connect_version: std::string::String,
1501
1502 pub v1beta1_crd: bool,
1507
1508 pub k8s_version: std::string::String,
1512
1513 pub k8s_git_version: std::string::String,
1517
1518 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1519}
1520
1521impl ResourceOptions {
1522 pub fn new() -> Self {
1523 std::default::Default::default()
1524 }
1525
1526 pub fn set_connect_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1528 self.connect_version = v.into();
1529 self
1530 }
1531
1532 pub fn set_v1beta1_crd<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1534 self.v1beta1_crd = v.into();
1535 self
1536 }
1537
1538 pub fn set_k8s_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1540 self.k8s_version = v.into();
1541 self
1542 }
1543
1544 pub fn set_k8s_git_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.k8s_git_version = v.into();
1547 self
1548 }
1549}
1550
1551impl wkt::message::Message for ResourceOptions {
1552 fn typename() -> &'static str {
1553 "type.googleapis.com/google.cloud.gkehub.v1.ResourceOptions"
1554 }
1555}
1556
1557#[derive(Clone, Default, PartialEq)]
1560#[non_exhaustive]
1561pub struct ResourceManifest {
1562 pub manifest: std::string::String,
1564
1565 pub cluster_scoped: bool,
1571
1572 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1573}
1574
1575impl ResourceManifest {
1576 pub fn new() -> Self {
1577 std::default::Default::default()
1578 }
1579
1580 pub fn set_manifest<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1582 self.manifest = v.into();
1583 self
1584 }
1585
1586 pub fn set_cluster_scoped<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1588 self.cluster_scoped = v.into();
1589 self
1590 }
1591}
1592
1593impl wkt::message::Message for ResourceManifest {
1594 fn typename() -> &'static str {
1595 "type.googleapis.com/google.cloud.gkehub.v1.ResourceManifest"
1596 }
1597}
1598
1599#[derive(Clone, Default, PartialEq)]
1601#[non_exhaustive]
1602pub struct GkeCluster {
1603 pub resource_link: std::string::String,
1610
1611 pub cluster_missing: bool,
1614
1615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1616}
1617
1618impl GkeCluster {
1619 pub fn new() -> Self {
1620 std::default::Default::default()
1621 }
1622
1623 pub fn set_resource_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1625 self.resource_link = v.into();
1626 self
1627 }
1628
1629 pub fn set_cluster_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1631 self.cluster_missing = v.into();
1632 self
1633 }
1634}
1635
1636impl wkt::message::Message for GkeCluster {
1637 fn typename() -> &'static str {
1638 "type.googleapis.com/google.cloud.gkehub.v1.GkeCluster"
1639 }
1640}
1641
1642#[derive(Clone, Default, PartialEq)]
1645#[non_exhaustive]
1646pub struct KubernetesMetadata {
1647 pub kubernetes_api_server_version: std::string::String,
1650
1651 pub node_provider_id: std::string::String,
1656
1657 pub node_count: i32,
1659
1660 pub vcpu_count: i32,
1662
1663 pub memory_mb: i32,
1666
1667 pub update_time: std::option::Option<wkt::Timestamp>,
1671
1672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1673}
1674
1675impl KubernetesMetadata {
1676 pub fn new() -> Self {
1677 std::default::Default::default()
1678 }
1679
1680 pub fn set_kubernetes_api_server_version<T: std::convert::Into<std::string::String>>(
1682 mut self,
1683 v: T,
1684 ) -> Self {
1685 self.kubernetes_api_server_version = v.into();
1686 self
1687 }
1688
1689 pub fn set_node_provider_id<T: std::convert::Into<std::string::String>>(
1691 mut self,
1692 v: T,
1693 ) -> Self {
1694 self.node_provider_id = v.into();
1695 self
1696 }
1697
1698 pub fn set_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1700 self.node_count = v.into();
1701 self
1702 }
1703
1704 pub fn set_vcpu_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1706 self.vcpu_count = v.into();
1707 self
1708 }
1709
1710 pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1712 self.memory_mb = v.into();
1713 self
1714 }
1715
1716 pub fn set_update_time<T>(mut self, v: T) -> Self
1718 where
1719 T: std::convert::Into<wkt::Timestamp>,
1720 {
1721 self.update_time = std::option::Option::Some(v.into());
1722 self
1723 }
1724
1725 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1727 where
1728 T: std::convert::Into<wkt::Timestamp>,
1729 {
1730 self.update_time = v.map(|x| x.into());
1731 self
1732 }
1733}
1734
1735impl wkt::message::Message for KubernetesMetadata {
1736 fn typename() -> &'static str {
1737 "type.googleapis.com/google.cloud.gkehub.v1.KubernetesMetadata"
1738 }
1739}
1740
1741#[derive(Clone, Default, PartialEq)]
1744#[non_exhaustive]
1745pub struct MonitoringConfig {
1746 pub project_id: std::string::String,
1748
1749 pub location: std::string::String,
1751
1752 pub cluster: std::string::String,
1758
1759 pub kubernetes_metrics_prefix: std::string::String,
1764
1765 pub cluster_hash: std::string::String,
1770
1771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1772}
1773
1774impl MonitoringConfig {
1775 pub fn new() -> Self {
1776 std::default::Default::default()
1777 }
1778
1779 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1781 self.project_id = v.into();
1782 self
1783 }
1784
1785 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1787 self.location = v.into();
1788 self
1789 }
1790
1791 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1793 self.cluster = v.into();
1794 self
1795 }
1796
1797 pub fn set_kubernetes_metrics_prefix<T: std::convert::Into<std::string::String>>(
1799 mut self,
1800 v: T,
1801 ) -> Self {
1802 self.kubernetes_metrics_prefix = v.into();
1803 self
1804 }
1805
1806 pub fn set_cluster_hash<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1808 self.cluster_hash = v.into();
1809 self
1810 }
1811}
1812
1813impl wkt::message::Message for MonitoringConfig {
1814 fn typename() -> &'static str {
1815 "type.googleapis.com/google.cloud.gkehub.v1.MonitoringConfig"
1816 }
1817}
1818
1819#[derive(Clone, Default, PartialEq)]
1821#[non_exhaustive]
1822pub struct MembershipState {
1823 pub code: crate::model::membership_state::Code,
1825
1826 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1827}
1828
1829impl MembershipState {
1830 pub fn new() -> Self {
1831 std::default::Default::default()
1832 }
1833
1834 pub fn set_code<T: std::convert::Into<crate::model::membership_state::Code>>(
1836 mut self,
1837 v: T,
1838 ) -> Self {
1839 self.code = v.into();
1840 self
1841 }
1842}
1843
1844impl wkt::message::Message for MembershipState {
1845 fn typename() -> &'static str {
1846 "type.googleapis.com/google.cloud.gkehub.v1.MembershipState"
1847 }
1848}
1849
1850pub mod membership_state {
1852 #[allow(unused_imports)]
1853 use super::*;
1854
1855 #[derive(Clone, Debug, PartialEq)]
1871 #[non_exhaustive]
1872 pub enum Code {
1873 Unspecified,
1875 Creating,
1877 Ready,
1879 Deleting,
1881 Updating,
1883 ServiceUpdating,
1885 UnknownValue(code::UnknownValue),
1890 }
1891
1892 #[doc(hidden)]
1893 pub mod code {
1894 #[allow(unused_imports)]
1895 use super::*;
1896 #[derive(Clone, Debug, PartialEq)]
1897 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1898 }
1899
1900 impl Code {
1901 pub fn value(&self) -> std::option::Option<i32> {
1906 match self {
1907 Self::Unspecified => std::option::Option::Some(0),
1908 Self::Creating => std::option::Option::Some(1),
1909 Self::Ready => std::option::Option::Some(2),
1910 Self::Deleting => std::option::Option::Some(3),
1911 Self::Updating => std::option::Option::Some(4),
1912 Self::ServiceUpdating => std::option::Option::Some(5),
1913 Self::UnknownValue(u) => u.0.value(),
1914 }
1915 }
1916
1917 pub fn name(&self) -> std::option::Option<&str> {
1922 match self {
1923 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
1924 Self::Creating => std::option::Option::Some("CREATING"),
1925 Self::Ready => std::option::Option::Some("READY"),
1926 Self::Deleting => std::option::Option::Some("DELETING"),
1927 Self::Updating => std::option::Option::Some("UPDATING"),
1928 Self::ServiceUpdating => std::option::Option::Some("SERVICE_UPDATING"),
1929 Self::UnknownValue(u) => u.0.name(),
1930 }
1931 }
1932 }
1933
1934 impl std::default::Default for Code {
1935 fn default() -> Self {
1936 use std::convert::From;
1937 Self::from(0)
1938 }
1939 }
1940
1941 impl std::fmt::Display for Code {
1942 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1943 wkt::internal::display_enum(f, self.name(), self.value())
1944 }
1945 }
1946
1947 impl std::convert::From<i32> for Code {
1948 fn from(value: i32) -> Self {
1949 match value {
1950 0 => Self::Unspecified,
1951 1 => Self::Creating,
1952 2 => Self::Ready,
1953 3 => Self::Deleting,
1954 4 => Self::Updating,
1955 5 => Self::ServiceUpdating,
1956 _ => Self::UnknownValue(code::UnknownValue(
1957 wkt::internal::UnknownEnumValue::Integer(value),
1958 )),
1959 }
1960 }
1961 }
1962
1963 impl std::convert::From<&str> for Code {
1964 fn from(value: &str) -> Self {
1965 use std::string::ToString;
1966 match value {
1967 "CODE_UNSPECIFIED" => Self::Unspecified,
1968 "CREATING" => Self::Creating,
1969 "READY" => Self::Ready,
1970 "DELETING" => Self::Deleting,
1971 "UPDATING" => Self::Updating,
1972 "SERVICE_UPDATING" => Self::ServiceUpdating,
1973 _ => Self::UnknownValue(code::UnknownValue(
1974 wkt::internal::UnknownEnumValue::String(value.to_string()),
1975 )),
1976 }
1977 }
1978 }
1979
1980 impl serde::ser::Serialize for Code {
1981 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1982 where
1983 S: serde::Serializer,
1984 {
1985 match self {
1986 Self::Unspecified => serializer.serialize_i32(0),
1987 Self::Creating => serializer.serialize_i32(1),
1988 Self::Ready => serializer.serialize_i32(2),
1989 Self::Deleting => serializer.serialize_i32(3),
1990 Self::Updating => serializer.serialize_i32(4),
1991 Self::ServiceUpdating => serializer.serialize_i32(5),
1992 Self::UnknownValue(u) => u.0.serialize(serializer),
1993 }
1994 }
1995 }
1996
1997 impl<'de> serde::de::Deserialize<'de> for Code {
1998 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1999 where
2000 D: serde::Deserializer<'de>,
2001 {
2002 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
2003 ".google.cloud.gkehub.v1.MembershipState.Code",
2004 ))
2005 }
2006 }
2007}
2008
2009#[derive(Clone, Default, PartialEq)]
2013#[non_exhaustive]
2014pub struct Authority {
2015 pub issuer: std::string::String,
2026
2027 pub workload_identity_pool: std::string::String,
2035
2036 pub identity_provider: std::string::String,
2039
2040 pub oidc_jwks: ::bytes::Bytes,
2046
2047 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2048}
2049
2050impl Authority {
2051 pub fn new() -> Self {
2052 std::default::Default::default()
2053 }
2054
2055 pub fn set_issuer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2057 self.issuer = v.into();
2058 self
2059 }
2060
2061 pub fn set_workload_identity_pool<T: std::convert::Into<std::string::String>>(
2063 mut self,
2064 v: T,
2065 ) -> Self {
2066 self.workload_identity_pool = v.into();
2067 self
2068 }
2069
2070 pub fn set_identity_provider<T: std::convert::Into<std::string::String>>(
2072 mut self,
2073 v: T,
2074 ) -> Self {
2075 self.identity_provider = v.into();
2076 self
2077 }
2078
2079 pub fn set_oidc_jwks<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2081 self.oidc_jwks = v.into();
2082 self
2083 }
2084}
2085
2086impl wkt::message::Message for Authority {
2087 fn typename() -> &'static str {
2088 "type.googleapis.com/google.cloud.gkehub.v1.Authority"
2089 }
2090}
2091
2092#[derive(Clone, Default, PartialEq)]
2094#[non_exhaustive]
2095pub struct ListMembershipsRequest {
2096 pub parent: std::string::String,
2100
2101 pub page_size: i32,
2105
2106 pub page_token: std::string::String,
2110
2111 pub filter: std::string::String,
2133
2134 pub order_by: std::string::String,
2137
2138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2139}
2140
2141impl ListMembershipsRequest {
2142 pub fn new() -> Self {
2143 std::default::Default::default()
2144 }
2145
2146 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2148 self.parent = v.into();
2149 self
2150 }
2151
2152 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2154 self.page_size = v.into();
2155 self
2156 }
2157
2158 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2160 self.page_token = v.into();
2161 self
2162 }
2163
2164 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2166 self.filter = v.into();
2167 self
2168 }
2169
2170 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2172 self.order_by = v.into();
2173 self
2174 }
2175}
2176
2177impl wkt::message::Message for ListMembershipsRequest {
2178 fn typename() -> &'static str {
2179 "type.googleapis.com/google.cloud.gkehub.v1.ListMembershipsRequest"
2180 }
2181}
2182
2183#[derive(Clone, Default, PartialEq)]
2185#[non_exhaustive]
2186pub struct ListMembershipsResponse {
2187 pub resources: std::vec::Vec<crate::model::Membership>,
2189
2190 pub next_page_token: std::string::String,
2194
2195 pub unreachable: std::vec::Vec<std::string::String>,
2197
2198 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2199}
2200
2201impl ListMembershipsResponse {
2202 pub fn new() -> Self {
2203 std::default::Default::default()
2204 }
2205
2206 pub fn set_resources<T, V>(mut self, v: T) -> Self
2208 where
2209 T: std::iter::IntoIterator<Item = V>,
2210 V: std::convert::Into<crate::model::Membership>,
2211 {
2212 use std::iter::Iterator;
2213 self.resources = v.into_iter().map(|i| i.into()).collect();
2214 self
2215 }
2216
2217 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2219 self.next_page_token = v.into();
2220 self
2221 }
2222
2223 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2225 where
2226 T: std::iter::IntoIterator<Item = V>,
2227 V: std::convert::Into<std::string::String>,
2228 {
2229 use std::iter::Iterator;
2230 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2231 self
2232 }
2233}
2234
2235impl wkt::message::Message for ListMembershipsResponse {
2236 fn typename() -> &'static str {
2237 "type.googleapis.com/google.cloud.gkehub.v1.ListMembershipsResponse"
2238 }
2239}
2240
2241#[doc(hidden)]
2242impl gax::paginator::internal::PageableResponse for ListMembershipsResponse {
2243 type PageItem = crate::model::Membership;
2244
2245 fn items(self) -> std::vec::Vec<Self::PageItem> {
2246 self.resources
2247 }
2248
2249 fn next_page_token(&self) -> std::string::String {
2250 use std::clone::Clone;
2251 self.next_page_token.clone()
2252 }
2253}
2254
2255#[derive(Clone, Default, PartialEq)]
2257#[non_exhaustive]
2258pub struct GetMembershipRequest {
2259 pub name: std::string::String,
2262
2263 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2264}
2265
2266impl GetMembershipRequest {
2267 pub fn new() -> Self {
2268 std::default::Default::default()
2269 }
2270
2271 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2273 self.name = v.into();
2274 self
2275 }
2276}
2277
2278impl wkt::message::Message for GetMembershipRequest {
2279 fn typename() -> &'static str {
2280 "type.googleapis.com/google.cloud.gkehub.v1.GetMembershipRequest"
2281 }
2282}
2283
2284#[derive(Clone, Default, PartialEq)]
2286#[non_exhaustive]
2287pub struct CreateMembershipRequest {
2288 pub parent: std::string::String,
2291
2292 pub membership_id: std::string::String,
2302
2303 pub resource: std::option::Option<crate::model::Membership>,
2305
2306 pub request_id: std::string::String,
2320
2321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2322}
2323
2324impl CreateMembershipRequest {
2325 pub fn new() -> Self {
2326 std::default::Default::default()
2327 }
2328
2329 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2331 self.parent = v.into();
2332 self
2333 }
2334
2335 pub fn set_membership_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2337 self.membership_id = v.into();
2338 self
2339 }
2340
2341 pub fn set_resource<T>(mut self, v: T) -> Self
2343 where
2344 T: std::convert::Into<crate::model::Membership>,
2345 {
2346 self.resource = std::option::Option::Some(v.into());
2347 self
2348 }
2349
2350 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2352 where
2353 T: std::convert::Into<crate::model::Membership>,
2354 {
2355 self.resource = v.map(|x| x.into());
2356 self
2357 }
2358
2359 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2361 self.request_id = v.into();
2362 self
2363 }
2364}
2365
2366impl wkt::message::Message for CreateMembershipRequest {
2367 fn typename() -> &'static str {
2368 "type.googleapis.com/google.cloud.gkehub.v1.CreateMembershipRequest"
2369 }
2370}
2371
2372#[derive(Clone, Default, PartialEq)]
2374#[non_exhaustive]
2375pub struct DeleteMembershipRequest {
2376 pub name: std::string::String,
2379
2380 pub request_id: std::string::String,
2394
2395 pub force: bool,
2399
2400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2401}
2402
2403impl DeleteMembershipRequest {
2404 pub fn new() -> Self {
2405 std::default::Default::default()
2406 }
2407
2408 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2410 self.name = v.into();
2411 self
2412 }
2413
2414 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2416 self.request_id = v.into();
2417 self
2418 }
2419
2420 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2422 self.force = v.into();
2423 self
2424 }
2425}
2426
2427impl wkt::message::Message for DeleteMembershipRequest {
2428 fn typename() -> &'static str {
2429 "type.googleapis.com/google.cloud.gkehub.v1.DeleteMembershipRequest"
2430 }
2431}
2432
2433#[derive(Clone, Default, PartialEq)]
2435#[non_exhaustive]
2436pub struct UpdateMembershipRequest {
2437 pub name: std::string::String,
2440
2441 pub update_mask: std::option::Option<wkt::FieldMask>,
2443
2444 pub resource: std::option::Option<crate::model::Membership>,
2453
2454 pub request_id: std::string::String,
2468
2469 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2470}
2471
2472impl UpdateMembershipRequest {
2473 pub fn new() -> Self {
2474 std::default::Default::default()
2475 }
2476
2477 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2479 self.name = v.into();
2480 self
2481 }
2482
2483 pub fn set_update_mask<T>(mut self, v: T) -> Self
2485 where
2486 T: std::convert::Into<wkt::FieldMask>,
2487 {
2488 self.update_mask = std::option::Option::Some(v.into());
2489 self
2490 }
2491
2492 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2494 where
2495 T: std::convert::Into<wkt::FieldMask>,
2496 {
2497 self.update_mask = v.map(|x| x.into());
2498 self
2499 }
2500
2501 pub fn set_resource<T>(mut self, v: T) -> Self
2503 where
2504 T: std::convert::Into<crate::model::Membership>,
2505 {
2506 self.resource = std::option::Option::Some(v.into());
2507 self
2508 }
2509
2510 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2512 where
2513 T: std::convert::Into<crate::model::Membership>,
2514 {
2515 self.resource = v.map(|x| x.into());
2516 self
2517 }
2518
2519 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2521 self.request_id = v.into();
2522 self
2523 }
2524}
2525
2526impl wkt::message::Message for UpdateMembershipRequest {
2527 fn typename() -> &'static str {
2528 "type.googleapis.com/google.cloud.gkehub.v1.UpdateMembershipRequest"
2529 }
2530}
2531
2532#[derive(Clone, Default, PartialEq)]
2536#[non_exhaustive]
2537pub struct GenerateConnectManifestRequest {
2538 pub name: std::string::String,
2541
2542 pub namespace: std::string::String,
2549
2550 pub proxy: ::bytes::Bytes,
2556
2557 pub version: std::string::String,
2560
2561 pub is_upgrade: bool,
2564
2565 pub registry: std::string::String,
2568
2569 pub image_pull_secret_content: ::bytes::Bytes,
2571
2572 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2573}
2574
2575impl GenerateConnectManifestRequest {
2576 pub fn new() -> Self {
2577 std::default::Default::default()
2578 }
2579
2580 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2582 self.name = v.into();
2583 self
2584 }
2585
2586 pub fn set_namespace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2588 self.namespace = v.into();
2589 self
2590 }
2591
2592 pub fn set_proxy<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2594 self.proxy = v.into();
2595 self
2596 }
2597
2598 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2600 self.version = v.into();
2601 self
2602 }
2603
2604 pub fn set_is_upgrade<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2606 self.is_upgrade = v.into();
2607 self
2608 }
2609
2610 pub fn set_registry<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2612 self.registry = v.into();
2613 self
2614 }
2615
2616 pub fn set_image_pull_secret_content<T: std::convert::Into<::bytes::Bytes>>(
2618 mut self,
2619 v: T,
2620 ) -> Self {
2621 self.image_pull_secret_content = v.into();
2622 self
2623 }
2624}
2625
2626impl wkt::message::Message for GenerateConnectManifestRequest {
2627 fn typename() -> &'static str {
2628 "type.googleapis.com/google.cloud.gkehub.v1.GenerateConnectManifestRequest"
2629 }
2630}
2631
2632#[derive(Clone, Default, PartialEq)]
2635#[non_exhaustive]
2636pub struct GenerateConnectManifestResponse {
2637 pub manifest: std::vec::Vec<crate::model::ConnectAgentResource>,
2640
2641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2642}
2643
2644impl GenerateConnectManifestResponse {
2645 pub fn new() -> Self {
2646 std::default::Default::default()
2647 }
2648
2649 pub fn set_manifest<T, V>(mut self, v: T) -> Self
2651 where
2652 T: std::iter::IntoIterator<Item = V>,
2653 V: std::convert::Into<crate::model::ConnectAgentResource>,
2654 {
2655 use std::iter::Iterator;
2656 self.manifest = v.into_iter().map(|i| i.into()).collect();
2657 self
2658 }
2659}
2660
2661impl wkt::message::Message for GenerateConnectManifestResponse {
2662 fn typename() -> &'static str {
2663 "type.googleapis.com/google.cloud.gkehub.v1.GenerateConnectManifestResponse"
2664 }
2665}
2666
2667#[derive(Clone, Default, PartialEq)]
2670#[non_exhaustive]
2671pub struct ConnectAgentResource {
2672 pub r#type: std::option::Option<crate::model::TypeMeta>,
2674
2675 pub manifest: std::string::String,
2677
2678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2679}
2680
2681impl ConnectAgentResource {
2682 pub fn new() -> Self {
2683 std::default::Default::default()
2684 }
2685
2686 pub fn set_type<T>(mut self, v: T) -> Self
2688 where
2689 T: std::convert::Into<crate::model::TypeMeta>,
2690 {
2691 self.r#type = std::option::Option::Some(v.into());
2692 self
2693 }
2694
2695 pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
2697 where
2698 T: std::convert::Into<crate::model::TypeMeta>,
2699 {
2700 self.r#type = v.map(|x| x.into());
2701 self
2702 }
2703
2704 pub fn set_manifest<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2706 self.manifest = v.into();
2707 self
2708 }
2709}
2710
2711impl wkt::message::Message for ConnectAgentResource {
2712 fn typename() -> &'static str {
2713 "type.googleapis.com/google.cloud.gkehub.v1.ConnectAgentResource"
2714 }
2715}
2716
2717#[derive(Clone, Default, PartialEq)]
2720#[non_exhaustive]
2721pub struct TypeMeta {
2722 pub kind: std::string::String,
2724
2725 pub api_version: std::string::String,
2727
2728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2729}
2730
2731impl TypeMeta {
2732 pub fn new() -> Self {
2733 std::default::Default::default()
2734 }
2735
2736 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2738 self.kind = v.into();
2739 self
2740 }
2741
2742 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2744 self.api_version = v.into();
2745 self
2746 }
2747}
2748
2749impl wkt::message::Message for TypeMeta {
2750 fn typename() -> &'static str {
2751 "type.googleapis.com/google.cloud.gkehub.v1.TypeMeta"
2752 }
2753}
2754
2755#[derive(Clone, Default, PartialEq)]
2757#[non_exhaustive]
2758pub struct ListFeaturesRequest {
2759 pub parent: std::string::String,
2762
2763 pub page_size: i32,
2767
2768 pub page_token: std::string::String,
2772
2773 pub filter: std::string::String,
2791
2792 pub order_by: std::string::String,
2795
2796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2797}
2798
2799impl ListFeaturesRequest {
2800 pub fn new() -> Self {
2801 std::default::Default::default()
2802 }
2803
2804 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2806 self.parent = v.into();
2807 self
2808 }
2809
2810 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2812 self.page_size = v.into();
2813 self
2814 }
2815
2816 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2818 self.page_token = v.into();
2819 self
2820 }
2821
2822 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2824 self.filter = v.into();
2825 self
2826 }
2827
2828 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2830 self.order_by = v.into();
2831 self
2832 }
2833}
2834
2835impl wkt::message::Message for ListFeaturesRequest {
2836 fn typename() -> &'static str {
2837 "type.googleapis.com/google.cloud.gkehub.v1.ListFeaturesRequest"
2838 }
2839}
2840
2841#[derive(Clone, Default, PartialEq)]
2843#[non_exhaustive]
2844pub struct ListFeaturesResponse {
2845 pub resources: std::vec::Vec<crate::model::Feature>,
2847
2848 pub next_page_token: std::string::String,
2852
2853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2854}
2855
2856impl ListFeaturesResponse {
2857 pub fn new() -> Self {
2858 std::default::Default::default()
2859 }
2860
2861 pub fn set_resources<T, V>(mut self, v: T) -> Self
2863 where
2864 T: std::iter::IntoIterator<Item = V>,
2865 V: std::convert::Into<crate::model::Feature>,
2866 {
2867 use std::iter::Iterator;
2868 self.resources = v.into_iter().map(|i| i.into()).collect();
2869 self
2870 }
2871
2872 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2874 self.next_page_token = v.into();
2875 self
2876 }
2877}
2878
2879impl wkt::message::Message for ListFeaturesResponse {
2880 fn typename() -> &'static str {
2881 "type.googleapis.com/google.cloud.gkehub.v1.ListFeaturesResponse"
2882 }
2883}
2884
2885#[doc(hidden)]
2886impl gax::paginator::internal::PageableResponse for ListFeaturesResponse {
2887 type PageItem = crate::model::Feature;
2888
2889 fn items(self) -> std::vec::Vec<Self::PageItem> {
2890 self.resources
2891 }
2892
2893 fn next_page_token(&self) -> std::string::String {
2894 use std::clone::Clone;
2895 self.next_page_token.clone()
2896 }
2897}
2898
2899#[derive(Clone, Default, PartialEq)]
2901#[non_exhaustive]
2902pub struct GetFeatureRequest {
2903 pub name: std::string::String,
2906
2907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2908}
2909
2910impl GetFeatureRequest {
2911 pub fn new() -> Self {
2912 std::default::Default::default()
2913 }
2914
2915 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2917 self.name = v.into();
2918 self
2919 }
2920}
2921
2922impl wkt::message::Message for GetFeatureRequest {
2923 fn typename() -> &'static str {
2924 "type.googleapis.com/google.cloud.gkehub.v1.GetFeatureRequest"
2925 }
2926}
2927
2928#[derive(Clone, Default, PartialEq)]
2930#[non_exhaustive]
2931pub struct CreateFeatureRequest {
2932 pub parent: std::string::String,
2935
2936 pub feature_id: std::string::String,
2938
2939 pub resource: std::option::Option<crate::model::Feature>,
2941
2942 pub request_id: std::string::String,
2956
2957 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2958}
2959
2960impl CreateFeatureRequest {
2961 pub fn new() -> Self {
2962 std::default::Default::default()
2963 }
2964
2965 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2967 self.parent = v.into();
2968 self
2969 }
2970
2971 pub fn set_feature_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2973 self.feature_id = v.into();
2974 self
2975 }
2976
2977 pub fn set_resource<T>(mut self, v: T) -> Self
2979 where
2980 T: std::convert::Into<crate::model::Feature>,
2981 {
2982 self.resource = std::option::Option::Some(v.into());
2983 self
2984 }
2985
2986 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2988 where
2989 T: std::convert::Into<crate::model::Feature>,
2990 {
2991 self.resource = v.map(|x| x.into());
2992 self
2993 }
2994
2995 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2997 self.request_id = v.into();
2998 self
2999 }
3000}
3001
3002impl wkt::message::Message for CreateFeatureRequest {
3003 fn typename() -> &'static str {
3004 "type.googleapis.com/google.cloud.gkehub.v1.CreateFeatureRequest"
3005 }
3006}
3007
3008#[derive(Clone, Default, PartialEq)]
3010#[non_exhaustive]
3011pub struct DeleteFeatureRequest {
3012 pub name: std::string::String,
3015
3016 pub force: bool,
3020
3021 pub request_id: std::string::String,
3035
3036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3037}
3038
3039impl DeleteFeatureRequest {
3040 pub fn new() -> Self {
3041 std::default::Default::default()
3042 }
3043
3044 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3046 self.name = v.into();
3047 self
3048 }
3049
3050 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3052 self.force = v.into();
3053 self
3054 }
3055
3056 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3058 self.request_id = v.into();
3059 self
3060 }
3061}
3062
3063impl wkt::message::Message for DeleteFeatureRequest {
3064 fn typename() -> &'static str {
3065 "type.googleapis.com/google.cloud.gkehub.v1.DeleteFeatureRequest"
3066 }
3067}
3068
3069#[derive(Clone, Default, PartialEq)]
3071#[non_exhaustive]
3072pub struct UpdateFeatureRequest {
3073 pub name: std::string::String,
3076
3077 pub update_mask: std::option::Option<wkt::FieldMask>,
3079
3080 pub resource: std::option::Option<crate::model::Feature>,
3089
3090 pub request_id: std::string::String,
3104
3105 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3106}
3107
3108impl UpdateFeatureRequest {
3109 pub fn new() -> Self {
3110 std::default::Default::default()
3111 }
3112
3113 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3115 self.name = v.into();
3116 self
3117 }
3118
3119 pub fn set_update_mask<T>(mut self, v: T) -> Self
3121 where
3122 T: std::convert::Into<wkt::FieldMask>,
3123 {
3124 self.update_mask = std::option::Option::Some(v.into());
3125 self
3126 }
3127
3128 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3130 where
3131 T: std::convert::Into<wkt::FieldMask>,
3132 {
3133 self.update_mask = v.map(|x| x.into());
3134 self
3135 }
3136
3137 pub fn set_resource<T>(mut self, v: T) -> Self
3139 where
3140 T: std::convert::Into<crate::model::Feature>,
3141 {
3142 self.resource = std::option::Option::Some(v.into());
3143 self
3144 }
3145
3146 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
3148 where
3149 T: std::convert::Into<crate::model::Feature>,
3150 {
3151 self.resource = v.map(|x| x.into());
3152 self
3153 }
3154
3155 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3157 self.request_id = v.into();
3158 self
3159 }
3160}
3161
3162impl wkt::message::Message for UpdateFeatureRequest {
3163 fn typename() -> &'static str {
3164 "type.googleapis.com/google.cloud.gkehub.v1.UpdateFeatureRequest"
3165 }
3166}
3167
3168#[derive(Clone, Default, PartialEq)]
3170#[non_exhaustive]
3171pub struct OperationMetadata {
3172 pub create_time: std::option::Option<wkt::Timestamp>,
3174
3175 pub end_time: std::option::Option<wkt::Timestamp>,
3177
3178 pub target: std::string::String,
3180
3181 pub verb: std::string::String,
3183
3184 pub status_detail: std::string::String,
3186
3187 pub cancel_requested: bool,
3195
3196 pub api_version: std::string::String,
3198
3199 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3200}
3201
3202impl OperationMetadata {
3203 pub fn new() -> Self {
3204 std::default::Default::default()
3205 }
3206
3207 pub fn set_create_time<T>(mut self, v: T) -> Self
3209 where
3210 T: std::convert::Into<wkt::Timestamp>,
3211 {
3212 self.create_time = std::option::Option::Some(v.into());
3213 self
3214 }
3215
3216 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3218 where
3219 T: std::convert::Into<wkt::Timestamp>,
3220 {
3221 self.create_time = v.map(|x| x.into());
3222 self
3223 }
3224
3225 pub fn set_end_time<T>(mut self, v: T) -> Self
3227 where
3228 T: std::convert::Into<wkt::Timestamp>,
3229 {
3230 self.end_time = std::option::Option::Some(v.into());
3231 self
3232 }
3233
3234 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3236 where
3237 T: std::convert::Into<wkt::Timestamp>,
3238 {
3239 self.end_time = v.map(|x| x.into());
3240 self
3241 }
3242
3243 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3245 self.target = v.into();
3246 self
3247 }
3248
3249 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3251 self.verb = v.into();
3252 self
3253 }
3254
3255 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3257 self.status_detail = v.into();
3258 self
3259 }
3260
3261 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3263 self.cancel_requested = v.into();
3264 self
3265 }
3266
3267 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3269 self.api_version = v.into();
3270 self
3271 }
3272}
3273
3274impl wkt::message::Message for OperationMetadata {
3275 fn typename() -> &'static str {
3276 "type.googleapis.com/google.cloud.gkehub.v1.OperationMetadata"
3277 }
3278}