google_cloud_gkehub_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![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/// Feature represents the settings and status of any Hub Feature.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct Feature {
45    /// Output only. The full, unique name of this Feature resource in the format
46    /// `projects/*/locations/*/features/*`.
47    pub name: std::string::String,
48
49    /// GCP labels for this Feature.
50    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
51
52    /// Output only. State of the Feature resource itself.
53    pub resource_state: std::option::Option<crate::model::FeatureResourceState>,
54
55    /// Optional. Hub-wide Feature configuration. If this Feature does not support any
56    /// Hub-wide configuration, this field may be unused.
57    pub spec: std::option::Option<crate::model::CommonFeatureSpec>,
58
59    /// Optional. Membership-specific configuration for this Feature. If this Feature does
60    /// not support any per-Membership configuration, this field may be unused.
61    ///
62    /// The keys indicate which Membership the configuration is for, in the form:
63    ///
64    /// ```norust
65    /// projects/{p}/locations/{l}/memberships/{m}
66    /// ```
67    ///
68    /// Where {p} is the project, {l} is a valid location and {m} is a valid
69    /// Membership in this project at that location. {p} WILL match the Feature's
70    /// project.
71    ///
72    /// {p} will always be returned as the project number, but the project ID is
73    /// also accepted during input. If the same Membership is specified in the map
74    /// twice (using the project ID form, and the project number form), exactly
75    /// ONE of the entries will be saved, with no guarantees as to which. For this
76    /// reason, it is recommended the same format be used for all entries when
77    /// mutating a Feature.
78    pub membership_specs:
79        std::collections::HashMap<std::string::String, crate::model::MembershipFeatureSpec>,
80
81    /// Output only. The Hub-wide Feature state.
82    pub state: std::option::Option<crate::model::CommonFeatureState>,
83
84    /// Output only. Membership-specific Feature status. If this Feature does
85    /// report any per-Membership status, this field may be unused.
86    ///
87    /// The keys indicate which Membership the state is for, in the form:
88    ///
89    /// ```norust
90    /// projects/{p}/locations/{l}/memberships/{m}
91    /// ```
92    ///
93    /// Where {p} is the project number, {l} is a valid location and {m} is a valid
94    /// Membership in this project at that location. {p} MUST match the Feature's
95    /// project number.
96    pub membership_states:
97        std::collections::HashMap<std::string::String, crate::model::MembershipFeatureState>,
98
99    /// Output only. When the Feature resource was created.
100    pub create_time: std::option::Option<wkt::Timestamp>,
101
102    /// Output only. When the Feature resource was last updated.
103    pub update_time: std::option::Option<wkt::Timestamp>,
104
105    /// Output only. When the Feature resource was deleted.
106    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    /// Sets the value of [name][crate::model::Feature::name].
117    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    /// Sets the value of [labels][crate::model::Feature::labels].
123    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    /// Sets the value of [resource_state][crate::model::Feature::resource_state].
135    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    /// Sets or clears the value of [resource_state][crate::model::Feature::resource_state].
144    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    /// Sets the value of [spec][crate::model::Feature::spec].
153    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    /// Sets or clears the value of [spec][crate::model::Feature::spec].
162    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    /// Sets the value of [membership_specs][crate::model::Feature::membership_specs].
171    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    /// Sets the value of [state][crate::model::Feature::state].
183    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    /// Sets or clears the value of [state][crate::model::Feature::state].
192    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    /// Sets the value of [membership_states][crate::model::Feature::membership_states].
201    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    /// Sets the value of [create_time][crate::model::Feature::create_time].
213    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    /// Sets or clears the value of [create_time][crate::model::Feature::create_time].
222    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    /// Sets the value of [update_time][crate::model::Feature::update_time].
231    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    /// Sets or clears the value of [update_time][crate::model::Feature::update_time].
240    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    /// Sets the value of [delete_time][crate::model::Feature::delete_time].
249    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    /// Sets or clears the value of [delete_time][crate::model::Feature::delete_time].
258    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/// FeatureResourceState describes the state of a Feature *resource* in the
274/// GkeHub API. See `FeatureState` for the "running state" of the Feature in the
275/// Hub and across Memberships.
276#[derive(Clone, Default, PartialEq)]
277#[non_exhaustive]
278pub struct FeatureResourceState {
279    /// The current state of the Feature resource in the Hub API.
280    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    /// Sets the value of [state][crate::model::FeatureResourceState::state].
291    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
306/// Defines additional types related to [FeatureResourceState].
307pub mod feature_resource_state {
308    #[allow(unused_imports)]
309    use super::*;
310
311    /// State describes the lifecycle status of a Feature.
312    ///
313    /// # Working with unknown values
314    ///
315    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
316    /// additional enum variants at any time. Adding new variants is not considered
317    /// a breaking change. Applications should write their code in anticipation of:
318    ///
319    /// - New values appearing in future releases of the client library, **and**
320    /// - New values received dynamically, without application changes.
321    ///
322    /// Please consult the [Working with enums] section in the user guide for some
323    /// guidelines.
324    ///
325    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
326    #[derive(Clone, Debug, PartialEq)]
327    #[non_exhaustive]
328    pub enum State {
329        /// State is unknown or not set.
330        Unspecified,
331        /// The Feature is being enabled, and the Feature resource is being created.
332        /// Once complete, the corresponding Feature will be enabled in this Hub.
333        Enabling,
334        /// The Feature is enabled in this Hub, and the Feature resource is fully
335        /// available.
336        Active,
337        /// The Feature is being disabled in this Hub, and the Feature resource
338        /// is being deleted.
339        Disabling,
340        /// The Feature resource is being updated.
341        Updating,
342        /// The Feature resource is being updated by the Hub Service.
343        ServiceUpdating,
344        /// If set, the enum was initialized with an unknown value.
345        ///
346        /// Applications can examine the value using [State::value] or
347        /// [State::name].
348        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        /// Gets the enum value.
361        ///
362        /// Returns `None` if the enum contains an unknown value deserialized from
363        /// the string representation of enums.
364        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        /// Gets the enum value as a string.
377        ///
378        /// Returns `None` if the enum contains an unknown value deserialized from
379        /// the integer representation of enums.
380        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/// FeatureState describes the high-level state of a Feature. It may be used to
469/// describe a Feature's state at the environ-level, or per-membershop, depending
470/// on the context.
471#[derive(Clone, Default, PartialEq)]
472#[non_exhaustive]
473pub struct FeatureState {
474    /// The high-level, machine-readable status of this Feature.
475    pub code: crate::model::feature_state::Code,
476
477    /// A human-readable description of the current status.
478    pub description: std::string::String,
479
480    /// The time this status and any related Feature-specific details were updated.
481    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    /// Sets the value of [code][crate::model::FeatureState::code].
492    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    /// Sets the value of [description][crate::model::FeatureState::description].
501    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    /// Sets the value of [update_time][crate::model::FeatureState::update_time].
507    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    /// Sets or clears the value of [update_time][crate::model::FeatureState::update_time].
516    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
531/// Defines additional types related to [FeatureState].
532pub mod feature_state {
533    #[allow(unused_imports)]
534    use super::*;
535
536    /// Code represents a machine-readable, high-level status of the Feature.
537    ///
538    /// # Working with unknown values
539    ///
540    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
541    /// additional enum variants at any time. Adding new variants is not considered
542    /// a breaking change. Applications should write their code in anticipation of:
543    ///
544    /// - New values appearing in future releases of the client library, **and**
545    /// - New values received dynamically, without application changes.
546    ///
547    /// Please consult the [Working with enums] section in the user guide for some
548    /// guidelines.
549    ///
550    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
551    #[derive(Clone, Debug, PartialEq)]
552    #[non_exhaustive]
553    pub enum Code {
554        /// Unknown or not set.
555        Unspecified,
556        /// The Feature is operating normally.
557        Ok,
558        /// The Feature has encountered an issue, and is operating in a degraded
559        /// state. The Feature may need intervention to return to normal operation.
560        /// See the description and any associated Feature-specific details for more
561        /// information.
562        Warning,
563        /// The Feature is not operating or is in a severely degraded state.
564        /// The Feature may need intervention to return to normal operation.
565        /// See the description and any associated Feature-specific details for more
566        /// information.
567        Error,
568        /// If set, the enum was initialized with an unknown value.
569        ///
570        /// Applications can examine the value using [Code::value] or
571        /// [Code::name].
572        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        /// Gets the enum value.
585        ///
586        /// Returns `None` if the enum contains an unknown value deserialized from
587        /// the string representation of enums.
588        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        /// Gets the enum value as a string.
599        ///
600        /// Returns `None` if the enum contains an unknown value deserialized from
601        /// the integer representation of enums.
602        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/// CommonFeatureSpec contains Hub-wide configuration information
683#[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    /// Sets the value of [feature_spec][crate::model::CommonFeatureSpec::feature_spec].
697    ///
698    /// Note that all the setters affecting `feature_spec` are mutually
699    /// exclusive.
700    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    /// The value of [feature_spec][crate::model::CommonFeatureSpec::feature_spec]
711    /// if it holds a `Multiclusteringress`, `None` if the field is not set or
712    /// holds a different branch.
713    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    /// Sets the value of [feature_spec][crate::model::CommonFeatureSpec::feature_spec]
727    /// to hold a `Multiclusteringress`.
728    ///
729    /// Note that all the setters affecting `feature_spec` are
730    /// mutually exclusive.
731    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
750/// Defines additional types related to [CommonFeatureSpec].
751pub 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        /// Multicluster Ingress-specific spec.
759        Multiclusteringress(std::boxed::Box<gkehub_multiclusteringress_v1::model::FeatureSpec>),
760    }
761}
762
763/// CommonFeatureState contains Hub-wide Feature status information.
764#[derive(Clone, Default, PartialEq)]
765#[non_exhaustive]
766pub struct CommonFeatureState {
767    /// Output only. The "running state" of the Feature in this Hub.
768    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    /// Sets the value of [state][crate::model::CommonFeatureState::state].
779    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    /// Sets or clears the value of [state][crate::model::CommonFeatureState::state].
788    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/// MembershipFeatureSpec contains configuration information for a single
804/// Membership.
805#[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    /// Sets the value of [feature_spec][crate::model::MembershipFeatureSpec::feature_spec].
819    ///
820    /// Note that all the setters affecting `feature_spec` are mutually
821    /// exclusive.
822    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    /// The value of [feature_spec][crate::model::MembershipFeatureSpec::feature_spec]
833    /// if it holds a `Configmanagement`, `None` if the field is not set or
834    /// holds a different branch.
835    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    /// Sets the value of [feature_spec][crate::model::MembershipFeatureSpec::feature_spec]
849    /// to hold a `Configmanagement`.
850    ///
851    /// Note that all the setters affecting `feature_spec` are
852    /// mutually exclusive.
853    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
872/// Defines additional types related to [MembershipFeatureSpec].
873pub 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        /// Config Management-specific spec.
881        Configmanagement(std::boxed::Box<gkehub_configmanagement_v1::model::MembershipSpec>),
882    }
883}
884
885/// MembershipFeatureState contains Feature status information for a single
886/// Membership.
887#[derive(Clone, Default, PartialEq)]
888#[non_exhaustive]
889pub struct MembershipFeatureState {
890    /// The high-level state of this Feature for a single membership.
891    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    /// Sets the value of [state][crate::model::MembershipFeatureState::state].
904    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    /// Sets or clears the value of [state][crate::model::MembershipFeatureState::state].
913    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    /// Sets the value of [feature_state][crate::model::MembershipFeatureState::feature_state].
922    ///
923    /// Note that all the setters affecting `feature_state` are mutually
924    /// exclusive.
925    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    /// The value of [feature_state][crate::model::MembershipFeatureState::feature_state]
938    /// if it holds a `Configmanagement`, `None` if the field is not set or
939    /// holds a different branch.
940    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    /// Sets the value of [feature_state][crate::model::MembershipFeatureState::feature_state]
954    /// to hold a `Configmanagement`.
955    ///
956    /// Note that all the setters affecting `feature_state` are
957    /// mutually exclusive.
958    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
977/// Defines additional types related to [MembershipFeatureState].
978pub 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        /// Config Management-specific state.
986        Configmanagement(std::boxed::Box<gkehub_configmanagement_v1::model::MembershipState>),
987    }
988}
989
990/// Membership contains information about a member cluster.
991#[derive(Clone, Default, PartialEq)]
992#[non_exhaustive]
993pub struct Membership {
994    /// Output only. The full, unique name of this Membership resource in the
995    /// format `projects/*/locations/*/memberships/{membership_id}`, set during
996    /// creation.
997    ///
998    /// `membership_id` must be a valid RFC 1123 compliant DNS label:
999    ///
1000    /// 1. At most 63 characters in length
1001    /// 1. It must consist of lower case alphanumeric characters or `-`
1002    /// 1. It must start and end with an alphanumeric character
1003    ///
1004    /// Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
1005    /// with a maximum length of 63 characters.
1006    pub name: std::string::String,
1007
1008    /// Optional. Labels for this membership.
1009    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1010
1011    /// Output only. Description of this membership, limited to 63 characters.
1012    /// Must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.\ ]*`
1013    ///
1014    /// This field is present for legacy purposes.
1015    pub description: std::string::String,
1016
1017    /// Output only. State of the Membership resource.
1018    pub state: std::option::Option<crate::model::MembershipState>,
1019
1020    /// Output only. When the Membership was created.
1021    pub create_time: std::option::Option<wkt::Timestamp>,
1022
1023    /// Output only. When the Membership was last updated.
1024    pub update_time: std::option::Option<wkt::Timestamp>,
1025
1026    /// Output only. When the Membership was deleted.
1027    pub delete_time: std::option::Option<wkt::Timestamp>,
1028
1029    /// Optional. An externally-generated and managed ID for this Membership. This
1030    /// ID may be modified after creation, but this is not recommended.
1031    ///
1032    /// The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
1033    ///
1034    /// If this Membership represents a Kubernetes cluster, this value should be
1035    /// set to the UID of the `kube-system` namespace object.
1036    pub external_id: std::string::String,
1037
1038    /// Output only. For clusters using Connect, the timestamp of the most recent
1039    /// connection established with Google Cloud. This time is updated every
1040    /// several minutes, not continuously. For clusters that do not use GKE
1041    /// Connect, or that have never connected successfully, this field will be
1042    /// unset.
1043    pub last_connection_time: std::option::Option<wkt::Timestamp>,
1044
1045    /// Output only. Google-generated UUID for this resource. This is unique across
1046    /// all Membership resources. If a Membership resource is deleted and another
1047    /// resource with the same name is created, it gets a different unique_id.
1048    pub unique_id: std::string::String,
1049
1050    /// Optional. How to identify workloads from this Membership.
1051    /// See the documentation on Workload Identity for more details:
1052    /// <https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity>
1053    pub authority: std::option::Option<crate::model::Authority>,
1054
1055    /// Optional. The monitoring config information for this membership.
1056    pub monitoring_config: std::option::Option<crate::model::MonitoringConfig>,
1057
1058    /// Type of resource represented by this Membership
1059    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    /// Sets the value of [name][crate::model::Membership::name].
1070    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    /// Sets the value of [labels][crate::model::Membership::labels].
1076    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    /// Sets the value of [description][crate::model::Membership::description].
1088    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    /// Sets the value of [state][crate::model::Membership::state].
1094    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    /// Sets or clears the value of [state][crate::model::Membership::state].
1103    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    /// Sets the value of [create_time][crate::model::Membership::create_time].
1112    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    /// Sets or clears the value of [create_time][crate::model::Membership::create_time].
1121    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    /// Sets the value of [update_time][crate::model::Membership::update_time].
1130    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    /// Sets or clears the value of [update_time][crate::model::Membership::update_time].
1139    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    /// Sets the value of [delete_time][crate::model::Membership::delete_time].
1148    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    /// Sets or clears the value of [delete_time][crate::model::Membership::delete_time].
1157    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    /// Sets the value of [external_id][crate::model::Membership::external_id].
1166    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    /// Sets the value of [last_connection_time][crate::model::Membership::last_connection_time].
1172    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    /// Sets or clears the value of [last_connection_time][crate::model::Membership::last_connection_time].
1181    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    /// Sets the value of [unique_id][crate::model::Membership::unique_id].
1190    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    /// Sets the value of [authority][crate::model::Membership::authority].
1196    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    /// Sets or clears the value of [authority][crate::model::Membership::authority].
1205    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    /// Sets the value of [monitoring_config][crate::model::Membership::monitoring_config].
1214    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    /// Sets or clears the value of [monitoring_config][crate::model::Membership::monitoring_config].
1223    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    /// Sets the value of [r#type][crate::model::Membership::type].
1232    ///
1233    /// Note that all the setters affecting `r#type` are mutually
1234    /// exclusive.
1235    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    /// The value of [r#type][crate::model::Membership::r#type]
1244    /// if it holds a `Endpoint`, `None` if the field is not set or
1245    /// holds a different branch.
1246    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    /// Sets the value of [r#type][crate::model::Membership::r#type]
1257    /// to hold a `Endpoint`.
1258    ///
1259    /// Note that all the setters affecting `r#type` are
1260    /// mutually exclusive.
1261    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
1278/// Defines additional types related to [Membership].
1279pub mod membership {
1280    #[allow(unused_imports)]
1281    use super::*;
1282
1283    /// Type of resource represented by this Membership
1284    #[derive(Clone, Debug, PartialEq)]
1285    #[non_exhaustive]
1286    pub enum Type {
1287        /// Optional. Endpoint information to reach this member.
1288        Endpoint(std::boxed::Box<crate::model::MembershipEndpoint>),
1289    }
1290}
1291
1292/// MembershipEndpoint contains information needed to contact a Kubernetes API,
1293/// endpoint and any additional Kubernetes metadata.
1294#[derive(Clone, Default, PartialEq)]
1295#[non_exhaustive]
1296pub struct MembershipEndpoint {
1297    /// Optional. GKE-specific information. Only present if this Membership is a GKE cluster.
1298    pub gke_cluster: std::option::Option<crate::model::GkeCluster>,
1299
1300    /// Output only. Useful Kubernetes-specific metadata.
1301    pub kubernetes_metadata: std::option::Option<crate::model::KubernetesMetadata>,
1302
1303    /// Optional. The in-cluster Kubernetes Resources that should be applied for a
1304    /// correctly registered cluster, in the steady state. These resources:
1305    ///
1306    /// * Ensure that the cluster is exclusively registered to one and only one
1307    ///   Hub Membership.
1308    /// * Propagate Workload Pool Information available in the Membership
1309    ///   Authority field.
1310    /// * Ensure proper initial configuration of default Hub Features.
1311    pub kubernetes_resource: std::option::Option<crate::model::KubernetesResource>,
1312
1313    /// Output only. Whether the lifecycle of this membership is managed by a
1314    /// google cluster platform service.
1315    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    /// Sets the value of [gke_cluster][crate::model::MembershipEndpoint::gke_cluster].
1326    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    /// Sets or clears the value of [gke_cluster][crate::model::MembershipEndpoint::gke_cluster].
1335    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    /// Sets the value of [kubernetes_metadata][crate::model::MembershipEndpoint::kubernetes_metadata].
1344    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    /// Sets or clears the value of [kubernetes_metadata][crate::model::MembershipEndpoint::kubernetes_metadata].
1353    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    /// Sets the value of [kubernetes_resource][crate::model::MembershipEndpoint::kubernetes_resource].
1362    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    /// Sets or clears the value of [kubernetes_resource][crate::model::MembershipEndpoint::kubernetes_resource].
1371    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    /// Sets the value of [google_managed][crate::model::MembershipEndpoint::google_managed].
1380    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/// KubernetesResource contains the YAML manifests and configuration for
1393/// Membership Kubernetes resources in the cluster. After CreateMembership or
1394/// UpdateMembership, these resources should be re-applied in the cluster.
1395#[derive(Clone, Default, PartialEq)]
1396#[non_exhaustive]
1397pub struct KubernetesResource {
1398    /// Input only. The YAML representation of the Membership CR. This field is
1399    /// ignored for GKE clusters where Hub can read the CR directly.
1400    ///
1401    /// Callers should provide the CR that is currently present in the cluster
1402    /// during CreateMembership or UpdateMembership, or leave this field empty if
1403    /// none exists. The CR manifest is used to validate the cluster has not been
1404    /// registered with another Membership.
1405    pub membership_cr_manifest: std::string::String,
1406
1407    /// Output only. Additional Kubernetes resources that need to be applied to the
1408    /// cluster after Membership creation, and after every update.
1409    ///
1410    /// This field is only populated in the Membership returned from a successful
1411    /// long-running operation from CreateMembership or UpdateMembership. It is not
1412    /// populated during normal GetMembership or ListMemberships requests. To get
1413    /// the resource manifest after the initial registration, the caller should
1414    /// make a UpdateMembership call with an empty field mask.
1415    pub membership_resources: std::vec::Vec<crate::model::ResourceManifest>,
1416
1417    /// Output only. The Kubernetes resources for installing the GKE Connect agent
1418    ///
1419    /// This field is only populated in the Membership returned from a successful
1420    /// long-running operation from CreateMembership or UpdateMembership. It is not
1421    /// populated during normal GetMembership or ListMemberships requests. To get
1422    /// the resource manifest after the initial registration, the caller should
1423    /// make a UpdateMembership call with an empty field mask.
1424    pub connect_resources: std::vec::Vec<crate::model::ResourceManifest>,
1425
1426    /// Optional. Options for Kubernetes resource generation.
1427    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    /// Sets the value of [membership_cr_manifest][crate::model::KubernetesResource::membership_cr_manifest].
1438    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    /// Sets the value of [membership_resources][crate::model::KubernetesResource::membership_resources].
1447    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    /// Sets the value of [connect_resources][crate::model::KubernetesResource::connect_resources].
1458    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    /// Sets the value of [resource_options][crate::model::KubernetesResource::resource_options].
1469    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    /// Sets or clears the value of [resource_options][crate::model::KubernetesResource::resource_options].
1478    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/// ResourceOptions represent options for Kubernetes resource generation.
1494#[derive(Clone, Default, PartialEq)]
1495#[non_exhaustive]
1496pub struct ResourceOptions {
1497    /// Optional. The Connect agent version to use for connect_resources. Defaults
1498    /// to the latest GKE Connect version. The version must be a currently
1499    /// supported version, obsolete versions will be rejected.
1500    pub connect_version: std::string::String,
1501
1502    /// Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
1503    /// CustomResourceDefinition resources.
1504    /// This option should be set for clusters with Kubernetes apiserver versions
1505    /// <1.16.
1506    pub v1beta1_crd: bool,
1507
1508    /// Optional. Major and minor version of the Kubernetes cluster. This is only
1509    /// used to determine which version to use for the CustomResourceDefinition
1510    /// resources, `apiextensions/v1beta1` or`apiextensions/v1`.
1511    pub k8s_version: std::string::String,
1512
1513    /// Optional. Git version of the Kubernetes cluster. This is only used to gate
1514    /// the Connect Agent migration to svc.id.goog on GDC-SO 1.33.100 patch and
1515    /// above.
1516    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    /// Sets the value of [connect_version][crate::model::ResourceOptions::connect_version].
1527    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    /// Sets the value of [v1beta1_crd][crate::model::ResourceOptions::v1beta1_crd].
1533    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    /// Sets the value of [k8s_version][crate::model::ResourceOptions::k8s_version].
1539    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    /// Sets the value of [k8s_git_version][crate::model::ResourceOptions::k8s_git_version].
1545    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/// ResourceManifest represents a single Kubernetes resource to be applied to
1558/// the cluster.
1559#[derive(Clone, Default, PartialEq)]
1560#[non_exhaustive]
1561pub struct ResourceManifest {
1562    /// YAML manifest of the resource.
1563    pub manifest: std::string::String,
1564
1565    /// Whether the resource provided in the manifest is `cluster_scoped`.
1566    /// If unset, the manifest is assumed to be namespace scoped.
1567    ///
1568    /// This field is used for REST mapping when applying the resource in a
1569    /// cluster.
1570    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    /// Sets the value of [manifest][crate::model::ResourceManifest::manifest].
1581    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    /// Sets the value of [cluster_scoped][crate::model::ResourceManifest::cluster_scoped].
1587    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/// GkeCluster contains information specific to GKE clusters.
1600#[derive(Clone, Default, PartialEq)]
1601#[non_exhaustive]
1602pub struct GkeCluster {
1603    /// Immutable. Self-link of the Google Cloud resource for the GKE cluster. For
1604    /// example:
1605    ///
1606    /// //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
1607    ///
1608    /// Zonal clusters are also supported.
1609    pub resource_link: std::string::String,
1610
1611    /// Output only. If cluster_missing is set then it denotes that the GKE cluster
1612    /// no longer exists in the GKE Control Plane.
1613    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    /// Sets the value of [resource_link][crate::model::GkeCluster::resource_link].
1624    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    /// Sets the value of [cluster_missing][crate::model::GkeCluster::cluster_missing].
1630    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/// KubernetesMetadata provides informational metadata for Memberships
1643/// representing Kubernetes clusters.
1644#[derive(Clone, Default, PartialEq)]
1645#[non_exhaustive]
1646pub struct KubernetesMetadata {
1647    /// Output only. Kubernetes API server version string as reported by
1648    /// `/version`.
1649    pub kubernetes_api_server_version: std::string::String,
1650
1651    /// Output only. Node providerID as reported by the first node in the list of
1652    /// nodes on the Kubernetes endpoint. On Kubernetes platforms that support
1653    /// zero-node clusters (like GKE-on-GCP), the node_count will be zero and the
1654    /// node_provider_id will be empty.
1655    pub node_provider_id: std::string::String,
1656
1657    /// Output only. Node count as reported by Kubernetes nodes resources.
1658    pub node_count: i32,
1659
1660    /// Output only. vCPU count as reported by Kubernetes nodes resources.
1661    pub vcpu_count: i32,
1662
1663    /// Output only. The total memory capacity as reported by the sum of all
1664    /// Kubernetes nodes resources, defined in MB.
1665    pub memory_mb: i32,
1666
1667    /// Output only. The time at which these details were last updated. This
1668    /// update_time is different from the Membership-level update_time since
1669    /// EndpointDetails are updated internally for API consumers.
1670    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    /// Sets the value of [kubernetes_api_server_version][crate::model::KubernetesMetadata::kubernetes_api_server_version].
1681    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    /// Sets the value of [node_provider_id][crate::model::KubernetesMetadata::node_provider_id].
1690    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    /// Sets the value of [node_count][crate::model::KubernetesMetadata::node_count].
1699    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    /// Sets the value of [vcpu_count][crate::model::KubernetesMetadata::vcpu_count].
1705    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    /// Sets the value of [memory_mb][crate::model::KubernetesMetadata::memory_mb].
1711    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    /// Sets the value of [update_time][crate::model::KubernetesMetadata::update_time].
1717    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    /// Sets or clears the value of [update_time][crate::model::KubernetesMetadata::update_time].
1726    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/// This field informs Fleet-based applications/services/UIs with the necessary
1742/// information for where each underlying Cluster reports its metrics.
1743#[derive(Clone, Default, PartialEq)]
1744#[non_exhaustive]
1745pub struct MonitoringConfig {
1746    /// Immutable. Project used to report Metrics
1747    pub project_id: std::string::String,
1748
1749    /// Immutable. Location used to report Metrics
1750    pub location: std::string::String,
1751
1752    /// Immutable. Cluster name used to report metrics.
1753    /// For Anthos on VMWare/Baremetal, it would be in format
1754    /// `memberClusters/cluster_name`; And for Anthos on MultiCloud, it would be in
1755    /// format
1756    /// `{azureClusters, awsClusters}/cluster_name`.
1757    pub cluster: std::string::String,
1758
1759    /// Kubernetes system metrics, if available, are written to this prefix.
1760    /// This defaults to kubernetes.io for GKE, and kubernetes.io/anthos for Anthos
1761    /// eventually. Noted: Anthos MultiCloud will have kubernetes.io prefix today
1762    /// but will migration to be under kubernetes.io/anthos
1763    pub kubernetes_metrics_prefix: std::string::String,
1764
1765    /// Immutable. Cluster hash, this is a unique string generated by google code,
1766    /// which does not contain any PII, which we can use to reference the cluster.
1767    /// This is expected to be created by the monitoring stack and persisted into
1768    /// the Cluster object as well as to GKE-Hub.
1769    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    /// Sets the value of [project_id][crate::model::MonitoringConfig::project_id].
1780    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    /// Sets the value of [location][crate::model::MonitoringConfig::location].
1786    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    /// Sets the value of [cluster][crate::model::MonitoringConfig::cluster].
1792    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    /// Sets the value of [kubernetes_metrics_prefix][crate::model::MonitoringConfig::kubernetes_metrics_prefix].
1798    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    /// Sets the value of [cluster_hash][crate::model::MonitoringConfig::cluster_hash].
1807    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/// MembershipState describes the state of a Membership resource.
1820#[derive(Clone, Default, PartialEq)]
1821#[non_exhaustive]
1822pub struct MembershipState {
1823    /// Output only. The current state of the Membership resource.
1824    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    /// Sets the value of [code][crate::model::MembershipState::code].
1835    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
1850/// Defines additional types related to [MembershipState].
1851pub mod membership_state {
1852    #[allow(unused_imports)]
1853    use super::*;
1854
1855    /// Code describes the state of a Membership resource.
1856    ///
1857    /// # Working with unknown values
1858    ///
1859    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1860    /// additional enum variants at any time. Adding new variants is not considered
1861    /// a breaking change. Applications should write their code in anticipation of:
1862    ///
1863    /// - New values appearing in future releases of the client library, **and**
1864    /// - New values received dynamically, without application changes.
1865    ///
1866    /// Please consult the [Working with enums] section in the user guide for some
1867    /// guidelines.
1868    ///
1869    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1870    #[derive(Clone, Debug, PartialEq)]
1871    #[non_exhaustive]
1872    pub enum Code {
1873        /// The code is not set.
1874        Unspecified,
1875        /// The cluster is being registered.
1876        Creating,
1877        /// The cluster is registered.
1878        Ready,
1879        /// The cluster is being unregistered.
1880        Deleting,
1881        /// The Membership is being updated.
1882        Updating,
1883        /// The Membership is being updated by the Hub Service.
1884        ServiceUpdating,
1885        /// If set, the enum was initialized with an unknown value.
1886        ///
1887        /// Applications can examine the value using [Code::value] or
1888        /// [Code::name].
1889        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        /// Gets the enum value.
1902        ///
1903        /// Returns `None` if the enum contains an unknown value deserialized from
1904        /// the string representation of enums.
1905        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        /// Gets the enum value as a string.
1918        ///
1919        /// Returns `None` if the enum contains an unknown value deserialized from
1920        /// the integer representation of enums.
1921        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/// Authority encodes how Google will recognize identities from this Membership.
2010/// See the workload identity documentation for more details:
2011/// <https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity>
2012#[derive(Clone, Default, PartialEq)]
2013#[non_exhaustive]
2014pub struct Authority {
2015    /// Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with
2016    /// `https://` and be a valid URL with length <2000 characters.
2017    ///
2018    /// If set, then Google will allow valid OIDC tokens from this issuer to
2019    /// authenticate within the workload_identity_pool. OIDC discovery will be
2020    /// performed on this URI to validate tokens from the issuer.
2021    ///
2022    /// Clearing `issuer` disables Workload Identity. `issuer` cannot be directly
2023    /// modified; it must be cleared (and Workload Identity disabled) before using
2024    /// a new issuer (and re-enabling Workload Identity).
2025    pub issuer: std::string::String,
2026
2027    /// Output only. The name of the workload identity pool in which `issuer` will
2028    /// be recognized.
2029    ///
2030    /// There is a single Workload Identity Pool per Hub that is shared
2031    /// between all Memberships that belong to that Hub. For a Hub hosted in
2032    /// {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
2033    /// although this is subject to change in newer versions of this API.
2034    pub workload_identity_pool: std::string::String,
2035
2036    /// Output only. An identity provider that reflects the `issuer` in the
2037    /// workload identity pool.
2038    pub identity_provider: std::string::String,
2039
2040    /// Optional. OIDC verification keys for this Membership in JWKS format (RFC
2041    /// 7517).
2042    ///
2043    /// When this field is set, OIDC discovery will NOT be performed on `issuer`,
2044    /// and instead OIDC tokens will be validated using this field.
2045    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    /// Sets the value of [issuer][crate::model::Authority::issuer].
2056    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    /// Sets the value of [workload_identity_pool][crate::model::Authority::workload_identity_pool].
2062    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    /// Sets the value of [identity_provider][crate::model::Authority::identity_provider].
2071    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    /// Sets the value of [oidc_jwks][crate::model::Authority::oidc_jwks].
2080    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/// Request message for `GkeHub.ListMemberships` method.
2093#[derive(Clone, Default, PartialEq)]
2094#[non_exhaustive]
2095pub struct ListMembershipsRequest {
2096    /// Required. The parent (project and location) where the Memberships will be
2097    /// listed. Specified in the format `projects/*/locations/*`.
2098    /// `projects/*/locations/-` list memberships in all the regions.
2099    pub parent: std::string::String,
2100
2101    /// Optional. When requesting a 'page' of resources, `page_size` specifies
2102    /// number of resources to return. If unspecified or set to 0, all resources
2103    /// will be returned.
2104    pub page_size: i32,
2105
2106    /// Optional. Token returned by previous call to `ListMemberships` which
2107    /// specifies the position in the list from where to continue listing the
2108    /// resources.
2109    pub page_token: std::string::String,
2110
2111    /// Optional. Lists Memberships that match the filter expression, following the
2112    /// syntax outlined in <https://google.aip.dev/160>.
2113    ///
2114    /// Examples:
2115    ///
2116    /// - Name is `bar` in project `foo-proj` and location `global`:
2117    ///
2118    ///   name = "projects/foo-proj/locations/global/membership/bar"
2119    ///
2120    /// - Memberships that have a label called `foo`:
2121    ///
2122    ///   labels.foo:*
2123    ///
2124    /// - Memberships that have a label called `foo` whose value is `bar`:
2125    ///
2126    ///   labels.foo = bar
2127    ///
2128    /// - Memberships in the CREATING state:
2129    ///
2130    ///   state = CREATING
2131    ///
2132    pub filter: std::string::String,
2133
2134    /// Optional. One or more fields to compare and use to sort the output.
2135    /// See <https://google.aip.dev/132#ordering>.
2136    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    /// Sets the value of [parent][crate::model::ListMembershipsRequest::parent].
2147    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    /// Sets the value of [page_size][crate::model::ListMembershipsRequest::page_size].
2153    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    /// Sets the value of [page_token][crate::model::ListMembershipsRequest::page_token].
2159    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    /// Sets the value of [filter][crate::model::ListMembershipsRequest::filter].
2165    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    /// Sets the value of [order_by][crate::model::ListMembershipsRequest::order_by].
2171    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/// Response message for the `GkeHub.ListMemberships` method.
2184#[derive(Clone, Default, PartialEq)]
2185#[non_exhaustive]
2186pub struct ListMembershipsResponse {
2187    /// The list of matching Memberships.
2188    pub resources: std::vec::Vec<crate::model::Membership>,
2189
2190    /// A token to request the next page of resources from the
2191    /// `ListMemberships` method. The value of an empty string means that
2192    /// there are no more resources to return.
2193    pub next_page_token: std::string::String,
2194
2195    /// List of locations that could not be reached while fetching this list.
2196    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    /// Sets the value of [resources][crate::model::ListMembershipsResponse::resources].
2207    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    /// Sets the value of [next_page_token][crate::model::ListMembershipsResponse::next_page_token].
2218    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    /// Sets the value of [unreachable][crate::model::ListMembershipsResponse::unreachable].
2224    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/// Request message for `GkeHub.GetMembership` method.
2256#[derive(Clone, Default, PartialEq)]
2257#[non_exhaustive]
2258pub struct GetMembershipRequest {
2259    /// Required. The Membership resource name in the format
2260    /// `projects/*/locations/*/memberships/*`.
2261    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    /// Sets the value of [name][crate::model::GetMembershipRequest::name].
2272    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/// Request message for the `GkeHub.CreateMembership` method.
2285#[derive(Clone, Default, PartialEq)]
2286#[non_exhaustive]
2287pub struct CreateMembershipRequest {
2288    /// Required. The parent (project and location) where the Memberships will be
2289    /// created. Specified in the format `projects/*/locations/*`.
2290    pub parent: std::string::String,
2291
2292    /// Required. Client chosen ID for the membership. `membership_id` must be a
2293    /// valid RFC 1123 compliant DNS label:
2294    ///
2295    /// 1. At most 63 characters in length
2296    /// 1. It must consist of lower case alphanumeric characters or `-`
2297    /// 1. It must start and end with an alphanumeric character
2298    ///
2299    /// Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
2300    /// with a maximum length of 63 characters.
2301    pub membership_id: std::string::String,
2302
2303    /// Required. The membership to create.
2304    pub resource: std::option::Option<crate::model::Membership>,
2305
2306    /// Optional. A request ID to identify requests. Specify a unique request ID
2307    /// so that if you must retry your request, the server will know to ignore
2308    /// the request if it has already been completed. The server will guarantee
2309    /// that for at least 60 minutes after the first request.
2310    ///
2311    /// For example, consider a situation where you make an initial request and
2312    /// the request times out. If you make the request again with the same request
2313    /// ID, the server can check if original operation with the same request ID
2314    /// was received, and if so, will ignore the second request. This prevents
2315    /// clients from accidentally creating duplicate commitments.
2316    ///
2317    /// The request ID must be a valid UUID with the exception that zero UUID is
2318    /// not supported (00000000-0000-0000-0000-000000000000).
2319    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    /// Sets the value of [parent][crate::model::CreateMembershipRequest::parent].
2330    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    /// Sets the value of [membership_id][crate::model::CreateMembershipRequest::membership_id].
2336    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    /// Sets the value of [resource][crate::model::CreateMembershipRequest::resource].
2342    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    /// Sets or clears the value of [resource][crate::model::CreateMembershipRequest::resource].
2351    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    /// Sets the value of [request_id][crate::model::CreateMembershipRequest::request_id].
2360    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/// Request message for `GkeHub.DeleteMembership` method.
2373#[derive(Clone, Default, PartialEq)]
2374#[non_exhaustive]
2375pub struct DeleteMembershipRequest {
2376    /// Required. The Membership resource name in the format
2377    /// `projects/*/locations/*/memberships/*`.
2378    pub name: std::string::String,
2379
2380    /// Optional. A request ID to identify requests. Specify a unique request ID
2381    /// so that if you must retry your request, the server will know to ignore
2382    /// the request if it has already been completed. The server will guarantee
2383    /// that for at least 60 minutes after the first request.
2384    ///
2385    /// For example, consider a situation where you make an initial request and
2386    /// the request times out. If you make the request again with the same request
2387    /// ID, the server can check if original operation with the same request ID
2388    /// was received, and if so, will ignore the second request. This prevents
2389    /// clients from accidentally creating duplicate commitments.
2390    ///
2391    /// The request ID must be a valid UUID with the exception that zero UUID is
2392    /// not supported (00000000-0000-0000-0000-000000000000).
2393    pub request_id: std::string::String,
2394
2395    /// Optional. If set to true, any subresource from this Membership will also be
2396    /// deleted. Otherwise, the request will only work if the Membership has no
2397    /// subresource.
2398    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    /// Sets the value of [name][crate::model::DeleteMembershipRequest::name].
2409    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    /// Sets the value of [request_id][crate::model::DeleteMembershipRequest::request_id].
2415    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    /// Sets the value of [force][crate::model::DeleteMembershipRequest::force].
2421    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/// Request message for `GkeHub.UpdateMembership` method.
2434#[derive(Clone, Default, PartialEq)]
2435#[non_exhaustive]
2436pub struct UpdateMembershipRequest {
2437    /// Required. The Membership resource name in the format
2438    /// `projects/*/locations/*/memberships/*`.
2439    pub name: std::string::String,
2440
2441    /// Required. Mask of fields to update.
2442    pub update_mask: std::option::Option<wkt::FieldMask>,
2443
2444    /// Required. Only fields specified in update_mask are updated.
2445    /// If you specify a field in the update_mask but don't specify its value here
2446    /// that field will be deleted.
2447    /// If you are updating a map field, set the value of a key to null or empty
2448    /// string to delete the key from the map. It's not possible to update a key's
2449    /// value to the empty string.
2450    /// If you specify the update_mask to be a special path "*", fully replaces all
2451    /// user-modifiable fields to match `resource`.
2452    pub resource: std::option::Option<crate::model::Membership>,
2453
2454    /// Optional. A request ID to identify requests. Specify a unique request ID
2455    /// so that if you must retry your request, the server will know to ignore
2456    /// the request if it has already been completed. The server will guarantee
2457    /// that for at least 60 minutes after the first request.
2458    ///
2459    /// For example, consider a situation where you make an initial request and
2460    /// the request times out. If you make the request again with the same request
2461    /// ID, the server can check if original operation with the same request ID
2462    /// was received, and if so, will ignore the second request. This prevents
2463    /// clients from accidentally creating duplicate commitments.
2464    ///
2465    /// The request ID must be a valid UUID with the exception that zero UUID is
2466    /// not supported (00000000-0000-0000-0000-000000000000).
2467    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    /// Sets the value of [name][crate::model::UpdateMembershipRequest::name].
2478    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    /// Sets the value of [update_mask][crate::model::UpdateMembershipRequest::update_mask].
2484    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    /// Sets or clears the value of [update_mask][crate::model::UpdateMembershipRequest::update_mask].
2493    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    /// Sets the value of [resource][crate::model::UpdateMembershipRequest::resource].
2502    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    /// Sets or clears the value of [resource][crate::model::UpdateMembershipRequest::resource].
2511    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    /// Sets the value of [request_id][crate::model::UpdateMembershipRequest::request_id].
2520    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/// Request message for `GkeHub.GenerateConnectManifest`
2533/// method.
2534/// .
2535#[derive(Clone, Default, PartialEq)]
2536#[non_exhaustive]
2537pub struct GenerateConnectManifestRequest {
2538    /// Required. The Membership resource name the Agent will associate with, in
2539    /// the format `projects/*/locations/*/memberships/*`.
2540    pub name: std::string::String,
2541
2542    /// Optional. Namespace for GKE Connect agent resources. Defaults to
2543    /// `gke-connect`.
2544    ///
2545    /// The Connect Agent is authorized automatically when run in the default
2546    /// namespace. Otherwise, explicit authorization must be granted with an
2547    /// additional IAM binding.
2548    pub namespace: std::string::String,
2549
2550    /// Optional. URI of a proxy if connectivity from the agent to
2551    /// gkeconnect.googleapis.com requires the use of a proxy. Format must be in
2552    /// the form `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
2553    /// supported by the proxy. This will direct the connect agent's outbound
2554    /// traffic through a HTTP(S) proxy.
2555    pub proxy: ::bytes::Bytes,
2556
2557    /// Optional. The Connect agent version to use. Defaults to the most current
2558    /// version.
2559    pub version: std::string::String,
2560
2561    /// Optional. If true, generate the resources for upgrade only. Some resources
2562    /// generated only for installation (e.g. secrets) will be excluded.
2563    pub is_upgrade: bool,
2564
2565    /// Optional. The registry to fetch the connect agent image from. Defaults to
2566    /// gcr.io/gkeconnect.
2567    pub registry: std::string::String,
2568
2569    /// Optional. The image pull secret content for the registry, if not public.
2570    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    /// Sets the value of [name][crate::model::GenerateConnectManifestRequest::name].
2581    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    /// Sets the value of [namespace][crate::model::GenerateConnectManifestRequest::namespace].
2587    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    /// Sets the value of [proxy][crate::model::GenerateConnectManifestRequest::proxy].
2593    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    /// Sets the value of [version][crate::model::GenerateConnectManifestRequest::version].
2599    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    /// Sets the value of [is_upgrade][crate::model::GenerateConnectManifestRequest::is_upgrade].
2605    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    /// Sets the value of [registry][crate::model::GenerateConnectManifestRequest::registry].
2611    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    /// Sets the value of [image_pull_secret_content][crate::model::GenerateConnectManifestRequest::image_pull_secret_content].
2617    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/// GenerateConnectManifestResponse contains manifest information for
2633/// installing/upgrading a Connect agent.
2634#[derive(Clone, Default, PartialEq)]
2635#[non_exhaustive]
2636pub struct GenerateConnectManifestResponse {
2637    /// The ordered list of Kubernetes resources that need to be applied to the
2638    /// cluster for GKE Connect agent installation/upgrade.
2639    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    /// Sets the value of [manifest][crate::model::GenerateConnectManifestResponse::manifest].
2650    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/// ConnectAgentResource represents a Kubernetes resource manifest for Connect
2668/// Agent deployment.
2669#[derive(Clone, Default, PartialEq)]
2670#[non_exhaustive]
2671pub struct ConnectAgentResource {
2672    /// Kubernetes type of the resource.
2673    pub r#type: std::option::Option<crate::model::TypeMeta>,
2674
2675    /// YAML manifest of the resource.
2676    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    /// Sets the value of [r#type][crate::model::ConnectAgentResource::type].
2687    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    /// Sets or clears the value of [r#type][crate::model::ConnectAgentResource::type].
2696    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    /// Sets the value of [manifest][crate::model::ConnectAgentResource::manifest].
2705    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/// TypeMeta is the type information needed for content unmarshalling of
2718/// Kubernetes resources in the manifest.
2719#[derive(Clone, Default, PartialEq)]
2720#[non_exhaustive]
2721pub struct TypeMeta {
2722    /// Kind of the resource (e.g. Deployment).
2723    pub kind: std::string::String,
2724
2725    /// APIVersion of the resource (e.g. v1).
2726    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    /// Sets the value of [kind][crate::model::TypeMeta::kind].
2737    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    /// Sets the value of [api_version][crate::model::TypeMeta::api_version].
2743    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/// Request message for `GkeHub.ListFeatures` method.
2756#[derive(Clone, Default, PartialEq)]
2757#[non_exhaustive]
2758pub struct ListFeaturesRequest {
2759    /// Required. The parent (project and location) where the Features will be
2760    /// listed. Specified in the format `projects/*/locations/*`.
2761    pub parent: std::string::String,
2762
2763    /// When requesting a 'page' of resources, `page_size` specifies number of
2764    /// resources to return. If unspecified or set to 0, all resources will
2765    /// be returned.
2766    pub page_size: i32,
2767
2768    /// Token returned by previous call to `ListFeatures` which
2769    /// specifies the position in the list from where to continue listing the
2770    /// resources.
2771    pub page_token: std::string::String,
2772
2773    /// Lists Features that match the filter expression, following the syntax
2774    /// outlined in <https://google.aip.dev/160>.
2775    ///
2776    /// Examples:
2777    ///
2778    /// - Feature with the name "servicemesh" in project "foo-proj":
2779    ///
2780    ///   name = "projects/foo-proj/locations/global/features/servicemesh"
2781    ///
2782    /// - Features that have a label called `foo`:
2783    ///
2784    ///   labels.foo:*
2785    ///
2786    /// - Features that have a label called `foo` whose value is `bar`:
2787    ///
2788    ///   labels.foo = bar
2789    ///
2790    pub filter: std::string::String,
2791
2792    /// One or more fields to compare and use to sort the output.
2793    /// See <https://google.aip.dev/132#ordering>.
2794    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    /// Sets the value of [parent][crate::model::ListFeaturesRequest::parent].
2805    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    /// Sets the value of [page_size][crate::model::ListFeaturesRequest::page_size].
2811    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    /// Sets the value of [page_token][crate::model::ListFeaturesRequest::page_token].
2817    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    /// Sets the value of [filter][crate::model::ListFeaturesRequest::filter].
2823    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    /// Sets the value of [order_by][crate::model::ListFeaturesRequest::order_by].
2829    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/// Response message for the `GkeHub.ListFeatures` method.
2842#[derive(Clone, Default, PartialEq)]
2843#[non_exhaustive]
2844pub struct ListFeaturesResponse {
2845    /// The list of matching Features
2846    pub resources: std::vec::Vec<crate::model::Feature>,
2847
2848    /// A token to request the next page of resources from the
2849    /// `ListFeatures` method. The value of an empty string means
2850    /// that there are no more resources to return.
2851    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    /// Sets the value of [resources][crate::model::ListFeaturesResponse::resources].
2862    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    /// Sets the value of [next_page_token][crate::model::ListFeaturesResponse::next_page_token].
2873    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/// Request message for `GkeHub.GetFeature` method.
2900#[derive(Clone, Default, PartialEq)]
2901#[non_exhaustive]
2902pub struct GetFeatureRequest {
2903    /// Required. The Feature resource name in the format
2904    /// `projects/*/locations/*/features/*`
2905    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    /// Sets the value of [name][crate::model::GetFeatureRequest::name].
2916    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/// Request message for the `GkeHub.CreateFeature` method.
2929#[derive(Clone, Default, PartialEq)]
2930#[non_exhaustive]
2931pub struct CreateFeatureRequest {
2932    /// Required. The parent (project and location) where the Feature will be
2933    /// created. Specified in the format `projects/*/locations/*`.
2934    pub parent: std::string::String,
2935
2936    /// The ID of the feature to create.
2937    pub feature_id: std::string::String,
2938
2939    /// The Feature resource to create.
2940    pub resource: std::option::Option<crate::model::Feature>,
2941
2942    /// Optional. A request ID to identify requests. Specify a unique request ID
2943    /// so that if you must retry your request, the server will know to ignore
2944    /// the request if it has already been completed. The server will guarantee
2945    /// that for at least 60 minutes after the first request.
2946    ///
2947    /// For example, consider a situation where you make an initial request and
2948    /// the request times out. If you make the request again with the same request
2949    /// ID, the server can check if original operation with the same request ID
2950    /// was received, and if so, will ignore the second request. This prevents
2951    /// clients from accidentally creating duplicate commitments.
2952    ///
2953    /// The request ID must be a valid UUID with the exception that zero UUID is
2954    /// not supported (00000000-0000-0000-0000-000000000000).
2955    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    /// Sets the value of [parent][crate::model::CreateFeatureRequest::parent].
2966    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    /// Sets the value of [feature_id][crate::model::CreateFeatureRequest::feature_id].
2972    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    /// Sets the value of [resource][crate::model::CreateFeatureRequest::resource].
2978    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    /// Sets or clears the value of [resource][crate::model::CreateFeatureRequest::resource].
2987    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    /// Sets the value of [request_id][crate::model::CreateFeatureRequest::request_id].
2996    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/// Request message for `GkeHub.DeleteFeature` method.
3009#[derive(Clone, Default, PartialEq)]
3010#[non_exhaustive]
3011pub struct DeleteFeatureRequest {
3012    /// Required. The Feature resource name in the format
3013    /// `projects/*/locations/*/features/*`.
3014    pub name: std::string::String,
3015
3016    /// If set to true, the delete will ignore any outstanding resources for
3017    /// this Feature (that is, `FeatureState.has_resources` is set to true). These
3018    /// resources will NOT be cleaned up or modified in any way.
3019    pub force: bool,
3020
3021    /// Optional. A request ID to identify requests. Specify a unique request ID
3022    /// so that if you must retry your request, the server will know to ignore
3023    /// the request if it has already been completed. The server will guarantee
3024    /// that for at least 60 minutes after the first request.
3025    ///
3026    /// For example, consider a situation where you make an initial request and
3027    /// the request times out. If you make the request again with the same request
3028    /// ID, the server can check if original operation with the same request ID
3029    /// was received, and if so, will ignore the second request. This prevents
3030    /// clients from accidentally creating duplicate commitments.
3031    ///
3032    /// The request ID must be a valid UUID with the exception that zero UUID is
3033    /// not supported (00000000-0000-0000-0000-000000000000).
3034    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    /// Sets the value of [name][crate::model::DeleteFeatureRequest::name].
3045    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    /// Sets the value of [force][crate::model::DeleteFeatureRequest::force].
3051    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3052        self.force = v.into();
3053        self
3054    }
3055
3056    /// Sets the value of [request_id][crate::model::DeleteFeatureRequest::request_id].
3057    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/// Request message for `GkeHub.UpdateFeature` method.
3070#[derive(Clone, Default, PartialEq)]
3071#[non_exhaustive]
3072pub struct UpdateFeatureRequest {
3073    /// Required. The Feature resource name in the format
3074    /// `projects/*/locations/*/features/*`.
3075    pub name: std::string::String,
3076
3077    /// Mask of fields to update.
3078    pub update_mask: std::option::Option<wkt::FieldMask>,
3079
3080    /// Only fields specified in update_mask are updated.
3081    /// If you specify a field in the update_mask but don't specify its value here
3082    /// that field will be deleted.
3083    /// If you are updating a map field, set the value of a key to null or empty
3084    /// string to delete the key from the map. It's not possible to update a key's
3085    /// value to the empty string.
3086    /// If you specify the update_mask to be a special path "*", fully replaces all
3087    /// user-modifiable fields to match `resource`.
3088    pub resource: std::option::Option<crate::model::Feature>,
3089
3090    /// Optional. A request ID to identify requests. Specify a unique request ID
3091    /// so that if you must retry your request, the server will know to ignore
3092    /// the request if it has already been completed. The server will guarantee
3093    /// that for at least 60 minutes after the first request.
3094    ///
3095    /// For example, consider a situation where you make an initial request and
3096    /// the request times out. If you make the request again with the same request
3097    /// ID, the server can check if original operation with the same request ID
3098    /// was received, and if so, will ignore the second request. This prevents
3099    /// clients from accidentally creating duplicate commitments.
3100    ///
3101    /// The request ID must be a valid UUID with the exception that zero UUID is
3102    /// not supported (00000000-0000-0000-0000-000000000000).
3103    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    /// Sets the value of [name][crate::model::UpdateFeatureRequest::name].
3114    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    /// Sets the value of [update_mask][crate::model::UpdateFeatureRequest::update_mask].
3120    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    /// Sets or clears the value of [update_mask][crate::model::UpdateFeatureRequest::update_mask].
3129    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    /// Sets the value of [resource][crate::model::UpdateFeatureRequest::resource].
3138    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    /// Sets or clears the value of [resource][crate::model::UpdateFeatureRequest::resource].
3147    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    /// Sets the value of [request_id][crate::model::UpdateFeatureRequest::request_id].
3156    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/// Represents the metadata of the long-running operation.
3169#[derive(Clone, Default, PartialEq)]
3170#[non_exhaustive]
3171pub struct OperationMetadata {
3172    /// Output only. The time the operation was created.
3173    pub create_time: std::option::Option<wkt::Timestamp>,
3174
3175    /// Output only. The time the operation finished running.
3176    pub end_time: std::option::Option<wkt::Timestamp>,
3177
3178    /// Output only. Server-defined resource path for the target of the operation.
3179    pub target: std::string::String,
3180
3181    /// Output only. Name of the verb executed by the operation.
3182    pub verb: std::string::String,
3183
3184    /// Output only. Human-readable status of the operation, if any.
3185    pub status_detail: std::string::String,
3186
3187    /// Output only. Identifies whether the user has requested cancellation
3188    /// of the operation. Operations that have successfully been cancelled
3189    /// have [Operation.error][] value with a
3190    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3191    /// `Code.CANCELLED`.
3192    ///
3193    /// [google.rpc.Status.code]: rpc::model::Status::code
3194    pub cancel_requested: bool,
3195
3196    /// Output only. API version used to start the operation.
3197    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    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3208    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    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3217    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    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3226    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    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3235    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    /// Sets the value of [target][crate::model::OperationMetadata::target].
3244    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    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3250    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    /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
3256    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    /// Sets the value of [cancel_requested][crate::model::OperationMetadata::cancel_requested].
3262    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    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3268    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}