google_cloud_managedkafka_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 lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36/// Request for ListClusters.
37#[derive(Clone, Default, PartialEq)]
38#[non_exhaustive]
39pub struct ListClustersRequest {
40    /// Required. The parent location whose clusters are to be listed. Structured
41    /// like `projects/{project}/locations/{location}`.
42    pub parent: std::string::String,
43
44    /// Optional. The maximum number of clusters to return. The service may return
45    /// fewer than this value. If unspecified, server will pick an appropriate
46    /// default.
47    pub page_size: i32,
48
49    /// Optional. A page token, received from a previous `ListClusters` call.
50    /// Provide this to retrieve the subsequent page.
51    ///
52    /// When paginating, all other parameters provided to `ListClusters` must match
53    /// the call that provided the page token.
54    pub page_token: std::string::String,
55
56    /// Optional. Filter expression for the result.
57    pub filter: std::string::String,
58
59    /// Optional. Order by fields for the result.
60    pub order_by: std::string::String,
61
62    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
63}
64
65impl ListClustersRequest {
66    pub fn new() -> Self {
67        std::default::Default::default()
68    }
69
70    /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
71    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
72        self.parent = v.into();
73        self
74    }
75
76    /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
77    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
78        self.page_size = v.into();
79        self
80    }
81
82    /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
83    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
84        self.page_token = v.into();
85        self
86    }
87
88    /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
89    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
90        self.filter = v.into();
91        self
92    }
93
94    /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
95    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
96        self.order_by = v.into();
97        self
98    }
99}
100
101impl wkt::message::Message for ListClustersRequest {
102    fn typename() -> &'static str {
103        "type.googleapis.com/google.cloud.managedkafka.v1.ListClustersRequest"
104    }
105}
106
107#[doc(hidden)]
108impl<'de> serde::de::Deserialize<'de> for ListClustersRequest {
109    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
110    where
111        D: serde::Deserializer<'de>,
112    {
113        #[allow(non_camel_case_types)]
114        #[doc(hidden)]
115        #[derive(PartialEq, Eq, Hash)]
116        enum __FieldTag {
117            __parent,
118            __page_size,
119            __page_token,
120            __filter,
121            __order_by,
122            Unknown(std::string::String),
123        }
124        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
125            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
126            where
127                D: serde::Deserializer<'de>,
128            {
129                struct Visitor;
130                impl<'de> serde::de::Visitor<'de> for Visitor {
131                    type Value = __FieldTag;
132                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
133                        formatter.write_str("a field name for ListClustersRequest")
134                    }
135                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
136                    where
137                        E: serde::de::Error,
138                    {
139                        use std::result::Result::Ok;
140                        use std::string::ToString;
141                        match value {
142                            "parent" => Ok(__FieldTag::__parent),
143                            "pageSize" => Ok(__FieldTag::__page_size),
144                            "page_size" => Ok(__FieldTag::__page_size),
145                            "pageToken" => Ok(__FieldTag::__page_token),
146                            "page_token" => Ok(__FieldTag::__page_token),
147                            "filter" => Ok(__FieldTag::__filter),
148                            "orderBy" => Ok(__FieldTag::__order_by),
149                            "order_by" => Ok(__FieldTag::__order_by),
150                            _ => Ok(__FieldTag::Unknown(value.to_string())),
151                        }
152                    }
153                }
154                deserializer.deserialize_identifier(Visitor)
155            }
156        }
157        struct Visitor;
158        impl<'de> serde::de::Visitor<'de> for Visitor {
159            type Value = ListClustersRequest;
160            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
161                formatter.write_str("struct ListClustersRequest")
162            }
163            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
164            where
165                A: serde::de::MapAccess<'de>,
166            {
167                #[allow(unused_imports)]
168                use serde::de::Error;
169                use std::option::Option::Some;
170                let mut fields = std::collections::HashSet::new();
171                let mut result = Self::Value::new();
172                while let Some(tag) = map.next_key::<__FieldTag>()? {
173                    #[allow(clippy::match_single_binding)]
174                    match tag {
175                        __FieldTag::__parent => {
176                            if !fields.insert(__FieldTag::__parent) {
177                                return std::result::Result::Err(A::Error::duplicate_field(
178                                    "multiple values for parent",
179                                ));
180                            }
181                            result.parent = map
182                                .next_value::<std::option::Option<std::string::String>>()?
183                                .unwrap_or_default();
184                        }
185                        __FieldTag::__page_size => {
186                            if !fields.insert(__FieldTag::__page_size) {
187                                return std::result::Result::Err(A::Error::duplicate_field(
188                                    "multiple values for page_size",
189                                ));
190                            }
191                            struct __With(std::option::Option<i32>);
192                            impl<'de> serde::de::Deserialize<'de> for __With {
193                                fn deserialize<D>(
194                                    deserializer: D,
195                                ) -> std::result::Result<Self, D::Error>
196                                where
197                                    D: serde::de::Deserializer<'de>,
198                                {
199                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
200                                }
201                            }
202                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
203                        }
204                        __FieldTag::__page_token => {
205                            if !fields.insert(__FieldTag::__page_token) {
206                                return std::result::Result::Err(A::Error::duplicate_field(
207                                    "multiple values for page_token",
208                                ));
209                            }
210                            result.page_token = map
211                                .next_value::<std::option::Option<std::string::String>>()?
212                                .unwrap_or_default();
213                        }
214                        __FieldTag::__filter => {
215                            if !fields.insert(__FieldTag::__filter) {
216                                return std::result::Result::Err(A::Error::duplicate_field(
217                                    "multiple values for filter",
218                                ));
219                            }
220                            result.filter = map
221                                .next_value::<std::option::Option<std::string::String>>()?
222                                .unwrap_or_default();
223                        }
224                        __FieldTag::__order_by => {
225                            if !fields.insert(__FieldTag::__order_by) {
226                                return std::result::Result::Err(A::Error::duplicate_field(
227                                    "multiple values for order_by",
228                                ));
229                            }
230                            result.order_by = map
231                                .next_value::<std::option::Option<std::string::String>>()?
232                                .unwrap_or_default();
233                        }
234                        __FieldTag::Unknown(key) => {
235                            let value = map.next_value::<serde_json::Value>()?;
236                            result._unknown_fields.insert(key, value);
237                        }
238                    }
239                }
240                std::result::Result::Ok(result)
241            }
242        }
243        deserializer.deserialize_any(Visitor)
244    }
245}
246
247#[doc(hidden)]
248impl serde::ser::Serialize for ListClustersRequest {
249    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
250    where
251        S: serde::ser::Serializer,
252    {
253        use serde::ser::SerializeMap;
254        #[allow(unused_imports)]
255        use std::option::Option::Some;
256        let mut state = serializer.serialize_map(std::option::Option::None)?;
257        if !self.parent.is_empty() {
258            state.serialize_entry("parent", &self.parent)?;
259        }
260        if !wkt::internal::is_default(&self.page_size) {
261            struct __With<'a>(&'a i32);
262            impl<'a> serde::ser::Serialize for __With<'a> {
263                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
264                where
265                    S: serde::ser::Serializer,
266                {
267                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
268                }
269            }
270            state.serialize_entry("pageSize", &__With(&self.page_size))?;
271        }
272        if !self.page_token.is_empty() {
273            state.serialize_entry("pageToken", &self.page_token)?;
274        }
275        if !self.filter.is_empty() {
276            state.serialize_entry("filter", &self.filter)?;
277        }
278        if !self.order_by.is_empty() {
279            state.serialize_entry("orderBy", &self.order_by)?;
280        }
281        if !self._unknown_fields.is_empty() {
282            for (key, value) in self._unknown_fields.iter() {
283                state.serialize_entry(key, &value)?;
284            }
285        }
286        state.end()
287    }
288}
289
290impl std::fmt::Debug for ListClustersRequest {
291    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
292        let mut debug_struct = f.debug_struct("ListClustersRequest");
293        debug_struct.field("parent", &self.parent);
294        debug_struct.field("page_size", &self.page_size);
295        debug_struct.field("page_token", &self.page_token);
296        debug_struct.field("filter", &self.filter);
297        debug_struct.field("order_by", &self.order_by);
298        if !self._unknown_fields.is_empty() {
299            debug_struct.field("_unknown_fields", &self._unknown_fields);
300        }
301        debug_struct.finish()
302    }
303}
304
305/// Response for ListClusters.
306#[derive(Clone, Default, PartialEq)]
307#[non_exhaustive]
308pub struct ListClustersResponse {
309    /// The list of Clusters in the requested parent.
310    pub clusters: std::vec::Vec<crate::model::Cluster>,
311
312    /// A token that can be sent as `page_token` to retrieve the next page of
313    /// results. If this field is omitted, there are no more results.
314    pub next_page_token: std::string::String,
315
316    /// Locations that could not be reached.
317    pub unreachable: std::vec::Vec<std::string::String>,
318
319    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
320}
321
322impl ListClustersResponse {
323    pub fn new() -> Self {
324        std::default::Default::default()
325    }
326
327    /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
328    pub fn set_clusters<T, V>(mut self, v: T) -> Self
329    where
330        T: std::iter::IntoIterator<Item = V>,
331        V: std::convert::Into<crate::model::Cluster>,
332    {
333        use std::iter::Iterator;
334        self.clusters = v.into_iter().map(|i| i.into()).collect();
335        self
336    }
337
338    /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
339    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
340        self.next_page_token = v.into();
341        self
342    }
343
344    /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
345    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
346    where
347        T: std::iter::IntoIterator<Item = V>,
348        V: std::convert::Into<std::string::String>,
349    {
350        use std::iter::Iterator;
351        self.unreachable = v.into_iter().map(|i| i.into()).collect();
352        self
353    }
354}
355
356impl wkt::message::Message for ListClustersResponse {
357    fn typename() -> &'static str {
358        "type.googleapis.com/google.cloud.managedkafka.v1.ListClustersResponse"
359    }
360}
361
362#[doc(hidden)]
363impl gax::paginator::internal::PageableResponse for ListClustersResponse {
364    type PageItem = crate::model::Cluster;
365
366    fn items(self) -> std::vec::Vec<Self::PageItem> {
367        self.clusters
368    }
369
370    fn next_page_token(&self) -> std::string::String {
371        use std::clone::Clone;
372        self.next_page_token.clone()
373    }
374}
375
376#[doc(hidden)]
377impl<'de> serde::de::Deserialize<'de> for ListClustersResponse {
378    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
379    where
380        D: serde::Deserializer<'de>,
381    {
382        #[allow(non_camel_case_types)]
383        #[doc(hidden)]
384        #[derive(PartialEq, Eq, Hash)]
385        enum __FieldTag {
386            __clusters,
387            __next_page_token,
388            __unreachable,
389            Unknown(std::string::String),
390        }
391        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
392            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
393            where
394                D: serde::Deserializer<'de>,
395            {
396                struct Visitor;
397                impl<'de> serde::de::Visitor<'de> for Visitor {
398                    type Value = __FieldTag;
399                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
400                        formatter.write_str("a field name for ListClustersResponse")
401                    }
402                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
403                    where
404                        E: serde::de::Error,
405                    {
406                        use std::result::Result::Ok;
407                        use std::string::ToString;
408                        match value {
409                            "clusters" => Ok(__FieldTag::__clusters),
410                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
411                            "next_page_token" => Ok(__FieldTag::__next_page_token),
412                            "unreachable" => Ok(__FieldTag::__unreachable),
413                            _ => Ok(__FieldTag::Unknown(value.to_string())),
414                        }
415                    }
416                }
417                deserializer.deserialize_identifier(Visitor)
418            }
419        }
420        struct Visitor;
421        impl<'de> serde::de::Visitor<'de> for Visitor {
422            type Value = ListClustersResponse;
423            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
424                formatter.write_str("struct ListClustersResponse")
425            }
426            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
427            where
428                A: serde::de::MapAccess<'de>,
429            {
430                #[allow(unused_imports)]
431                use serde::de::Error;
432                use std::option::Option::Some;
433                let mut fields = std::collections::HashSet::new();
434                let mut result = Self::Value::new();
435                while let Some(tag) = map.next_key::<__FieldTag>()? {
436                    #[allow(clippy::match_single_binding)]
437                    match tag {
438                        __FieldTag::__clusters => {
439                            if !fields.insert(__FieldTag::__clusters) {
440                                return std::result::Result::Err(A::Error::duplicate_field(
441                                    "multiple values for clusters",
442                                ));
443                            }
444                            result.clusters = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Cluster>>>()?.unwrap_or_default();
445                        }
446                        __FieldTag::__next_page_token => {
447                            if !fields.insert(__FieldTag::__next_page_token) {
448                                return std::result::Result::Err(A::Error::duplicate_field(
449                                    "multiple values for next_page_token",
450                                ));
451                            }
452                            result.next_page_token = map
453                                .next_value::<std::option::Option<std::string::String>>()?
454                                .unwrap_or_default();
455                        }
456                        __FieldTag::__unreachable => {
457                            if !fields.insert(__FieldTag::__unreachable) {
458                                return std::result::Result::Err(A::Error::duplicate_field(
459                                    "multiple values for unreachable",
460                                ));
461                            }
462                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
463                        }
464                        __FieldTag::Unknown(key) => {
465                            let value = map.next_value::<serde_json::Value>()?;
466                            result._unknown_fields.insert(key, value);
467                        }
468                    }
469                }
470                std::result::Result::Ok(result)
471            }
472        }
473        deserializer.deserialize_any(Visitor)
474    }
475}
476
477#[doc(hidden)]
478impl serde::ser::Serialize for ListClustersResponse {
479    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
480    where
481        S: serde::ser::Serializer,
482    {
483        use serde::ser::SerializeMap;
484        #[allow(unused_imports)]
485        use std::option::Option::Some;
486        let mut state = serializer.serialize_map(std::option::Option::None)?;
487        if !self.clusters.is_empty() {
488            state.serialize_entry("clusters", &self.clusters)?;
489        }
490        if !self.next_page_token.is_empty() {
491            state.serialize_entry("nextPageToken", &self.next_page_token)?;
492        }
493        if !self.unreachable.is_empty() {
494            state.serialize_entry("unreachable", &self.unreachable)?;
495        }
496        if !self._unknown_fields.is_empty() {
497            for (key, value) in self._unknown_fields.iter() {
498                state.serialize_entry(key, &value)?;
499            }
500        }
501        state.end()
502    }
503}
504
505impl std::fmt::Debug for ListClustersResponse {
506    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
507        let mut debug_struct = f.debug_struct("ListClustersResponse");
508        debug_struct.field("clusters", &self.clusters);
509        debug_struct.field("next_page_token", &self.next_page_token);
510        debug_struct.field("unreachable", &self.unreachable);
511        if !self._unknown_fields.is_empty() {
512            debug_struct.field("_unknown_fields", &self._unknown_fields);
513        }
514        debug_struct.finish()
515    }
516}
517
518/// Request for GetCluster.
519#[derive(Clone, Default, PartialEq)]
520#[non_exhaustive]
521pub struct GetClusterRequest {
522    /// Required. The name of the cluster whose configuration to return.
523    pub name: std::string::String,
524
525    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
526}
527
528impl GetClusterRequest {
529    pub fn new() -> Self {
530        std::default::Default::default()
531    }
532
533    /// Sets the value of [name][crate::model::GetClusterRequest::name].
534    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
535        self.name = v.into();
536        self
537    }
538}
539
540impl wkt::message::Message for GetClusterRequest {
541    fn typename() -> &'static str {
542        "type.googleapis.com/google.cloud.managedkafka.v1.GetClusterRequest"
543    }
544}
545
546#[doc(hidden)]
547impl<'de> serde::de::Deserialize<'de> for GetClusterRequest {
548    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
549    where
550        D: serde::Deserializer<'de>,
551    {
552        #[allow(non_camel_case_types)]
553        #[doc(hidden)]
554        #[derive(PartialEq, Eq, Hash)]
555        enum __FieldTag {
556            __name,
557            Unknown(std::string::String),
558        }
559        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
560            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
561            where
562                D: serde::Deserializer<'de>,
563            {
564                struct Visitor;
565                impl<'de> serde::de::Visitor<'de> for Visitor {
566                    type Value = __FieldTag;
567                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
568                        formatter.write_str("a field name for GetClusterRequest")
569                    }
570                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
571                    where
572                        E: serde::de::Error,
573                    {
574                        use std::result::Result::Ok;
575                        use std::string::ToString;
576                        match value {
577                            "name" => Ok(__FieldTag::__name),
578                            _ => Ok(__FieldTag::Unknown(value.to_string())),
579                        }
580                    }
581                }
582                deserializer.deserialize_identifier(Visitor)
583            }
584        }
585        struct Visitor;
586        impl<'de> serde::de::Visitor<'de> for Visitor {
587            type Value = GetClusterRequest;
588            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
589                formatter.write_str("struct GetClusterRequest")
590            }
591            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
592            where
593                A: serde::de::MapAccess<'de>,
594            {
595                #[allow(unused_imports)]
596                use serde::de::Error;
597                use std::option::Option::Some;
598                let mut fields = std::collections::HashSet::new();
599                let mut result = Self::Value::new();
600                while let Some(tag) = map.next_key::<__FieldTag>()? {
601                    #[allow(clippy::match_single_binding)]
602                    match tag {
603                        __FieldTag::__name => {
604                            if !fields.insert(__FieldTag::__name) {
605                                return std::result::Result::Err(A::Error::duplicate_field(
606                                    "multiple values for name",
607                                ));
608                            }
609                            result.name = map
610                                .next_value::<std::option::Option<std::string::String>>()?
611                                .unwrap_or_default();
612                        }
613                        __FieldTag::Unknown(key) => {
614                            let value = map.next_value::<serde_json::Value>()?;
615                            result._unknown_fields.insert(key, value);
616                        }
617                    }
618                }
619                std::result::Result::Ok(result)
620            }
621        }
622        deserializer.deserialize_any(Visitor)
623    }
624}
625
626#[doc(hidden)]
627impl serde::ser::Serialize for GetClusterRequest {
628    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
629    where
630        S: serde::ser::Serializer,
631    {
632        use serde::ser::SerializeMap;
633        #[allow(unused_imports)]
634        use std::option::Option::Some;
635        let mut state = serializer.serialize_map(std::option::Option::None)?;
636        if !self.name.is_empty() {
637            state.serialize_entry("name", &self.name)?;
638        }
639        if !self._unknown_fields.is_empty() {
640            for (key, value) in self._unknown_fields.iter() {
641                state.serialize_entry(key, &value)?;
642            }
643        }
644        state.end()
645    }
646}
647
648impl std::fmt::Debug for GetClusterRequest {
649    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
650        let mut debug_struct = f.debug_struct("GetClusterRequest");
651        debug_struct.field("name", &self.name);
652        if !self._unknown_fields.is_empty() {
653            debug_struct.field("_unknown_fields", &self._unknown_fields);
654        }
655        debug_struct.finish()
656    }
657}
658
659/// Request for CreateCluster.
660#[derive(Clone, Default, PartialEq)]
661#[non_exhaustive]
662pub struct CreateClusterRequest {
663    /// Required. The parent region in which to create the cluster. Structured like
664    /// `projects/{project}/locations/{location}`.
665    pub parent: std::string::String,
666
667    /// Required. The ID to use for the cluster, which will become the final
668    /// component of the cluster's name. The ID must be 1-63 characters long, and
669    /// match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with
670    /// RFC 1035.
671    ///
672    /// This value is structured like: `my-cluster-id`.
673    pub cluster_id: std::string::String,
674
675    /// Required. Configuration of the cluster to create. Its `name` field is
676    /// ignored.
677    pub cluster: std::option::Option<crate::model::Cluster>,
678
679    /// Optional. An optional request ID to identify requests. Specify a unique
680    /// request ID to avoid duplication of requests. If a request times out or
681    /// fails, retrying with the same ID allows the server to recognize the
682    /// previous attempt. For at least 60 minutes, the server ignores duplicate
683    /// requests bearing the same ID.
684    ///
685    /// For example, consider a situation where you make an initial request and the
686    /// request times out. If you make the request again with the same request ID
687    /// within 60 minutes of the last request, the server checks if an original
688    /// operation with the same request ID was received. If so, the server ignores
689    /// the second request.
690    ///
691    /// The request ID must be a valid UUID. A zero UUID is not supported
692    /// (00000000-0000-0000-0000-000000000000).
693    pub request_id: std::string::String,
694
695    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
696}
697
698impl CreateClusterRequest {
699    pub fn new() -> Self {
700        std::default::Default::default()
701    }
702
703    /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
704    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
705        self.parent = v.into();
706        self
707    }
708
709    /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
710    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
711        self.cluster_id = v.into();
712        self
713    }
714
715    /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
716    pub fn set_cluster<T>(mut self, v: T) -> Self
717    where
718        T: std::convert::Into<crate::model::Cluster>,
719    {
720        self.cluster = std::option::Option::Some(v.into());
721        self
722    }
723
724    /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
725    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
726    where
727        T: std::convert::Into<crate::model::Cluster>,
728    {
729        self.cluster = v.map(|x| x.into());
730        self
731    }
732
733    /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
734    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
735        self.request_id = v.into();
736        self
737    }
738}
739
740impl wkt::message::Message for CreateClusterRequest {
741    fn typename() -> &'static str {
742        "type.googleapis.com/google.cloud.managedkafka.v1.CreateClusterRequest"
743    }
744}
745
746#[doc(hidden)]
747impl<'de> serde::de::Deserialize<'de> for CreateClusterRequest {
748    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
749    where
750        D: serde::Deserializer<'de>,
751    {
752        #[allow(non_camel_case_types)]
753        #[doc(hidden)]
754        #[derive(PartialEq, Eq, Hash)]
755        enum __FieldTag {
756            __parent,
757            __cluster_id,
758            __cluster,
759            __request_id,
760            Unknown(std::string::String),
761        }
762        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
763            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
764            where
765                D: serde::Deserializer<'de>,
766            {
767                struct Visitor;
768                impl<'de> serde::de::Visitor<'de> for Visitor {
769                    type Value = __FieldTag;
770                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
771                        formatter.write_str("a field name for CreateClusterRequest")
772                    }
773                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
774                    where
775                        E: serde::de::Error,
776                    {
777                        use std::result::Result::Ok;
778                        use std::string::ToString;
779                        match value {
780                            "parent" => Ok(__FieldTag::__parent),
781                            "clusterId" => Ok(__FieldTag::__cluster_id),
782                            "cluster_id" => Ok(__FieldTag::__cluster_id),
783                            "cluster" => Ok(__FieldTag::__cluster),
784                            "requestId" => Ok(__FieldTag::__request_id),
785                            "request_id" => Ok(__FieldTag::__request_id),
786                            _ => Ok(__FieldTag::Unknown(value.to_string())),
787                        }
788                    }
789                }
790                deserializer.deserialize_identifier(Visitor)
791            }
792        }
793        struct Visitor;
794        impl<'de> serde::de::Visitor<'de> for Visitor {
795            type Value = CreateClusterRequest;
796            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
797                formatter.write_str("struct CreateClusterRequest")
798            }
799            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
800            where
801                A: serde::de::MapAccess<'de>,
802            {
803                #[allow(unused_imports)]
804                use serde::de::Error;
805                use std::option::Option::Some;
806                let mut fields = std::collections::HashSet::new();
807                let mut result = Self::Value::new();
808                while let Some(tag) = map.next_key::<__FieldTag>()? {
809                    #[allow(clippy::match_single_binding)]
810                    match tag {
811                        __FieldTag::__parent => {
812                            if !fields.insert(__FieldTag::__parent) {
813                                return std::result::Result::Err(A::Error::duplicate_field(
814                                    "multiple values for parent",
815                                ));
816                            }
817                            result.parent = map
818                                .next_value::<std::option::Option<std::string::String>>()?
819                                .unwrap_or_default();
820                        }
821                        __FieldTag::__cluster_id => {
822                            if !fields.insert(__FieldTag::__cluster_id) {
823                                return std::result::Result::Err(A::Error::duplicate_field(
824                                    "multiple values for cluster_id",
825                                ));
826                            }
827                            result.cluster_id = map
828                                .next_value::<std::option::Option<std::string::String>>()?
829                                .unwrap_or_default();
830                        }
831                        __FieldTag::__cluster => {
832                            if !fields.insert(__FieldTag::__cluster) {
833                                return std::result::Result::Err(A::Error::duplicate_field(
834                                    "multiple values for cluster",
835                                ));
836                            }
837                            result.cluster =
838                                map.next_value::<std::option::Option<crate::model::Cluster>>()?;
839                        }
840                        __FieldTag::__request_id => {
841                            if !fields.insert(__FieldTag::__request_id) {
842                                return std::result::Result::Err(A::Error::duplicate_field(
843                                    "multiple values for request_id",
844                                ));
845                            }
846                            result.request_id = map
847                                .next_value::<std::option::Option<std::string::String>>()?
848                                .unwrap_or_default();
849                        }
850                        __FieldTag::Unknown(key) => {
851                            let value = map.next_value::<serde_json::Value>()?;
852                            result._unknown_fields.insert(key, value);
853                        }
854                    }
855                }
856                std::result::Result::Ok(result)
857            }
858        }
859        deserializer.deserialize_any(Visitor)
860    }
861}
862
863#[doc(hidden)]
864impl serde::ser::Serialize for CreateClusterRequest {
865    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
866    where
867        S: serde::ser::Serializer,
868    {
869        use serde::ser::SerializeMap;
870        #[allow(unused_imports)]
871        use std::option::Option::Some;
872        let mut state = serializer.serialize_map(std::option::Option::None)?;
873        if !self.parent.is_empty() {
874            state.serialize_entry("parent", &self.parent)?;
875        }
876        if !self.cluster_id.is_empty() {
877            state.serialize_entry("clusterId", &self.cluster_id)?;
878        }
879        if self.cluster.is_some() {
880            state.serialize_entry("cluster", &self.cluster)?;
881        }
882        if !self.request_id.is_empty() {
883            state.serialize_entry("requestId", &self.request_id)?;
884        }
885        if !self._unknown_fields.is_empty() {
886            for (key, value) in self._unknown_fields.iter() {
887                state.serialize_entry(key, &value)?;
888            }
889        }
890        state.end()
891    }
892}
893
894impl std::fmt::Debug for CreateClusterRequest {
895    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
896        let mut debug_struct = f.debug_struct("CreateClusterRequest");
897        debug_struct.field("parent", &self.parent);
898        debug_struct.field("cluster_id", &self.cluster_id);
899        debug_struct.field("cluster", &self.cluster);
900        debug_struct.field("request_id", &self.request_id);
901        if !self._unknown_fields.is_empty() {
902            debug_struct.field("_unknown_fields", &self._unknown_fields);
903        }
904        debug_struct.finish()
905    }
906}
907
908/// Request for UpdateCluster.
909#[derive(Clone, Default, PartialEq)]
910#[non_exhaustive]
911pub struct UpdateClusterRequest {
912    /// Required. Field mask is used to specify the fields to be overwritten in the
913    /// cluster resource by the update. The fields specified in the update_mask are
914    /// relative to the resource, not the full request. A field will be overwritten
915    /// if it is in the mask. The mask is required and a value of * will update all
916    /// fields.
917    pub update_mask: std::option::Option<wkt::FieldMask>,
918
919    /// Required. The cluster to update. Its `name` field must be populated.
920    pub cluster: std::option::Option<crate::model::Cluster>,
921
922    /// Optional. An optional request ID to identify requests. Specify a unique
923    /// request ID to avoid duplication of requests. If a request times out or
924    /// fails, retrying with the same ID allows the server to recognize the
925    /// previous attempt. For at least 60 minutes, the server ignores duplicate
926    /// requests bearing the same ID.
927    ///
928    /// For example, consider a situation where you make an initial request and the
929    /// request times out. If you make the request again with the same request ID
930    /// within 60 minutes of the last request, the server checks if an original
931    /// operation with the same request ID was received. If so, the server ignores
932    /// the second request.
933    ///
934    /// The request ID must be a valid UUID. A zero UUID is not supported
935    /// (00000000-0000-0000-0000-000000000000).
936    pub request_id: std::string::String,
937
938    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
939}
940
941impl UpdateClusterRequest {
942    pub fn new() -> Self {
943        std::default::Default::default()
944    }
945
946    /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
947    pub fn set_update_mask<T>(mut self, v: T) -> Self
948    where
949        T: std::convert::Into<wkt::FieldMask>,
950    {
951        self.update_mask = std::option::Option::Some(v.into());
952        self
953    }
954
955    /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
956    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
957    where
958        T: std::convert::Into<wkt::FieldMask>,
959    {
960        self.update_mask = v.map(|x| x.into());
961        self
962    }
963
964    /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
965    pub fn set_cluster<T>(mut self, v: T) -> Self
966    where
967        T: std::convert::Into<crate::model::Cluster>,
968    {
969        self.cluster = std::option::Option::Some(v.into());
970        self
971    }
972
973    /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
974    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
975    where
976        T: std::convert::Into<crate::model::Cluster>,
977    {
978        self.cluster = v.map(|x| x.into());
979        self
980    }
981
982    /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
983    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
984        self.request_id = v.into();
985        self
986    }
987}
988
989impl wkt::message::Message for UpdateClusterRequest {
990    fn typename() -> &'static str {
991        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateClusterRequest"
992    }
993}
994
995#[doc(hidden)]
996impl<'de> serde::de::Deserialize<'de> for UpdateClusterRequest {
997    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
998    where
999        D: serde::Deserializer<'de>,
1000    {
1001        #[allow(non_camel_case_types)]
1002        #[doc(hidden)]
1003        #[derive(PartialEq, Eq, Hash)]
1004        enum __FieldTag {
1005            __update_mask,
1006            __cluster,
1007            __request_id,
1008            Unknown(std::string::String),
1009        }
1010        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1011            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1012            where
1013                D: serde::Deserializer<'de>,
1014            {
1015                struct Visitor;
1016                impl<'de> serde::de::Visitor<'de> for Visitor {
1017                    type Value = __FieldTag;
1018                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1019                        formatter.write_str("a field name for UpdateClusterRequest")
1020                    }
1021                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1022                    where
1023                        E: serde::de::Error,
1024                    {
1025                        use std::result::Result::Ok;
1026                        use std::string::ToString;
1027                        match value {
1028                            "updateMask" => Ok(__FieldTag::__update_mask),
1029                            "update_mask" => Ok(__FieldTag::__update_mask),
1030                            "cluster" => Ok(__FieldTag::__cluster),
1031                            "requestId" => Ok(__FieldTag::__request_id),
1032                            "request_id" => Ok(__FieldTag::__request_id),
1033                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1034                        }
1035                    }
1036                }
1037                deserializer.deserialize_identifier(Visitor)
1038            }
1039        }
1040        struct Visitor;
1041        impl<'de> serde::de::Visitor<'de> for Visitor {
1042            type Value = UpdateClusterRequest;
1043            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1044                formatter.write_str("struct UpdateClusterRequest")
1045            }
1046            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1047            where
1048                A: serde::de::MapAccess<'de>,
1049            {
1050                #[allow(unused_imports)]
1051                use serde::de::Error;
1052                use std::option::Option::Some;
1053                let mut fields = std::collections::HashSet::new();
1054                let mut result = Self::Value::new();
1055                while let Some(tag) = map.next_key::<__FieldTag>()? {
1056                    #[allow(clippy::match_single_binding)]
1057                    match tag {
1058                        __FieldTag::__update_mask => {
1059                            if !fields.insert(__FieldTag::__update_mask) {
1060                                return std::result::Result::Err(A::Error::duplicate_field(
1061                                    "multiple values for update_mask",
1062                                ));
1063                            }
1064                            result.update_mask =
1065                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
1066                        }
1067                        __FieldTag::__cluster => {
1068                            if !fields.insert(__FieldTag::__cluster) {
1069                                return std::result::Result::Err(A::Error::duplicate_field(
1070                                    "multiple values for cluster",
1071                                ));
1072                            }
1073                            result.cluster =
1074                                map.next_value::<std::option::Option<crate::model::Cluster>>()?;
1075                        }
1076                        __FieldTag::__request_id => {
1077                            if !fields.insert(__FieldTag::__request_id) {
1078                                return std::result::Result::Err(A::Error::duplicate_field(
1079                                    "multiple values for request_id",
1080                                ));
1081                            }
1082                            result.request_id = map
1083                                .next_value::<std::option::Option<std::string::String>>()?
1084                                .unwrap_or_default();
1085                        }
1086                        __FieldTag::Unknown(key) => {
1087                            let value = map.next_value::<serde_json::Value>()?;
1088                            result._unknown_fields.insert(key, value);
1089                        }
1090                    }
1091                }
1092                std::result::Result::Ok(result)
1093            }
1094        }
1095        deserializer.deserialize_any(Visitor)
1096    }
1097}
1098
1099#[doc(hidden)]
1100impl serde::ser::Serialize for UpdateClusterRequest {
1101    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1102    where
1103        S: serde::ser::Serializer,
1104    {
1105        use serde::ser::SerializeMap;
1106        #[allow(unused_imports)]
1107        use std::option::Option::Some;
1108        let mut state = serializer.serialize_map(std::option::Option::None)?;
1109        if self.update_mask.is_some() {
1110            state.serialize_entry("updateMask", &self.update_mask)?;
1111        }
1112        if self.cluster.is_some() {
1113            state.serialize_entry("cluster", &self.cluster)?;
1114        }
1115        if !self.request_id.is_empty() {
1116            state.serialize_entry("requestId", &self.request_id)?;
1117        }
1118        if !self._unknown_fields.is_empty() {
1119            for (key, value) in self._unknown_fields.iter() {
1120                state.serialize_entry(key, &value)?;
1121            }
1122        }
1123        state.end()
1124    }
1125}
1126
1127impl std::fmt::Debug for UpdateClusterRequest {
1128    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1129        let mut debug_struct = f.debug_struct("UpdateClusterRequest");
1130        debug_struct.field("update_mask", &self.update_mask);
1131        debug_struct.field("cluster", &self.cluster);
1132        debug_struct.field("request_id", &self.request_id);
1133        if !self._unknown_fields.is_empty() {
1134            debug_struct.field("_unknown_fields", &self._unknown_fields);
1135        }
1136        debug_struct.finish()
1137    }
1138}
1139
1140/// Request for DeleteCluster.
1141#[derive(Clone, Default, PartialEq)]
1142#[non_exhaustive]
1143pub struct DeleteClusterRequest {
1144    /// Required. The name of the cluster to delete.
1145    pub name: std::string::String,
1146
1147    /// Optional. An optional request ID to identify requests. Specify a unique
1148    /// request ID to avoid duplication of requests. If a request times out or
1149    /// fails, retrying with the same ID allows the server to recognize the
1150    /// previous attempt. For at least 60 minutes, the server ignores duplicate
1151    /// requests bearing the same ID.
1152    ///
1153    /// For example, consider a situation where you make an initial request and the
1154    /// request times out. If you make the request again with the same request ID
1155    /// within 60 minutes of the last request, the server checks if an original
1156    /// operation with the same request ID was received. If so, the server ignores
1157    /// the second request.
1158    ///
1159    /// The request ID must be a valid UUID. A zero UUID is not supported
1160    /// (00000000-0000-0000-0000-000000000000).
1161    pub request_id: std::string::String,
1162
1163    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1164}
1165
1166impl DeleteClusterRequest {
1167    pub fn new() -> Self {
1168        std::default::Default::default()
1169    }
1170
1171    /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
1172    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1173        self.name = v.into();
1174        self
1175    }
1176
1177    /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
1178    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1179        self.request_id = v.into();
1180        self
1181    }
1182}
1183
1184impl wkt::message::Message for DeleteClusterRequest {
1185    fn typename() -> &'static str {
1186        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteClusterRequest"
1187    }
1188}
1189
1190#[doc(hidden)]
1191impl<'de> serde::de::Deserialize<'de> for DeleteClusterRequest {
1192    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1193    where
1194        D: serde::Deserializer<'de>,
1195    {
1196        #[allow(non_camel_case_types)]
1197        #[doc(hidden)]
1198        #[derive(PartialEq, Eq, Hash)]
1199        enum __FieldTag {
1200            __name,
1201            __request_id,
1202            Unknown(std::string::String),
1203        }
1204        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1205            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1206            where
1207                D: serde::Deserializer<'de>,
1208            {
1209                struct Visitor;
1210                impl<'de> serde::de::Visitor<'de> for Visitor {
1211                    type Value = __FieldTag;
1212                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1213                        formatter.write_str("a field name for DeleteClusterRequest")
1214                    }
1215                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1216                    where
1217                        E: serde::de::Error,
1218                    {
1219                        use std::result::Result::Ok;
1220                        use std::string::ToString;
1221                        match value {
1222                            "name" => Ok(__FieldTag::__name),
1223                            "requestId" => Ok(__FieldTag::__request_id),
1224                            "request_id" => Ok(__FieldTag::__request_id),
1225                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1226                        }
1227                    }
1228                }
1229                deserializer.deserialize_identifier(Visitor)
1230            }
1231        }
1232        struct Visitor;
1233        impl<'de> serde::de::Visitor<'de> for Visitor {
1234            type Value = DeleteClusterRequest;
1235            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1236                formatter.write_str("struct DeleteClusterRequest")
1237            }
1238            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1239            where
1240                A: serde::de::MapAccess<'de>,
1241            {
1242                #[allow(unused_imports)]
1243                use serde::de::Error;
1244                use std::option::Option::Some;
1245                let mut fields = std::collections::HashSet::new();
1246                let mut result = Self::Value::new();
1247                while let Some(tag) = map.next_key::<__FieldTag>()? {
1248                    #[allow(clippy::match_single_binding)]
1249                    match tag {
1250                        __FieldTag::__name => {
1251                            if !fields.insert(__FieldTag::__name) {
1252                                return std::result::Result::Err(A::Error::duplicate_field(
1253                                    "multiple values for name",
1254                                ));
1255                            }
1256                            result.name = map
1257                                .next_value::<std::option::Option<std::string::String>>()?
1258                                .unwrap_or_default();
1259                        }
1260                        __FieldTag::__request_id => {
1261                            if !fields.insert(__FieldTag::__request_id) {
1262                                return std::result::Result::Err(A::Error::duplicate_field(
1263                                    "multiple values for request_id",
1264                                ));
1265                            }
1266                            result.request_id = map
1267                                .next_value::<std::option::Option<std::string::String>>()?
1268                                .unwrap_or_default();
1269                        }
1270                        __FieldTag::Unknown(key) => {
1271                            let value = map.next_value::<serde_json::Value>()?;
1272                            result._unknown_fields.insert(key, value);
1273                        }
1274                    }
1275                }
1276                std::result::Result::Ok(result)
1277            }
1278        }
1279        deserializer.deserialize_any(Visitor)
1280    }
1281}
1282
1283#[doc(hidden)]
1284impl serde::ser::Serialize for DeleteClusterRequest {
1285    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1286    where
1287        S: serde::ser::Serializer,
1288    {
1289        use serde::ser::SerializeMap;
1290        #[allow(unused_imports)]
1291        use std::option::Option::Some;
1292        let mut state = serializer.serialize_map(std::option::Option::None)?;
1293        if !self.name.is_empty() {
1294            state.serialize_entry("name", &self.name)?;
1295        }
1296        if !self.request_id.is_empty() {
1297            state.serialize_entry("requestId", &self.request_id)?;
1298        }
1299        if !self._unknown_fields.is_empty() {
1300            for (key, value) in self._unknown_fields.iter() {
1301                state.serialize_entry(key, &value)?;
1302            }
1303        }
1304        state.end()
1305    }
1306}
1307
1308impl std::fmt::Debug for DeleteClusterRequest {
1309    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1310        let mut debug_struct = f.debug_struct("DeleteClusterRequest");
1311        debug_struct.field("name", &self.name);
1312        debug_struct.field("request_id", &self.request_id);
1313        if !self._unknown_fields.is_empty() {
1314            debug_struct.field("_unknown_fields", &self._unknown_fields);
1315        }
1316        debug_struct.finish()
1317    }
1318}
1319
1320/// Request for ListTopics.
1321#[derive(Clone, Default, PartialEq)]
1322#[non_exhaustive]
1323pub struct ListTopicsRequest {
1324    /// Required. The parent cluster whose topics are to be listed. Structured like
1325    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
1326    pub parent: std::string::String,
1327
1328    /// Optional. The maximum number of topics to return. The service may return
1329    /// fewer than this value. If unset or zero, all topics for the parent is
1330    /// returned.
1331    pub page_size: i32,
1332
1333    /// Optional. A page token, received from a previous `ListTopics` call.
1334    /// Provide this to retrieve the subsequent page.
1335    ///
1336    /// When paginating, all other parameters provided to `ListTopics` must match
1337    /// the call that provided the page token.
1338    pub page_token: std::string::String,
1339
1340    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1341}
1342
1343impl ListTopicsRequest {
1344    pub fn new() -> Self {
1345        std::default::Default::default()
1346    }
1347
1348    /// Sets the value of [parent][crate::model::ListTopicsRequest::parent].
1349    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1350        self.parent = v.into();
1351        self
1352    }
1353
1354    /// Sets the value of [page_size][crate::model::ListTopicsRequest::page_size].
1355    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1356        self.page_size = v.into();
1357        self
1358    }
1359
1360    /// Sets the value of [page_token][crate::model::ListTopicsRequest::page_token].
1361    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1362        self.page_token = v.into();
1363        self
1364    }
1365}
1366
1367impl wkt::message::Message for ListTopicsRequest {
1368    fn typename() -> &'static str {
1369        "type.googleapis.com/google.cloud.managedkafka.v1.ListTopicsRequest"
1370    }
1371}
1372
1373#[doc(hidden)]
1374impl<'de> serde::de::Deserialize<'de> for ListTopicsRequest {
1375    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1376    where
1377        D: serde::Deserializer<'de>,
1378    {
1379        #[allow(non_camel_case_types)]
1380        #[doc(hidden)]
1381        #[derive(PartialEq, Eq, Hash)]
1382        enum __FieldTag {
1383            __parent,
1384            __page_size,
1385            __page_token,
1386            Unknown(std::string::String),
1387        }
1388        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1389            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1390            where
1391                D: serde::Deserializer<'de>,
1392            {
1393                struct Visitor;
1394                impl<'de> serde::de::Visitor<'de> for Visitor {
1395                    type Value = __FieldTag;
1396                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1397                        formatter.write_str("a field name for ListTopicsRequest")
1398                    }
1399                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1400                    where
1401                        E: serde::de::Error,
1402                    {
1403                        use std::result::Result::Ok;
1404                        use std::string::ToString;
1405                        match value {
1406                            "parent" => Ok(__FieldTag::__parent),
1407                            "pageSize" => Ok(__FieldTag::__page_size),
1408                            "page_size" => Ok(__FieldTag::__page_size),
1409                            "pageToken" => Ok(__FieldTag::__page_token),
1410                            "page_token" => Ok(__FieldTag::__page_token),
1411                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1412                        }
1413                    }
1414                }
1415                deserializer.deserialize_identifier(Visitor)
1416            }
1417        }
1418        struct Visitor;
1419        impl<'de> serde::de::Visitor<'de> for Visitor {
1420            type Value = ListTopicsRequest;
1421            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1422                formatter.write_str("struct ListTopicsRequest")
1423            }
1424            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1425            where
1426                A: serde::de::MapAccess<'de>,
1427            {
1428                #[allow(unused_imports)]
1429                use serde::de::Error;
1430                use std::option::Option::Some;
1431                let mut fields = std::collections::HashSet::new();
1432                let mut result = Self::Value::new();
1433                while let Some(tag) = map.next_key::<__FieldTag>()? {
1434                    #[allow(clippy::match_single_binding)]
1435                    match tag {
1436                        __FieldTag::__parent => {
1437                            if !fields.insert(__FieldTag::__parent) {
1438                                return std::result::Result::Err(A::Error::duplicate_field(
1439                                    "multiple values for parent",
1440                                ));
1441                            }
1442                            result.parent = map
1443                                .next_value::<std::option::Option<std::string::String>>()?
1444                                .unwrap_or_default();
1445                        }
1446                        __FieldTag::__page_size => {
1447                            if !fields.insert(__FieldTag::__page_size) {
1448                                return std::result::Result::Err(A::Error::duplicate_field(
1449                                    "multiple values for page_size",
1450                                ));
1451                            }
1452                            struct __With(std::option::Option<i32>);
1453                            impl<'de> serde::de::Deserialize<'de> for __With {
1454                                fn deserialize<D>(
1455                                    deserializer: D,
1456                                ) -> std::result::Result<Self, D::Error>
1457                                where
1458                                    D: serde::de::Deserializer<'de>,
1459                                {
1460                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1461                                }
1462                            }
1463                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
1464                        }
1465                        __FieldTag::__page_token => {
1466                            if !fields.insert(__FieldTag::__page_token) {
1467                                return std::result::Result::Err(A::Error::duplicate_field(
1468                                    "multiple values for page_token",
1469                                ));
1470                            }
1471                            result.page_token = map
1472                                .next_value::<std::option::Option<std::string::String>>()?
1473                                .unwrap_or_default();
1474                        }
1475                        __FieldTag::Unknown(key) => {
1476                            let value = map.next_value::<serde_json::Value>()?;
1477                            result._unknown_fields.insert(key, value);
1478                        }
1479                    }
1480                }
1481                std::result::Result::Ok(result)
1482            }
1483        }
1484        deserializer.deserialize_any(Visitor)
1485    }
1486}
1487
1488#[doc(hidden)]
1489impl serde::ser::Serialize for ListTopicsRequest {
1490    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1491    where
1492        S: serde::ser::Serializer,
1493    {
1494        use serde::ser::SerializeMap;
1495        #[allow(unused_imports)]
1496        use std::option::Option::Some;
1497        let mut state = serializer.serialize_map(std::option::Option::None)?;
1498        if !self.parent.is_empty() {
1499            state.serialize_entry("parent", &self.parent)?;
1500        }
1501        if !wkt::internal::is_default(&self.page_size) {
1502            struct __With<'a>(&'a i32);
1503            impl<'a> serde::ser::Serialize for __With<'a> {
1504                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1505                where
1506                    S: serde::ser::Serializer,
1507                {
1508                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
1509                }
1510            }
1511            state.serialize_entry("pageSize", &__With(&self.page_size))?;
1512        }
1513        if !self.page_token.is_empty() {
1514            state.serialize_entry("pageToken", &self.page_token)?;
1515        }
1516        if !self._unknown_fields.is_empty() {
1517            for (key, value) in self._unknown_fields.iter() {
1518                state.serialize_entry(key, &value)?;
1519            }
1520        }
1521        state.end()
1522    }
1523}
1524
1525impl std::fmt::Debug for ListTopicsRequest {
1526    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1527        let mut debug_struct = f.debug_struct("ListTopicsRequest");
1528        debug_struct.field("parent", &self.parent);
1529        debug_struct.field("page_size", &self.page_size);
1530        debug_struct.field("page_token", &self.page_token);
1531        if !self._unknown_fields.is_empty() {
1532            debug_struct.field("_unknown_fields", &self._unknown_fields);
1533        }
1534        debug_struct.finish()
1535    }
1536}
1537
1538/// Response for ListTopics.
1539#[derive(Clone, Default, PartialEq)]
1540#[non_exhaustive]
1541pub struct ListTopicsResponse {
1542    /// The list of topics in the requested parent. The order of the topics is
1543    /// unspecified.
1544    pub topics: std::vec::Vec<crate::model::Topic>,
1545
1546    /// A token that can be sent as `page_token` to retrieve the next page of
1547    /// results. If this field is omitted, there are no more results.
1548    pub next_page_token: std::string::String,
1549
1550    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1551}
1552
1553impl ListTopicsResponse {
1554    pub fn new() -> Self {
1555        std::default::Default::default()
1556    }
1557
1558    /// Sets the value of [topics][crate::model::ListTopicsResponse::topics].
1559    pub fn set_topics<T, V>(mut self, v: T) -> Self
1560    where
1561        T: std::iter::IntoIterator<Item = V>,
1562        V: std::convert::Into<crate::model::Topic>,
1563    {
1564        use std::iter::Iterator;
1565        self.topics = v.into_iter().map(|i| i.into()).collect();
1566        self
1567    }
1568
1569    /// Sets the value of [next_page_token][crate::model::ListTopicsResponse::next_page_token].
1570    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1571        self.next_page_token = v.into();
1572        self
1573    }
1574}
1575
1576impl wkt::message::Message for ListTopicsResponse {
1577    fn typename() -> &'static str {
1578        "type.googleapis.com/google.cloud.managedkafka.v1.ListTopicsResponse"
1579    }
1580}
1581
1582#[doc(hidden)]
1583impl gax::paginator::internal::PageableResponse for ListTopicsResponse {
1584    type PageItem = crate::model::Topic;
1585
1586    fn items(self) -> std::vec::Vec<Self::PageItem> {
1587        self.topics
1588    }
1589
1590    fn next_page_token(&self) -> std::string::String {
1591        use std::clone::Clone;
1592        self.next_page_token.clone()
1593    }
1594}
1595
1596#[doc(hidden)]
1597impl<'de> serde::de::Deserialize<'de> for ListTopicsResponse {
1598    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1599    where
1600        D: serde::Deserializer<'de>,
1601    {
1602        #[allow(non_camel_case_types)]
1603        #[doc(hidden)]
1604        #[derive(PartialEq, Eq, Hash)]
1605        enum __FieldTag {
1606            __topics,
1607            __next_page_token,
1608            Unknown(std::string::String),
1609        }
1610        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1611            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1612            where
1613                D: serde::Deserializer<'de>,
1614            {
1615                struct Visitor;
1616                impl<'de> serde::de::Visitor<'de> for Visitor {
1617                    type Value = __FieldTag;
1618                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1619                        formatter.write_str("a field name for ListTopicsResponse")
1620                    }
1621                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1622                    where
1623                        E: serde::de::Error,
1624                    {
1625                        use std::result::Result::Ok;
1626                        use std::string::ToString;
1627                        match value {
1628                            "topics" => Ok(__FieldTag::__topics),
1629                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
1630                            "next_page_token" => Ok(__FieldTag::__next_page_token),
1631                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1632                        }
1633                    }
1634                }
1635                deserializer.deserialize_identifier(Visitor)
1636            }
1637        }
1638        struct Visitor;
1639        impl<'de> serde::de::Visitor<'de> for Visitor {
1640            type Value = ListTopicsResponse;
1641            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1642                formatter.write_str("struct ListTopicsResponse")
1643            }
1644            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1645            where
1646                A: serde::de::MapAccess<'de>,
1647            {
1648                #[allow(unused_imports)]
1649                use serde::de::Error;
1650                use std::option::Option::Some;
1651                let mut fields = std::collections::HashSet::new();
1652                let mut result = Self::Value::new();
1653                while let Some(tag) = map.next_key::<__FieldTag>()? {
1654                    #[allow(clippy::match_single_binding)]
1655                    match tag {
1656                        __FieldTag::__topics => {
1657                            if !fields.insert(__FieldTag::__topics) {
1658                                return std::result::Result::Err(A::Error::duplicate_field(
1659                                    "multiple values for topics",
1660                                ));
1661                            }
1662                            result.topics = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Topic>>>()?.unwrap_or_default();
1663                        }
1664                        __FieldTag::__next_page_token => {
1665                            if !fields.insert(__FieldTag::__next_page_token) {
1666                                return std::result::Result::Err(A::Error::duplicate_field(
1667                                    "multiple values for next_page_token",
1668                                ));
1669                            }
1670                            result.next_page_token = map
1671                                .next_value::<std::option::Option<std::string::String>>()?
1672                                .unwrap_or_default();
1673                        }
1674                        __FieldTag::Unknown(key) => {
1675                            let value = map.next_value::<serde_json::Value>()?;
1676                            result._unknown_fields.insert(key, value);
1677                        }
1678                    }
1679                }
1680                std::result::Result::Ok(result)
1681            }
1682        }
1683        deserializer.deserialize_any(Visitor)
1684    }
1685}
1686
1687#[doc(hidden)]
1688impl serde::ser::Serialize for ListTopicsResponse {
1689    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1690    where
1691        S: serde::ser::Serializer,
1692    {
1693        use serde::ser::SerializeMap;
1694        #[allow(unused_imports)]
1695        use std::option::Option::Some;
1696        let mut state = serializer.serialize_map(std::option::Option::None)?;
1697        if !self.topics.is_empty() {
1698            state.serialize_entry("topics", &self.topics)?;
1699        }
1700        if !self.next_page_token.is_empty() {
1701            state.serialize_entry("nextPageToken", &self.next_page_token)?;
1702        }
1703        if !self._unknown_fields.is_empty() {
1704            for (key, value) in self._unknown_fields.iter() {
1705                state.serialize_entry(key, &value)?;
1706            }
1707        }
1708        state.end()
1709    }
1710}
1711
1712impl std::fmt::Debug for ListTopicsResponse {
1713    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1714        let mut debug_struct = f.debug_struct("ListTopicsResponse");
1715        debug_struct.field("topics", &self.topics);
1716        debug_struct.field("next_page_token", &self.next_page_token);
1717        if !self._unknown_fields.is_empty() {
1718            debug_struct.field("_unknown_fields", &self._unknown_fields);
1719        }
1720        debug_struct.finish()
1721    }
1722}
1723
1724/// Request for GetTopic.
1725#[derive(Clone, Default, PartialEq)]
1726#[non_exhaustive]
1727pub struct GetTopicRequest {
1728    /// Required. The name of the topic whose configuration to return. Structured
1729    /// like:
1730    /// projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}.
1731    pub name: std::string::String,
1732
1733    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1734}
1735
1736impl GetTopicRequest {
1737    pub fn new() -> Self {
1738        std::default::Default::default()
1739    }
1740
1741    /// Sets the value of [name][crate::model::GetTopicRequest::name].
1742    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1743        self.name = v.into();
1744        self
1745    }
1746}
1747
1748impl wkt::message::Message for GetTopicRequest {
1749    fn typename() -> &'static str {
1750        "type.googleapis.com/google.cloud.managedkafka.v1.GetTopicRequest"
1751    }
1752}
1753
1754#[doc(hidden)]
1755impl<'de> serde::de::Deserialize<'de> for GetTopicRequest {
1756    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1757    where
1758        D: serde::Deserializer<'de>,
1759    {
1760        #[allow(non_camel_case_types)]
1761        #[doc(hidden)]
1762        #[derive(PartialEq, Eq, Hash)]
1763        enum __FieldTag {
1764            __name,
1765            Unknown(std::string::String),
1766        }
1767        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1768            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1769            where
1770                D: serde::Deserializer<'de>,
1771            {
1772                struct Visitor;
1773                impl<'de> serde::de::Visitor<'de> for Visitor {
1774                    type Value = __FieldTag;
1775                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1776                        formatter.write_str("a field name for GetTopicRequest")
1777                    }
1778                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1779                    where
1780                        E: serde::de::Error,
1781                    {
1782                        use std::result::Result::Ok;
1783                        use std::string::ToString;
1784                        match value {
1785                            "name" => Ok(__FieldTag::__name),
1786                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1787                        }
1788                    }
1789                }
1790                deserializer.deserialize_identifier(Visitor)
1791            }
1792        }
1793        struct Visitor;
1794        impl<'de> serde::de::Visitor<'de> for Visitor {
1795            type Value = GetTopicRequest;
1796            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1797                formatter.write_str("struct GetTopicRequest")
1798            }
1799            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1800            where
1801                A: serde::de::MapAccess<'de>,
1802            {
1803                #[allow(unused_imports)]
1804                use serde::de::Error;
1805                use std::option::Option::Some;
1806                let mut fields = std::collections::HashSet::new();
1807                let mut result = Self::Value::new();
1808                while let Some(tag) = map.next_key::<__FieldTag>()? {
1809                    #[allow(clippy::match_single_binding)]
1810                    match tag {
1811                        __FieldTag::__name => {
1812                            if !fields.insert(__FieldTag::__name) {
1813                                return std::result::Result::Err(A::Error::duplicate_field(
1814                                    "multiple values for name",
1815                                ));
1816                            }
1817                            result.name = map
1818                                .next_value::<std::option::Option<std::string::String>>()?
1819                                .unwrap_or_default();
1820                        }
1821                        __FieldTag::Unknown(key) => {
1822                            let value = map.next_value::<serde_json::Value>()?;
1823                            result._unknown_fields.insert(key, value);
1824                        }
1825                    }
1826                }
1827                std::result::Result::Ok(result)
1828            }
1829        }
1830        deserializer.deserialize_any(Visitor)
1831    }
1832}
1833
1834#[doc(hidden)]
1835impl serde::ser::Serialize for GetTopicRequest {
1836    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1837    where
1838        S: serde::ser::Serializer,
1839    {
1840        use serde::ser::SerializeMap;
1841        #[allow(unused_imports)]
1842        use std::option::Option::Some;
1843        let mut state = serializer.serialize_map(std::option::Option::None)?;
1844        if !self.name.is_empty() {
1845            state.serialize_entry("name", &self.name)?;
1846        }
1847        if !self._unknown_fields.is_empty() {
1848            for (key, value) in self._unknown_fields.iter() {
1849                state.serialize_entry(key, &value)?;
1850            }
1851        }
1852        state.end()
1853    }
1854}
1855
1856impl std::fmt::Debug for GetTopicRequest {
1857    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1858        let mut debug_struct = f.debug_struct("GetTopicRequest");
1859        debug_struct.field("name", &self.name);
1860        if !self._unknown_fields.is_empty() {
1861            debug_struct.field("_unknown_fields", &self._unknown_fields);
1862        }
1863        debug_struct.finish()
1864    }
1865}
1866
1867/// Request for CreateTopic.
1868#[derive(Clone, Default, PartialEq)]
1869#[non_exhaustive]
1870pub struct CreateTopicRequest {
1871    /// Required. The parent cluster in which to create the topic.
1872    /// Structured like
1873    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
1874    pub parent: std::string::String,
1875
1876    /// Required. The ID to use for the topic, which will become the final
1877    /// component of the topic's name.
1878    ///
1879    /// This value is structured like: `my-topic-name`.
1880    pub topic_id: std::string::String,
1881
1882    /// Required. Configuration of the topic to create. Its `name` field is
1883    /// ignored.
1884    pub topic: std::option::Option<crate::model::Topic>,
1885
1886    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1887}
1888
1889impl CreateTopicRequest {
1890    pub fn new() -> Self {
1891        std::default::Default::default()
1892    }
1893
1894    /// Sets the value of [parent][crate::model::CreateTopicRequest::parent].
1895    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1896        self.parent = v.into();
1897        self
1898    }
1899
1900    /// Sets the value of [topic_id][crate::model::CreateTopicRequest::topic_id].
1901    pub fn set_topic_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1902        self.topic_id = v.into();
1903        self
1904    }
1905
1906    /// Sets the value of [topic][crate::model::CreateTopicRequest::topic].
1907    pub fn set_topic<T>(mut self, v: T) -> Self
1908    where
1909        T: std::convert::Into<crate::model::Topic>,
1910    {
1911        self.topic = std::option::Option::Some(v.into());
1912        self
1913    }
1914
1915    /// Sets or clears the value of [topic][crate::model::CreateTopicRequest::topic].
1916    pub fn set_or_clear_topic<T>(mut self, v: std::option::Option<T>) -> Self
1917    where
1918        T: std::convert::Into<crate::model::Topic>,
1919    {
1920        self.topic = v.map(|x| x.into());
1921        self
1922    }
1923}
1924
1925impl wkt::message::Message for CreateTopicRequest {
1926    fn typename() -> &'static str {
1927        "type.googleapis.com/google.cloud.managedkafka.v1.CreateTopicRequest"
1928    }
1929}
1930
1931#[doc(hidden)]
1932impl<'de> serde::de::Deserialize<'de> for CreateTopicRequest {
1933    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1934    where
1935        D: serde::Deserializer<'de>,
1936    {
1937        #[allow(non_camel_case_types)]
1938        #[doc(hidden)]
1939        #[derive(PartialEq, Eq, Hash)]
1940        enum __FieldTag {
1941            __parent,
1942            __topic_id,
1943            __topic,
1944            Unknown(std::string::String),
1945        }
1946        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1947            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1948            where
1949                D: serde::Deserializer<'de>,
1950            {
1951                struct Visitor;
1952                impl<'de> serde::de::Visitor<'de> for Visitor {
1953                    type Value = __FieldTag;
1954                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1955                        formatter.write_str("a field name for CreateTopicRequest")
1956                    }
1957                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1958                    where
1959                        E: serde::de::Error,
1960                    {
1961                        use std::result::Result::Ok;
1962                        use std::string::ToString;
1963                        match value {
1964                            "parent" => Ok(__FieldTag::__parent),
1965                            "topicId" => Ok(__FieldTag::__topic_id),
1966                            "topic_id" => Ok(__FieldTag::__topic_id),
1967                            "topic" => Ok(__FieldTag::__topic),
1968                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1969                        }
1970                    }
1971                }
1972                deserializer.deserialize_identifier(Visitor)
1973            }
1974        }
1975        struct Visitor;
1976        impl<'de> serde::de::Visitor<'de> for Visitor {
1977            type Value = CreateTopicRequest;
1978            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1979                formatter.write_str("struct CreateTopicRequest")
1980            }
1981            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1982            where
1983                A: serde::de::MapAccess<'de>,
1984            {
1985                #[allow(unused_imports)]
1986                use serde::de::Error;
1987                use std::option::Option::Some;
1988                let mut fields = std::collections::HashSet::new();
1989                let mut result = Self::Value::new();
1990                while let Some(tag) = map.next_key::<__FieldTag>()? {
1991                    #[allow(clippy::match_single_binding)]
1992                    match tag {
1993                        __FieldTag::__parent => {
1994                            if !fields.insert(__FieldTag::__parent) {
1995                                return std::result::Result::Err(A::Error::duplicate_field(
1996                                    "multiple values for parent",
1997                                ));
1998                            }
1999                            result.parent = map
2000                                .next_value::<std::option::Option<std::string::String>>()?
2001                                .unwrap_or_default();
2002                        }
2003                        __FieldTag::__topic_id => {
2004                            if !fields.insert(__FieldTag::__topic_id) {
2005                                return std::result::Result::Err(A::Error::duplicate_field(
2006                                    "multiple values for topic_id",
2007                                ));
2008                            }
2009                            result.topic_id = map
2010                                .next_value::<std::option::Option<std::string::String>>()?
2011                                .unwrap_or_default();
2012                        }
2013                        __FieldTag::__topic => {
2014                            if !fields.insert(__FieldTag::__topic) {
2015                                return std::result::Result::Err(A::Error::duplicate_field(
2016                                    "multiple values for topic",
2017                                ));
2018                            }
2019                            result.topic =
2020                                map.next_value::<std::option::Option<crate::model::Topic>>()?;
2021                        }
2022                        __FieldTag::Unknown(key) => {
2023                            let value = map.next_value::<serde_json::Value>()?;
2024                            result._unknown_fields.insert(key, value);
2025                        }
2026                    }
2027                }
2028                std::result::Result::Ok(result)
2029            }
2030        }
2031        deserializer.deserialize_any(Visitor)
2032    }
2033}
2034
2035#[doc(hidden)]
2036impl serde::ser::Serialize for CreateTopicRequest {
2037    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2038    where
2039        S: serde::ser::Serializer,
2040    {
2041        use serde::ser::SerializeMap;
2042        #[allow(unused_imports)]
2043        use std::option::Option::Some;
2044        let mut state = serializer.serialize_map(std::option::Option::None)?;
2045        if !self.parent.is_empty() {
2046            state.serialize_entry("parent", &self.parent)?;
2047        }
2048        if !self.topic_id.is_empty() {
2049            state.serialize_entry("topicId", &self.topic_id)?;
2050        }
2051        if self.topic.is_some() {
2052            state.serialize_entry("topic", &self.topic)?;
2053        }
2054        if !self._unknown_fields.is_empty() {
2055            for (key, value) in self._unknown_fields.iter() {
2056                state.serialize_entry(key, &value)?;
2057            }
2058        }
2059        state.end()
2060    }
2061}
2062
2063impl std::fmt::Debug for CreateTopicRequest {
2064    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2065        let mut debug_struct = f.debug_struct("CreateTopicRequest");
2066        debug_struct.field("parent", &self.parent);
2067        debug_struct.field("topic_id", &self.topic_id);
2068        debug_struct.field("topic", &self.topic);
2069        if !self._unknown_fields.is_empty() {
2070            debug_struct.field("_unknown_fields", &self._unknown_fields);
2071        }
2072        debug_struct.finish()
2073    }
2074}
2075
2076/// Request for UpdateTopic.
2077#[derive(Clone, Default, PartialEq)]
2078#[non_exhaustive]
2079pub struct UpdateTopicRequest {
2080    /// Required. Field mask is used to specify the fields to be overwritten in the
2081    /// Topic resource by the update. The fields specified in the update_mask are
2082    /// relative to the resource, not the full request. A field will be overwritten
2083    /// if it is in the mask. The mask is required and a value of * will update all
2084    /// fields.
2085    pub update_mask: std::option::Option<wkt::FieldMask>,
2086
2087    /// Required. The topic to update. Its `name` field must be populated.
2088    pub topic: std::option::Option<crate::model::Topic>,
2089
2090    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2091}
2092
2093impl UpdateTopicRequest {
2094    pub fn new() -> Self {
2095        std::default::Default::default()
2096    }
2097
2098    /// Sets the value of [update_mask][crate::model::UpdateTopicRequest::update_mask].
2099    pub fn set_update_mask<T>(mut self, v: T) -> Self
2100    where
2101        T: std::convert::Into<wkt::FieldMask>,
2102    {
2103        self.update_mask = std::option::Option::Some(v.into());
2104        self
2105    }
2106
2107    /// Sets or clears the value of [update_mask][crate::model::UpdateTopicRequest::update_mask].
2108    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2109    where
2110        T: std::convert::Into<wkt::FieldMask>,
2111    {
2112        self.update_mask = v.map(|x| x.into());
2113        self
2114    }
2115
2116    /// Sets the value of [topic][crate::model::UpdateTopicRequest::topic].
2117    pub fn set_topic<T>(mut self, v: T) -> Self
2118    where
2119        T: std::convert::Into<crate::model::Topic>,
2120    {
2121        self.topic = std::option::Option::Some(v.into());
2122        self
2123    }
2124
2125    /// Sets or clears the value of [topic][crate::model::UpdateTopicRequest::topic].
2126    pub fn set_or_clear_topic<T>(mut self, v: std::option::Option<T>) -> Self
2127    where
2128        T: std::convert::Into<crate::model::Topic>,
2129    {
2130        self.topic = v.map(|x| x.into());
2131        self
2132    }
2133}
2134
2135impl wkt::message::Message for UpdateTopicRequest {
2136    fn typename() -> &'static str {
2137        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateTopicRequest"
2138    }
2139}
2140
2141#[doc(hidden)]
2142impl<'de> serde::de::Deserialize<'de> for UpdateTopicRequest {
2143    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2144    where
2145        D: serde::Deserializer<'de>,
2146    {
2147        #[allow(non_camel_case_types)]
2148        #[doc(hidden)]
2149        #[derive(PartialEq, Eq, Hash)]
2150        enum __FieldTag {
2151            __update_mask,
2152            __topic,
2153            Unknown(std::string::String),
2154        }
2155        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2156            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2157            where
2158                D: serde::Deserializer<'de>,
2159            {
2160                struct Visitor;
2161                impl<'de> serde::de::Visitor<'de> for Visitor {
2162                    type Value = __FieldTag;
2163                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2164                        formatter.write_str("a field name for UpdateTopicRequest")
2165                    }
2166                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2167                    where
2168                        E: serde::de::Error,
2169                    {
2170                        use std::result::Result::Ok;
2171                        use std::string::ToString;
2172                        match value {
2173                            "updateMask" => Ok(__FieldTag::__update_mask),
2174                            "update_mask" => Ok(__FieldTag::__update_mask),
2175                            "topic" => Ok(__FieldTag::__topic),
2176                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2177                        }
2178                    }
2179                }
2180                deserializer.deserialize_identifier(Visitor)
2181            }
2182        }
2183        struct Visitor;
2184        impl<'de> serde::de::Visitor<'de> for Visitor {
2185            type Value = UpdateTopicRequest;
2186            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2187                formatter.write_str("struct UpdateTopicRequest")
2188            }
2189            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2190            where
2191                A: serde::de::MapAccess<'de>,
2192            {
2193                #[allow(unused_imports)]
2194                use serde::de::Error;
2195                use std::option::Option::Some;
2196                let mut fields = std::collections::HashSet::new();
2197                let mut result = Self::Value::new();
2198                while let Some(tag) = map.next_key::<__FieldTag>()? {
2199                    #[allow(clippy::match_single_binding)]
2200                    match tag {
2201                        __FieldTag::__update_mask => {
2202                            if !fields.insert(__FieldTag::__update_mask) {
2203                                return std::result::Result::Err(A::Error::duplicate_field(
2204                                    "multiple values for update_mask",
2205                                ));
2206                            }
2207                            result.update_mask =
2208                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
2209                        }
2210                        __FieldTag::__topic => {
2211                            if !fields.insert(__FieldTag::__topic) {
2212                                return std::result::Result::Err(A::Error::duplicate_field(
2213                                    "multiple values for topic",
2214                                ));
2215                            }
2216                            result.topic =
2217                                map.next_value::<std::option::Option<crate::model::Topic>>()?;
2218                        }
2219                        __FieldTag::Unknown(key) => {
2220                            let value = map.next_value::<serde_json::Value>()?;
2221                            result._unknown_fields.insert(key, value);
2222                        }
2223                    }
2224                }
2225                std::result::Result::Ok(result)
2226            }
2227        }
2228        deserializer.deserialize_any(Visitor)
2229    }
2230}
2231
2232#[doc(hidden)]
2233impl serde::ser::Serialize for UpdateTopicRequest {
2234    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2235    where
2236        S: serde::ser::Serializer,
2237    {
2238        use serde::ser::SerializeMap;
2239        #[allow(unused_imports)]
2240        use std::option::Option::Some;
2241        let mut state = serializer.serialize_map(std::option::Option::None)?;
2242        if self.update_mask.is_some() {
2243            state.serialize_entry("updateMask", &self.update_mask)?;
2244        }
2245        if self.topic.is_some() {
2246            state.serialize_entry("topic", &self.topic)?;
2247        }
2248        if !self._unknown_fields.is_empty() {
2249            for (key, value) in self._unknown_fields.iter() {
2250                state.serialize_entry(key, &value)?;
2251            }
2252        }
2253        state.end()
2254    }
2255}
2256
2257impl std::fmt::Debug for UpdateTopicRequest {
2258    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2259        let mut debug_struct = f.debug_struct("UpdateTopicRequest");
2260        debug_struct.field("update_mask", &self.update_mask);
2261        debug_struct.field("topic", &self.topic);
2262        if !self._unknown_fields.is_empty() {
2263            debug_struct.field("_unknown_fields", &self._unknown_fields);
2264        }
2265        debug_struct.finish()
2266    }
2267}
2268
2269/// Request for DeleteTopic.
2270#[derive(Clone, Default, PartialEq)]
2271#[non_exhaustive]
2272pub struct DeleteTopicRequest {
2273    /// Required. The name of the topic to delete.
2274    /// `projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}`.
2275    pub name: std::string::String,
2276
2277    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2278}
2279
2280impl DeleteTopicRequest {
2281    pub fn new() -> Self {
2282        std::default::Default::default()
2283    }
2284
2285    /// Sets the value of [name][crate::model::DeleteTopicRequest::name].
2286    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2287        self.name = v.into();
2288        self
2289    }
2290}
2291
2292impl wkt::message::Message for DeleteTopicRequest {
2293    fn typename() -> &'static str {
2294        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteTopicRequest"
2295    }
2296}
2297
2298#[doc(hidden)]
2299impl<'de> serde::de::Deserialize<'de> for DeleteTopicRequest {
2300    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2301    where
2302        D: serde::Deserializer<'de>,
2303    {
2304        #[allow(non_camel_case_types)]
2305        #[doc(hidden)]
2306        #[derive(PartialEq, Eq, Hash)]
2307        enum __FieldTag {
2308            __name,
2309            Unknown(std::string::String),
2310        }
2311        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2312            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2313            where
2314                D: serde::Deserializer<'de>,
2315            {
2316                struct Visitor;
2317                impl<'de> serde::de::Visitor<'de> for Visitor {
2318                    type Value = __FieldTag;
2319                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2320                        formatter.write_str("a field name for DeleteTopicRequest")
2321                    }
2322                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2323                    where
2324                        E: serde::de::Error,
2325                    {
2326                        use std::result::Result::Ok;
2327                        use std::string::ToString;
2328                        match value {
2329                            "name" => Ok(__FieldTag::__name),
2330                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2331                        }
2332                    }
2333                }
2334                deserializer.deserialize_identifier(Visitor)
2335            }
2336        }
2337        struct Visitor;
2338        impl<'de> serde::de::Visitor<'de> for Visitor {
2339            type Value = DeleteTopicRequest;
2340            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2341                formatter.write_str("struct DeleteTopicRequest")
2342            }
2343            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2344            where
2345                A: serde::de::MapAccess<'de>,
2346            {
2347                #[allow(unused_imports)]
2348                use serde::de::Error;
2349                use std::option::Option::Some;
2350                let mut fields = std::collections::HashSet::new();
2351                let mut result = Self::Value::new();
2352                while let Some(tag) = map.next_key::<__FieldTag>()? {
2353                    #[allow(clippy::match_single_binding)]
2354                    match tag {
2355                        __FieldTag::__name => {
2356                            if !fields.insert(__FieldTag::__name) {
2357                                return std::result::Result::Err(A::Error::duplicate_field(
2358                                    "multiple values for name",
2359                                ));
2360                            }
2361                            result.name = map
2362                                .next_value::<std::option::Option<std::string::String>>()?
2363                                .unwrap_or_default();
2364                        }
2365                        __FieldTag::Unknown(key) => {
2366                            let value = map.next_value::<serde_json::Value>()?;
2367                            result._unknown_fields.insert(key, value);
2368                        }
2369                    }
2370                }
2371                std::result::Result::Ok(result)
2372            }
2373        }
2374        deserializer.deserialize_any(Visitor)
2375    }
2376}
2377
2378#[doc(hidden)]
2379impl serde::ser::Serialize for DeleteTopicRequest {
2380    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2381    where
2382        S: serde::ser::Serializer,
2383    {
2384        use serde::ser::SerializeMap;
2385        #[allow(unused_imports)]
2386        use std::option::Option::Some;
2387        let mut state = serializer.serialize_map(std::option::Option::None)?;
2388        if !self.name.is_empty() {
2389            state.serialize_entry("name", &self.name)?;
2390        }
2391        if !self._unknown_fields.is_empty() {
2392            for (key, value) in self._unknown_fields.iter() {
2393                state.serialize_entry(key, &value)?;
2394            }
2395        }
2396        state.end()
2397    }
2398}
2399
2400impl std::fmt::Debug for DeleteTopicRequest {
2401    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2402        let mut debug_struct = f.debug_struct("DeleteTopicRequest");
2403        debug_struct.field("name", &self.name);
2404        if !self._unknown_fields.is_empty() {
2405            debug_struct.field("_unknown_fields", &self._unknown_fields);
2406        }
2407        debug_struct.finish()
2408    }
2409}
2410
2411/// Request for ListConsumerGroups.
2412#[derive(Clone, Default, PartialEq)]
2413#[non_exhaustive]
2414pub struct ListConsumerGroupsRequest {
2415    /// Required. The parent cluster whose consumer groups are to be listed.
2416    /// Structured like
2417    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
2418    pub parent: std::string::String,
2419
2420    /// Optional. The maximum number of consumer groups to return. The service may
2421    /// return fewer than this value. If unset or zero, all consumer groups for the
2422    /// parent is returned.
2423    pub page_size: i32,
2424
2425    /// Optional. A page token, received from a previous `ListConsumerGroups` call.
2426    /// Provide this to retrieve the subsequent page.
2427    ///
2428    /// When paginating, all other parameters provided to `ListConsumerGroups` must
2429    /// match the call that provided the page token.
2430    pub page_token: std::string::String,
2431
2432    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2433}
2434
2435impl ListConsumerGroupsRequest {
2436    pub fn new() -> Self {
2437        std::default::Default::default()
2438    }
2439
2440    /// Sets the value of [parent][crate::model::ListConsumerGroupsRequest::parent].
2441    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2442        self.parent = v.into();
2443        self
2444    }
2445
2446    /// Sets the value of [page_size][crate::model::ListConsumerGroupsRequest::page_size].
2447    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2448        self.page_size = v.into();
2449        self
2450    }
2451
2452    /// Sets the value of [page_token][crate::model::ListConsumerGroupsRequest::page_token].
2453    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2454        self.page_token = v.into();
2455        self
2456    }
2457}
2458
2459impl wkt::message::Message for ListConsumerGroupsRequest {
2460    fn typename() -> &'static str {
2461        "type.googleapis.com/google.cloud.managedkafka.v1.ListConsumerGroupsRequest"
2462    }
2463}
2464
2465#[doc(hidden)]
2466impl<'de> serde::de::Deserialize<'de> for ListConsumerGroupsRequest {
2467    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2468    where
2469        D: serde::Deserializer<'de>,
2470    {
2471        #[allow(non_camel_case_types)]
2472        #[doc(hidden)]
2473        #[derive(PartialEq, Eq, Hash)]
2474        enum __FieldTag {
2475            __parent,
2476            __page_size,
2477            __page_token,
2478            Unknown(std::string::String),
2479        }
2480        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2481            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2482            where
2483                D: serde::Deserializer<'de>,
2484            {
2485                struct Visitor;
2486                impl<'de> serde::de::Visitor<'de> for Visitor {
2487                    type Value = __FieldTag;
2488                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2489                        formatter.write_str("a field name for ListConsumerGroupsRequest")
2490                    }
2491                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2492                    where
2493                        E: serde::de::Error,
2494                    {
2495                        use std::result::Result::Ok;
2496                        use std::string::ToString;
2497                        match value {
2498                            "parent" => Ok(__FieldTag::__parent),
2499                            "pageSize" => Ok(__FieldTag::__page_size),
2500                            "page_size" => Ok(__FieldTag::__page_size),
2501                            "pageToken" => Ok(__FieldTag::__page_token),
2502                            "page_token" => Ok(__FieldTag::__page_token),
2503                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2504                        }
2505                    }
2506                }
2507                deserializer.deserialize_identifier(Visitor)
2508            }
2509        }
2510        struct Visitor;
2511        impl<'de> serde::de::Visitor<'de> for Visitor {
2512            type Value = ListConsumerGroupsRequest;
2513            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2514                formatter.write_str("struct ListConsumerGroupsRequest")
2515            }
2516            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2517            where
2518                A: serde::de::MapAccess<'de>,
2519            {
2520                #[allow(unused_imports)]
2521                use serde::de::Error;
2522                use std::option::Option::Some;
2523                let mut fields = std::collections::HashSet::new();
2524                let mut result = Self::Value::new();
2525                while let Some(tag) = map.next_key::<__FieldTag>()? {
2526                    #[allow(clippy::match_single_binding)]
2527                    match tag {
2528                        __FieldTag::__parent => {
2529                            if !fields.insert(__FieldTag::__parent) {
2530                                return std::result::Result::Err(A::Error::duplicate_field(
2531                                    "multiple values for parent",
2532                                ));
2533                            }
2534                            result.parent = map
2535                                .next_value::<std::option::Option<std::string::String>>()?
2536                                .unwrap_or_default();
2537                        }
2538                        __FieldTag::__page_size => {
2539                            if !fields.insert(__FieldTag::__page_size) {
2540                                return std::result::Result::Err(A::Error::duplicate_field(
2541                                    "multiple values for page_size",
2542                                ));
2543                            }
2544                            struct __With(std::option::Option<i32>);
2545                            impl<'de> serde::de::Deserialize<'de> for __With {
2546                                fn deserialize<D>(
2547                                    deserializer: D,
2548                                ) -> std::result::Result<Self, D::Error>
2549                                where
2550                                    D: serde::de::Deserializer<'de>,
2551                                {
2552                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
2553                                }
2554                            }
2555                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
2556                        }
2557                        __FieldTag::__page_token => {
2558                            if !fields.insert(__FieldTag::__page_token) {
2559                                return std::result::Result::Err(A::Error::duplicate_field(
2560                                    "multiple values for page_token",
2561                                ));
2562                            }
2563                            result.page_token = map
2564                                .next_value::<std::option::Option<std::string::String>>()?
2565                                .unwrap_or_default();
2566                        }
2567                        __FieldTag::Unknown(key) => {
2568                            let value = map.next_value::<serde_json::Value>()?;
2569                            result._unknown_fields.insert(key, value);
2570                        }
2571                    }
2572                }
2573                std::result::Result::Ok(result)
2574            }
2575        }
2576        deserializer.deserialize_any(Visitor)
2577    }
2578}
2579
2580#[doc(hidden)]
2581impl serde::ser::Serialize for ListConsumerGroupsRequest {
2582    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2583    where
2584        S: serde::ser::Serializer,
2585    {
2586        use serde::ser::SerializeMap;
2587        #[allow(unused_imports)]
2588        use std::option::Option::Some;
2589        let mut state = serializer.serialize_map(std::option::Option::None)?;
2590        if !self.parent.is_empty() {
2591            state.serialize_entry("parent", &self.parent)?;
2592        }
2593        if !wkt::internal::is_default(&self.page_size) {
2594            struct __With<'a>(&'a i32);
2595            impl<'a> serde::ser::Serialize for __With<'a> {
2596                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2597                where
2598                    S: serde::ser::Serializer,
2599                {
2600                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
2601                }
2602            }
2603            state.serialize_entry("pageSize", &__With(&self.page_size))?;
2604        }
2605        if !self.page_token.is_empty() {
2606            state.serialize_entry("pageToken", &self.page_token)?;
2607        }
2608        if !self._unknown_fields.is_empty() {
2609            for (key, value) in self._unknown_fields.iter() {
2610                state.serialize_entry(key, &value)?;
2611            }
2612        }
2613        state.end()
2614    }
2615}
2616
2617impl std::fmt::Debug for ListConsumerGroupsRequest {
2618    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2619        let mut debug_struct = f.debug_struct("ListConsumerGroupsRequest");
2620        debug_struct.field("parent", &self.parent);
2621        debug_struct.field("page_size", &self.page_size);
2622        debug_struct.field("page_token", &self.page_token);
2623        if !self._unknown_fields.is_empty() {
2624            debug_struct.field("_unknown_fields", &self._unknown_fields);
2625        }
2626        debug_struct.finish()
2627    }
2628}
2629
2630/// Response for ListConsumerGroups.
2631#[derive(Clone, Default, PartialEq)]
2632#[non_exhaustive]
2633pub struct ListConsumerGroupsResponse {
2634    /// The list of consumer group in the requested parent. The order of the
2635    /// consumer groups is unspecified.
2636    pub consumer_groups: std::vec::Vec<crate::model::ConsumerGroup>,
2637
2638    /// A token that can be sent as `page_token` to retrieve the next page of
2639    /// results. If this field is omitted, there are no more results.
2640    pub next_page_token: std::string::String,
2641
2642    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2643}
2644
2645impl ListConsumerGroupsResponse {
2646    pub fn new() -> Self {
2647        std::default::Default::default()
2648    }
2649
2650    /// Sets the value of [consumer_groups][crate::model::ListConsumerGroupsResponse::consumer_groups].
2651    pub fn set_consumer_groups<T, V>(mut self, v: T) -> Self
2652    where
2653        T: std::iter::IntoIterator<Item = V>,
2654        V: std::convert::Into<crate::model::ConsumerGroup>,
2655    {
2656        use std::iter::Iterator;
2657        self.consumer_groups = v.into_iter().map(|i| i.into()).collect();
2658        self
2659    }
2660
2661    /// Sets the value of [next_page_token][crate::model::ListConsumerGroupsResponse::next_page_token].
2662    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2663        self.next_page_token = v.into();
2664        self
2665    }
2666}
2667
2668impl wkt::message::Message for ListConsumerGroupsResponse {
2669    fn typename() -> &'static str {
2670        "type.googleapis.com/google.cloud.managedkafka.v1.ListConsumerGroupsResponse"
2671    }
2672}
2673
2674#[doc(hidden)]
2675impl gax::paginator::internal::PageableResponse for ListConsumerGroupsResponse {
2676    type PageItem = crate::model::ConsumerGroup;
2677
2678    fn items(self) -> std::vec::Vec<Self::PageItem> {
2679        self.consumer_groups
2680    }
2681
2682    fn next_page_token(&self) -> std::string::String {
2683        use std::clone::Clone;
2684        self.next_page_token.clone()
2685    }
2686}
2687
2688#[doc(hidden)]
2689impl<'de> serde::de::Deserialize<'de> for ListConsumerGroupsResponse {
2690    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2691    where
2692        D: serde::Deserializer<'de>,
2693    {
2694        #[allow(non_camel_case_types)]
2695        #[doc(hidden)]
2696        #[derive(PartialEq, Eq, Hash)]
2697        enum __FieldTag {
2698            __consumer_groups,
2699            __next_page_token,
2700            Unknown(std::string::String),
2701        }
2702        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2703            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2704            where
2705                D: serde::Deserializer<'de>,
2706            {
2707                struct Visitor;
2708                impl<'de> serde::de::Visitor<'de> for Visitor {
2709                    type Value = __FieldTag;
2710                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2711                        formatter.write_str("a field name for ListConsumerGroupsResponse")
2712                    }
2713                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2714                    where
2715                        E: serde::de::Error,
2716                    {
2717                        use std::result::Result::Ok;
2718                        use std::string::ToString;
2719                        match value {
2720                            "consumerGroups" => Ok(__FieldTag::__consumer_groups),
2721                            "consumer_groups" => Ok(__FieldTag::__consumer_groups),
2722                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
2723                            "next_page_token" => Ok(__FieldTag::__next_page_token),
2724                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2725                        }
2726                    }
2727                }
2728                deserializer.deserialize_identifier(Visitor)
2729            }
2730        }
2731        struct Visitor;
2732        impl<'de> serde::de::Visitor<'de> for Visitor {
2733            type Value = ListConsumerGroupsResponse;
2734            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2735                formatter.write_str("struct ListConsumerGroupsResponse")
2736            }
2737            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2738            where
2739                A: serde::de::MapAccess<'de>,
2740            {
2741                #[allow(unused_imports)]
2742                use serde::de::Error;
2743                use std::option::Option::Some;
2744                let mut fields = std::collections::HashSet::new();
2745                let mut result = Self::Value::new();
2746                while let Some(tag) = map.next_key::<__FieldTag>()? {
2747                    #[allow(clippy::match_single_binding)]
2748                    match tag {
2749                        __FieldTag::__consumer_groups => {
2750                            if !fields.insert(__FieldTag::__consumer_groups) {
2751                                return std::result::Result::Err(A::Error::duplicate_field(
2752                                    "multiple values for consumer_groups",
2753                                ));
2754                            }
2755                            result.consumer_groups = map.next_value::<std::option::Option<std::vec::Vec<crate::model::ConsumerGroup>>>()?.unwrap_or_default();
2756                        }
2757                        __FieldTag::__next_page_token => {
2758                            if !fields.insert(__FieldTag::__next_page_token) {
2759                                return std::result::Result::Err(A::Error::duplicate_field(
2760                                    "multiple values for next_page_token",
2761                                ));
2762                            }
2763                            result.next_page_token = map
2764                                .next_value::<std::option::Option<std::string::String>>()?
2765                                .unwrap_or_default();
2766                        }
2767                        __FieldTag::Unknown(key) => {
2768                            let value = map.next_value::<serde_json::Value>()?;
2769                            result._unknown_fields.insert(key, value);
2770                        }
2771                    }
2772                }
2773                std::result::Result::Ok(result)
2774            }
2775        }
2776        deserializer.deserialize_any(Visitor)
2777    }
2778}
2779
2780#[doc(hidden)]
2781impl serde::ser::Serialize for ListConsumerGroupsResponse {
2782    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2783    where
2784        S: serde::ser::Serializer,
2785    {
2786        use serde::ser::SerializeMap;
2787        #[allow(unused_imports)]
2788        use std::option::Option::Some;
2789        let mut state = serializer.serialize_map(std::option::Option::None)?;
2790        if !self.consumer_groups.is_empty() {
2791            state.serialize_entry("consumerGroups", &self.consumer_groups)?;
2792        }
2793        if !self.next_page_token.is_empty() {
2794            state.serialize_entry("nextPageToken", &self.next_page_token)?;
2795        }
2796        if !self._unknown_fields.is_empty() {
2797            for (key, value) in self._unknown_fields.iter() {
2798                state.serialize_entry(key, &value)?;
2799            }
2800        }
2801        state.end()
2802    }
2803}
2804
2805impl std::fmt::Debug for ListConsumerGroupsResponse {
2806    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2807        let mut debug_struct = f.debug_struct("ListConsumerGroupsResponse");
2808        debug_struct.field("consumer_groups", &self.consumer_groups);
2809        debug_struct.field("next_page_token", &self.next_page_token);
2810        if !self._unknown_fields.is_empty() {
2811            debug_struct.field("_unknown_fields", &self._unknown_fields);
2812        }
2813        debug_struct.finish()
2814    }
2815}
2816
2817/// Request for GetConsumerGroup.
2818#[derive(Clone, Default, PartialEq)]
2819#[non_exhaustive]
2820pub struct GetConsumerGroupRequest {
2821    /// Required. The name of the consumer group whose configuration to return.
2822    /// `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`.
2823    pub name: std::string::String,
2824
2825    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2826}
2827
2828impl GetConsumerGroupRequest {
2829    pub fn new() -> Self {
2830        std::default::Default::default()
2831    }
2832
2833    /// Sets the value of [name][crate::model::GetConsumerGroupRequest::name].
2834    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2835        self.name = v.into();
2836        self
2837    }
2838}
2839
2840impl wkt::message::Message for GetConsumerGroupRequest {
2841    fn typename() -> &'static str {
2842        "type.googleapis.com/google.cloud.managedkafka.v1.GetConsumerGroupRequest"
2843    }
2844}
2845
2846#[doc(hidden)]
2847impl<'de> serde::de::Deserialize<'de> for GetConsumerGroupRequest {
2848    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2849    where
2850        D: serde::Deserializer<'de>,
2851    {
2852        #[allow(non_camel_case_types)]
2853        #[doc(hidden)]
2854        #[derive(PartialEq, Eq, Hash)]
2855        enum __FieldTag {
2856            __name,
2857            Unknown(std::string::String),
2858        }
2859        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2860            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2861            where
2862                D: serde::Deserializer<'de>,
2863            {
2864                struct Visitor;
2865                impl<'de> serde::de::Visitor<'de> for Visitor {
2866                    type Value = __FieldTag;
2867                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2868                        formatter.write_str("a field name for GetConsumerGroupRequest")
2869                    }
2870                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2871                    where
2872                        E: serde::de::Error,
2873                    {
2874                        use std::result::Result::Ok;
2875                        use std::string::ToString;
2876                        match value {
2877                            "name" => Ok(__FieldTag::__name),
2878                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2879                        }
2880                    }
2881                }
2882                deserializer.deserialize_identifier(Visitor)
2883            }
2884        }
2885        struct Visitor;
2886        impl<'de> serde::de::Visitor<'de> for Visitor {
2887            type Value = GetConsumerGroupRequest;
2888            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2889                formatter.write_str("struct GetConsumerGroupRequest")
2890            }
2891            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2892            where
2893                A: serde::de::MapAccess<'de>,
2894            {
2895                #[allow(unused_imports)]
2896                use serde::de::Error;
2897                use std::option::Option::Some;
2898                let mut fields = std::collections::HashSet::new();
2899                let mut result = Self::Value::new();
2900                while let Some(tag) = map.next_key::<__FieldTag>()? {
2901                    #[allow(clippy::match_single_binding)]
2902                    match tag {
2903                        __FieldTag::__name => {
2904                            if !fields.insert(__FieldTag::__name) {
2905                                return std::result::Result::Err(A::Error::duplicate_field(
2906                                    "multiple values for name",
2907                                ));
2908                            }
2909                            result.name = map
2910                                .next_value::<std::option::Option<std::string::String>>()?
2911                                .unwrap_or_default();
2912                        }
2913                        __FieldTag::Unknown(key) => {
2914                            let value = map.next_value::<serde_json::Value>()?;
2915                            result._unknown_fields.insert(key, value);
2916                        }
2917                    }
2918                }
2919                std::result::Result::Ok(result)
2920            }
2921        }
2922        deserializer.deserialize_any(Visitor)
2923    }
2924}
2925
2926#[doc(hidden)]
2927impl serde::ser::Serialize for GetConsumerGroupRequest {
2928    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2929    where
2930        S: serde::ser::Serializer,
2931    {
2932        use serde::ser::SerializeMap;
2933        #[allow(unused_imports)]
2934        use std::option::Option::Some;
2935        let mut state = serializer.serialize_map(std::option::Option::None)?;
2936        if !self.name.is_empty() {
2937            state.serialize_entry("name", &self.name)?;
2938        }
2939        if !self._unknown_fields.is_empty() {
2940            for (key, value) in self._unknown_fields.iter() {
2941                state.serialize_entry(key, &value)?;
2942            }
2943        }
2944        state.end()
2945    }
2946}
2947
2948impl std::fmt::Debug for GetConsumerGroupRequest {
2949    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2950        let mut debug_struct = f.debug_struct("GetConsumerGroupRequest");
2951        debug_struct.field("name", &self.name);
2952        if !self._unknown_fields.is_empty() {
2953            debug_struct.field("_unknown_fields", &self._unknown_fields);
2954        }
2955        debug_struct.finish()
2956    }
2957}
2958
2959/// Request for UpdateConsumerGroup.
2960#[derive(Clone, Default, PartialEq)]
2961#[non_exhaustive]
2962pub struct UpdateConsumerGroupRequest {
2963    /// Required. Field mask is used to specify the fields to be overwritten in the
2964    /// ConsumerGroup resource by the update.
2965    /// The fields specified in the update_mask are relative to the resource, not
2966    /// the full request. A field will be overwritten if it is in the mask. The
2967    /// mask is required and a value of * will update all fields.
2968    pub update_mask: std::option::Option<wkt::FieldMask>,
2969
2970    /// Required. The consumer group to update. Its `name` field must be populated.
2971    pub consumer_group: std::option::Option<crate::model::ConsumerGroup>,
2972
2973    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2974}
2975
2976impl UpdateConsumerGroupRequest {
2977    pub fn new() -> Self {
2978        std::default::Default::default()
2979    }
2980
2981    /// Sets the value of [update_mask][crate::model::UpdateConsumerGroupRequest::update_mask].
2982    pub fn set_update_mask<T>(mut self, v: T) -> Self
2983    where
2984        T: std::convert::Into<wkt::FieldMask>,
2985    {
2986        self.update_mask = std::option::Option::Some(v.into());
2987        self
2988    }
2989
2990    /// Sets or clears the value of [update_mask][crate::model::UpdateConsumerGroupRequest::update_mask].
2991    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2992    where
2993        T: std::convert::Into<wkt::FieldMask>,
2994    {
2995        self.update_mask = v.map(|x| x.into());
2996        self
2997    }
2998
2999    /// Sets the value of [consumer_group][crate::model::UpdateConsumerGroupRequest::consumer_group].
3000    pub fn set_consumer_group<T>(mut self, v: T) -> Self
3001    where
3002        T: std::convert::Into<crate::model::ConsumerGroup>,
3003    {
3004        self.consumer_group = std::option::Option::Some(v.into());
3005        self
3006    }
3007
3008    /// Sets or clears the value of [consumer_group][crate::model::UpdateConsumerGroupRequest::consumer_group].
3009    pub fn set_or_clear_consumer_group<T>(mut self, v: std::option::Option<T>) -> Self
3010    where
3011        T: std::convert::Into<crate::model::ConsumerGroup>,
3012    {
3013        self.consumer_group = v.map(|x| x.into());
3014        self
3015    }
3016}
3017
3018impl wkt::message::Message for UpdateConsumerGroupRequest {
3019    fn typename() -> &'static str {
3020        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateConsumerGroupRequest"
3021    }
3022}
3023
3024#[doc(hidden)]
3025impl<'de> serde::de::Deserialize<'de> for UpdateConsumerGroupRequest {
3026    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3027    where
3028        D: serde::Deserializer<'de>,
3029    {
3030        #[allow(non_camel_case_types)]
3031        #[doc(hidden)]
3032        #[derive(PartialEq, Eq, Hash)]
3033        enum __FieldTag {
3034            __update_mask,
3035            __consumer_group,
3036            Unknown(std::string::String),
3037        }
3038        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3039            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3040            where
3041                D: serde::Deserializer<'de>,
3042            {
3043                struct Visitor;
3044                impl<'de> serde::de::Visitor<'de> for Visitor {
3045                    type Value = __FieldTag;
3046                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3047                        formatter.write_str("a field name for UpdateConsumerGroupRequest")
3048                    }
3049                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3050                    where
3051                        E: serde::de::Error,
3052                    {
3053                        use std::result::Result::Ok;
3054                        use std::string::ToString;
3055                        match value {
3056                            "updateMask" => Ok(__FieldTag::__update_mask),
3057                            "update_mask" => Ok(__FieldTag::__update_mask),
3058                            "consumerGroup" => Ok(__FieldTag::__consumer_group),
3059                            "consumer_group" => Ok(__FieldTag::__consumer_group),
3060                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3061                        }
3062                    }
3063                }
3064                deserializer.deserialize_identifier(Visitor)
3065            }
3066        }
3067        struct Visitor;
3068        impl<'de> serde::de::Visitor<'de> for Visitor {
3069            type Value = UpdateConsumerGroupRequest;
3070            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3071                formatter.write_str("struct UpdateConsumerGroupRequest")
3072            }
3073            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3074            where
3075                A: serde::de::MapAccess<'de>,
3076            {
3077                #[allow(unused_imports)]
3078                use serde::de::Error;
3079                use std::option::Option::Some;
3080                let mut fields = std::collections::HashSet::new();
3081                let mut result = Self::Value::new();
3082                while let Some(tag) = map.next_key::<__FieldTag>()? {
3083                    #[allow(clippy::match_single_binding)]
3084                    match tag {
3085                        __FieldTag::__update_mask => {
3086                            if !fields.insert(__FieldTag::__update_mask) {
3087                                return std::result::Result::Err(A::Error::duplicate_field(
3088                                    "multiple values for update_mask",
3089                                ));
3090                            }
3091                            result.update_mask =
3092                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
3093                        }
3094                        __FieldTag::__consumer_group => {
3095                            if !fields.insert(__FieldTag::__consumer_group) {
3096                                return std::result::Result::Err(A::Error::duplicate_field(
3097                                    "multiple values for consumer_group",
3098                                ));
3099                            }
3100                            result.consumer_group = map
3101                                .next_value::<std::option::Option<crate::model::ConsumerGroup>>()?;
3102                        }
3103                        __FieldTag::Unknown(key) => {
3104                            let value = map.next_value::<serde_json::Value>()?;
3105                            result._unknown_fields.insert(key, value);
3106                        }
3107                    }
3108                }
3109                std::result::Result::Ok(result)
3110            }
3111        }
3112        deserializer.deserialize_any(Visitor)
3113    }
3114}
3115
3116#[doc(hidden)]
3117impl serde::ser::Serialize for UpdateConsumerGroupRequest {
3118    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3119    where
3120        S: serde::ser::Serializer,
3121    {
3122        use serde::ser::SerializeMap;
3123        #[allow(unused_imports)]
3124        use std::option::Option::Some;
3125        let mut state = serializer.serialize_map(std::option::Option::None)?;
3126        if self.update_mask.is_some() {
3127            state.serialize_entry("updateMask", &self.update_mask)?;
3128        }
3129        if self.consumer_group.is_some() {
3130            state.serialize_entry("consumerGroup", &self.consumer_group)?;
3131        }
3132        if !self._unknown_fields.is_empty() {
3133            for (key, value) in self._unknown_fields.iter() {
3134                state.serialize_entry(key, &value)?;
3135            }
3136        }
3137        state.end()
3138    }
3139}
3140
3141impl std::fmt::Debug for UpdateConsumerGroupRequest {
3142    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3143        let mut debug_struct = f.debug_struct("UpdateConsumerGroupRequest");
3144        debug_struct.field("update_mask", &self.update_mask);
3145        debug_struct.field("consumer_group", &self.consumer_group);
3146        if !self._unknown_fields.is_empty() {
3147            debug_struct.field("_unknown_fields", &self._unknown_fields);
3148        }
3149        debug_struct.finish()
3150    }
3151}
3152
3153/// Request for DeleteConsumerGroup.
3154#[derive(Clone, Default, PartialEq)]
3155#[non_exhaustive]
3156pub struct DeleteConsumerGroupRequest {
3157    /// Required. The name of the consumer group to delete.
3158    /// `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`.
3159    pub name: std::string::String,
3160
3161    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3162}
3163
3164impl DeleteConsumerGroupRequest {
3165    pub fn new() -> Self {
3166        std::default::Default::default()
3167    }
3168
3169    /// Sets the value of [name][crate::model::DeleteConsumerGroupRequest::name].
3170    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3171        self.name = v.into();
3172        self
3173    }
3174}
3175
3176impl wkt::message::Message for DeleteConsumerGroupRequest {
3177    fn typename() -> &'static str {
3178        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteConsumerGroupRequest"
3179    }
3180}
3181
3182#[doc(hidden)]
3183impl<'de> serde::de::Deserialize<'de> for DeleteConsumerGroupRequest {
3184    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3185    where
3186        D: serde::Deserializer<'de>,
3187    {
3188        #[allow(non_camel_case_types)]
3189        #[doc(hidden)]
3190        #[derive(PartialEq, Eq, Hash)]
3191        enum __FieldTag {
3192            __name,
3193            Unknown(std::string::String),
3194        }
3195        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3196            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3197            where
3198                D: serde::Deserializer<'de>,
3199            {
3200                struct Visitor;
3201                impl<'de> serde::de::Visitor<'de> for Visitor {
3202                    type Value = __FieldTag;
3203                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3204                        formatter.write_str("a field name for DeleteConsumerGroupRequest")
3205                    }
3206                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3207                    where
3208                        E: serde::de::Error,
3209                    {
3210                        use std::result::Result::Ok;
3211                        use std::string::ToString;
3212                        match value {
3213                            "name" => Ok(__FieldTag::__name),
3214                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3215                        }
3216                    }
3217                }
3218                deserializer.deserialize_identifier(Visitor)
3219            }
3220        }
3221        struct Visitor;
3222        impl<'de> serde::de::Visitor<'de> for Visitor {
3223            type Value = DeleteConsumerGroupRequest;
3224            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3225                formatter.write_str("struct DeleteConsumerGroupRequest")
3226            }
3227            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3228            where
3229                A: serde::de::MapAccess<'de>,
3230            {
3231                #[allow(unused_imports)]
3232                use serde::de::Error;
3233                use std::option::Option::Some;
3234                let mut fields = std::collections::HashSet::new();
3235                let mut result = Self::Value::new();
3236                while let Some(tag) = map.next_key::<__FieldTag>()? {
3237                    #[allow(clippy::match_single_binding)]
3238                    match tag {
3239                        __FieldTag::__name => {
3240                            if !fields.insert(__FieldTag::__name) {
3241                                return std::result::Result::Err(A::Error::duplicate_field(
3242                                    "multiple values for name",
3243                                ));
3244                            }
3245                            result.name = map
3246                                .next_value::<std::option::Option<std::string::String>>()?
3247                                .unwrap_or_default();
3248                        }
3249                        __FieldTag::Unknown(key) => {
3250                            let value = map.next_value::<serde_json::Value>()?;
3251                            result._unknown_fields.insert(key, value);
3252                        }
3253                    }
3254                }
3255                std::result::Result::Ok(result)
3256            }
3257        }
3258        deserializer.deserialize_any(Visitor)
3259    }
3260}
3261
3262#[doc(hidden)]
3263impl serde::ser::Serialize for DeleteConsumerGroupRequest {
3264    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3265    where
3266        S: serde::ser::Serializer,
3267    {
3268        use serde::ser::SerializeMap;
3269        #[allow(unused_imports)]
3270        use std::option::Option::Some;
3271        let mut state = serializer.serialize_map(std::option::Option::None)?;
3272        if !self.name.is_empty() {
3273            state.serialize_entry("name", &self.name)?;
3274        }
3275        if !self._unknown_fields.is_empty() {
3276            for (key, value) in self._unknown_fields.iter() {
3277                state.serialize_entry(key, &value)?;
3278            }
3279        }
3280        state.end()
3281    }
3282}
3283
3284impl std::fmt::Debug for DeleteConsumerGroupRequest {
3285    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3286        let mut debug_struct = f.debug_struct("DeleteConsumerGroupRequest");
3287        debug_struct.field("name", &self.name);
3288        if !self._unknown_fields.is_empty() {
3289            debug_struct.field("_unknown_fields", &self._unknown_fields);
3290        }
3291        debug_struct.finish()
3292    }
3293}
3294
3295/// Request for ListAcls.
3296#[derive(Clone, Default, PartialEq)]
3297#[non_exhaustive]
3298pub struct ListAclsRequest {
3299    /// Required. The parent cluster whose acls are to be listed.
3300    /// Structured like
3301    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
3302    pub parent: std::string::String,
3303
3304    /// Optional. The maximum number of acls to return. The service may return
3305    /// fewer than this value. If unset or zero, all acls for the parent is
3306    /// returned.
3307    pub page_size: i32,
3308
3309    /// Optional. A page token, received from a previous `ListAcls` call.
3310    /// Provide this to retrieve the subsequent page.
3311    ///
3312    /// When paginating, all other parameters provided to `ListAcls` must match
3313    /// the call that provided the page token.
3314    pub page_token: std::string::String,
3315
3316    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3317}
3318
3319impl ListAclsRequest {
3320    pub fn new() -> Self {
3321        std::default::Default::default()
3322    }
3323
3324    /// Sets the value of [parent][crate::model::ListAclsRequest::parent].
3325    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3326        self.parent = v.into();
3327        self
3328    }
3329
3330    /// Sets the value of [page_size][crate::model::ListAclsRequest::page_size].
3331    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3332        self.page_size = v.into();
3333        self
3334    }
3335
3336    /// Sets the value of [page_token][crate::model::ListAclsRequest::page_token].
3337    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3338        self.page_token = v.into();
3339        self
3340    }
3341}
3342
3343impl wkt::message::Message for ListAclsRequest {
3344    fn typename() -> &'static str {
3345        "type.googleapis.com/google.cloud.managedkafka.v1.ListAclsRequest"
3346    }
3347}
3348
3349#[doc(hidden)]
3350impl<'de> serde::de::Deserialize<'de> for ListAclsRequest {
3351    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3352    where
3353        D: serde::Deserializer<'de>,
3354    {
3355        #[allow(non_camel_case_types)]
3356        #[doc(hidden)]
3357        #[derive(PartialEq, Eq, Hash)]
3358        enum __FieldTag {
3359            __parent,
3360            __page_size,
3361            __page_token,
3362            Unknown(std::string::String),
3363        }
3364        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3365            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3366            where
3367                D: serde::Deserializer<'de>,
3368            {
3369                struct Visitor;
3370                impl<'de> serde::de::Visitor<'de> for Visitor {
3371                    type Value = __FieldTag;
3372                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3373                        formatter.write_str("a field name for ListAclsRequest")
3374                    }
3375                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3376                    where
3377                        E: serde::de::Error,
3378                    {
3379                        use std::result::Result::Ok;
3380                        use std::string::ToString;
3381                        match value {
3382                            "parent" => Ok(__FieldTag::__parent),
3383                            "pageSize" => Ok(__FieldTag::__page_size),
3384                            "page_size" => Ok(__FieldTag::__page_size),
3385                            "pageToken" => Ok(__FieldTag::__page_token),
3386                            "page_token" => Ok(__FieldTag::__page_token),
3387                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3388                        }
3389                    }
3390                }
3391                deserializer.deserialize_identifier(Visitor)
3392            }
3393        }
3394        struct Visitor;
3395        impl<'de> serde::de::Visitor<'de> for Visitor {
3396            type Value = ListAclsRequest;
3397            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3398                formatter.write_str("struct ListAclsRequest")
3399            }
3400            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3401            where
3402                A: serde::de::MapAccess<'de>,
3403            {
3404                #[allow(unused_imports)]
3405                use serde::de::Error;
3406                use std::option::Option::Some;
3407                let mut fields = std::collections::HashSet::new();
3408                let mut result = Self::Value::new();
3409                while let Some(tag) = map.next_key::<__FieldTag>()? {
3410                    #[allow(clippy::match_single_binding)]
3411                    match tag {
3412                        __FieldTag::__parent => {
3413                            if !fields.insert(__FieldTag::__parent) {
3414                                return std::result::Result::Err(A::Error::duplicate_field(
3415                                    "multiple values for parent",
3416                                ));
3417                            }
3418                            result.parent = map
3419                                .next_value::<std::option::Option<std::string::String>>()?
3420                                .unwrap_or_default();
3421                        }
3422                        __FieldTag::__page_size => {
3423                            if !fields.insert(__FieldTag::__page_size) {
3424                                return std::result::Result::Err(A::Error::duplicate_field(
3425                                    "multiple values for page_size",
3426                                ));
3427                            }
3428                            struct __With(std::option::Option<i32>);
3429                            impl<'de> serde::de::Deserialize<'de> for __With {
3430                                fn deserialize<D>(
3431                                    deserializer: D,
3432                                ) -> std::result::Result<Self, D::Error>
3433                                where
3434                                    D: serde::de::Deserializer<'de>,
3435                                {
3436                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
3437                                }
3438                            }
3439                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
3440                        }
3441                        __FieldTag::__page_token => {
3442                            if !fields.insert(__FieldTag::__page_token) {
3443                                return std::result::Result::Err(A::Error::duplicate_field(
3444                                    "multiple values for page_token",
3445                                ));
3446                            }
3447                            result.page_token = map
3448                                .next_value::<std::option::Option<std::string::String>>()?
3449                                .unwrap_or_default();
3450                        }
3451                        __FieldTag::Unknown(key) => {
3452                            let value = map.next_value::<serde_json::Value>()?;
3453                            result._unknown_fields.insert(key, value);
3454                        }
3455                    }
3456                }
3457                std::result::Result::Ok(result)
3458            }
3459        }
3460        deserializer.deserialize_any(Visitor)
3461    }
3462}
3463
3464#[doc(hidden)]
3465impl serde::ser::Serialize for ListAclsRequest {
3466    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3467    where
3468        S: serde::ser::Serializer,
3469    {
3470        use serde::ser::SerializeMap;
3471        #[allow(unused_imports)]
3472        use std::option::Option::Some;
3473        let mut state = serializer.serialize_map(std::option::Option::None)?;
3474        if !self.parent.is_empty() {
3475            state.serialize_entry("parent", &self.parent)?;
3476        }
3477        if !wkt::internal::is_default(&self.page_size) {
3478            struct __With<'a>(&'a i32);
3479            impl<'a> serde::ser::Serialize for __With<'a> {
3480                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3481                where
3482                    S: serde::ser::Serializer,
3483                {
3484                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
3485                }
3486            }
3487            state.serialize_entry("pageSize", &__With(&self.page_size))?;
3488        }
3489        if !self.page_token.is_empty() {
3490            state.serialize_entry("pageToken", &self.page_token)?;
3491        }
3492        if !self._unknown_fields.is_empty() {
3493            for (key, value) in self._unknown_fields.iter() {
3494                state.serialize_entry(key, &value)?;
3495            }
3496        }
3497        state.end()
3498    }
3499}
3500
3501impl std::fmt::Debug for ListAclsRequest {
3502    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3503        let mut debug_struct = f.debug_struct("ListAclsRequest");
3504        debug_struct.field("parent", &self.parent);
3505        debug_struct.field("page_size", &self.page_size);
3506        debug_struct.field("page_token", &self.page_token);
3507        if !self._unknown_fields.is_empty() {
3508            debug_struct.field("_unknown_fields", &self._unknown_fields);
3509        }
3510        debug_struct.finish()
3511    }
3512}
3513
3514/// Response for ListAcls.
3515#[derive(Clone, Default, PartialEq)]
3516#[non_exhaustive]
3517pub struct ListAclsResponse {
3518    /// The list of acls in the requested parent. The order of the acls is
3519    /// unspecified.
3520    pub acls: std::vec::Vec<crate::model::Acl>,
3521
3522    /// A token that can be sent as `page_token` to retrieve the next page of
3523    /// results. If this field is omitted, there are no more results.
3524    pub next_page_token: std::string::String,
3525
3526    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3527}
3528
3529impl ListAclsResponse {
3530    pub fn new() -> Self {
3531        std::default::Default::default()
3532    }
3533
3534    /// Sets the value of [acls][crate::model::ListAclsResponse::acls].
3535    pub fn set_acls<T, V>(mut self, v: T) -> Self
3536    where
3537        T: std::iter::IntoIterator<Item = V>,
3538        V: std::convert::Into<crate::model::Acl>,
3539    {
3540        use std::iter::Iterator;
3541        self.acls = v.into_iter().map(|i| i.into()).collect();
3542        self
3543    }
3544
3545    /// Sets the value of [next_page_token][crate::model::ListAclsResponse::next_page_token].
3546    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3547        self.next_page_token = v.into();
3548        self
3549    }
3550}
3551
3552impl wkt::message::Message for ListAclsResponse {
3553    fn typename() -> &'static str {
3554        "type.googleapis.com/google.cloud.managedkafka.v1.ListAclsResponse"
3555    }
3556}
3557
3558#[doc(hidden)]
3559impl gax::paginator::internal::PageableResponse for ListAclsResponse {
3560    type PageItem = crate::model::Acl;
3561
3562    fn items(self) -> std::vec::Vec<Self::PageItem> {
3563        self.acls
3564    }
3565
3566    fn next_page_token(&self) -> std::string::String {
3567        use std::clone::Clone;
3568        self.next_page_token.clone()
3569    }
3570}
3571
3572#[doc(hidden)]
3573impl<'de> serde::de::Deserialize<'de> for ListAclsResponse {
3574    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3575    where
3576        D: serde::Deserializer<'de>,
3577    {
3578        #[allow(non_camel_case_types)]
3579        #[doc(hidden)]
3580        #[derive(PartialEq, Eq, Hash)]
3581        enum __FieldTag {
3582            __acls,
3583            __next_page_token,
3584            Unknown(std::string::String),
3585        }
3586        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3587            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3588            where
3589                D: serde::Deserializer<'de>,
3590            {
3591                struct Visitor;
3592                impl<'de> serde::de::Visitor<'de> for Visitor {
3593                    type Value = __FieldTag;
3594                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3595                        formatter.write_str("a field name for ListAclsResponse")
3596                    }
3597                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3598                    where
3599                        E: serde::de::Error,
3600                    {
3601                        use std::result::Result::Ok;
3602                        use std::string::ToString;
3603                        match value {
3604                            "acls" => Ok(__FieldTag::__acls),
3605                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
3606                            "next_page_token" => Ok(__FieldTag::__next_page_token),
3607                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3608                        }
3609                    }
3610                }
3611                deserializer.deserialize_identifier(Visitor)
3612            }
3613        }
3614        struct Visitor;
3615        impl<'de> serde::de::Visitor<'de> for Visitor {
3616            type Value = ListAclsResponse;
3617            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3618                formatter.write_str("struct ListAclsResponse")
3619            }
3620            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3621            where
3622                A: serde::de::MapAccess<'de>,
3623            {
3624                #[allow(unused_imports)]
3625                use serde::de::Error;
3626                use std::option::Option::Some;
3627                let mut fields = std::collections::HashSet::new();
3628                let mut result = Self::Value::new();
3629                while let Some(tag) = map.next_key::<__FieldTag>()? {
3630                    #[allow(clippy::match_single_binding)]
3631                    match tag {
3632                        __FieldTag::__acls => {
3633                            if !fields.insert(__FieldTag::__acls) {
3634                                return std::result::Result::Err(A::Error::duplicate_field(
3635                                    "multiple values for acls",
3636                                ));
3637                            }
3638                            result.acls = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Acl>>>()?.unwrap_or_default();
3639                        }
3640                        __FieldTag::__next_page_token => {
3641                            if !fields.insert(__FieldTag::__next_page_token) {
3642                                return std::result::Result::Err(A::Error::duplicate_field(
3643                                    "multiple values for next_page_token",
3644                                ));
3645                            }
3646                            result.next_page_token = map
3647                                .next_value::<std::option::Option<std::string::String>>()?
3648                                .unwrap_or_default();
3649                        }
3650                        __FieldTag::Unknown(key) => {
3651                            let value = map.next_value::<serde_json::Value>()?;
3652                            result._unknown_fields.insert(key, value);
3653                        }
3654                    }
3655                }
3656                std::result::Result::Ok(result)
3657            }
3658        }
3659        deserializer.deserialize_any(Visitor)
3660    }
3661}
3662
3663#[doc(hidden)]
3664impl serde::ser::Serialize for ListAclsResponse {
3665    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3666    where
3667        S: serde::ser::Serializer,
3668    {
3669        use serde::ser::SerializeMap;
3670        #[allow(unused_imports)]
3671        use std::option::Option::Some;
3672        let mut state = serializer.serialize_map(std::option::Option::None)?;
3673        if !self.acls.is_empty() {
3674            state.serialize_entry("acls", &self.acls)?;
3675        }
3676        if !self.next_page_token.is_empty() {
3677            state.serialize_entry("nextPageToken", &self.next_page_token)?;
3678        }
3679        if !self._unknown_fields.is_empty() {
3680            for (key, value) in self._unknown_fields.iter() {
3681                state.serialize_entry(key, &value)?;
3682            }
3683        }
3684        state.end()
3685    }
3686}
3687
3688impl std::fmt::Debug for ListAclsResponse {
3689    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3690        let mut debug_struct = f.debug_struct("ListAclsResponse");
3691        debug_struct.field("acls", &self.acls);
3692        debug_struct.field("next_page_token", &self.next_page_token);
3693        if !self._unknown_fields.is_empty() {
3694            debug_struct.field("_unknown_fields", &self._unknown_fields);
3695        }
3696        debug_struct.finish()
3697    }
3698}
3699
3700/// Request for GetAcl.
3701#[derive(Clone, Default, PartialEq)]
3702#[non_exhaustive]
3703pub struct GetAclRequest {
3704    /// Required. The name of the acl to return.
3705    /// Structured like:
3706    /// `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
3707    ///
3708    /// The structure of `acl_id` defines the Resource Pattern (resource_type,
3709    /// resource_name, pattern_type) of the acl. See `Acl.name` for
3710    /// details.
3711    pub name: std::string::String,
3712
3713    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3714}
3715
3716impl GetAclRequest {
3717    pub fn new() -> Self {
3718        std::default::Default::default()
3719    }
3720
3721    /// Sets the value of [name][crate::model::GetAclRequest::name].
3722    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3723        self.name = v.into();
3724        self
3725    }
3726}
3727
3728impl wkt::message::Message for GetAclRequest {
3729    fn typename() -> &'static str {
3730        "type.googleapis.com/google.cloud.managedkafka.v1.GetAclRequest"
3731    }
3732}
3733
3734#[doc(hidden)]
3735impl<'de> serde::de::Deserialize<'de> for GetAclRequest {
3736    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3737    where
3738        D: serde::Deserializer<'de>,
3739    {
3740        #[allow(non_camel_case_types)]
3741        #[doc(hidden)]
3742        #[derive(PartialEq, Eq, Hash)]
3743        enum __FieldTag {
3744            __name,
3745            Unknown(std::string::String),
3746        }
3747        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3748            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3749            where
3750                D: serde::Deserializer<'de>,
3751            {
3752                struct Visitor;
3753                impl<'de> serde::de::Visitor<'de> for Visitor {
3754                    type Value = __FieldTag;
3755                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3756                        formatter.write_str("a field name for GetAclRequest")
3757                    }
3758                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3759                    where
3760                        E: serde::de::Error,
3761                    {
3762                        use std::result::Result::Ok;
3763                        use std::string::ToString;
3764                        match value {
3765                            "name" => Ok(__FieldTag::__name),
3766                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3767                        }
3768                    }
3769                }
3770                deserializer.deserialize_identifier(Visitor)
3771            }
3772        }
3773        struct Visitor;
3774        impl<'de> serde::de::Visitor<'de> for Visitor {
3775            type Value = GetAclRequest;
3776            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3777                formatter.write_str("struct GetAclRequest")
3778            }
3779            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3780            where
3781                A: serde::de::MapAccess<'de>,
3782            {
3783                #[allow(unused_imports)]
3784                use serde::de::Error;
3785                use std::option::Option::Some;
3786                let mut fields = std::collections::HashSet::new();
3787                let mut result = Self::Value::new();
3788                while let Some(tag) = map.next_key::<__FieldTag>()? {
3789                    #[allow(clippy::match_single_binding)]
3790                    match tag {
3791                        __FieldTag::__name => {
3792                            if !fields.insert(__FieldTag::__name) {
3793                                return std::result::Result::Err(A::Error::duplicate_field(
3794                                    "multiple values for name",
3795                                ));
3796                            }
3797                            result.name = map
3798                                .next_value::<std::option::Option<std::string::String>>()?
3799                                .unwrap_or_default();
3800                        }
3801                        __FieldTag::Unknown(key) => {
3802                            let value = map.next_value::<serde_json::Value>()?;
3803                            result._unknown_fields.insert(key, value);
3804                        }
3805                    }
3806                }
3807                std::result::Result::Ok(result)
3808            }
3809        }
3810        deserializer.deserialize_any(Visitor)
3811    }
3812}
3813
3814#[doc(hidden)]
3815impl serde::ser::Serialize for GetAclRequest {
3816    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3817    where
3818        S: serde::ser::Serializer,
3819    {
3820        use serde::ser::SerializeMap;
3821        #[allow(unused_imports)]
3822        use std::option::Option::Some;
3823        let mut state = serializer.serialize_map(std::option::Option::None)?;
3824        if !self.name.is_empty() {
3825            state.serialize_entry("name", &self.name)?;
3826        }
3827        if !self._unknown_fields.is_empty() {
3828            for (key, value) in self._unknown_fields.iter() {
3829                state.serialize_entry(key, &value)?;
3830            }
3831        }
3832        state.end()
3833    }
3834}
3835
3836impl std::fmt::Debug for GetAclRequest {
3837    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3838        let mut debug_struct = f.debug_struct("GetAclRequest");
3839        debug_struct.field("name", &self.name);
3840        if !self._unknown_fields.is_empty() {
3841            debug_struct.field("_unknown_fields", &self._unknown_fields);
3842        }
3843        debug_struct.finish()
3844    }
3845}
3846
3847/// Request for CreateAcl.
3848#[derive(Clone, Default, PartialEq)]
3849#[non_exhaustive]
3850pub struct CreateAclRequest {
3851    /// Required. The parent cluster in which to create the acl.
3852    /// Structured like
3853    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
3854    pub parent: std::string::String,
3855
3856    /// Required. The ID to use for the acl, which will become the final component
3857    /// of the acl's name. The structure of `acl_id` defines the Resource Pattern
3858    /// (resource_type, resource_name, pattern_type) of the acl. `acl_id` is
3859    /// structured like one of the following:
3860    ///
3861    /// For acls on the cluster:
3862    /// `cluster`
3863    ///
3864    /// For acls on a single resource within the cluster:
3865    /// `topic/{resource_name}`
3866    /// `consumerGroup/{resource_name}`
3867    /// `transactionalId/{resource_name}`
3868    ///
3869    /// For acls on all resources that match a prefix:
3870    /// `topicPrefixed/{resource_name}`
3871    /// `consumerGroupPrefixed/{resource_name}`
3872    /// `transactionalIdPrefixed/{resource_name}`
3873    ///
3874    /// For acls on all resources of a given type (i.e. the wildcard literal "*"):
3875    /// `allTopics` (represents `topic/*`)
3876    /// `allConsumerGroups` (represents `consumerGroup/*`)
3877    /// `allTransactionalIds` (represents `transactionalId/*`)
3878    pub acl_id: std::string::String,
3879
3880    /// Required. Configuration of the acl to create. Its `name` field is ignored.
3881    pub acl: std::option::Option<crate::model::Acl>,
3882
3883    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3884}
3885
3886impl CreateAclRequest {
3887    pub fn new() -> Self {
3888        std::default::Default::default()
3889    }
3890
3891    /// Sets the value of [parent][crate::model::CreateAclRequest::parent].
3892    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3893        self.parent = v.into();
3894        self
3895    }
3896
3897    /// Sets the value of [acl_id][crate::model::CreateAclRequest::acl_id].
3898    pub fn set_acl_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3899        self.acl_id = v.into();
3900        self
3901    }
3902
3903    /// Sets the value of [acl][crate::model::CreateAclRequest::acl].
3904    pub fn set_acl<T>(mut self, v: T) -> Self
3905    where
3906        T: std::convert::Into<crate::model::Acl>,
3907    {
3908        self.acl = std::option::Option::Some(v.into());
3909        self
3910    }
3911
3912    /// Sets or clears the value of [acl][crate::model::CreateAclRequest::acl].
3913    pub fn set_or_clear_acl<T>(mut self, v: std::option::Option<T>) -> Self
3914    where
3915        T: std::convert::Into<crate::model::Acl>,
3916    {
3917        self.acl = v.map(|x| x.into());
3918        self
3919    }
3920}
3921
3922impl wkt::message::Message for CreateAclRequest {
3923    fn typename() -> &'static str {
3924        "type.googleapis.com/google.cloud.managedkafka.v1.CreateAclRequest"
3925    }
3926}
3927
3928#[doc(hidden)]
3929impl<'de> serde::de::Deserialize<'de> for CreateAclRequest {
3930    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3931    where
3932        D: serde::Deserializer<'de>,
3933    {
3934        #[allow(non_camel_case_types)]
3935        #[doc(hidden)]
3936        #[derive(PartialEq, Eq, Hash)]
3937        enum __FieldTag {
3938            __parent,
3939            __acl_id,
3940            __acl,
3941            Unknown(std::string::String),
3942        }
3943        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3944            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3945            where
3946                D: serde::Deserializer<'de>,
3947            {
3948                struct Visitor;
3949                impl<'de> serde::de::Visitor<'de> for Visitor {
3950                    type Value = __FieldTag;
3951                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3952                        formatter.write_str("a field name for CreateAclRequest")
3953                    }
3954                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3955                    where
3956                        E: serde::de::Error,
3957                    {
3958                        use std::result::Result::Ok;
3959                        use std::string::ToString;
3960                        match value {
3961                            "parent" => Ok(__FieldTag::__parent),
3962                            "aclId" => Ok(__FieldTag::__acl_id),
3963                            "acl_id" => Ok(__FieldTag::__acl_id),
3964                            "acl" => Ok(__FieldTag::__acl),
3965                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3966                        }
3967                    }
3968                }
3969                deserializer.deserialize_identifier(Visitor)
3970            }
3971        }
3972        struct Visitor;
3973        impl<'de> serde::de::Visitor<'de> for Visitor {
3974            type Value = CreateAclRequest;
3975            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3976                formatter.write_str("struct CreateAclRequest")
3977            }
3978            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3979            where
3980                A: serde::de::MapAccess<'de>,
3981            {
3982                #[allow(unused_imports)]
3983                use serde::de::Error;
3984                use std::option::Option::Some;
3985                let mut fields = std::collections::HashSet::new();
3986                let mut result = Self::Value::new();
3987                while let Some(tag) = map.next_key::<__FieldTag>()? {
3988                    #[allow(clippy::match_single_binding)]
3989                    match tag {
3990                        __FieldTag::__parent => {
3991                            if !fields.insert(__FieldTag::__parent) {
3992                                return std::result::Result::Err(A::Error::duplicate_field(
3993                                    "multiple values for parent",
3994                                ));
3995                            }
3996                            result.parent = map
3997                                .next_value::<std::option::Option<std::string::String>>()?
3998                                .unwrap_or_default();
3999                        }
4000                        __FieldTag::__acl_id => {
4001                            if !fields.insert(__FieldTag::__acl_id) {
4002                                return std::result::Result::Err(A::Error::duplicate_field(
4003                                    "multiple values for acl_id",
4004                                ));
4005                            }
4006                            result.acl_id = map
4007                                .next_value::<std::option::Option<std::string::String>>()?
4008                                .unwrap_or_default();
4009                        }
4010                        __FieldTag::__acl => {
4011                            if !fields.insert(__FieldTag::__acl) {
4012                                return std::result::Result::Err(A::Error::duplicate_field(
4013                                    "multiple values for acl",
4014                                ));
4015                            }
4016                            result.acl =
4017                                map.next_value::<std::option::Option<crate::model::Acl>>()?;
4018                        }
4019                        __FieldTag::Unknown(key) => {
4020                            let value = map.next_value::<serde_json::Value>()?;
4021                            result._unknown_fields.insert(key, value);
4022                        }
4023                    }
4024                }
4025                std::result::Result::Ok(result)
4026            }
4027        }
4028        deserializer.deserialize_any(Visitor)
4029    }
4030}
4031
4032#[doc(hidden)]
4033impl serde::ser::Serialize for CreateAclRequest {
4034    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4035    where
4036        S: serde::ser::Serializer,
4037    {
4038        use serde::ser::SerializeMap;
4039        #[allow(unused_imports)]
4040        use std::option::Option::Some;
4041        let mut state = serializer.serialize_map(std::option::Option::None)?;
4042        if !self.parent.is_empty() {
4043            state.serialize_entry("parent", &self.parent)?;
4044        }
4045        if !self.acl_id.is_empty() {
4046            state.serialize_entry("aclId", &self.acl_id)?;
4047        }
4048        if self.acl.is_some() {
4049            state.serialize_entry("acl", &self.acl)?;
4050        }
4051        if !self._unknown_fields.is_empty() {
4052            for (key, value) in self._unknown_fields.iter() {
4053                state.serialize_entry(key, &value)?;
4054            }
4055        }
4056        state.end()
4057    }
4058}
4059
4060impl std::fmt::Debug for CreateAclRequest {
4061    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4062        let mut debug_struct = f.debug_struct("CreateAclRequest");
4063        debug_struct.field("parent", &self.parent);
4064        debug_struct.field("acl_id", &self.acl_id);
4065        debug_struct.field("acl", &self.acl);
4066        if !self._unknown_fields.is_empty() {
4067            debug_struct.field("_unknown_fields", &self._unknown_fields);
4068        }
4069        debug_struct.finish()
4070    }
4071}
4072
4073/// Request for UpdateAcl.
4074#[derive(Clone, Default, PartialEq)]
4075#[non_exhaustive]
4076pub struct UpdateAclRequest {
4077    /// Required. The updated acl. Its `name` and `etag` fields must be populated.
4078    /// `acl_entries` must not be empty in the updated acl; to remove all acl
4079    /// entries for an acl, use DeleteAcl.
4080    pub acl: std::option::Option<crate::model::Acl>,
4081
4082    /// Optional. Field mask is used to specify the fields to be overwritten in the
4083    /// Acl resource by the update. The fields specified in the update_mask are
4084    /// relative to the resource, not the full request. A field will be overwritten
4085    /// if it is in the mask.
4086    pub update_mask: std::option::Option<wkt::FieldMask>,
4087
4088    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4089}
4090
4091impl UpdateAclRequest {
4092    pub fn new() -> Self {
4093        std::default::Default::default()
4094    }
4095
4096    /// Sets the value of [acl][crate::model::UpdateAclRequest::acl].
4097    pub fn set_acl<T>(mut self, v: T) -> Self
4098    where
4099        T: std::convert::Into<crate::model::Acl>,
4100    {
4101        self.acl = std::option::Option::Some(v.into());
4102        self
4103    }
4104
4105    /// Sets or clears the value of [acl][crate::model::UpdateAclRequest::acl].
4106    pub fn set_or_clear_acl<T>(mut self, v: std::option::Option<T>) -> Self
4107    where
4108        T: std::convert::Into<crate::model::Acl>,
4109    {
4110        self.acl = v.map(|x| x.into());
4111        self
4112    }
4113
4114    /// Sets the value of [update_mask][crate::model::UpdateAclRequest::update_mask].
4115    pub fn set_update_mask<T>(mut self, v: T) -> Self
4116    where
4117        T: std::convert::Into<wkt::FieldMask>,
4118    {
4119        self.update_mask = std::option::Option::Some(v.into());
4120        self
4121    }
4122
4123    /// Sets or clears the value of [update_mask][crate::model::UpdateAclRequest::update_mask].
4124    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4125    where
4126        T: std::convert::Into<wkt::FieldMask>,
4127    {
4128        self.update_mask = v.map(|x| x.into());
4129        self
4130    }
4131}
4132
4133impl wkt::message::Message for UpdateAclRequest {
4134    fn typename() -> &'static str {
4135        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateAclRequest"
4136    }
4137}
4138
4139#[doc(hidden)]
4140impl<'de> serde::de::Deserialize<'de> for UpdateAclRequest {
4141    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4142    where
4143        D: serde::Deserializer<'de>,
4144    {
4145        #[allow(non_camel_case_types)]
4146        #[doc(hidden)]
4147        #[derive(PartialEq, Eq, Hash)]
4148        enum __FieldTag {
4149            __acl,
4150            __update_mask,
4151            Unknown(std::string::String),
4152        }
4153        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4154            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4155            where
4156                D: serde::Deserializer<'de>,
4157            {
4158                struct Visitor;
4159                impl<'de> serde::de::Visitor<'de> for Visitor {
4160                    type Value = __FieldTag;
4161                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4162                        formatter.write_str("a field name for UpdateAclRequest")
4163                    }
4164                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4165                    where
4166                        E: serde::de::Error,
4167                    {
4168                        use std::result::Result::Ok;
4169                        use std::string::ToString;
4170                        match value {
4171                            "acl" => Ok(__FieldTag::__acl),
4172                            "updateMask" => Ok(__FieldTag::__update_mask),
4173                            "update_mask" => Ok(__FieldTag::__update_mask),
4174                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4175                        }
4176                    }
4177                }
4178                deserializer.deserialize_identifier(Visitor)
4179            }
4180        }
4181        struct Visitor;
4182        impl<'de> serde::de::Visitor<'de> for Visitor {
4183            type Value = UpdateAclRequest;
4184            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4185                formatter.write_str("struct UpdateAclRequest")
4186            }
4187            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4188            where
4189                A: serde::de::MapAccess<'de>,
4190            {
4191                #[allow(unused_imports)]
4192                use serde::de::Error;
4193                use std::option::Option::Some;
4194                let mut fields = std::collections::HashSet::new();
4195                let mut result = Self::Value::new();
4196                while let Some(tag) = map.next_key::<__FieldTag>()? {
4197                    #[allow(clippy::match_single_binding)]
4198                    match tag {
4199                        __FieldTag::__acl => {
4200                            if !fields.insert(__FieldTag::__acl) {
4201                                return std::result::Result::Err(A::Error::duplicate_field(
4202                                    "multiple values for acl",
4203                                ));
4204                            }
4205                            result.acl =
4206                                map.next_value::<std::option::Option<crate::model::Acl>>()?;
4207                        }
4208                        __FieldTag::__update_mask => {
4209                            if !fields.insert(__FieldTag::__update_mask) {
4210                                return std::result::Result::Err(A::Error::duplicate_field(
4211                                    "multiple values for update_mask",
4212                                ));
4213                            }
4214                            result.update_mask =
4215                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
4216                        }
4217                        __FieldTag::Unknown(key) => {
4218                            let value = map.next_value::<serde_json::Value>()?;
4219                            result._unknown_fields.insert(key, value);
4220                        }
4221                    }
4222                }
4223                std::result::Result::Ok(result)
4224            }
4225        }
4226        deserializer.deserialize_any(Visitor)
4227    }
4228}
4229
4230#[doc(hidden)]
4231impl serde::ser::Serialize for UpdateAclRequest {
4232    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4233    where
4234        S: serde::ser::Serializer,
4235    {
4236        use serde::ser::SerializeMap;
4237        #[allow(unused_imports)]
4238        use std::option::Option::Some;
4239        let mut state = serializer.serialize_map(std::option::Option::None)?;
4240        if self.acl.is_some() {
4241            state.serialize_entry("acl", &self.acl)?;
4242        }
4243        if self.update_mask.is_some() {
4244            state.serialize_entry("updateMask", &self.update_mask)?;
4245        }
4246        if !self._unknown_fields.is_empty() {
4247            for (key, value) in self._unknown_fields.iter() {
4248                state.serialize_entry(key, &value)?;
4249            }
4250        }
4251        state.end()
4252    }
4253}
4254
4255impl std::fmt::Debug for UpdateAclRequest {
4256    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4257        let mut debug_struct = f.debug_struct("UpdateAclRequest");
4258        debug_struct.field("acl", &self.acl);
4259        debug_struct.field("update_mask", &self.update_mask);
4260        if !self._unknown_fields.is_empty() {
4261            debug_struct.field("_unknown_fields", &self._unknown_fields);
4262        }
4263        debug_struct.finish()
4264    }
4265}
4266
4267/// Request for DeleteAcl.
4268#[derive(Clone, Default, PartialEq)]
4269#[non_exhaustive]
4270pub struct DeleteAclRequest {
4271    /// Required. The name of the acl to delete.
4272    /// Structured like:
4273    /// `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
4274    ///
4275    /// The structure of `acl_id` defines the Resource Pattern (resource_type,
4276    /// resource_name, pattern_type) of the acl. See `Acl.name` for details.
4277    pub name: std::string::String,
4278
4279    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4280}
4281
4282impl DeleteAclRequest {
4283    pub fn new() -> Self {
4284        std::default::Default::default()
4285    }
4286
4287    /// Sets the value of [name][crate::model::DeleteAclRequest::name].
4288    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4289        self.name = v.into();
4290        self
4291    }
4292}
4293
4294impl wkt::message::Message for DeleteAclRequest {
4295    fn typename() -> &'static str {
4296        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteAclRequest"
4297    }
4298}
4299
4300#[doc(hidden)]
4301impl<'de> serde::de::Deserialize<'de> for DeleteAclRequest {
4302    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4303    where
4304        D: serde::Deserializer<'de>,
4305    {
4306        #[allow(non_camel_case_types)]
4307        #[doc(hidden)]
4308        #[derive(PartialEq, Eq, Hash)]
4309        enum __FieldTag {
4310            __name,
4311            Unknown(std::string::String),
4312        }
4313        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4314            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4315            where
4316                D: serde::Deserializer<'de>,
4317            {
4318                struct Visitor;
4319                impl<'de> serde::de::Visitor<'de> for Visitor {
4320                    type Value = __FieldTag;
4321                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4322                        formatter.write_str("a field name for DeleteAclRequest")
4323                    }
4324                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4325                    where
4326                        E: serde::de::Error,
4327                    {
4328                        use std::result::Result::Ok;
4329                        use std::string::ToString;
4330                        match value {
4331                            "name" => Ok(__FieldTag::__name),
4332                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4333                        }
4334                    }
4335                }
4336                deserializer.deserialize_identifier(Visitor)
4337            }
4338        }
4339        struct Visitor;
4340        impl<'de> serde::de::Visitor<'de> for Visitor {
4341            type Value = DeleteAclRequest;
4342            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4343                formatter.write_str("struct DeleteAclRequest")
4344            }
4345            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4346            where
4347                A: serde::de::MapAccess<'de>,
4348            {
4349                #[allow(unused_imports)]
4350                use serde::de::Error;
4351                use std::option::Option::Some;
4352                let mut fields = std::collections::HashSet::new();
4353                let mut result = Self::Value::new();
4354                while let Some(tag) = map.next_key::<__FieldTag>()? {
4355                    #[allow(clippy::match_single_binding)]
4356                    match tag {
4357                        __FieldTag::__name => {
4358                            if !fields.insert(__FieldTag::__name) {
4359                                return std::result::Result::Err(A::Error::duplicate_field(
4360                                    "multiple values for name",
4361                                ));
4362                            }
4363                            result.name = map
4364                                .next_value::<std::option::Option<std::string::String>>()?
4365                                .unwrap_or_default();
4366                        }
4367                        __FieldTag::Unknown(key) => {
4368                            let value = map.next_value::<serde_json::Value>()?;
4369                            result._unknown_fields.insert(key, value);
4370                        }
4371                    }
4372                }
4373                std::result::Result::Ok(result)
4374            }
4375        }
4376        deserializer.deserialize_any(Visitor)
4377    }
4378}
4379
4380#[doc(hidden)]
4381impl serde::ser::Serialize for DeleteAclRequest {
4382    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4383    where
4384        S: serde::ser::Serializer,
4385    {
4386        use serde::ser::SerializeMap;
4387        #[allow(unused_imports)]
4388        use std::option::Option::Some;
4389        let mut state = serializer.serialize_map(std::option::Option::None)?;
4390        if !self.name.is_empty() {
4391            state.serialize_entry("name", &self.name)?;
4392        }
4393        if !self._unknown_fields.is_empty() {
4394            for (key, value) in self._unknown_fields.iter() {
4395                state.serialize_entry(key, &value)?;
4396            }
4397        }
4398        state.end()
4399    }
4400}
4401
4402impl std::fmt::Debug for DeleteAclRequest {
4403    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4404        let mut debug_struct = f.debug_struct("DeleteAclRequest");
4405        debug_struct.field("name", &self.name);
4406        if !self._unknown_fields.is_empty() {
4407            debug_struct.field("_unknown_fields", &self._unknown_fields);
4408        }
4409        debug_struct.finish()
4410    }
4411}
4412
4413/// Request for AddAclEntry.
4414#[derive(Clone, Default, PartialEq)]
4415#[non_exhaustive]
4416pub struct AddAclEntryRequest {
4417    /// Required. The name of the acl to add the acl entry to.
4418    /// Structured like:
4419    /// `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
4420    ///
4421    /// The structure of `acl_id` defines the Resource Pattern (resource_type,
4422    /// resource_name, pattern_type) of the acl. See `Acl.name` for
4423    /// details.
4424    pub acl: std::string::String,
4425
4426    /// Required. The acl entry to add.
4427    pub acl_entry: std::option::Option<crate::model::AclEntry>,
4428
4429    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4430}
4431
4432impl AddAclEntryRequest {
4433    pub fn new() -> Self {
4434        std::default::Default::default()
4435    }
4436
4437    /// Sets the value of [acl][crate::model::AddAclEntryRequest::acl].
4438    pub fn set_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4439        self.acl = v.into();
4440        self
4441    }
4442
4443    /// Sets the value of [acl_entry][crate::model::AddAclEntryRequest::acl_entry].
4444    pub fn set_acl_entry<T>(mut self, v: T) -> Self
4445    where
4446        T: std::convert::Into<crate::model::AclEntry>,
4447    {
4448        self.acl_entry = std::option::Option::Some(v.into());
4449        self
4450    }
4451
4452    /// Sets or clears the value of [acl_entry][crate::model::AddAclEntryRequest::acl_entry].
4453    pub fn set_or_clear_acl_entry<T>(mut self, v: std::option::Option<T>) -> Self
4454    where
4455        T: std::convert::Into<crate::model::AclEntry>,
4456    {
4457        self.acl_entry = v.map(|x| x.into());
4458        self
4459    }
4460}
4461
4462impl wkt::message::Message for AddAclEntryRequest {
4463    fn typename() -> &'static str {
4464        "type.googleapis.com/google.cloud.managedkafka.v1.AddAclEntryRequest"
4465    }
4466}
4467
4468#[doc(hidden)]
4469impl<'de> serde::de::Deserialize<'de> for AddAclEntryRequest {
4470    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4471    where
4472        D: serde::Deserializer<'de>,
4473    {
4474        #[allow(non_camel_case_types)]
4475        #[doc(hidden)]
4476        #[derive(PartialEq, Eq, Hash)]
4477        enum __FieldTag {
4478            __acl,
4479            __acl_entry,
4480            Unknown(std::string::String),
4481        }
4482        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4483            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4484            where
4485                D: serde::Deserializer<'de>,
4486            {
4487                struct Visitor;
4488                impl<'de> serde::de::Visitor<'de> for Visitor {
4489                    type Value = __FieldTag;
4490                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4491                        formatter.write_str("a field name for AddAclEntryRequest")
4492                    }
4493                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4494                    where
4495                        E: serde::de::Error,
4496                    {
4497                        use std::result::Result::Ok;
4498                        use std::string::ToString;
4499                        match value {
4500                            "acl" => Ok(__FieldTag::__acl),
4501                            "aclEntry" => Ok(__FieldTag::__acl_entry),
4502                            "acl_entry" => Ok(__FieldTag::__acl_entry),
4503                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4504                        }
4505                    }
4506                }
4507                deserializer.deserialize_identifier(Visitor)
4508            }
4509        }
4510        struct Visitor;
4511        impl<'de> serde::de::Visitor<'de> for Visitor {
4512            type Value = AddAclEntryRequest;
4513            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4514                formatter.write_str("struct AddAclEntryRequest")
4515            }
4516            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4517            where
4518                A: serde::de::MapAccess<'de>,
4519            {
4520                #[allow(unused_imports)]
4521                use serde::de::Error;
4522                use std::option::Option::Some;
4523                let mut fields = std::collections::HashSet::new();
4524                let mut result = Self::Value::new();
4525                while let Some(tag) = map.next_key::<__FieldTag>()? {
4526                    #[allow(clippy::match_single_binding)]
4527                    match tag {
4528                        __FieldTag::__acl => {
4529                            if !fields.insert(__FieldTag::__acl) {
4530                                return std::result::Result::Err(A::Error::duplicate_field(
4531                                    "multiple values for acl",
4532                                ));
4533                            }
4534                            result.acl = map
4535                                .next_value::<std::option::Option<std::string::String>>()?
4536                                .unwrap_or_default();
4537                        }
4538                        __FieldTag::__acl_entry => {
4539                            if !fields.insert(__FieldTag::__acl_entry) {
4540                                return std::result::Result::Err(A::Error::duplicate_field(
4541                                    "multiple values for acl_entry",
4542                                ));
4543                            }
4544                            result.acl_entry =
4545                                map.next_value::<std::option::Option<crate::model::AclEntry>>()?;
4546                        }
4547                        __FieldTag::Unknown(key) => {
4548                            let value = map.next_value::<serde_json::Value>()?;
4549                            result._unknown_fields.insert(key, value);
4550                        }
4551                    }
4552                }
4553                std::result::Result::Ok(result)
4554            }
4555        }
4556        deserializer.deserialize_any(Visitor)
4557    }
4558}
4559
4560#[doc(hidden)]
4561impl serde::ser::Serialize for AddAclEntryRequest {
4562    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4563    where
4564        S: serde::ser::Serializer,
4565    {
4566        use serde::ser::SerializeMap;
4567        #[allow(unused_imports)]
4568        use std::option::Option::Some;
4569        let mut state = serializer.serialize_map(std::option::Option::None)?;
4570        if !self.acl.is_empty() {
4571            state.serialize_entry("acl", &self.acl)?;
4572        }
4573        if self.acl_entry.is_some() {
4574            state.serialize_entry("aclEntry", &self.acl_entry)?;
4575        }
4576        if !self._unknown_fields.is_empty() {
4577            for (key, value) in self._unknown_fields.iter() {
4578                state.serialize_entry(key, &value)?;
4579            }
4580        }
4581        state.end()
4582    }
4583}
4584
4585impl std::fmt::Debug for AddAclEntryRequest {
4586    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4587        let mut debug_struct = f.debug_struct("AddAclEntryRequest");
4588        debug_struct.field("acl", &self.acl);
4589        debug_struct.field("acl_entry", &self.acl_entry);
4590        if !self._unknown_fields.is_empty() {
4591            debug_struct.field("_unknown_fields", &self._unknown_fields);
4592        }
4593        debug_struct.finish()
4594    }
4595}
4596
4597/// Response for AddAclEntry.
4598#[derive(Clone, Default, PartialEq)]
4599#[non_exhaustive]
4600pub struct AddAclEntryResponse {
4601    /// The updated acl.
4602    pub acl: std::option::Option<crate::model::Acl>,
4603
4604    /// Whether the acl was created as a result of adding the acl entry.
4605    pub acl_created: bool,
4606
4607    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4608}
4609
4610impl AddAclEntryResponse {
4611    pub fn new() -> Self {
4612        std::default::Default::default()
4613    }
4614
4615    /// Sets the value of [acl][crate::model::AddAclEntryResponse::acl].
4616    pub fn set_acl<T>(mut self, v: T) -> Self
4617    where
4618        T: std::convert::Into<crate::model::Acl>,
4619    {
4620        self.acl = std::option::Option::Some(v.into());
4621        self
4622    }
4623
4624    /// Sets or clears the value of [acl][crate::model::AddAclEntryResponse::acl].
4625    pub fn set_or_clear_acl<T>(mut self, v: std::option::Option<T>) -> Self
4626    where
4627        T: std::convert::Into<crate::model::Acl>,
4628    {
4629        self.acl = v.map(|x| x.into());
4630        self
4631    }
4632
4633    /// Sets the value of [acl_created][crate::model::AddAclEntryResponse::acl_created].
4634    pub fn set_acl_created<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4635        self.acl_created = v.into();
4636        self
4637    }
4638}
4639
4640impl wkt::message::Message for AddAclEntryResponse {
4641    fn typename() -> &'static str {
4642        "type.googleapis.com/google.cloud.managedkafka.v1.AddAclEntryResponse"
4643    }
4644}
4645
4646#[doc(hidden)]
4647impl<'de> serde::de::Deserialize<'de> for AddAclEntryResponse {
4648    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4649    where
4650        D: serde::Deserializer<'de>,
4651    {
4652        #[allow(non_camel_case_types)]
4653        #[doc(hidden)]
4654        #[derive(PartialEq, Eq, Hash)]
4655        enum __FieldTag {
4656            __acl,
4657            __acl_created,
4658            Unknown(std::string::String),
4659        }
4660        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4661            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4662            where
4663                D: serde::Deserializer<'de>,
4664            {
4665                struct Visitor;
4666                impl<'de> serde::de::Visitor<'de> for Visitor {
4667                    type Value = __FieldTag;
4668                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4669                        formatter.write_str("a field name for AddAclEntryResponse")
4670                    }
4671                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4672                    where
4673                        E: serde::de::Error,
4674                    {
4675                        use std::result::Result::Ok;
4676                        use std::string::ToString;
4677                        match value {
4678                            "acl" => Ok(__FieldTag::__acl),
4679                            "aclCreated" => Ok(__FieldTag::__acl_created),
4680                            "acl_created" => Ok(__FieldTag::__acl_created),
4681                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4682                        }
4683                    }
4684                }
4685                deserializer.deserialize_identifier(Visitor)
4686            }
4687        }
4688        struct Visitor;
4689        impl<'de> serde::de::Visitor<'de> for Visitor {
4690            type Value = AddAclEntryResponse;
4691            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4692                formatter.write_str("struct AddAclEntryResponse")
4693            }
4694            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4695            where
4696                A: serde::de::MapAccess<'de>,
4697            {
4698                #[allow(unused_imports)]
4699                use serde::de::Error;
4700                use std::option::Option::Some;
4701                let mut fields = std::collections::HashSet::new();
4702                let mut result = Self::Value::new();
4703                while let Some(tag) = map.next_key::<__FieldTag>()? {
4704                    #[allow(clippy::match_single_binding)]
4705                    match tag {
4706                        __FieldTag::__acl => {
4707                            if !fields.insert(__FieldTag::__acl) {
4708                                return std::result::Result::Err(A::Error::duplicate_field(
4709                                    "multiple values for acl",
4710                                ));
4711                            }
4712                            result.acl =
4713                                map.next_value::<std::option::Option<crate::model::Acl>>()?;
4714                        }
4715                        __FieldTag::__acl_created => {
4716                            if !fields.insert(__FieldTag::__acl_created) {
4717                                return std::result::Result::Err(A::Error::duplicate_field(
4718                                    "multiple values for acl_created",
4719                                ));
4720                            }
4721                            result.acl_created = map
4722                                .next_value::<std::option::Option<bool>>()?
4723                                .unwrap_or_default();
4724                        }
4725                        __FieldTag::Unknown(key) => {
4726                            let value = map.next_value::<serde_json::Value>()?;
4727                            result._unknown_fields.insert(key, value);
4728                        }
4729                    }
4730                }
4731                std::result::Result::Ok(result)
4732            }
4733        }
4734        deserializer.deserialize_any(Visitor)
4735    }
4736}
4737
4738#[doc(hidden)]
4739impl serde::ser::Serialize for AddAclEntryResponse {
4740    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4741    where
4742        S: serde::ser::Serializer,
4743    {
4744        use serde::ser::SerializeMap;
4745        #[allow(unused_imports)]
4746        use std::option::Option::Some;
4747        let mut state = serializer.serialize_map(std::option::Option::None)?;
4748        if self.acl.is_some() {
4749            state.serialize_entry("acl", &self.acl)?;
4750        }
4751        if !wkt::internal::is_default(&self.acl_created) {
4752            state.serialize_entry("aclCreated", &self.acl_created)?;
4753        }
4754        if !self._unknown_fields.is_empty() {
4755            for (key, value) in self._unknown_fields.iter() {
4756                state.serialize_entry(key, &value)?;
4757            }
4758        }
4759        state.end()
4760    }
4761}
4762
4763impl std::fmt::Debug for AddAclEntryResponse {
4764    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4765        let mut debug_struct = f.debug_struct("AddAclEntryResponse");
4766        debug_struct.field("acl", &self.acl);
4767        debug_struct.field("acl_created", &self.acl_created);
4768        if !self._unknown_fields.is_empty() {
4769            debug_struct.field("_unknown_fields", &self._unknown_fields);
4770        }
4771        debug_struct.finish()
4772    }
4773}
4774
4775/// Request for RemoveAclEntry.
4776#[derive(Clone, Default, PartialEq)]
4777#[non_exhaustive]
4778pub struct RemoveAclEntryRequest {
4779    /// Required. The name of the acl to remove the acl entry from.
4780    /// Structured like:
4781    /// `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
4782    ///
4783    /// The structure of `acl_id` defines the Resource Pattern (resource_type,
4784    /// resource_name, pattern_type) of the acl. See `Acl.name` for
4785    /// details.
4786    pub acl: std::string::String,
4787
4788    /// Required. The acl entry to remove.
4789    pub acl_entry: std::option::Option<crate::model::AclEntry>,
4790
4791    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4792}
4793
4794impl RemoveAclEntryRequest {
4795    pub fn new() -> Self {
4796        std::default::Default::default()
4797    }
4798
4799    /// Sets the value of [acl][crate::model::RemoveAclEntryRequest::acl].
4800    pub fn set_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4801        self.acl = v.into();
4802        self
4803    }
4804
4805    /// Sets the value of [acl_entry][crate::model::RemoveAclEntryRequest::acl_entry].
4806    pub fn set_acl_entry<T>(mut self, v: T) -> Self
4807    where
4808        T: std::convert::Into<crate::model::AclEntry>,
4809    {
4810        self.acl_entry = std::option::Option::Some(v.into());
4811        self
4812    }
4813
4814    /// Sets or clears the value of [acl_entry][crate::model::RemoveAclEntryRequest::acl_entry].
4815    pub fn set_or_clear_acl_entry<T>(mut self, v: std::option::Option<T>) -> Self
4816    where
4817        T: std::convert::Into<crate::model::AclEntry>,
4818    {
4819        self.acl_entry = v.map(|x| x.into());
4820        self
4821    }
4822}
4823
4824impl wkt::message::Message for RemoveAclEntryRequest {
4825    fn typename() -> &'static str {
4826        "type.googleapis.com/google.cloud.managedkafka.v1.RemoveAclEntryRequest"
4827    }
4828}
4829
4830#[doc(hidden)]
4831impl<'de> serde::de::Deserialize<'de> for RemoveAclEntryRequest {
4832    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4833    where
4834        D: serde::Deserializer<'de>,
4835    {
4836        #[allow(non_camel_case_types)]
4837        #[doc(hidden)]
4838        #[derive(PartialEq, Eq, Hash)]
4839        enum __FieldTag {
4840            __acl,
4841            __acl_entry,
4842            Unknown(std::string::String),
4843        }
4844        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4845            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4846            where
4847                D: serde::Deserializer<'de>,
4848            {
4849                struct Visitor;
4850                impl<'de> serde::de::Visitor<'de> for Visitor {
4851                    type Value = __FieldTag;
4852                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4853                        formatter.write_str("a field name for RemoveAclEntryRequest")
4854                    }
4855                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4856                    where
4857                        E: serde::de::Error,
4858                    {
4859                        use std::result::Result::Ok;
4860                        use std::string::ToString;
4861                        match value {
4862                            "acl" => Ok(__FieldTag::__acl),
4863                            "aclEntry" => Ok(__FieldTag::__acl_entry),
4864                            "acl_entry" => Ok(__FieldTag::__acl_entry),
4865                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4866                        }
4867                    }
4868                }
4869                deserializer.deserialize_identifier(Visitor)
4870            }
4871        }
4872        struct Visitor;
4873        impl<'de> serde::de::Visitor<'de> for Visitor {
4874            type Value = RemoveAclEntryRequest;
4875            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4876                formatter.write_str("struct RemoveAclEntryRequest")
4877            }
4878            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4879            where
4880                A: serde::de::MapAccess<'de>,
4881            {
4882                #[allow(unused_imports)]
4883                use serde::de::Error;
4884                use std::option::Option::Some;
4885                let mut fields = std::collections::HashSet::new();
4886                let mut result = Self::Value::new();
4887                while let Some(tag) = map.next_key::<__FieldTag>()? {
4888                    #[allow(clippy::match_single_binding)]
4889                    match tag {
4890                        __FieldTag::__acl => {
4891                            if !fields.insert(__FieldTag::__acl) {
4892                                return std::result::Result::Err(A::Error::duplicate_field(
4893                                    "multiple values for acl",
4894                                ));
4895                            }
4896                            result.acl = map
4897                                .next_value::<std::option::Option<std::string::String>>()?
4898                                .unwrap_or_default();
4899                        }
4900                        __FieldTag::__acl_entry => {
4901                            if !fields.insert(__FieldTag::__acl_entry) {
4902                                return std::result::Result::Err(A::Error::duplicate_field(
4903                                    "multiple values for acl_entry",
4904                                ));
4905                            }
4906                            result.acl_entry =
4907                                map.next_value::<std::option::Option<crate::model::AclEntry>>()?;
4908                        }
4909                        __FieldTag::Unknown(key) => {
4910                            let value = map.next_value::<serde_json::Value>()?;
4911                            result._unknown_fields.insert(key, value);
4912                        }
4913                    }
4914                }
4915                std::result::Result::Ok(result)
4916            }
4917        }
4918        deserializer.deserialize_any(Visitor)
4919    }
4920}
4921
4922#[doc(hidden)]
4923impl serde::ser::Serialize for RemoveAclEntryRequest {
4924    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4925    where
4926        S: serde::ser::Serializer,
4927    {
4928        use serde::ser::SerializeMap;
4929        #[allow(unused_imports)]
4930        use std::option::Option::Some;
4931        let mut state = serializer.serialize_map(std::option::Option::None)?;
4932        if !self.acl.is_empty() {
4933            state.serialize_entry("acl", &self.acl)?;
4934        }
4935        if self.acl_entry.is_some() {
4936            state.serialize_entry("aclEntry", &self.acl_entry)?;
4937        }
4938        if !self._unknown_fields.is_empty() {
4939            for (key, value) in self._unknown_fields.iter() {
4940                state.serialize_entry(key, &value)?;
4941            }
4942        }
4943        state.end()
4944    }
4945}
4946
4947impl std::fmt::Debug for RemoveAclEntryRequest {
4948    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4949        let mut debug_struct = f.debug_struct("RemoveAclEntryRequest");
4950        debug_struct.field("acl", &self.acl);
4951        debug_struct.field("acl_entry", &self.acl_entry);
4952        if !self._unknown_fields.is_empty() {
4953            debug_struct.field("_unknown_fields", &self._unknown_fields);
4954        }
4955        debug_struct.finish()
4956    }
4957}
4958
4959/// Response for RemoveAclEntry.
4960#[derive(Clone, Default, PartialEq)]
4961#[non_exhaustive]
4962pub struct RemoveAclEntryResponse {
4963    /// The result of removing the acl entry, depending on whether the acl was
4964    /// deleted as a result of removing the acl entry.
4965    pub result: std::option::Option<crate::model::remove_acl_entry_response::Result>,
4966
4967    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4968}
4969
4970impl RemoveAclEntryResponse {
4971    pub fn new() -> Self {
4972        std::default::Default::default()
4973    }
4974
4975    /// Sets the value of [result][crate::model::RemoveAclEntryResponse::result].
4976    ///
4977    /// Note that all the setters affecting `result` are mutually
4978    /// exclusive.
4979    pub fn set_result<
4980        T: std::convert::Into<std::option::Option<crate::model::remove_acl_entry_response::Result>>,
4981    >(
4982        mut self,
4983        v: T,
4984    ) -> Self {
4985        self.result = v.into();
4986        self
4987    }
4988
4989    /// The value of [result][crate::model::RemoveAclEntryResponse::result]
4990    /// if it holds a `Acl`, `None` if the field is not set or
4991    /// holds a different branch.
4992    pub fn acl(&self) -> std::option::Option<&std::boxed::Box<crate::model::Acl>> {
4993        #[allow(unreachable_patterns)]
4994        self.result.as_ref().and_then(|v| match v {
4995            crate::model::remove_acl_entry_response::Result::Acl(v) => std::option::Option::Some(v),
4996            _ => std::option::Option::None,
4997        })
4998    }
4999
5000    /// Sets the value of [result][crate::model::RemoveAclEntryResponse::result]
5001    /// to hold a `Acl`.
5002    ///
5003    /// Note that all the setters affecting `result` are
5004    /// mutually exclusive.
5005    pub fn set_acl<T: std::convert::Into<std::boxed::Box<crate::model::Acl>>>(
5006        mut self,
5007        v: T,
5008    ) -> Self {
5009        self.result = std::option::Option::Some(
5010            crate::model::remove_acl_entry_response::Result::Acl(v.into()),
5011        );
5012        self
5013    }
5014
5015    /// The value of [result][crate::model::RemoveAclEntryResponse::result]
5016    /// if it holds a `AclDeleted`, `None` if the field is not set or
5017    /// holds a different branch.
5018    pub fn acl_deleted(&self) -> std::option::Option<&bool> {
5019        #[allow(unreachable_patterns)]
5020        self.result.as_ref().and_then(|v| match v {
5021            crate::model::remove_acl_entry_response::Result::AclDeleted(v) => {
5022                std::option::Option::Some(v)
5023            }
5024            _ => std::option::Option::None,
5025        })
5026    }
5027
5028    /// Sets the value of [result][crate::model::RemoveAclEntryResponse::result]
5029    /// to hold a `AclDeleted`.
5030    ///
5031    /// Note that all the setters affecting `result` are
5032    /// mutually exclusive.
5033    pub fn set_acl_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5034        self.result = std::option::Option::Some(
5035            crate::model::remove_acl_entry_response::Result::AclDeleted(v.into()),
5036        );
5037        self
5038    }
5039}
5040
5041impl wkt::message::Message for RemoveAclEntryResponse {
5042    fn typename() -> &'static str {
5043        "type.googleapis.com/google.cloud.managedkafka.v1.RemoveAclEntryResponse"
5044    }
5045}
5046
5047#[doc(hidden)]
5048impl<'de> serde::de::Deserialize<'de> for RemoveAclEntryResponse {
5049    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5050    where
5051        D: serde::Deserializer<'de>,
5052    {
5053        #[allow(non_camel_case_types)]
5054        #[doc(hidden)]
5055        #[derive(PartialEq, Eq, Hash)]
5056        enum __FieldTag {
5057            __acl,
5058            __acl_deleted,
5059            Unknown(std::string::String),
5060        }
5061        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5062            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5063            where
5064                D: serde::Deserializer<'de>,
5065            {
5066                struct Visitor;
5067                impl<'de> serde::de::Visitor<'de> for Visitor {
5068                    type Value = __FieldTag;
5069                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5070                        formatter.write_str("a field name for RemoveAclEntryResponse")
5071                    }
5072                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5073                    where
5074                        E: serde::de::Error,
5075                    {
5076                        use std::result::Result::Ok;
5077                        use std::string::ToString;
5078                        match value {
5079                            "acl" => Ok(__FieldTag::__acl),
5080                            "aclDeleted" => Ok(__FieldTag::__acl_deleted),
5081                            "acl_deleted" => Ok(__FieldTag::__acl_deleted),
5082                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5083                        }
5084                    }
5085                }
5086                deserializer.deserialize_identifier(Visitor)
5087            }
5088        }
5089        struct Visitor;
5090        impl<'de> serde::de::Visitor<'de> for Visitor {
5091            type Value = RemoveAclEntryResponse;
5092            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5093                formatter.write_str("struct RemoveAclEntryResponse")
5094            }
5095            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5096            where
5097                A: serde::de::MapAccess<'de>,
5098            {
5099                #[allow(unused_imports)]
5100                use serde::de::Error;
5101                use std::option::Option::Some;
5102                let mut fields = std::collections::HashSet::new();
5103                let mut result = Self::Value::new();
5104                while let Some(tag) = map.next_key::<__FieldTag>()? {
5105                    #[allow(clippy::match_single_binding)]
5106                    match tag {
5107                        __FieldTag::__acl => {
5108                            if !fields.insert(__FieldTag::__acl) {
5109                                return std::result::Result::Err(A::Error::duplicate_field(
5110                                    "multiple values for acl",
5111                                ));
5112                            }
5113                            if result.result.is_some() {
5114                                return std::result::Result::Err(A::Error::duplicate_field(
5115                                    "multiple values for `result`, a oneof with full ID .google.cloud.managedkafka.v1.RemoveAclEntryResponse.acl, latest field was acl",
5116                                ));
5117                            }
5118                            result.result = std::option::Option::Some(
5119                                crate::model::remove_acl_entry_response::Result::Acl(
5120                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::Acl>>>()?.unwrap_or_default()
5121                                ),
5122                            );
5123                        }
5124                        __FieldTag::__acl_deleted => {
5125                            if !fields.insert(__FieldTag::__acl_deleted) {
5126                                return std::result::Result::Err(A::Error::duplicate_field(
5127                                    "multiple values for acl_deleted",
5128                                ));
5129                            }
5130                            if result.result.is_some() {
5131                                return std::result::Result::Err(A::Error::duplicate_field(
5132                                    "multiple values for `result`, a oneof with full ID .google.cloud.managedkafka.v1.RemoveAclEntryResponse.acl_deleted, latest field was aclDeleted",
5133                                ));
5134                            }
5135                            result.result = std::option::Option::Some(
5136                                crate::model::remove_acl_entry_response::Result::AclDeleted(
5137                                    map.next_value::<std::option::Option<bool>>()?
5138                                        .unwrap_or_default(),
5139                                ),
5140                            );
5141                        }
5142                        __FieldTag::Unknown(key) => {
5143                            let value = map.next_value::<serde_json::Value>()?;
5144                            result._unknown_fields.insert(key, value);
5145                        }
5146                    }
5147                }
5148                std::result::Result::Ok(result)
5149            }
5150        }
5151        deserializer.deserialize_any(Visitor)
5152    }
5153}
5154
5155#[doc(hidden)]
5156impl serde::ser::Serialize for RemoveAclEntryResponse {
5157    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5158    where
5159        S: serde::ser::Serializer,
5160    {
5161        use serde::ser::SerializeMap;
5162        #[allow(unused_imports)]
5163        use std::option::Option::Some;
5164        let mut state = serializer.serialize_map(std::option::Option::None)?;
5165        if let Some(value) = self.acl() {
5166            state.serialize_entry("acl", value)?;
5167        }
5168        if let Some(value) = self.acl_deleted() {
5169            state.serialize_entry("aclDeleted", value)?;
5170        }
5171        if !self._unknown_fields.is_empty() {
5172            for (key, value) in self._unknown_fields.iter() {
5173                state.serialize_entry(key, &value)?;
5174            }
5175        }
5176        state.end()
5177    }
5178}
5179
5180impl std::fmt::Debug for RemoveAclEntryResponse {
5181    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5182        let mut debug_struct = f.debug_struct("RemoveAclEntryResponse");
5183        debug_struct.field("result", &self.result);
5184        if !self._unknown_fields.is_empty() {
5185            debug_struct.field("_unknown_fields", &self._unknown_fields);
5186        }
5187        debug_struct.finish()
5188    }
5189}
5190
5191/// Defines additional types related to [RemoveAclEntryResponse].
5192pub mod remove_acl_entry_response {
5193    #[allow(unused_imports)]
5194    use super::*;
5195
5196    /// The result of removing the acl entry, depending on whether the acl was
5197    /// deleted as a result of removing the acl entry.
5198    #[derive(Clone, Debug, PartialEq)]
5199    #[non_exhaustive]
5200    pub enum Result {
5201        /// The updated acl. Returned if the removed acl entry was not the last entry
5202        /// in the acl.
5203        Acl(std::boxed::Box<crate::model::Acl>),
5204        /// Returned with value true if the removed acl entry was the last entry in
5205        /// the acl, resulting in acl deletion.
5206        AclDeleted(bool),
5207    }
5208}
5209
5210/// Request for GetConnectCluster.
5211#[derive(Clone, Default, PartialEq)]
5212#[non_exhaustive]
5213pub struct GetConnectClusterRequest {
5214    /// Required. The name of the Kafka Connect cluster whose configuration to
5215    /// return. Structured like
5216    /// `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.
5217    pub name: std::string::String,
5218
5219    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5220}
5221
5222impl GetConnectClusterRequest {
5223    pub fn new() -> Self {
5224        std::default::Default::default()
5225    }
5226
5227    /// Sets the value of [name][crate::model::GetConnectClusterRequest::name].
5228    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5229        self.name = v.into();
5230        self
5231    }
5232}
5233
5234impl wkt::message::Message for GetConnectClusterRequest {
5235    fn typename() -> &'static str {
5236        "type.googleapis.com/google.cloud.managedkafka.v1.GetConnectClusterRequest"
5237    }
5238}
5239
5240#[doc(hidden)]
5241impl<'de> serde::de::Deserialize<'de> for GetConnectClusterRequest {
5242    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5243    where
5244        D: serde::Deserializer<'de>,
5245    {
5246        #[allow(non_camel_case_types)]
5247        #[doc(hidden)]
5248        #[derive(PartialEq, Eq, Hash)]
5249        enum __FieldTag {
5250            __name,
5251            Unknown(std::string::String),
5252        }
5253        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5254            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5255            where
5256                D: serde::Deserializer<'de>,
5257            {
5258                struct Visitor;
5259                impl<'de> serde::de::Visitor<'de> for Visitor {
5260                    type Value = __FieldTag;
5261                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5262                        formatter.write_str("a field name for GetConnectClusterRequest")
5263                    }
5264                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5265                    where
5266                        E: serde::de::Error,
5267                    {
5268                        use std::result::Result::Ok;
5269                        use std::string::ToString;
5270                        match value {
5271                            "name" => Ok(__FieldTag::__name),
5272                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5273                        }
5274                    }
5275                }
5276                deserializer.deserialize_identifier(Visitor)
5277            }
5278        }
5279        struct Visitor;
5280        impl<'de> serde::de::Visitor<'de> for Visitor {
5281            type Value = GetConnectClusterRequest;
5282            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5283                formatter.write_str("struct GetConnectClusterRequest")
5284            }
5285            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5286            where
5287                A: serde::de::MapAccess<'de>,
5288            {
5289                #[allow(unused_imports)]
5290                use serde::de::Error;
5291                use std::option::Option::Some;
5292                let mut fields = std::collections::HashSet::new();
5293                let mut result = Self::Value::new();
5294                while let Some(tag) = map.next_key::<__FieldTag>()? {
5295                    #[allow(clippy::match_single_binding)]
5296                    match tag {
5297                        __FieldTag::__name => {
5298                            if !fields.insert(__FieldTag::__name) {
5299                                return std::result::Result::Err(A::Error::duplicate_field(
5300                                    "multiple values for name",
5301                                ));
5302                            }
5303                            result.name = map
5304                                .next_value::<std::option::Option<std::string::String>>()?
5305                                .unwrap_or_default();
5306                        }
5307                        __FieldTag::Unknown(key) => {
5308                            let value = map.next_value::<serde_json::Value>()?;
5309                            result._unknown_fields.insert(key, value);
5310                        }
5311                    }
5312                }
5313                std::result::Result::Ok(result)
5314            }
5315        }
5316        deserializer.deserialize_any(Visitor)
5317    }
5318}
5319
5320#[doc(hidden)]
5321impl serde::ser::Serialize for GetConnectClusterRequest {
5322    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5323    where
5324        S: serde::ser::Serializer,
5325    {
5326        use serde::ser::SerializeMap;
5327        #[allow(unused_imports)]
5328        use std::option::Option::Some;
5329        let mut state = serializer.serialize_map(std::option::Option::None)?;
5330        if !self.name.is_empty() {
5331            state.serialize_entry("name", &self.name)?;
5332        }
5333        if !self._unknown_fields.is_empty() {
5334            for (key, value) in self._unknown_fields.iter() {
5335                state.serialize_entry(key, &value)?;
5336            }
5337        }
5338        state.end()
5339    }
5340}
5341
5342impl std::fmt::Debug for GetConnectClusterRequest {
5343    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5344        let mut debug_struct = f.debug_struct("GetConnectClusterRequest");
5345        debug_struct.field("name", &self.name);
5346        if !self._unknown_fields.is_empty() {
5347            debug_struct.field("_unknown_fields", &self._unknown_fields);
5348        }
5349        debug_struct.finish()
5350    }
5351}
5352
5353/// Request for CreateConnectCluster.
5354#[derive(Clone, Default, PartialEq)]
5355#[non_exhaustive]
5356pub struct CreateConnectClusterRequest {
5357    /// Required. The parent project/location in which to create the Kafka Connect
5358    /// cluster. Structured like
5359    /// `projects/{project}/locations/{location}/`.
5360    pub parent: std::string::String,
5361
5362    /// Required. The ID to use for the Connect cluster, which will become the
5363    /// final component of the cluster's name. The ID must be 1-63 characters long,
5364    /// and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply
5365    /// with RFC 1035.
5366    ///
5367    /// This value is structured like: `my-cluster-id`.
5368    pub connect_cluster_id: std::string::String,
5369
5370    /// Required. Configuration of the Kafka Connect cluster to create. Its `name`
5371    /// field is ignored.
5372    pub connect_cluster: std::option::Option<crate::model::ConnectCluster>,
5373
5374    /// Optional. An optional request ID to identify requests. Specify a unique
5375    /// request ID to avoid duplication of requests. If a request times out or
5376    /// fails, retrying with the same ID allows the server to recognize the
5377    /// previous attempt. For at least 60 minutes, the server ignores duplicate
5378    /// requests bearing the same ID.
5379    ///
5380    /// For example, consider a situation where you make an initial request and the
5381    /// request times out. If you make the request again with the same request ID
5382    /// within 60 minutes of the last request, the server checks if an original
5383    /// operation with the same request ID was received. If so, the server ignores
5384    /// the second request.
5385    ///
5386    /// The request ID must be a valid UUID. A zero UUID is not supported
5387    /// (00000000-0000-0000-0000-000000000000).
5388    pub request_id: std::string::String,
5389
5390    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5391}
5392
5393impl CreateConnectClusterRequest {
5394    pub fn new() -> Self {
5395        std::default::Default::default()
5396    }
5397
5398    /// Sets the value of [parent][crate::model::CreateConnectClusterRequest::parent].
5399    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5400        self.parent = v.into();
5401        self
5402    }
5403
5404    /// Sets the value of [connect_cluster_id][crate::model::CreateConnectClusterRequest::connect_cluster_id].
5405    pub fn set_connect_cluster_id<T: std::convert::Into<std::string::String>>(
5406        mut self,
5407        v: T,
5408    ) -> Self {
5409        self.connect_cluster_id = v.into();
5410        self
5411    }
5412
5413    /// Sets the value of [connect_cluster][crate::model::CreateConnectClusterRequest::connect_cluster].
5414    pub fn set_connect_cluster<T>(mut self, v: T) -> Self
5415    where
5416        T: std::convert::Into<crate::model::ConnectCluster>,
5417    {
5418        self.connect_cluster = std::option::Option::Some(v.into());
5419        self
5420    }
5421
5422    /// Sets or clears the value of [connect_cluster][crate::model::CreateConnectClusterRequest::connect_cluster].
5423    pub fn set_or_clear_connect_cluster<T>(mut self, v: std::option::Option<T>) -> Self
5424    where
5425        T: std::convert::Into<crate::model::ConnectCluster>,
5426    {
5427        self.connect_cluster = v.map(|x| x.into());
5428        self
5429    }
5430
5431    /// Sets the value of [request_id][crate::model::CreateConnectClusterRequest::request_id].
5432    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5433        self.request_id = v.into();
5434        self
5435    }
5436}
5437
5438impl wkt::message::Message for CreateConnectClusterRequest {
5439    fn typename() -> &'static str {
5440        "type.googleapis.com/google.cloud.managedkafka.v1.CreateConnectClusterRequest"
5441    }
5442}
5443
5444#[doc(hidden)]
5445impl<'de> serde::de::Deserialize<'de> for CreateConnectClusterRequest {
5446    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5447    where
5448        D: serde::Deserializer<'de>,
5449    {
5450        #[allow(non_camel_case_types)]
5451        #[doc(hidden)]
5452        #[derive(PartialEq, Eq, Hash)]
5453        enum __FieldTag {
5454            __parent,
5455            __connect_cluster_id,
5456            __connect_cluster,
5457            __request_id,
5458            Unknown(std::string::String),
5459        }
5460        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5461            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5462            where
5463                D: serde::Deserializer<'de>,
5464            {
5465                struct Visitor;
5466                impl<'de> serde::de::Visitor<'de> for Visitor {
5467                    type Value = __FieldTag;
5468                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5469                        formatter.write_str("a field name for CreateConnectClusterRequest")
5470                    }
5471                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5472                    where
5473                        E: serde::de::Error,
5474                    {
5475                        use std::result::Result::Ok;
5476                        use std::string::ToString;
5477                        match value {
5478                            "parent" => Ok(__FieldTag::__parent),
5479                            "connectClusterId" => Ok(__FieldTag::__connect_cluster_id),
5480                            "connect_cluster_id" => Ok(__FieldTag::__connect_cluster_id),
5481                            "connectCluster" => Ok(__FieldTag::__connect_cluster),
5482                            "connect_cluster" => Ok(__FieldTag::__connect_cluster),
5483                            "requestId" => Ok(__FieldTag::__request_id),
5484                            "request_id" => Ok(__FieldTag::__request_id),
5485                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5486                        }
5487                    }
5488                }
5489                deserializer.deserialize_identifier(Visitor)
5490            }
5491        }
5492        struct Visitor;
5493        impl<'de> serde::de::Visitor<'de> for Visitor {
5494            type Value = CreateConnectClusterRequest;
5495            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5496                formatter.write_str("struct CreateConnectClusterRequest")
5497            }
5498            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5499            where
5500                A: serde::de::MapAccess<'de>,
5501            {
5502                #[allow(unused_imports)]
5503                use serde::de::Error;
5504                use std::option::Option::Some;
5505                let mut fields = std::collections::HashSet::new();
5506                let mut result = Self::Value::new();
5507                while let Some(tag) = map.next_key::<__FieldTag>()? {
5508                    #[allow(clippy::match_single_binding)]
5509                    match tag {
5510                        __FieldTag::__parent => {
5511                            if !fields.insert(__FieldTag::__parent) {
5512                                return std::result::Result::Err(A::Error::duplicate_field(
5513                                    "multiple values for parent",
5514                                ));
5515                            }
5516                            result.parent = map
5517                                .next_value::<std::option::Option<std::string::String>>()?
5518                                .unwrap_or_default();
5519                        }
5520                        __FieldTag::__connect_cluster_id => {
5521                            if !fields.insert(__FieldTag::__connect_cluster_id) {
5522                                return std::result::Result::Err(A::Error::duplicate_field(
5523                                    "multiple values for connect_cluster_id",
5524                                ));
5525                            }
5526                            result.connect_cluster_id = map
5527                                .next_value::<std::option::Option<std::string::String>>()?
5528                                .unwrap_or_default();
5529                        }
5530                        __FieldTag::__connect_cluster => {
5531                            if !fields.insert(__FieldTag::__connect_cluster) {
5532                                return std::result::Result::Err(A::Error::duplicate_field(
5533                                    "multiple values for connect_cluster",
5534                                ));
5535                            }
5536                            result.connect_cluster = map
5537                                .next_value::<std::option::Option<crate::model::ConnectCluster>>(
5538                                )?;
5539                        }
5540                        __FieldTag::__request_id => {
5541                            if !fields.insert(__FieldTag::__request_id) {
5542                                return std::result::Result::Err(A::Error::duplicate_field(
5543                                    "multiple values for request_id",
5544                                ));
5545                            }
5546                            result.request_id = map
5547                                .next_value::<std::option::Option<std::string::String>>()?
5548                                .unwrap_or_default();
5549                        }
5550                        __FieldTag::Unknown(key) => {
5551                            let value = map.next_value::<serde_json::Value>()?;
5552                            result._unknown_fields.insert(key, value);
5553                        }
5554                    }
5555                }
5556                std::result::Result::Ok(result)
5557            }
5558        }
5559        deserializer.deserialize_any(Visitor)
5560    }
5561}
5562
5563#[doc(hidden)]
5564impl serde::ser::Serialize for CreateConnectClusterRequest {
5565    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5566    where
5567        S: serde::ser::Serializer,
5568    {
5569        use serde::ser::SerializeMap;
5570        #[allow(unused_imports)]
5571        use std::option::Option::Some;
5572        let mut state = serializer.serialize_map(std::option::Option::None)?;
5573        if !self.parent.is_empty() {
5574            state.serialize_entry("parent", &self.parent)?;
5575        }
5576        if !self.connect_cluster_id.is_empty() {
5577            state.serialize_entry("connectClusterId", &self.connect_cluster_id)?;
5578        }
5579        if self.connect_cluster.is_some() {
5580            state.serialize_entry("connectCluster", &self.connect_cluster)?;
5581        }
5582        if !self.request_id.is_empty() {
5583            state.serialize_entry("requestId", &self.request_id)?;
5584        }
5585        if !self._unknown_fields.is_empty() {
5586            for (key, value) in self._unknown_fields.iter() {
5587                state.serialize_entry(key, &value)?;
5588            }
5589        }
5590        state.end()
5591    }
5592}
5593
5594impl std::fmt::Debug for CreateConnectClusterRequest {
5595    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5596        let mut debug_struct = f.debug_struct("CreateConnectClusterRequest");
5597        debug_struct.field("parent", &self.parent);
5598        debug_struct.field("connect_cluster_id", &self.connect_cluster_id);
5599        debug_struct.field("connect_cluster", &self.connect_cluster);
5600        debug_struct.field("request_id", &self.request_id);
5601        if !self._unknown_fields.is_empty() {
5602            debug_struct.field("_unknown_fields", &self._unknown_fields);
5603        }
5604        debug_struct.finish()
5605    }
5606}
5607
5608/// Request for UpdateConnectCluster.
5609#[derive(Clone, Default, PartialEq)]
5610#[non_exhaustive]
5611pub struct UpdateConnectClusterRequest {
5612    /// Required. Field mask is used to specify the fields to be overwritten in the
5613    /// cluster resource by the update. The fields specified in the update_mask are
5614    /// relative to the resource, not the full request. A field will be overwritten
5615    /// if it is in the mask. The mask is required and a value of * will update all
5616    /// fields.
5617    pub update_mask: std::option::Option<wkt::FieldMask>,
5618
5619    /// Required. The Kafka Connect cluster to update. Its `name` field must be
5620    /// populated.
5621    pub connect_cluster: std::option::Option<crate::model::ConnectCluster>,
5622
5623    /// Optional. An optional request ID to identify requests. Specify a unique
5624    /// request ID to avoid duplication of requests. If a request times out or
5625    /// fails, retrying with the same ID allows the server to recognize the
5626    /// previous attempt. For at least 60 minutes, the server ignores duplicate
5627    /// requests bearing the same ID.
5628    ///
5629    /// For example, consider a situation where you make an initial request and the
5630    /// request times out. If you make the request again with the same request ID
5631    /// within 60 minutes of the last request, the server checks if an original
5632    /// operation with the same request ID was received. If so, the server ignores
5633    /// the second request.
5634    ///
5635    /// The request ID must be a valid UUID. A zero UUID is not supported
5636    /// (00000000-0000-0000-0000-000000000000).
5637    pub request_id: std::string::String,
5638
5639    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5640}
5641
5642impl UpdateConnectClusterRequest {
5643    pub fn new() -> Self {
5644        std::default::Default::default()
5645    }
5646
5647    /// Sets the value of [update_mask][crate::model::UpdateConnectClusterRequest::update_mask].
5648    pub fn set_update_mask<T>(mut self, v: T) -> Self
5649    where
5650        T: std::convert::Into<wkt::FieldMask>,
5651    {
5652        self.update_mask = std::option::Option::Some(v.into());
5653        self
5654    }
5655
5656    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectClusterRequest::update_mask].
5657    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5658    where
5659        T: std::convert::Into<wkt::FieldMask>,
5660    {
5661        self.update_mask = v.map(|x| x.into());
5662        self
5663    }
5664
5665    /// Sets the value of [connect_cluster][crate::model::UpdateConnectClusterRequest::connect_cluster].
5666    pub fn set_connect_cluster<T>(mut self, v: T) -> Self
5667    where
5668        T: std::convert::Into<crate::model::ConnectCluster>,
5669    {
5670        self.connect_cluster = std::option::Option::Some(v.into());
5671        self
5672    }
5673
5674    /// Sets or clears the value of [connect_cluster][crate::model::UpdateConnectClusterRequest::connect_cluster].
5675    pub fn set_or_clear_connect_cluster<T>(mut self, v: std::option::Option<T>) -> Self
5676    where
5677        T: std::convert::Into<crate::model::ConnectCluster>,
5678    {
5679        self.connect_cluster = v.map(|x| x.into());
5680        self
5681    }
5682
5683    /// Sets the value of [request_id][crate::model::UpdateConnectClusterRequest::request_id].
5684    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5685        self.request_id = v.into();
5686        self
5687    }
5688}
5689
5690impl wkt::message::Message for UpdateConnectClusterRequest {
5691    fn typename() -> &'static str {
5692        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateConnectClusterRequest"
5693    }
5694}
5695
5696#[doc(hidden)]
5697impl<'de> serde::de::Deserialize<'de> for UpdateConnectClusterRequest {
5698    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5699    where
5700        D: serde::Deserializer<'de>,
5701    {
5702        #[allow(non_camel_case_types)]
5703        #[doc(hidden)]
5704        #[derive(PartialEq, Eq, Hash)]
5705        enum __FieldTag {
5706            __update_mask,
5707            __connect_cluster,
5708            __request_id,
5709            Unknown(std::string::String),
5710        }
5711        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5712            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5713            where
5714                D: serde::Deserializer<'de>,
5715            {
5716                struct Visitor;
5717                impl<'de> serde::de::Visitor<'de> for Visitor {
5718                    type Value = __FieldTag;
5719                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5720                        formatter.write_str("a field name for UpdateConnectClusterRequest")
5721                    }
5722                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5723                    where
5724                        E: serde::de::Error,
5725                    {
5726                        use std::result::Result::Ok;
5727                        use std::string::ToString;
5728                        match value {
5729                            "updateMask" => Ok(__FieldTag::__update_mask),
5730                            "update_mask" => Ok(__FieldTag::__update_mask),
5731                            "connectCluster" => Ok(__FieldTag::__connect_cluster),
5732                            "connect_cluster" => Ok(__FieldTag::__connect_cluster),
5733                            "requestId" => Ok(__FieldTag::__request_id),
5734                            "request_id" => Ok(__FieldTag::__request_id),
5735                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5736                        }
5737                    }
5738                }
5739                deserializer.deserialize_identifier(Visitor)
5740            }
5741        }
5742        struct Visitor;
5743        impl<'de> serde::de::Visitor<'de> for Visitor {
5744            type Value = UpdateConnectClusterRequest;
5745            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5746                formatter.write_str("struct UpdateConnectClusterRequest")
5747            }
5748            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5749            where
5750                A: serde::de::MapAccess<'de>,
5751            {
5752                #[allow(unused_imports)]
5753                use serde::de::Error;
5754                use std::option::Option::Some;
5755                let mut fields = std::collections::HashSet::new();
5756                let mut result = Self::Value::new();
5757                while let Some(tag) = map.next_key::<__FieldTag>()? {
5758                    #[allow(clippy::match_single_binding)]
5759                    match tag {
5760                        __FieldTag::__update_mask => {
5761                            if !fields.insert(__FieldTag::__update_mask) {
5762                                return std::result::Result::Err(A::Error::duplicate_field(
5763                                    "multiple values for update_mask",
5764                                ));
5765                            }
5766                            result.update_mask =
5767                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
5768                        }
5769                        __FieldTag::__connect_cluster => {
5770                            if !fields.insert(__FieldTag::__connect_cluster) {
5771                                return std::result::Result::Err(A::Error::duplicate_field(
5772                                    "multiple values for connect_cluster",
5773                                ));
5774                            }
5775                            result.connect_cluster = map
5776                                .next_value::<std::option::Option<crate::model::ConnectCluster>>(
5777                                )?;
5778                        }
5779                        __FieldTag::__request_id => {
5780                            if !fields.insert(__FieldTag::__request_id) {
5781                                return std::result::Result::Err(A::Error::duplicate_field(
5782                                    "multiple values for request_id",
5783                                ));
5784                            }
5785                            result.request_id = map
5786                                .next_value::<std::option::Option<std::string::String>>()?
5787                                .unwrap_or_default();
5788                        }
5789                        __FieldTag::Unknown(key) => {
5790                            let value = map.next_value::<serde_json::Value>()?;
5791                            result._unknown_fields.insert(key, value);
5792                        }
5793                    }
5794                }
5795                std::result::Result::Ok(result)
5796            }
5797        }
5798        deserializer.deserialize_any(Visitor)
5799    }
5800}
5801
5802#[doc(hidden)]
5803impl serde::ser::Serialize for UpdateConnectClusterRequest {
5804    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5805    where
5806        S: serde::ser::Serializer,
5807    {
5808        use serde::ser::SerializeMap;
5809        #[allow(unused_imports)]
5810        use std::option::Option::Some;
5811        let mut state = serializer.serialize_map(std::option::Option::None)?;
5812        if self.update_mask.is_some() {
5813            state.serialize_entry("updateMask", &self.update_mask)?;
5814        }
5815        if self.connect_cluster.is_some() {
5816            state.serialize_entry("connectCluster", &self.connect_cluster)?;
5817        }
5818        if !self.request_id.is_empty() {
5819            state.serialize_entry("requestId", &self.request_id)?;
5820        }
5821        if !self._unknown_fields.is_empty() {
5822            for (key, value) in self._unknown_fields.iter() {
5823                state.serialize_entry(key, &value)?;
5824            }
5825        }
5826        state.end()
5827    }
5828}
5829
5830impl std::fmt::Debug for UpdateConnectClusterRequest {
5831    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5832        let mut debug_struct = f.debug_struct("UpdateConnectClusterRequest");
5833        debug_struct.field("update_mask", &self.update_mask);
5834        debug_struct.field("connect_cluster", &self.connect_cluster);
5835        debug_struct.field("request_id", &self.request_id);
5836        if !self._unknown_fields.is_empty() {
5837            debug_struct.field("_unknown_fields", &self._unknown_fields);
5838        }
5839        debug_struct.finish()
5840    }
5841}
5842
5843/// Request for DeleteConnectCluster.
5844#[derive(Clone, Default, PartialEq)]
5845#[non_exhaustive]
5846pub struct DeleteConnectClusterRequest {
5847    /// Required. The name of the Kafka Connect cluster to delete.
5848    /// Structured like
5849    /// `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.
5850    pub name: std::string::String,
5851
5852    /// Optional. An optional request ID to identify requests. Specify a unique
5853    /// request ID to avoid duplication of requests. If a request times out or
5854    /// fails, retrying with the same ID allows the server to recognize the
5855    /// previous attempt. For at least 60 minutes, the server ignores duplicate
5856    /// requests bearing the same ID.
5857    ///
5858    /// For example, consider a situation where you make an initial request and the
5859    /// request times out. If you make the request again with the same request ID
5860    /// within 60 minutes of the last request, the server checks if an original
5861    /// operation with the same request ID was received. If so, the server ignores
5862    /// the second request.
5863    ///
5864    /// The request ID must be a valid UUID. A zero UUID is not supported
5865    /// (00000000-0000-0000-0000-000000000000).
5866    pub request_id: std::string::String,
5867
5868    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5869}
5870
5871impl DeleteConnectClusterRequest {
5872    pub fn new() -> Self {
5873        std::default::Default::default()
5874    }
5875
5876    /// Sets the value of [name][crate::model::DeleteConnectClusterRequest::name].
5877    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5878        self.name = v.into();
5879        self
5880    }
5881
5882    /// Sets the value of [request_id][crate::model::DeleteConnectClusterRequest::request_id].
5883    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5884        self.request_id = v.into();
5885        self
5886    }
5887}
5888
5889impl wkt::message::Message for DeleteConnectClusterRequest {
5890    fn typename() -> &'static str {
5891        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteConnectClusterRequest"
5892    }
5893}
5894
5895#[doc(hidden)]
5896impl<'de> serde::de::Deserialize<'de> for DeleteConnectClusterRequest {
5897    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5898    where
5899        D: serde::Deserializer<'de>,
5900    {
5901        #[allow(non_camel_case_types)]
5902        #[doc(hidden)]
5903        #[derive(PartialEq, Eq, Hash)]
5904        enum __FieldTag {
5905            __name,
5906            __request_id,
5907            Unknown(std::string::String),
5908        }
5909        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5910            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5911            where
5912                D: serde::Deserializer<'de>,
5913            {
5914                struct Visitor;
5915                impl<'de> serde::de::Visitor<'de> for Visitor {
5916                    type Value = __FieldTag;
5917                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5918                        formatter.write_str("a field name for DeleteConnectClusterRequest")
5919                    }
5920                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5921                    where
5922                        E: serde::de::Error,
5923                    {
5924                        use std::result::Result::Ok;
5925                        use std::string::ToString;
5926                        match value {
5927                            "name" => Ok(__FieldTag::__name),
5928                            "requestId" => Ok(__FieldTag::__request_id),
5929                            "request_id" => Ok(__FieldTag::__request_id),
5930                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5931                        }
5932                    }
5933                }
5934                deserializer.deserialize_identifier(Visitor)
5935            }
5936        }
5937        struct Visitor;
5938        impl<'de> serde::de::Visitor<'de> for Visitor {
5939            type Value = DeleteConnectClusterRequest;
5940            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5941                formatter.write_str("struct DeleteConnectClusterRequest")
5942            }
5943            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5944            where
5945                A: serde::de::MapAccess<'de>,
5946            {
5947                #[allow(unused_imports)]
5948                use serde::de::Error;
5949                use std::option::Option::Some;
5950                let mut fields = std::collections::HashSet::new();
5951                let mut result = Self::Value::new();
5952                while let Some(tag) = map.next_key::<__FieldTag>()? {
5953                    #[allow(clippy::match_single_binding)]
5954                    match tag {
5955                        __FieldTag::__name => {
5956                            if !fields.insert(__FieldTag::__name) {
5957                                return std::result::Result::Err(A::Error::duplicate_field(
5958                                    "multiple values for name",
5959                                ));
5960                            }
5961                            result.name = map
5962                                .next_value::<std::option::Option<std::string::String>>()?
5963                                .unwrap_or_default();
5964                        }
5965                        __FieldTag::__request_id => {
5966                            if !fields.insert(__FieldTag::__request_id) {
5967                                return std::result::Result::Err(A::Error::duplicate_field(
5968                                    "multiple values for request_id",
5969                                ));
5970                            }
5971                            result.request_id = map
5972                                .next_value::<std::option::Option<std::string::String>>()?
5973                                .unwrap_or_default();
5974                        }
5975                        __FieldTag::Unknown(key) => {
5976                            let value = map.next_value::<serde_json::Value>()?;
5977                            result._unknown_fields.insert(key, value);
5978                        }
5979                    }
5980                }
5981                std::result::Result::Ok(result)
5982            }
5983        }
5984        deserializer.deserialize_any(Visitor)
5985    }
5986}
5987
5988#[doc(hidden)]
5989impl serde::ser::Serialize for DeleteConnectClusterRequest {
5990    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5991    where
5992        S: serde::ser::Serializer,
5993    {
5994        use serde::ser::SerializeMap;
5995        #[allow(unused_imports)]
5996        use std::option::Option::Some;
5997        let mut state = serializer.serialize_map(std::option::Option::None)?;
5998        if !self.name.is_empty() {
5999            state.serialize_entry("name", &self.name)?;
6000        }
6001        if !self.request_id.is_empty() {
6002            state.serialize_entry("requestId", &self.request_id)?;
6003        }
6004        if !self._unknown_fields.is_empty() {
6005            for (key, value) in self._unknown_fields.iter() {
6006                state.serialize_entry(key, &value)?;
6007            }
6008        }
6009        state.end()
6010    }
6011}
6012
6013impl std::fmt::Debug for DeleteConnectClusterRequest {
6014    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6015        let mut debug_struct = f.debug_struct("DeleteConnectClusterRequest");
6016        debug_struct.field("name", &self.name);
6017        debug_struct.field("request_id", &self.request_id);
6018        if !self._unknown_fields.is_empty() {
6019            debug_struct.field("_unknown_fields", &self._unknown_fields);
6020        }
6021        debug_struct.finish()
6022    }
6023}
6024
6025/// Request for ListConnectClusters.
6026#[derive(Clone, Default, PartialEq)]
6027#[non_exhaustive]
6028pub struct ListConnectClustersRequest {
6029    /// Required. The parent project/location whose Connect clusters are to be
6030    /// listed. Structured like `projects/{project}/locations/{location}`.
6031    pub parent: std::string::String,
6032
6033    /// Optional. The maximum number of Connect clusters to return. The service may
6034    /// return fewer than this value. If unspecified, server will pick an
6035    /// appropriate default.
6036    pub page_size: i32,
6037
6038    /// Optional. A page token, received from a previous `ListConnectClusters`
6039    /// call. Provide this to retrieve the subsequent page.
6040    ///
6041    /// When paginating, all other parameters provided to `ListConnectClusters`
6042    /// must match the call that provided the page token.
6043    pub page_token: std::string::String,
6044
6045    /// Optional. Filter expression for the result.
6046    pub filter: std::string::String,
6047
6048    /// Optional. Order by fields for the result.
6049    pub order_by: std::string::String,
6050
6051    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6052}
6053
6054impl ListConnectClustersRequest {
6055    pub fn new() -> Self {
6056        std::default::Default::default()
6057    }
6058
6059    /// Sets the value of [parent][crate::model::ListConnectClustersRequest::parent].
6060    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6061        self.parent = v.into();
6062        self
6063    }
6064
6065    /// Sets the value of [page_size][crate::model::ListConnectClustersRequest::page_size].
6066    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6067        self.page_size = v.into();
6068        self
6069    }
6070
6071    /// Sets the value of [page_token][crate::model::ListConnectClustersRequest::page_token].
6072    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6073        self.page_token = v.into();
6074        self
6075    }
6076
6077    /// Sets the value of [filter][crate::model::ListConnectClustersRequest::filter].
6078    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6079        self.filter = v.into();
6080        self
6081    }
6082
6083    /// Sets the value of [order_by][crate::model::ListConnectClustersRequest::order_by].
6084    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6085        self.order_by = v.into();
6086        self
6087    }
6088}
6089
6090impl wkt::message::Message for ListConnectClustersRequest {
6091    fn typename() -> &'static str {
6092        "type.googleapis.com/google.cloud.managedkafka.v1.ListConnectClustersRequest"
6093    }
6094}
6095
6096#[doc(hidden)]
6097impl<'de> serde::de::Deserialize<'de> for ListConnectClustersRequest {
6098    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6099    where
6100        D: serde::Deserializer<'de>,
6101    {
6102        #[allow(non_camel_case_types)]
6103        #[doc(hidden)]
6104        #[derive(PartialEq, Eq, Hash)]
6105        enum __FieldTag {
6106            __parent,
6107            __page_size,
6108            __page_token,
6109            __filter,
6110            __order_by,
6111            Unknown(std::string::String),
6112        }
6113        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6114            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6115            where
6116                D: serde::Deserializer<'de>,
6117            {
6118                struct Visitor;
6119                impl<'de> serde::de::Visitor<'de> for Visitor {
6120                    type Value = __FieldTag;
6121                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6122                        formatter.write_str("a field name for ListConnectClustersRequest")
6123                    }
6124                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6125                    where
6126                        E: serde::de::Error,
6127                    {
6128                        use std::result::Result::Ok;
6129                        use std::string::ToString;
6130                        match value {
6131                            "parent" => Ok(__FieldTag::__parent),
6132                            "pageSize" => Ok(__FieldTag::__page_size),
6133                            "page_size" => Ok(__FieldTag::__page_size),
6134                            "pageToken" => Ok(__FieldTag::__page_token),
6135                            "page_token" => Ok(__FieldTag::__page_token),
6136                            "filter" => Ok(__FieldTag::__filter),
6137                            "orderBy" => Ok(__FieldTag::__order_by),
6138                            "order_by" => Ok(__FieldTag::__order_by),
6139                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6140                        }
6141                    }
6142                }
6143                deserializer.deserialize_identifier(Visitor)
6144            }
6145        }
6146        struct Visitor;
6147        impl<'de> serde::de::Visitor<'de> for Visitor {
6148            type Value = ListConnectClustersRequest;
6149            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6150                formatter.write_str("struct ListConnectClustersRequest")
6151            }
6152            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6153            where
6154                A: serde::de::MapAccess<'de>,
6155            {
6156                #[allow(unused_imports)]
6157                use serde::de::Error;
6158                use std::option::Option::Some;
6159                let mut fields = std::collections::HashSet::new();
6160                let mut result = Self::Value::new();
6161                while let Some(tag) = map.next_key::<__FieldTag>()? {
6162                    #[allow(clippy::match_single_binding)]
6163                    match tag {
6164                        __FieldTag::__parent => {
6165                            if !fields.insert(__FieldTag::__parent) {
6166                                return std::result::Result::Err(A::Error::duplicate_field(
6167                                    "multiple values for parent",
6168                                ));
6169                            }
6170                            result.parent = map
6171                                .next_value::<std::option::Option<std::string::String>>()?
6172                                .unwrap_or_default();
6173                        }
6174                        __FieldTag::__page_size => {
6175                            if !fields.insert(__FieldTag::__page_size) {
6176                                return std::result::Result::Err(A::Error::duplicate_field(
6177                                    "multiple values for page_size",
6178                                ));
6179                            }
6180                            struct __With(std::option::Option<i32>);
6181                            impl<'de> serde::de::Deserialize<'de> for __With {
6182                                fn deserialize<D>(
6183                                    deserializer: D,
6184                                ) -> std::result::Result<Self, D::Error>
6185                                where
6186                                    D: serde::de::Deserializer<'de>,
6187                                {
6188                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
6189                                }
6190                            }
6191                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
6192                        }
6193                        __FieldTag::__page_token => {
6194                            if !fields.insert(__FieldTag::__page_token) {
6195                                return std::result::Result::Err(A::Error::duplicate_field(
6196                                    "multiple values for page_token",
6197                                ));
6198                            }
6199                            result.page_token = map
6200                                .next_value::<std::option::Option<std::string::String>>()?
6201                                .unwrap_or_default();
6202                        }
6203                        __FieldTag::__filter => {
6204                            if !fields.insert(__FieldTag::__filter) {
6205                                return std::result::Result::Err(A::Error::duplicate_field(
6206                                    "multiple values for filter",
6207                                ));
6208                            }
6209                            result.filter = map
6210                                .next_value::<std::option::Option<std::string::String>>()?
6211                                .unwrap_or_default();
6212                        }
6213                        __FieldTag::__order_by => {
6214                            if !fields.insert(__FieldTag::__order_by) {
6215                                return std::result::Result::Err(A::Error::duplicate_field(
6216                                    "multiple values for order_by",
6217                                ));
6218                            }
6219                            result.order_by = map
6220                                .next_value::<std::option::Option<std::string::String>>()?
6221                                .unwrap_or_default();
6222                        }
6223                        __FieldTag::Unknown(key) => {
6224                            let value = map.next_value::<serde_json::Value>()?;
6225                            result._unknown_fields.insert(key, value);
6226                        }
6227                    }
6228                }
6229                std::result::Result::Ok(result)
6230            }
6231        }
6232        deserializer.deserialize_any(Visitor)
6233    }
6234}
6235
6236#[doc(hidden)]
6237impl serde::ser::Serialize for ListConnectClustersRequest {
6238    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6239    where
6240        S: serde::ser::Serializer,
6241    {
6242        use serde::ser::SerializeMap;
6243        #[allow(unused_imports)]
6244        use std::option::Option::Some;
6245        let mut state = serializer.serialize_map(std::option::Option::None)?;
6246        if !self.parent.is_empty() {
6247            state.serialize_entry("parent", &self.parent)?;
6248        }
6249        if !wkt::internal::is_default(&self.page_size) {
6250            struct __With<'a>(&'a i32);
6251            impl<'a> serde::ser::Serialize for __With<'a> {
6252                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6253                where
6254                    S: serde::ser::Serializer,
6255                {
6256                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
6257                }
6258            }
6259            state.serialize_entry("pageSize", &__With(&self.page_size))?;
6260        }
6261        if !self.page_token.is_empty() {
6262            state.serialize_entry("pageToken", &self.page_token)?;
6263        }
6264        if !self.filter.is_empty() {
6265            state.serialize_entry("filter", &self.filter)?;
6266        }
6267        if !self.order_by.is_empty() {
6268            state.serialize_entry("orderBy", &self.order_by)?;
6269        }
6270        if !self._unknown_fields.is_empty() {
6271            for (key, value) in self._unknown_fields.iter() {
6272                state.serialize_entry(key, &value)?;
6273            }
6274        }
6275        state.end()
6276    }
6277}
6278
6279impl std::fmt::Debug for ListConnectClustersRequest {
6280    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6281        let mut debug_struct = f.debug_struct("ListConnectClustersRequest");
6282        debug_struct.field("parent", &self.parent);
6283        debug_struct.field("page_size", &self.page_size);
6284        debug_struct.field("page_token", &self.page_token);
6285        debug_struct.field("filter", &self.filter);
6286        debug_struct.field("order_by", &self.order_by);
6287        if !self._unknown_fields.is_empty() {
6288            debug_struct.field("_unknown_fields", &self._unknown_fields);
6289        }
6290        debug_struct.finish()
6291    }
6292}
6293
6294/// Response for ListConnectClusters.
6295#[derive(Clone, Default, PartialEq)]
6296#[non_exhaustive]
6297pub struct ListConnectClustersResponse {
6298    /// The list of Connect clusters in the requested parent.
6299    pub connect_clusters: std::vec::Vec<crate::model::ConnectCluster>,
6300
6301    /// A token that can be sent as `page_token` to retrieve the next page of
6302    /// results. If this field is omitted, there are no more results.
6303    pub next_page_token: std::string::String,
6304
6305    /// Locations that could not be reached.
6306    pub unreachable: std::vec::Vec<std::string::String>,
6307
6308    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6309}
6310
6311impl ListConnectClustersResponse {
6312    pub fn new() -> Self {
6313        std::default::Default::default()
6314    }
6315
6316    /// Sets the value of [connect_clusters][crate::model::ListConnectClustersResponse::connect_clusters].
6317    pub fn set_connect_clusters<T, V>(mut self, v: T) -> Self
6318    where
6319        T: std::iter::IntoIterator<Item = V>,
6320        V: std::convert::Into<crate::model::ConnectCluster>,
6321    {
6322        use std::iter::Iterator;
6323        self.connect_clusters = v.into_iter().map(|i| i.into()).collect();
6324        self
6325    }
6326
6327    /// Sets the value of [next_page_token][crate::model::ListConnectClustersResponse::next_page_token].
6328    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6329        self.next_page_token = v.into();
6330        self
6331    }
6332
6333    /// Sets the value of [unreachable][crate::model::ListConnectClustersResponse::unreachable].
6334    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6335    where
6336        T: std::iter::IntoIterator<Item = V>,
6337        V: std::convert::Into<std::string::String>,
6338    {
6339        use std::iter::Iterator;
6340        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6341        self
6342    }
6343}
6344
6345impl wkt::message::Message for ListConnectClustersResponse {
6346    fn typename() -> &'static str {
6347        "type.googleapis.com/google.cloud.managedkafka.v1.ListConnectClustersResponse"
6348    }
6349}
6350
6351#[doc(hidden)]
6352impl gax::paginator::internal::PageableResponse for ListConnectClustersResponse {
6353    type PageItem = crate::model::ConnectCluster;
6354
6355    fn items(self) -> std::vec::Vec<Self::PageItem> {
6356        self.connect_clusters
6357    }
6358
6359    fn next_page_token(&self) -> std::string::String {
6360        use std::clone::Clone;
6361        self.next_page_token.clone()
6362    }
6363}
6364
6365#[doc(hidden)]
6366impl<'de> serde::de::Deserialize<'de> for ListConnectClustersResponse {
6367    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6368    where
6369        D: serde::Deserializer<'de>,
6370    {
6371        #[allow(non_camel_case_types)]
6372        #[doc(hidden)]
6373        #[derive(PartialEq, Eq, Hash)]
6374        enum __FieldTag {
6375            __connect_clusters,
6376            __next_page_token,
6377            __unreachable,
6378            Unknown(std::string::String),
6379        }
6380        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6381            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6382            where
6383                D: serde::Deserializer<'de>,
6384            {
6385                struct Visitor;
6386                impl<'de> serde::de::Visitor<'de> for Visitor {
6387                    type Value = __FieldTag;
6388                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6389                        formatter.write_str("a field name for ListConnectClustersResponse")
6390                    }
6391                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6392                    where
6393                        E: serde::de::Error,
6394                    {
6395                        use std::result::Result::Ok;
6396                        use std::string::ToString;
6397                        match value {
6398                            "connectClusters" => Ok(__FieldTag::__connect_clusters),
6399                            "connect_clusters" => Ok(__FieldTag::__connect_clusters),
6400                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
6401                            "next_page_token" => Ok(__FieldTag::__next_page_token),
6402                            "unreachable" => Ok(__FieldTag::__unreachable),
6403                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6404                        }
6405                    }
6406                }
6407                deserializer.deserialize_identifier(Visitor)
6408            }
6409        }
6410        struct Visitor;
6411        impl<'de> serde::de::Visitor<'de> for Visitor {
6412            type Value = ListConnectClustersResponse;
6413            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6414                formatter.write_str("struct ListConnectClustersResponse")
6415            }
6416            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6417            where
6418                A: serde::de::MapAccess<'de>,
6419            {
6420                #[allow(unused_imports)]
6421                use serde::de::Error;
6422                use std::option::Option::Some;
6423                let mut fields = std::collections::HashSet::new();
6424                let mut result = Self::Value::new();
6425                while let Some(tag) = map.next_key::<__FieldTag>()? {
6426                    #[allow(clippy::match_single_binding)]
6427                    match tag {
6428                        __FieldTag::__connect_clusters => {
6429                            if !fields.insert(__FieldTag::__connect_clusters) {
6430                                return std::result::Result::Err(A::Error::duplicate_field(
6431                                    "multiple values for connect_clusters",
6432                                ));
6433                            }
6434                            result.connect_clusters =
6435                                map.next_value::<std::option::Option<
6436                                    std::vec::Vec<crate::model::ConnectCluster>,
6437                                >>()?
6438                                .unwrap_or_default();
6439                        }
6440                        __FieldTag::__next_page_token => {
6441                            if !fields.insert(__FieldTag::__next_page_token) {
6442                                return std::result::Result::Err(A::Error::duplicate_field(
6443                                    "multiple values for next_page_token",
6444                                ));
6445                            }
6446                            result.next_page_token = map
6447                                .next_value::<std::option::Option<std::string::String>>()?
6448                                .unwrap_or_default();
6449                        }
6450                        __FieldTag::__unreachable => {
6451                            if !fields.insert(__FieldTag::__unreachable) {
6452                                return std::result::Result::Err(A::Error::duplicate_field(
6453                                    "multiple values for unreachable",
6454                                ));
6455                            }
6456                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
6457                        }
6458                        __FieldTag::Unknown(key) => {
6459                            let value = map.next_value::<serde_json::Value>()?;
6460                            result._unknown_fields.insert(key, value);
6461                        }
6462                    }
6463                }
6464                std::result::Result::Ok(result)
6465            }
6466        }
6467        deserializer.deserialize_any(Visitor)
6468    }
6469}
6470
6471#[doc(hidden)]
6472impl serde::ser::Serialize for ListConnectClustersResponse {
6473    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6474    where
6475        S: serde::ser::Serializer,
6476    {
6477        use serde::ser::SerializeMap;
6478        #[allow(unused_imports)]
6479        use std::option::Option::Some;
6480        let mut state = serializer.serialize_map(std::option::Option::None)?;
6481        if !self.connect_clusters.is_empty() {
6482            state.serialize_entry("connectClusters", &self.connect_clusters)?;
6483        }
6484        if !self.next_page_token.is_empty() {
6485            state.serialize_entry("nextPageToken", &self.next_page_token)?;
6486        }
6487        if !self.unreachable.is_empty() {
6488            state.serialize_entry("unreachable", &self.unreachable)?;
6489        }
6490        if !self._unknown_fields.is_empty() {
6491            for (key, value) in self._unknown_fields.iter() {
6492                state.serialize_entry(key, &value)?;
6493            }
6494        }
6495        state.end()
6496    }
6497}
6498
6499impl std::fmt::Debug for ListConnectClustersResponse {
6500    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6501        let mut debug_struct = f.debug_struct("ListConnectClustersResponse");
6502        debug_struct.field("connect_clusters", &self.connect_clusters);
6503        debug_struct.field("next_page_token", &self.next_page_token);
6504        debug_struct.field("unreachable", &self.unreachable);
6505        if !self._unknown_fields.is_empty() {
6506            debug_struct.field("_unknown_fields", &self._unknown_fields);
6507        }
6508        debug_struct.finish()
6509    }
6510}
6511
6512/// Request for GetConnector.
6513#[derive(Clone, Default, PartialEq)]
6514#[non_exhaustive]
6515pub struct GetConnectorRequest {
6516    /// Required. The name of the connector whose configuration to return.
6517    /// Structured like:
6518    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
6519    pub name: std::string::String,
6520
6521    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6522}
6523
6524impl GetConnectorRequest {
6525    pub fn new() -> Self {
6526        std::default::Default::default()
6527    }
6528
6529    /// Sets the value of [name][crate::model::GetConnectorRequest::name].
6530    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6531        self.name = v.into();
6532        self
6533    }
6534}
6535
6536impl wkt::message::Message for GetConnectorRequest {
6537    fn typename() -> &'static str {
6538        "type.googleapis.com/google.cloud.managedkafka.v1.GetConnectorRequest"
6539    }
6540}
6541
6542#[doc(hidden)]
6543impl<'de> serde::de::Deserialize<'de> for GetConnectorRequest {
6544    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6545    where
6546        D: serde::Deserializer<'de>,
6547    {
6548        #[allow(non_camel_case_types)]
6549        #[doc(hidden)]
6550        #[derive(PartialEq, Eq, Hash)]
6551        enum __FieldTag {
6552            __name,
6553            Unknown(std::string::String),
6554        }
6555        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6556            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6557            where
6558                D: serde::Deserializer<'de>,
6559            {
6560                struct Visitor;
6561                impl<'de> serde::de::Visitor<'de> for Visitor {
6562                    type Value = __FieldTag;
6563                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6564                        formatter.write_str("a field name for GetConnectorRequest")
6565                    }
6566                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6567                    where
6568                        E: serde::de::Error,
6569                    {
6570                        use std::result::Result::Ok;
6571                        use std::string::ToString;
6572                        match value {
6573                            "name" => Ok(__FieldTag::__name),
6574                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6575                        }
6576                    }
6577                }
6578                deserializer.deserialize_identifier(Visitor)
6579            }
6580        }
6581        struct Visitor;
6582        impl<'de> serde::de::Visitor<'de> for Visitor {
6583            type Value = GetConnectorRequest;
6584            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6585                formatter.write_str("struct GetConnectorRequest")
6586            }
6587            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6588            where
6589                A: serde::de::MapAccess<'de>,
6590            {
6591                #[allow(unused_imports)]
6592                use serde::de::Error;
6593                use std::option::Option::Some;
6594                let mut fields = std::collections::HashSet::new();
6595                let mut result = Self::Value::new();
6596                while let Some(tag) = map.next_key::<__FieldTag>()? {
6597                    #[allow(clippy::match_single_binding)]
6598                    match tag {
6599                        __FieldTag::__name => {
6600                            if !fields.insert(__FieldTag::__name) {
6601                                return std::result::Result::Err(A::Error::duplicate_field(
6602                                    "multiple values for name",
6603                                ));
6604                            }
6605                            result.name = map
6606                                .next_value::<std::option::Option<std::string::String>>()?
6607                                .unwrap_or_default();
6608                        }
6609                        __FieldTag::Unknown(key) => {
6610                            let value = map.next_value::<serde_json::Value>()?;
6611                            result._unknown_fields.insert(key, value);
6612                        }
6613                    }
6614                }
6615                std::result::Result::Ok(result)
6616            }
6617        }
6618        deserializer.deserialize_any(Visitor)
6619    }
6620}
6621
6622#[doc(hidden)]
6623impl serde::ser::Serialize for GetConnectorRequest {
6624    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6625    where
6626        S: serde::ser::Serializer,
6627    {
6628        use serde::ser::SerializeMap;
6629        #[allow(unused_imports)]
6630        use std::option::Option::Some;
6631        let mut state = serializer.serialize_map(std::option::Option::None)?;
6632        if !self.name.is_empty() {
6633            state.serialize_entry("name", &self.name)?;
6634        }
6635        if !self._unknown_fields.is_empty() {
6636            for (key, value) in self._unknown_fields.iter() {
6637                state.serialize_entry(key, &value)?;
6638            }
6639        }
6640        state.end()
6641    }
6642}
6643
6644impl std::fmt::Debug for GetConnectorRequest {
6645    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6646        let mut debug_struct = f.debug_struct("GetConnectorRequest");
6647        debug_struct.field("name", &self.name);
6648        if !self._unknown_fields.is_empty() {
6649            debug_struct.field("_unknown_fields", &self._unknown_fields);
6650        }
6651        debug_struct.finish()
6652    }
6653}
6654
6655/// Request for CreateConnector.
6656#[derive(Clone, Default, PartialEq)]
6657#[non_exhaustive]
6658pub struct CreateConnectorRequest {
6659    /// Required. The parent Connect cluster in which to create the connector.
6660    /// Structured like
6661    /// `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.
6662    pub parent: std::string::String,
6663
6664    /// Required. The ID to use for the connector, which will become the final
6665    /// component of the connector's name. The ID must be 1-63 characters long, and
6666    /// match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with
6667    /// RFC 1035.
6668    ///
6669    /// This value is structured like: `my-connector-id`.
6670    pub connector_id: std::string::String,
6671
6672    /// Required. The connector to create.
6673    pub connector: std::option::Option<crate::model::Connector>,
6674
6675    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6676}
6677
6678impl CreateConnectorRequest {
6679    pub fn new() -> Self {
6680        std::default::Default::default()
6681    }
6682
6683    /// Sets the value of [parent][crate::model::CreateConnectorRequest::parent].
6684    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6685        self.parent = v.into();
6686        self
6687    }
6688
6689    /// Sets the value of [connector_id][crate::model::CreateConnectorRequest::connector_id].
6690    pub fn set_connector_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6691        self.connector_id = v.into();
6692        self
6693    }
6694
6695    /// Sets the value of [connector][crate::model::CreateConnectorRequest::connector].
6696    pub fn set_connector<T>(mut self, v: T) -> Self
6697    where
6698        T: std::convert::Into<crate::model::Connector>,
6699    {
6700        self.connector = std::option::Option::Some(v.into());
6701        self
6702    }
6703
6704    /// Sets or clears the value of [connector][crate::model::CreateConnectorRequest::connector].
6705    pub fn set_or_clear_connector<T>(mut self, v: std::option::Option<T>) -> Self
6706    where
6707        T: std::convert::Into<crate::model::Connector>,
6708    {
6709        self.connector = v.map(|x| x.into());
6710        self
6711    }
6712}
6713
6714impl wkt::message::Message for CreateConnectorRequest {
6715    fn typename() -> &'static str {
6716        "type.googleapis.com/google.cloud.managedkafka.v1.CreateConnectorRequest"
6717    }
6718}
6719
6720#[doc(hidden)]
6721impl<'de> serde::de::Deserialize<'de> for CreateConnectorRequest {
6722    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6723    where
6724        D: serde::Deserializer<'de>,
6725    {
6726        #[allow(non_camel_case_types)]
6727        #[doc(hidden)]
6728        #[derive(PartialEq, Eq, Hash)]
6729        enum __FieldTag {
6730            __parent,
6731            __connector_id,
6732            __connector,
6733            Unknown(std::string::String),
6734        }
6735        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6736            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6737            where
6738                D: serde::Deserializer<'de>,
6739            {
6740                struct Visitor;
6741                impl<'de> serde::de::Visitor<'de> for Visitor {
6742                    type Value = __FieldTag;
6743                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6744                        formatter.write_str("a field name for CreateConnectorRequest")
6745                    }
6746                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6747                    where
6748                        E: serde::de::Error,
6749                    {
6750                        use std::result::Result::Ok;
6751                        use std::string::ToString;
6752                        match value {
6753                            "parent" => Ok(__FieldTag::__parent),
6754                            "connectorId" => Ok(__FieldTag::__connector_id),
6755                            "connector_id" => Ok(__FieldTag::__connector_id),
6756                            "connector" => Ok(__FieldTag::__connector),
6757                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6758                        }
6759                    }
6760                }
6761                deserializer.deserialize_identifier(Visitor)
6762            }
6763        }
6764        struct Visitor;
6765        impl<'de> serde::de::Visitor<'de> for Visitor {
6766            type Value = CreateConnectorRequest;
6767            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6768                formatter.write_str("struct CreateConnectorRequest")
6769            }
6770            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6771            where
6772                A: serde::de::MapAccess<'de>,
6773            {
6774                #[allow(unused_imports)]
6775                use serde::de::Error;
6776                use std::option::Option::Some;
6777                let mut fields = std::collections::HashSet::new();
6778                let mut result = Self::Value::new();
6779                while let Some(tag) = map.next_key::<__FieldTag>()? {
6780                    #[allow(clippy::match_single_binding)]
6781                    match tag {
6782                        __FieldTag::__parent => {
6783                            if !fields.insert(__FieldTag::__parent) {
6784                                return std::result::Result::Err(A::Error::duplicate_field(
6785                                    "multiple values for parent",
6786                                ));
6787                            }
6788                            result.parent = map
6789                                .next_value::<std::option::Option<std::string::String>>()?
6790                                .unwrap_or_default();
6791                        }
6792                        __FieldTag::__connector_id => {
6793                            if !fields.insert(__FieldTag::__connector_id) {
6794                                return std::result::Result::Err(A::Error::duplicate_field(
6795                                    "multiple values for connector_id",
6796                                ));
6797                            }
6798                            result.connector_id = map
6799                                .next_value::<std::option::Option<std::string::String>>()?
6800                                .unwrap_or_default();
6801                        }
6802                        __FieldTag::__connector => {
6803                            if !fields.insert(__FieldTag::__connector) {
6804                                return std::result::Result::Err(A::Error::duplicate_field(
6805                                    "multiple values for connector",
6806                                ));
6807                            }
6808                            result.connector =
6809                                map.next_value::<std::option::Option<crate::model::Connector>>()?;
6810                        }
6811                        __FieldTag::Unknown(key) => {
6812                            let value = map.next_value::<serde_json::Value>()?;
6813                            result._unknown_fields.insert(key, value);
6814                        }
6815                    }
6816                }
6817                std::result::Result::Ok(result)
6818            }
6819        }
6820        deserializer.deserialize_any(Visitor)
6821    }
6822}
6823
6824#[doc(hidden)]
6825impl serde::ser::Serialize for CreateConnectorRequest {
6826    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6827    where
6828        S: serde::ser::Serializer,
6829    {
6830        use serde::ser::SerializeMap;
6831        #[allow(unused_imports)]
6832        use std::option::Option::Some;
6833        let mut state = serializer.serialize_map(std::option::Option::None)?;
6834        if !self.parent.is_empty() {
6835            state.serialize_entry("parent", &self.parent)?;
6836        }
6837        if !self.connector_id.is_empty() {
6838            state.serialize_entry("connectorId", &self.connector_id)?;
6839        }
6840        if self.connector.is_some() {
6841            state.serialize_entry("connector", &self.connector)?;
6842        }
6843        if !self._unknown_fields.is_empty() {
6844            for (key, value) in self._unknown_fields.iter() {
6845                state.serialize_entry(key, &value)?;
6846            }
6847        }
6848        state.end()
6849    }
6850}
6851
6852impl std::fmt::Debug for CreateConnectorRequest {
6853    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6854        let mut debug_struct = f.debug_struct("CreateConnectorRequest");
6855        debug_struct.field("parent", &self.parent);
6856        debug_struct.field("connector_id", &self.connector_id);
6857        debug_struct.field("connector", &self.connector);
6858        if !self._unknown_fields.is_empty() {
6859            debug_struct.field("_unknown_fields", &self._unknown_fields);
6860        }
6861        debug_struct.finish()
6862    }
6863}
6864
6865/// Request for UpdateConnector.
6866#[derive(Clone, Default, PartialEq)]
6867#[non_exhaustive]
6868pub struct UpdateConnectorRequest {
6869    /// Required. Field mask is used to specify the fields to be overwritten in the
6870    /// cluster resource by the update. The fields specified in the update_mask are
6871    /// relative to the resource, not the full request. A field will be overwritten
6872    /// if it is in the mask. The mask is required and a value of * will update all
6873    /// fields.
6874    pub update_mask: std::option::Option<wkt::FieldMask>,
6875
6876    /// Required. The connector to update. Its `name` field must be populated.
6877    pub connector: std::option::Option<crate::model::Connector>,
6878
6879    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6880}
6881
6882impl UpdateConnectorRequest {
6883    pub fn new() -> Self {
6884        std::default::Default::default()
6885    }
6886
6887    /// Sets the value of [update_mask][crate::model::UpdateConnectorRequest::update_mask].
6888    pub fn set_update_mask<T>(mut self, v: T) -> Self
6889    where
6890        T: std::convert::Into<wkt::FieldMask>,
6891    {
6892        self.update_mask = std::option::Option::Some(v.into());
6893        self
6894    }
6895
6896    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectorRequest::update_mask].
6897    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6898    where
6899        T: std::convert::Into<wkt::FieldMask>,
6900    {
6901        self.update_mask = v.map(|x| x.into());
6902        self
6903    }
6904
6905    /// Sets the value of [connector][crate::model::UpdateConnectorRequest::connector].
6906    pub fn set_connector<T>(mut self, v: T) -> Self
6907    where
6908        T: std::convert::Into<crate::model::Connector>,
6909    {
6910        self.connector = std::option::Option::Some(v.into());
6911        self
6912    }
6913
6914    /// Sets or clears the value of [connector][crate::model::UpdateConnectorRequest::connector].
6915    pub fn set_or_clear_connector<T>(mut self, v: std::option::Option<T>) -> Self
6916    where
6917        T: std::convert::Into<crate::model::Connector>,
6918    {
6919        self.connector = v.map(|x| x.into());
6920        self
6921    }
6922}
6923
6924impl wkt::message::Message for UpdateConnectorRequest {
6925    fn typename() -> &'static str {
6926        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateConnectorRequest"
6927    }
6928}
6929
6930#[doc(hidden)]
6931impl<'de> serde::de::Deserialize<'de> for UpdateConnectorRequest {
6932    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6933    where
6934        D: serde::Deserializer<'de>,
6935    {
6936        #[allow(non_camel_case_types)]
6937        #[doc(hidden)]
6938        #[derive(PartialEq, Eq, Hash)]
6939        enum __FieldTag {
6940            __update_mask,
6941            __connector,
6942            Unknown(std::string::String),
6943        }
6944        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6945            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6946            where
6947                D: serde::Deserializer<'de>,
6948            {
6949                struct Visitor;
6950                impl<'de> serde::de::Visitor<'de> for Visitor {
6951                    type Value = __FieldTag;
6952                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6953                        formatter.write_str("a field name for UpdateConnectorRequest")
6954                    }
6955                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6956                    where
6957                        E: serde::de::Error,
6958                    {
6959                        use std::result::Result::Ok;
6960                        use std::string::ToString;
6961                        match value {
6962                            "updateMask" => Ok(__FieldTag::__update_mask),
6963                            "update_mask" => Ok(__FieldTag::__update_mask),
6964                            "connector" => Ok(__FieldTag::__connector),
6965                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6966                        }
6967                    }
6968                }
6969                deserializer.deserialize_identifier(Visitor)
6970            }
6971        }
6972        struct Visitor;
6973        impl<'de> serde::de::Visitor<'de> for Visitor {
6974            type Value = UpdateConnectorRequest;
6975            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6976                formatter.write_str("struct UpdateConnectorRequest")
6977            }
6978            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6979            where
6980                A: serde::de::MapAccess<'de>,
6981            {
6982                #[allow(unused_imports)]
6983                use serde::de::Error;
6984                use std::option::Option::Some;
6985                let mut fields = std::collections::HashSet::new();
6986                let mut result = Self::Value::new();
6987                while let Some(tag) = map.next_key::<__FieldTag>()? {
6988                    #[allow(clippy::match_single_binding)]
6989                    match tag {
6990                        __FieldTag::__update_mask => {
6991                            if !fields.insert(__FieldTag::__update_mask) {
6992                                return std::result::Result::Err(A::Error::duplicate_field(
6993                                    "multiple values for update_mask",
6994                                ));
6995                            }
6996                            result.update_mask =
6997                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
6998                        }
6999                        __FieldTag::__connector => {
7000                            if !fields.insert(__FieldTag::__connector) {
7001                                return std::result::Result::Err(A::Error::duplicate_field(
7002                                    "multiple values for connector",
7003                                ));
7004                            }
7005                            result.connector =
7006                                map.next_value::<std::option::Option<crate::model::Connector>>()?;
7007                        }
7008                        __FieldTag::Unknown(key) => {
7009                            let value = map.next_value::<serde_json::Value>()?;
7010                            result._unknown_fields.insert(key, value);
7011                        }
7012                    }
7013                }
7014                std::result::Result::Ok(result)
7015            }
7016        }
7017        deserializer.deserialize_any(Visitor)
7018    }
7019}
7020
7021#[doc(hidden)]
7022impl serde::ser::Serialize for UpdateConnectorRequest {
7023    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7024    where
7025        S: serde::ser::Serializer,
7026    {
7027        use serde::ser::SerializeMap;
7028        #[allow(unused_imports)]
7029        use std::option::Option::Some;
7030        let mut state = serializer.serialize_map(std::option::Option::None)?;
7031        if self.update_mask.is_some() {
7032            state.serialize_entry("updateMask", &self.update_mask)?;
7033        }
7034        if self.connector.is_some() {
7035            state.serialize_entry("connector", &self.connector)?;
7036        }
7037        if !self._unknown_fields.is_empty() {
7038            for (key, value) in self._unknown_fields.iter() {
7039                state.serialize_entry(key, &value)?;
7040            }
7041        }
7042        state.end()
7043    }
7044}
7045
7046impl std::fmt::Debug for UpdateConnectorRequest {
7047    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7048        let mut debug_struct = f.debug_struct("UpdateConnectorRequest");
7049        debug_struct.field("update_mask", &self.update_mask);
7050        debug_struct.field("connector", &self.connector);
7051        if !self._unknown_fields.is_empty() {
7052            debug_struct.field("_unknown_fields", &self._unknown_fields);
7053        }
7054        debug_struct.finish()
7055    }
7056}
7057
7058/// Request for DeleteConnector.
7059#[derive(Clone, Default, PartialEq)]
7060#[non_exhaustive]
7061pub struct DeleteConnectorRequest {
7062    /// Required. The name of the connector to delete.
7063    /// Structured like:
7064    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
7065    pub name: std::string::String,
7066
7067    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7068}
7069
7070impl DeleteConnectorRequest {
7071    pub fn new() -> Self {
7072        std::default::Default::default()
7073    }
7074
7075    /// Sets the value of [name][crate::model::DeleteConnectorRequest::name].
7076    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7077        self.name = v.into();
7078        self
7079    }
7080}
7081
7082impl wkt::message::Message for DeleteConnectorRequest {
7083    fn typename() -> &'static str {
7084        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteConnectorRequest"
7085    }
7086}
7087
7088#[doc(hidden)]
7089impl<'de> serde::de::Deserialize<'de> for DeleteConnectorRequest {
7090    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7091    where
7092        D: serde::Deserializer<'de>,
7093    {
7094        #[allow(non_camel_case_types)]
7095        #[doc(hidden)]
7096        #[derive(PartialEq, Eq, Hash)]
7097        enum __FieldTag {
7098            __name,
7099            Unknown(std::string::String),
7100        }
7101        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7102            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7103            where
7104                D: serde::Deserializer<'de>,
7105            {
7106                struct Visitor;
7107                impl<'de> serde::de::Visitor<'de> for Visitor {
7108                    type Value = __FieldTag;
7109                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7110                        formatter.write_str("a field name for DeleteConnectorRequest")
7111                    }
7112                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7113                    where
7114                        E: serde::de::Error,
7115                    {
7116                        use std::result::Result::Ok;
7117                        use std::string::ToString;
7118                        match value {
7119                            "name" => Ok(__FieldTag::__name),
7120                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7121                        }
7122                    }
7123                }
7124                deserializer.deserialize_identifier(Visitor)
7125            }
7126        }
7127        struct Visitor;
7128        impl<'de> serde::de::Visitor<'de> for Visitor {
7129            type Value = DeleteConnectorRequest;
7130            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7131                formatter.write_str("struct DeleteConnectorRequest")
7132            }
7133            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7134            where
7135                A: serde::de::MapAccess<'de>,
7136            {
7137                #[allow(unused_imports)]
7138                use serde::de::Error;
7139                use std::option::Option::Some;
7140                let mut fields = std::collections::HashSet::new();
7141                let mut result = Self::Value::new();
7142                while let Some(tag) = map.next_key::<__FieldTag>()? {
7143                    #[allow(clippy::match_single_binding)]
7144                    match tag {
7145                        __FieldTag::__name => {
7146                            if !fields.insert(__FieldTag::__name) {
7147                                return std::result::Result::Err(A::Error::duplicate_field(
7148                                    "multiple values for name",
7149                                ));
7150                            }
7151                            result.name = map
7152                                .next_value::<std::option::Option<std::string::String>>()?
7153                                .unwrap_or_default();
7154                        }
7155                        __FieldTag::Unknown(key) => {
7156                            let value = map.next_value::<serde_json::Value>()?;
7157                            result._unknown_fields.insert(key, value);
7158                        }
7159                    }
7160                }
7161                std::result::Result::Ok(result)
7162            }
7163        }
7164        deserializer.deserialize_any(Visitor)
7165    }
7166}
7167
7168#[doc(hidden)]
7169impl serde::ser::Serialize for DeleteConnectorRequest {
7170    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7171    where
7172        S: serde::ser::Serializer,
7173    {
7174        use serde::ser::SerializeMap;
7175        #[allow(unused_imports)]
7176        use std::option::Option::Some;
7177        let mut state = serializer.serialize_map(std::option::Option::None)?;
7178        if !self.name.is_empty() {
7179            state.serialize_entry("name", &self.name)?;
7180        }
7181        if !self._unknown_fields.is_empty() {
7182            for (key, value) in self._unknown_fields.iter() {
7183                state.serialize_entry(key, &value)?;
7184            }
7185        }
7186        state.end()
7187    }
7188}
7189
7190impl std::fmt::Debug for DeleteConnectorRequest {
7191    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7192        let mut debug_struct = f.debug_struct("DeleteConnectorRequest");
7193        debug_struct.field("name", &self.name);
7194        if !self._unknown_fields.is_empty() {
7195            debug_struct.field("_unknown_fields", &self._unknown_fields);
7196        }
7197        debug_struct.finish()
7198    }
7199}
7200
7201/// Request for ListConnectors.
7202#[derive(Clone, Default, PartialEq)]
7203#[non_exhaustive]
7204pub struct ListConnectorsRequest {
7205    /// Required. The parent Connect cluster whose connectors are to be listed.
7206    /// Structured like
7207    /// `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.
7208    pub parent: std::string::String,
7209
7210    /// Optional. The maximum number of connectors to return. The service may
7211    /// return fewer than this value. If unspecified, server will pick an
7212    /// appropriate default.
7213    pub page_size: i32,
7214
7215    /// Optional. A page token, received from a previous `ListConnectors` call.
7216    /// Provide this to retrieve the subsequent page.
7217    ///
7218    /// When paginating, all other parameters provided to `ListConnectors`
7219    /// must match the call that provided the page token.
7220    pub page_token: std::string::String,
7221
7222    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7223}
7224
7225impl ListConnectorsRequest {
7226    pub fn new() -> Self {
7227        std::default::Default::default()
7228    }
7229
7230    /// Sets the value of [parent][crate::model::ListConnectorsRequest::parent].
7231    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7232        self.parent = v.into();
7233        self
7234    }
7235
7236    /// Sets the value of [page_size][crate::model::ListConnectorsRequest::page_size].
7237    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7238        self.page_size = v.into();
7239        self
7240    }
7241
7242    /// Sets the value of [page_token][crate::model::ListConnectorsRequest::page_token].
7243    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7244        self.page_token = v.into();
7245        self
7246    }
7247}
7248
7249impl wkt::message::Message for ListConnectorsRequest {
7250    fn typename() -> &'static str {
7251        "type.googleapis.com/google.cloud.managedkafka.v1.ListConnectorsRequest"
7252    }
7253}
7254
7255#[doc(hidden)]
7256impl<'de> serde::de::Deserialize<'de> for ListConnectorsRequest {
7257    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7258    where
7259        D: serde::Deserializer<'de>,
7260    {
7261        #[allow(non_camel_case_types)]
7262        #[doc(hidden)]
7263        #[derive(PartialEq, Eq, Hash)]
7264        enum __FieldTag {
7265            __parent,
7266            __page_size,
7267            __page_token,
7268            Unknown(std::string::String),
7269        }
7270        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7271            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7272            where
7273                D: serde::Deserializer<'de>,
7274            {
7275                struct Visitor;
7276                impl<'de> serde::de::Visitor<'de> for Visitor {
7277                    type Value = __FieldTag;
7278                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7279                        formatter.write_str("a field name for ListConnectorsRequest")
7280                    }
7281                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7282                    where
7283                        E: serde::de::Error,
7284                    {
7285                        use std::result::Result::Ok;
7286                        use std::string::ToString;
7287                        match value {
7288                            "parent" => Ok(__FieldTag::__parent),
7289                            "pageSize" => Ok(__FieldTag::__page_size),
7290                            "page_size" => Ok(__FieldTag::__page_size),
7291                            "pageToken" => Ok(__FieldTag::__page_token),
7292                            "page_token" => Ok(__FieldTag::__page_token),
7293                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7294                        }
7295                    }
7296                }
7297                deserializer.deserialize_identifier(Visitor)
7298            }
7299        }
7300        struct Visitor;
7301        impl<'de> serde::de::Visitor<'de> for Visitor {
7302            type Value = ListConnectorsRequest;
7303            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7304                formatter.write_str("struct ListConnectorsRequest")
7305            }
7306            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7307            where
7308                A: serde::de::MapAccess<'de>,
7309            {
7310                #[allow(unused_imports)]
7311                use serde::de::Error;
7312                use std::option::Option::Some;
7313                let mut fields = std::collections::HashSet::new();
7314                let mut result = Self::Value::new();
7315                while let Some(tag) = map.next_key::<__FieldTag>()? {
7316                    #[allow(clippy::match_single_binding)]
7317                    match tag {
7318                        __FieldTag::__parent => {
7319                            if !fields.insert(__FieldTag::__parent) {
7320                                return std::result::Result::Err(A::Error::duplicate_field(
7321                                    "multiple values for parent",
7322                                ));
7323                            }
7324                            result.parent = map
7325                                .next_value::<std::option::Option<std::string::String>>()?
7326                                .unwrap_or_default();
7327                        }
7328                        __FieldTag::__page_size => {
7329                            if !fields.insert(__FieldTag::__page_size) {
7330                                return std::result::Result::Err(A::Error::duplicate_field(
7331                                    "multiple values for page_size",
7332                                ));
7333                            }
7334                            struct __With(std::option::Option<i32>);
7335                            impl<'de> serde::de::Deserialize<'de> for __With {
7336                                fn deserialize<D>(
7337                                    deserializer: D,
7338                                ) -> std::result::Result<Self, D::Error>
7339                                where
7340                                    D: serde::de::Deserializer<'de>,
7341                                {
7342                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
7343                                }
7344                            }
7345                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
7346                        }
7347                        __FieldTag::__page_token => {
7348                            if !fields.insert(__FieldTag::__page_token) {
7349                                return std::result::Result::Err(A::Error::duplicate_field(
7350                                    "multiple values for page_token",
7351                                ));
7352                            }
7353                            result.page_token = map
7354                                .next_value::<std::option::Option<std::string::String>>()?
7355                                .unwrap_or_default();
7356                        }
7357                        __FieldTag::Unknown(key) => {
7358                            let value = map.next_value::<serde_json::Value>()?;
7359                            result._unknown_fields.insert(key, value);
7360                        }
7361                    }
7362                }
7363                std::result::Result::Ok(result)
7364            }
7365        }
7366        deserializer.deserialize_any(Visitor)
7367    }
7368}
7369
7370#[doc(hidden)]
7371impl serde::ser::Serialize for ListConnectorsRequest {
7372    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7373    where
7374        S: serde::ser::Serializer,
7375    {
7376        use serde::ser::SerializeMap;
7377        #[allow(unused_imports)]
7378        use std::option::Option::Some;
7379        let mut state = serializer.serialize_map(std::option::Option::None)?;
7380        if !self.parent.is_empty() {
7381            state.serialize_entry("parent", &self.parent)?;
7382        }
7383        if !wkt::internal::is_default(&self.page_size) {
7384            struct __With<'a>(&'a i32);
7385            impl<'a> serde::ser::Serialize for __With<'a> {
7386                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7387                where
7388                    S: serde::ser::Serializer,
7389                {
7390                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
7391                }
7392            }
7393            state.serialize_entry("pageSize", &__With(&self.page_size))?;
7394        }
7395        if !self.page_token.is_empty() {
7396            state.serialize_entry("pageToken", &self.page_token)?;
7397        }
7398        if !self._unknown_fields.is_empty() {
7399            for (key, value) in self._unknown_fields.iter() {
7400                state.serialize_entry(key, &value)?;
7401            }
7402        }
7403        state.end()
7404    }
7405}
7406
7407impl std::fmt::Debug for ListConnectorsRequest {
7408    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7409        let mut debug_struct = f.debug_struct("ListConnectorsRequest");
7410        debug_struct.field("parent", &self.parent);
7411        debug_struct.field("page_size", &self.page_size);
7412        debug_struct.field("page_token", &self.page_token);
7413        if !self._unknown_fields.is_empty() {
7414            debug_struct.field("_unknown_fields", &self._unknown_fields);
7415        }
7416        debug_struct.finish()
7417    }
7418}
7419
7420/// Response for ListConnectors.
7421#[derive(Clone, Default, PartialEq)]
7422#[non_exhaustive]
7423pub struct ListConnectorsResponse {
7424    /// The list of connectors in the requested parent.
7425    pub connectors: std::vec::Vec<crate::model::Connector>,
7426
7427    /// A token that can be sent as `page_token` to retrieve the next page of
7428    /// results. If this field is omitted, there are no more results.
7429    pub next_page_token: std::string::String,
7430
7431    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7432}
7433
7434impl ListConnectorsResponse {
7435    pub fn new() -> Self {
7436        std::default::Default::default()
7437    }
7438
7439    /// Sets the value of [connectors][crate::model::ListConnectorsResponse::connectors].
7440    pub fn set_connectors<T, V>(mut self, v: T) -> Self
7441    where
7442        T: std::iter::IntoIterator<Item = V>,
7443        V: std::convert::Into<crate::model::Connector>,
7444    {
7445        use std::iter::Iterator;
7446        self.connectors = v.into_iter().map(|i| i.into()).collect();
7447        self
7448    }
7449
7450    /// Sets the value of [next_page_token][crate::model::ListConnectorsResponse::next_page_token].
7451    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7452        self.next_page_token = v.into();
7453        self
7454    }
7455}
7456
7457impl wkt::message::Message for ListConnectorsResponse {
7458    fn typename() -> &'static str {
7459        "type.googleapis.com/google.cloud.managedkafka.v1.ListConnectorsResponse"
7460    }
7461}
7462
7463#[doc(hidden)]
7464impl gax::paginator::internal::PageableResponse for ListConnectorsResponse {
7465    type PageItem = crate::model::Connector;
7466
7467    fn items(self) -> std::vec::Vec<Self::PageItem> {
7468        self.connectors
7469    }
7470
7471    fn next_page_token(&self) -> std::string::String {
7472        use std::clone::Clone;
7473        self.next_page_token.clone()
7474    }
7475}
7476
7477#[doc(hidden)]
7478impl<'de> serde::de::Deserialize<'de> for ListConnectorsResponse {
7479    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7480    where
7481        D: serde::Deserializer<'de>,
7482    {
7483        #[allow(non_camel_case_types)]
7484        #[doc(hidden)]
7485        #[derive(PartialEq, Eq, Hash)]
7486        enum __FieldTag {
7487            __connectors,
7488            __next_page_token,
7489            Unknown(std::string::String),
7490        }
7491        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7492            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7493            where
7494                D: serde::Deserializer<'de>,
7495            {
7496                struct Visitor;
7497                impl<'de> serde::de::Visitor<'de> for Visitor {
7498                    type Value = __FieldTag;
7499                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7500                        formatter.write_str("a field name for ListConnectorsResponse")
7501                    }
7502                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7503                    where
7504                        E: serde::de::Error,
7505                    {
7506                        use std::result::Result::Ok;
7507                        use std::string::ToString;
7508                        match value {
7509                            "connectors" => Ok(__FieldTag::__connectors),
7510                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
7511                            "next_page_token" => Ok(__FieldTag::__next_page_token),
7512                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7513                        }
7514                    }
7515                }
7516                deserializer.deserialize_identifier(Visitor)
7517            }
7518        }
7519        struct Visitor;
7520        impl<'de> serde::de::Visitor<'de> for Visitor {
7521            type Value = ListConnectorsResponse;
7522            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7523                formatter.write_str("struct ListConnectorsResponse")
7524            }
7525            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7526            where
7527                A: serde::de::MapAccess<'de>,
7528            {
7529                #[allow(unused_imports)]
7530                use serde::de::Error;
7531                use std::option::Option::Some;
7532                let mut fields = std::collections::HashSet::new();
7533                let mut result = Self::Value::new();
7534                while let Some(tag) = map.next_key::<__FieldTag>()? {
7535                    #[allow(clippy::match_single_binding)]
7536                    match tag {
7537                        __FieldTag::__connectors => {
7538                            if !fields.insert(__FieldTag::__connectors) {
7539                                return std::result::Result::Err(A::Error::duplicate_field(
7540                                    "multiple values for connectors",
7541                                ));
7542                            }
7543                            result.connectors = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Connector>>>()?.unwrap_or_default();
7544                        }
7545                        __FieldTag::__next_page_token => {
7546                            if !fields.insert(__FieldTag::__next_page_token) {
7547                                return std::result::Result::Err(A::Error::duplicate_field(
7548                                    "multiple values for next_page_token",
7549                                ));
7550                            }
7551                            result.next_page_token = map
7552                                .next_value::<std::option::Option<std::string::String>>()?
7553                                .unwrap_or_default();
7554                        }
7555                        __FieldTag::Unknown(key) => {
7556                            let value = map.next_value::<serde_json::Value>()?;
7557                            result._unknown_fields.insert(key, value);
7558                        }
7559                    }
7560                }
7561                std::result::Result::Ok(result)
7562            }
7563        }
7564        deserializer.deserialize_any(Visitor)
7565    }
7566}
7567
7568#[doc(hidden)]
7569impl serde::ser::Serialize for ListConnectorsResponse {
7570    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7571    where
7572        S: serde::ser::Serializer,
7573    {
7574        use serde::ser::SerializeMap;
7575        #[allow(unused_imports)]
7576        use std::option::Option::Some;
7577        let mut state = serializer.serialize_map(std::option::Option::None)?;
7578        if !self.connectors.is_empty() {
7579            state.serialize_entry("connectors", &self.connectors)?;
7580        }
7581        if !self.next_page_token.is_empty() {
7582            state.serialize_entry("nextPageToken", &self.next_page_token)?;
7583        }
7584        if !self._unknown_fields.is_empty() {
7585            for (key, value) in self._unknown_fields.iter() {
7586                state.serialize_entry(key, &value)?;
7587            }
7588        }
7589        state.end()
7590    }
7591}
7592
7593impl std::fmt::Debug for ListConnectorsResponse {
7594    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7595        let mut debug_struct = f.debug_struct("ListConnectorsResponse");
7596        debug_struct.field("connectors", &self.connectors);
7597        debug_struct.field("next_page_token", &self.next_page_token);
7598        if !self._unknown_fields.is_empty() {
7599            debug_struct.field("_unknown_fields", &self._unknown_fields);
7600        }
7601        debug_struct.finish()
7602    }
7603}
7604
7605/// Request for PauseConnector.
7606#[derive(Clone, Default, PartialEq)]
7607#[non_exhaustive]
7608pub struct PauseConnectorRequest {
7609    /// Required. The name of the connector to pause.
7610    /// Structured like:
7611    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
7612    pub name: std::string::String,
7613
7614    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7615}
7616
7617impl PauseConnectorRequest {
7618    pub fn new() -> Self {
7619        std::default::Default::default()
7620    }
7621
7622    /// Sets the value of [name][crate::model::PauseConnectorRequest::name].
7623    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7624        self.name = v.into();
7625        self
7626    }
7627}
7628
7629impl wkt::message::Message for PauseConnectorRequest {
7630    fn typename() -> &'static str {
7631        "type.googleapis.com/google.cloud.managedkafka.v1.PauseConnectorRequest"
7632    }
7633}
7634
7635#[doc(hidden)]
7636impl<'de> serde::de::Deserialize<'de> for PauseConnectorRequest {
7637    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7638    where
7639        D: serde::Deserializer<'de>,
7640    {
7641        #[allow(non_camel_case_types)]
7642        #[doc(hidden)]
7643        #[derive(PartialEq, Eq, Hash)]
7644        enum __FieldTag {
7645            __name,
7646            Unknown(std::string::String),
7647        }
7648        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7649            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7650            where
7651                D: serde::Deserializer<'de>,
7652            {
7653                struct Visitor;
7654                impl<'de> serde::de::Visitor<'de> for Visitor {
7655                    type Value = __FieldTag;
7656                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7657                        formatter.write_str("a field name for PauseConnectorRequest")
7658                    }
7659                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7660                    where
7661                        E: serde::de::Error,
7662                    {
7663                        use std::result::Result::Ok;
7664                        use std::string::ToString;
7665                        match value {
7666                            "name" => Ok(__FieldTag::__name),
7667                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7668                        }
7669                    }
7670                }
7671                deserializer.deserialize_identifier(Visitor)
7672            }
7673        }
7674        struct Visitor;
7675        impl<'de> serde::de::Visitor<'de> for Visitor {
7676            type Value = PauseConnectorRequest;
7677            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7678                formatter.write_str("struct PauseConnectorRequest")
7679            }
7680            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7681            where
7682                A: serde::de::MapAccess<'de>,
7683            {
7684                #[allow(unused_imports)]
7685                use serde::de::Error;
7686                use std::option::Option::Some;
7687                let mut fields = std::collections::HashSet::new();
7688                let mut result = Self::Value::new();
7689                while let Some(tag) = map.next_key::<__FieldTag>()? {
7690                    #[allow(clippy::match_single_binding)]
7691                    match tag {
7692                        __FieldTag::__name => {
7693                            if !fields.insert(__FieldTag::__name) {
7694                                return std::result::Result::Err(A::Error::duplicate_field(
7695                                    "multiple values for name",
7696                                ));
7697                            }
7698                            result.name = map
7699                                .next_value::<std::option::Option<std::string::String>>()?
7700                                .unwrap_or_default();
7701                        }
7702                        __FieldTag::Unknown(key) => {
7703                            let value = map.next_value::<serde_json::Value>()?;
7704                            result._unknown_fields.insert(key, value);
7705                        }
7706                    }
7707                }
7708                std::result::Result::Ok(result)
7709            }
7710        }
7711        deserializer.deserialize_any(Visitor)
7712    }
7713}
7714
7715#[doc(hidden)]
7716impl serde::ser::Serialize for PauseConnectorRequest {
7717    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7718    where
7719        S: serde::ser::Serializer,
7720    {
7721        use serde::ser::SerializeMap;
7722        #[allow(unused_imports)]
7723        use std::option::Option::Some;
7724        let mut state = serializer.serialize_map(std::option::Option::None)?;
7725        if !self.name.is_empty() {
7726            state.serialize_entry("name", &self.name)?;
7727        }
7728        if !self._unknown_fields.is_empty() {
7729            for (key, value) in self._unknown_fields.iter() {
7730                state.serialize_entry(key, &value)?;
7731            }
7732        }
7733        state.end()
7734    }
7735}
7736
7737impl std::fmt::Debug for PauseConnectorRequest {
7738    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7739        let mut debug_struct = f.debug_struct("PauseConnectorRequest");
7740        debug_struct.field("name", &self.name);
7741        if !self._unknown_fields.is_empty() {
7742            debug_struct.field("_unknown_fields", &self._unknown_fields);
7743        }
7744        debug_struct.finish()
7745    }
7746}
7747
7748/// Response for PauseConnector.
7749#[derive(Clone, Default, PartialEq)]
7750#[non_exhaustive]
7751pub struct PauseConnectorResponse {
7752    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7753}
7754
7755impl PauseConnectorResponse {
7756    pub fn new() -> Self {
7757        std::default::Default::default()
7758    }
7759}
7760
7761impl wkt::message::Message for PauseConnectorResponse {
7762    fn typename() -> &'static str {
7763        "type.googleapis.com/google.cloud.managedkafka.v1.PauseConnectorResponse"
7764    }
7765}
7766
7767#[doc(hidden)]
7768impl<'de> serde::de::Deserialize<'de> for PauseConnectorResponse {
7769    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7770    where
7771        D: serde::Deserializer<'de>,
7772    {
7773        #[allow(non_camel_case_types)]
7774        #[doc(hidden)]
7775        #[derive(PartialEq, Eq, Hash)]
7776        enum __FieldTag {
7777            Unknown(std::string::String),
7778        }
7779        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7780            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7781            where
7782                D: serde::Deserializer<'de>,
7783            {
7784                struct Visitor;
7785                impl<'de> serde::de::Visitor<'de> for Visitor {
7786                    type Value = __FieldTag;
7787                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7788                        formatter.write_str("a field name for PauseConnectorResponse")
7789                    }
7790                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7791                    where
7792                        E: serde::de::Error,
7793                    {
7794                        use std::result::Result::Ok;
7795                        use std::string::ToString;
7796                        Ok(__FieldTag::Unknown(value.to_string()))
7797                    }
7798                }
7799                deserializer.deserialize_identifier(Visitor)
7800            }
7801        }
7802        struct Visitor;
7803        impl<'de> serde::de::Visitor<'de> for Visitor {
7804            type Value = PauseConnectorResponse;
7805            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7806                formatter.write_str("struct PauseConnectorResponse")
7807            }
7808            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7809            where
7810                A: serde::de::MapAccess<'de>,
7811            {
7812                #[allow(unused_imports)]
7813                use serde::de::Error;
7814                use std::option::Option::Some;
7815                let mut result = Self::Value::new();
7816                while let Some(tag) = map.next_key::<__FieldTag>()? {
7817                    #[allow(clippy::match_single_binding)]
7818                    match tag {
7819                        __FieldTag::Unknown(key) => {
7820                            let value = map.next_value::<serde_json::Value>()?;
7821                            result._unknown_fields.insert(key, value);
7822                        }
7823                    }
7824                }
7825                std::result::Result::Ok(result)
7826            }
7827        }
7828        deserializer.deserialize_any(Visitor)
7829    }
7830}
7831
7832#[doc(hidden)]
7833impl serde::ser::Serialize for PauseConnectorResponse {
7834    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7835    where
7836        S: serde::ser::Serializer,
7837    {
7838        use serde::ser::SerializeMap;
7839        #[allow(unused_imports)]
7840        use std::option::Option::Some;
7841        let mut state = serializer.serialize_map(std::option::Option::None)?;
7842        if !self._unknown_fields.is_empty() {
7843            for (key, value) in self._unknown_fields.iter() {
7844                state.serialize_entry(key, &value)?;
7845            }
7846        }
7847        state.end()
7848    }
7849}
7850
7851impl std::fmt::Debug for PauseConnectorResponse {
7852    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7853        let mut debug_struct = f.debug_struct("PauseConnectorResponse");
7854        if !self._unknown_fields.is_empty() {
7855            debug_struct.field("_unknown_fields", &self._unknown_fields);
7856        }
7857        debug_struct.finish()
7858    }
7859}
7860
7861/// Request for ResumeConnector.
7862#[derive(Clone, Default, PartialEq)]
7863#[non_exhaustive]
7864pub struct ResumeConnectorRequest {
7865    /// Required. The name of the connector to pause.
7866    /// Structured like:
7867    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
7868    pub name: std::string::String,
7869
7870    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7871}
7872
7873impl ResumeConnectorRequest {
7874    pub fn new() -> Self {
7875        std::default::Default::default()
7876    }
7877
7878    /// Sets the value of [name][crate::model::ResumeConnectorRequest::name].
7879    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7880        self.name = v.into();
7881        self
7882    }
7883}
7884
7885impl wkt::message::Message for ResumeConnectorRequest {
7886    fn typename() -> &'static str {
7887        "type.googleapis.com/google.cloud.managedkafka.v1.ResumeConnectorRequest"
7888    }
7889}
7890
7891#[doc(hidden)]
7892impl<'de> serde::de::Deserialize<'de> for ResumeConnectorRequest {
7893    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7894    where
7895        D: serde::Deserializer<'de>,
7896    {
7897        #[allow(non_camel_case_types)]
7898        #[doc(hidden)]
7899        #[derive(PartialEq, Eq, Hash)]
7900        enum __FieldTag {
7901            __name,
7902            Unknown(std::string::String),
7903        }
7904        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7905            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7906            where
7907                D: serde::Deserializer<'de>,
7908            {
7909                struct Visitor;
7910                impl<'de> serde::de::Visitor<'de> for Visitor {
7911                    type Value = __FieldTag;
7912                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7913                        formatter.write_str("a field name for ResumeConnectorRequest")
7914                    }
7915                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7916                    where
7917                        E: serde::de::Error,
7918                    {
7919                        use std::result::Result::Ok;
7920                        use std::string::ToString;
7921                        match value {
7922                            "name" => Ok(__FieldTag::__name),
7923                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7924                        }
7925                    }
7926                }
7927                deserializer.deserialize_identifier(Visitor)
7928            }
7929        }
7930        struct Visitor;
7931        impl<'de> serde::de::Visitor<'de> for Visitor {
7932            type Value = ResumeConnectorRequest;
7933            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7934                formatter.write_str("struct ResumeConnectorRequest")
7935            }
7936            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7937            where
7938                A: serde::de::MapAccess<'de>,
7939            {
7940                #[allow(unused_imports)]
7941                use serde::de::Error;
7942                use std::option::Option::Some;
7943                let mut fields = std::collections::HashSet::new();
7944                let mut result = Self::Value::new();
7945                while let Some(tag) = map.next_key::<__FieldTag>()? {
7946                    #[allow(clippy::match_single_binding)]
7947                    match tag {
7948                        __FieldTag::__name => {
7949                            if !fields.insert(__FieldTag::__name) {
7950                                return std::result::Result::Err(A::Error::duplicate_field(
7951                                    "multiple values for name",
7952                                ));
7953                            }
7954                            result.name = map
7955                                .next_value::<std::option::Option<std::string::String>>()?
7956                                .unwrap_or_default();
7957                        }
7958                        __FieldTag::Unknown(key) => {
7959                            let value = map.next_value::<serde_json::Value>()?;
7960                            result._unknown_fields.insert(key, value);
7961                        }
7962                    }
7963                }
7964                std::result::Result::Ok(result)
7965            }
7966        }
7967        deserializer.deserialize_any(Visitor)
7968    }
7969}
7970
7971#[doc(hidden)]
7972impl serde::ser::Serialize for ResumeConnectorRequest {
7973    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7974    where
7975        S: serde::ser::Serializer,
7976    {
7977        use serde::ser::SerializeMap;
7978        #[allow(unused_imports)]
7979        use std::option::Option::Some;
7980        let mut state = serializer.serialize_map(std::option::Option::None)?;
7981        if !self.name.is_empty() {
7982            state.serialize_entry("name", &self.name)?;
7983        }
7984        if !self._unknown_fields.is_empty() {
7985            for (key, value) in self._unknown_fields.iter() {
7986                state.serialize_entry(key, &value)?;
7987            }
7988        }
7989        state.end()
7990    }
7991}
7992
7993impl std::fmt::Debug for ResumeConnectorRequest {
7994    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7995        let mut debug_struct = f.debug_struct("ResumeConnectorRequest");
7996        debug_struct.field("name", &self.name);
7997        if !self._unknown_fields.is_empty() {
7998            debug_struct.field("_unknown_fields", &self._unknown_fields);
7999        }
8000        debug_struct.finish()
8001    }
8002}
8003
8004/// Response for ResumeConnector.
8005#[derive(Clone, Default, PartialEq)]
8006#[non_exhaustive]
8007pub struct ResumeConnectorResponse {
8008    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8009}
8010
8011impl ResumeConnectorResponse {
8012    pub fn new() -> Self {
8013        std::default::Default::default()
8014    }
8015}
8016
8017impl wkt::message::Message for ResumeConnectorResponse {
8018    fn typename() -> &'static str {
8019        "type.googleapis.com/google.cloud.managedkafka.v1.ResumeConnectorResponse"
8020    }
8021}
8022
8023#[doc(hidden)]
8024impl<'de> serde::de::Deserialize<'de> for ResumeConnectorResponse {
8025    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8026    where
8027        D: serde::Deserializer<'de>,
8028    {
8029        #[allow(non_camel_case_types)]
8030        #[doc(hidden)]
8031        #[derive(PartialEq, Eq, Hash)]
8032        enum __FieldTag {
8033            Unknown(std::string::String),
8034        }
8035        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8036            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8037            where
8038                D: serde::Deserializer<'de>,
8039            {
8040                struct Visitor;
8041                impl<'de> serde::de::Visitor<'de> for Visitor {
8042                    type Value = __FieldTag;
8043                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8044                        formatter.write_str("a field name for ResumeConnectorResponse")
8045                    }
8046                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8047                    where
8048                        E: serde::de::Error,
8049                    {
8050                        use std::result::Result::Ok;
8051                        use std::string::ToString;
8052                        Ok(__FieldTag::Unknown(value.to_string()))
8053                    }
8054                }
8055                deserializer.deserialize_identifier(Visitor)
8056            }
8057        }
8058        struct Visitor;
8059        impl<'de> serde::de::Visitor<'de> for Visitor {
8060            type Value = ResumeConnectorResponse;
8061            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8062                formatter.write_str("struct ResumeConnectorResponse")
8063            }
8064            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8065            where
8066                A: serde::de::MapAccess<'de>,
8067            {
8068                #[allow(unused_imports)]
8069                use serde::de::Error;
8070                use std::option::Option::Some;
8071                let mut result = Self::Value::new();
8072                while let Some(tag) = map.next_key::<__FieldTag>()? {
8073                    #[allow(clippy::match_single_binding)]
8074                    match tag {
8075                        __FieldTag::Unknown(key) => {
8076                            let value = map.next_value::<serde_json::Value>()?;
8077                            result._unknown_fields.insert(key, value);
8078                        }
8079                    }
8080                }
8081                std::result::Result::Ok(result)
8082            }
8083        }
8084        deserializer.deserialize_any(Visitor)
8085    }
8086}
8087
8088#[doc(hidden)]
8089impl serde::ser::Serialize for ResumeConnectorResponse {
8090    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8091    where
8092        S: serde::ser::Serializer,
8093    {
8094        use serde::ser::SerializeMap;
8095        #[allow(unused_imports)]
8096        use std::option::Option::Some;
8097        let mut state = serializer.serialize_map(std::option::Option::None)?;
8098        if !self._unknown_fields.is_empty() {
8099            for (key, value) in self._unknown_fields.iter() {
8100                state.serialize_entry(key, &value)?;
8101            }
8102        }
8103        state.end()
8104    }
8105}
8106
8107impl std::fmt::Debug for ResumeConnectorResponse {
8108    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8109        let mut debug_struct = f.debug_struct("ResumeConnectorResponse");
8110        if !self._unknown_fields.is_empty() {
8111            debug_struct.field("_unknown_fields", &self._unknown_fields);
8112        }
8113        debug_struct.finish()
8114    }
8115}
8116
8117/// Request for RestartConnector.
8118#[derive(Clone, Default, PartialEq)]
8119#[non_exhaustive]
8120pub struct RestartConnectorRequest {
8121    /// Required. The name of the connector to restart.
8122    /// Structured like:
8123    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
8124    pub name: std::string::String,
8125
8126    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8127}
8128
8129impl RestartConnectorRequest {
8130    pub fn new() -> Self {
8131        std::default::Default::default()
8132    }
8133
8134    /// Sets the value of [name][crate::model::RestartConnectorRequest::name].
8135    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8136        self.name = v.into();
8137        self
8138    }
8139}
8140
8141impl wkt::message::Message for RestartConnectorRequest {
8142    fn typename() -> &'static str {
8143        "type.googleapis.com/google.cloud.managedkafka.v1.RestartConnectorRequest"
8144    }
8145}
8146
8147#[doc(hidden)]
8148impl<'de> serde::de::Deserialize<'de> for RestartConnectorRequest {
8149    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8150    where
8151        D: serde::Deserializer<'de>,
8152    {
8153        #[allow(non_camel_case_types)]
8154        #[doc(hidden)]
8155        #[derive(PartialEq, Eq, Hash)]
8156        enum __FieldTag {
8157            __name,
8158            Unknown(std::string::String),
8159        }
8160        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8161            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8162            where
8163                D: serde::Deserializer<'de>,
8164            {
8165                struct Visitor;
8166                impl<'de> serde::de::Visitor<'de> for Visitor {
8167                    type Value = __FieldTag;
8168                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8169                        formatter.write_str("a field name for RestartConnectorRequest")
8170                    }
8171                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8172                    where
8173                        E: serde::de::Error,
8174                    {
8175                        use std::result::Result::Ok;
8176                        use std::string::ToString;
8177                        match value {
8178                            "name" => Ok(__FieldTag::__name),
8179                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8180                        }
8181                    }
8182                }
8183                deserializer.deserialize_identifier(Visitor)
8184            }
8185        }
8186        struct Visitor;
8187        impl<'de> serde::de::Visitor<'de> for Visitor {
8188            type Value = RestartConnectorRequest;
8189            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8190                formatter.write_str("struct RestartConnectorRequest")
8191            }
8192            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8193            where
8194                A: serde::de::MapAccess<'de>,
8195            {
8196                #[allow(unused_imports)]
8197                use serde::de::Error;
8198                use std::option::Option::Some;
8199                let mut fields = std::collections::HashSet::new();
8200                let mut result = Self::Value::new();
8201                while let Some(tag) = map.next_key::<__FieldTag>()? {
8202                    #[allow(clippy::match_single_binding)]
8203                    match tag {
8204                        __FieldTag::__name => {
8205                            if !fields.insert(__FieldTag::__name) {
8206                                return std::result::Result::Err(A::Error::duplicate_field(
8207                                    "multiple values for name",
8208                                ));
8209                            }
8210                            result.name = map
8211                                .next_value::<std::option::Option<std::string::String>>()?
8212                                .unwrap_or_default();
8213                        }
8214                        __FieldTag::Unknown(key) => {
8215                            let value = map.next_value::<serde_json::Value>()?;
8216                            result._unknown_fields.insert(key, value);
8217                        }
8218                    }
8219                }
8220                std::result::Result::Ok(result)
8221            }
8222        }
8223        deserializer.deserialize_any(Visitor)
8224    }
8225}
8226
8227#[doc(hidden)]
8228impl serde::ser::Serialize for RestartConnectorRequest {
8229    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8230    where
8231        S: serde::ser::Serializer,
8232    {
8233        use serde::ser::SerializeMap;
8234        #[allow(unused_imports)]
8235        use std::option::Option::Some;
8236        let mut state = serializer.serialize_map(std::option::Option::None)?;
8237        if !self.name.is_empty() {
8238            state.serialize_entry("name", &self.name)?;
8239        }
8240        if !self._unknown_fields.is_empty() {
8241            for (key, value) in self._unknown_fields.iter() {
8242                state.serialize_entry(key, &value)?;
8243            }
8244        }
8245        state.end()
8246    }
8247}
8248
8249impl std::fmt::Debug for RestartConnectorRequest {
8250    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8251        let mut debug_struct = f.debug_struct("RestartConnectorRequest");
8252        debug_struct.field("name", &self.name);
8253        if !self._unknown_fields.is_empty() {
8254            debug_struct.field("_unknown_fields", &self._unknown_fields);
8255        }
8256        debug_struct.finish()
8257    }
8258}
8259
8260/// Response for RestartConnector.
8261#[derive(Clone, Default, PartialEq)]
8262#[non_exhaustive]
8263pub struct RestartConnectorResponse {
8264    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8265}
8266
8267impl RestartConnectorResponse {
8268    pub fn new() -> Self {
8269        std::default::Default::default()
8270    }
8271}
8272
8273impl wkt::message::Message for RestartConnectorResponse {
8274    fn typename() -> &'static str {
8275        "type.googleapis.com/google.cloud.managedkafka.v1.RestartConnectorResponse"
8276    }
8277}
8278
8279#[doc(hidden)]
8280impl<'de> serde::de::Deserialize<'de> for RestartConnectorResponse {
8281    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8282    where
8283        D: serde::Deserializer<'de>,
8284    {
8285        #[allow(non_camel_case_types)]
8286        #[doc(hidden)]
8287        #[derive(PartialEq, Eq, Hash)]
8288        enum __FieldTag {
8289            Unknown(std::string::String),
8290        }
8291        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8292            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8293            where
8294                D: serde::Deserializer<'de>,
8295            {
8296                struct Visitor;
8297                impl<'de> serde::de::Visitor<'de> for Visitor {
8298                    type Value = __FieldTag;
8299                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8300                        formatter.write_str("a field name for RestartConnectorResponse")
8301                    }
8302                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8303                    where
8304                        E: serde::de::Error,
8305                    {
8306                        use std::result::Result::Ok;
8307                        use std::string::ToString;
8308                        Ok(__FieldTag::Unknown(value.to_string()))
8309                    }
8310                }
8311                deserializer.deserialize_identifier(Visitor)
8312            }
8313        }
8314        struct Visitor;
8315        impl<'de> serde::de::Visitor<'de> for Visitor {
8316            type Value = RestartConnectorResponse;
8317            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8318                formatter.write_str("struct RestartConnectorResponse")
8319            }
8320            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8321            where
8322                A: serde::de::MapAccess<'de>,
8323            {
8324                #[allow(unused_imports)]
8325                use serde::de::Error;
8326                use std::option::Option::Some;
8327                let mut result = Self::Value::new();
8328                while let Some(tag) = map.next_key::<__FieldTag>()? {
8329                    #[allow(clippy::match_single_binding)]
8330                    match tag {
8331                        __FieldTag::Unknown(key) => {
8332                            let value = map.next_value::<serde_json::Value>()?;
8333                            result._unknown_fields.insert(key, value);
8334                        }
8335                    }
8336                }
8337                std::result::Result::Ok(result)
8338            }
8339        }
8340        deserializer.deserialize_any(Visitor)
8341    }
8342}
8343
8344#[doc(hidden)]
8345impl serde::ser::Serialize for RestartConnectorResponse {
8346    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8347    where
8348        S: serde::ser::Serializer,
8349    {
8350        use serde::ser::SerializeMap;
8351        #[allow(unused_imports)]
8352        use std::option::Option::Some;
8353        let mut state = serializer.serialize_map(std::option::Option::None)?;
8354        if !self._unknown_fields.is_empty() {
8355            for (key, value) in self._unknown_fields.iter() {
8356                state.serialize_entry(key, &value)?;
8357            }
8358        }
8359        state.end()
8360    }
8361}
8362
8363impl std::fmt::Debug for RestartConnectorResponse {
8364    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8365        let mut debug_struct = f.debug_struct("RestartConnectorResponse");
8366        if !self._unknown_fields.is_empty() {
8367            debug_struct.field("_unknown_fields", &self._unknown_fields);
8368        }
8369        debug_struct.finish()
8370    }
8371}
8372
8373/// Request for StopConnector.
8374#[derive(Clone, Default, PartialEq)]
8375#[non_exhaustive]
8376pub struct StopConnectorRequest {
8377    /// Required. The name of the connector to stop.
8378    /// Structured like:
8379    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
8380    pub name: std::string::String,
8381
8382    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8383}
8384
8385impl StopConnectorRequest {
8386    pub fn new() -> Self {
8387        std::default::Default::default()
8388    }
8389
8390    /// Sets the value of [name][crate::model::StopConnectorRequest::name].
8391    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8392        self.name = v.into();
8393        self
8394    }
8395}
8396
8397impl wkt::message::Message for StopConnectorRequest {
8398    fn typename() -> &'static str {
8399        "type.googleapis.com/google.cloud.managedkafka.v1.StopConnectorRequest"
8400    }
8401}
8402
8403#[doc(hidden)]
8404impl<'de> serde::de::Deserialize<'de> for StopConnectorRequest {
8405    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8406    where
8407        D: serde::Deserializer<'de>,
8408    {
8409        #[allow(non_camel_case_types)]
8410        #[doc(hidden)]
8411        #[derive(PartialEq, Eq, Hash)]
8412        enum __FieldTag {
8413            __name,
8414            Unknown(std::string::String),
8415        }
8416        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8417            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8418            where
8419                D: serde::Deserializer<'de>,
8420            {
8421                struct Visitor;
8422                impl<'de> serde::de::Visitor<'de> for Visitor {
8423                    type Value = __FieldTag;
8424                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8425                        formatter.write_str("a field name for StopConnectorRequest")
8426                    }
8427                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8428                    where
8429                        E: serde::de::Error,
8430                    {
8431                        use std::result::Result::Ok;
8432                        use std::string::ToString;
8433                        match value {
8434                            "name" => Ok(__FieldTag::__name),
8435                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8436                        }
8437                    }
8438                }
8439                deserializer.deserialize_identifier(Visitor)
8440            }
8441        }
8442        struct Visitor;
8443        impl<'de> serde::de::Visitor<'de> for Visitor {
8444            type Value = StopConnectorRequest;
8445            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8446                formatter.write_str("struct StopConnectorRequest")
8447            }
8448            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8449            where
8450                A: serde::de::MapAccess<'de>,
8451            {
8452                #[allow(unused_imports)]
8453                use serde::de::Error;
8454                use std::option::Option::Some;
8455                let mut fields = std::collections::HashSet::new();
8456                let mut result = Self::Value::new();
8457                while let Some(tag) = map.next_key::<__FieldTag>()? {
8458                    #[allow(clippy::match_single_binding)]
8459                    match tag {
8460                        __FieldTag::__name => {
8461                            if !fields.insert(__FieldTag::__name) {
8462                                return std::result::Result::Err(A::Error::duplicate_field(
8463                                    "multiple values for name",
8464                                ));
8465                            }
8466                            result.name = map
8467                                .next_value::<std::option::Option<std::string::String>>()?
8468                                .unwrap_or_default();
8469                        }
8470                        __FieldTag::Unknown(key) => {
8471                            let value = map.next_value::<serde_json::Value>()?;
8472                            result._unknown_fields.insert(key, value);
8473                        }
8474                    }
8475                }
8476                std::result::Result::Ok(result)
8477            }
8478        }
8479        deserializer.deserialize_any(Visitor)
8480    }
8481}
8482
8483#[doc(hidden)]
8484impl serde::ser::Serialize for StopConnectorRequest {
8485    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8486    where
8487        S: serde::ser::Serializer,
8488    {
8489        use serde::ser::SerializeMap;
8490        #[allow(unused_imports)]
8491        use std::option::Option::Some;
8492        let mut state = serializer.serialize_map(std::option::Option::None)?;
8493        if !self.name.is_empty() {
8494            state.serialize_entry("name", &self.name)?;
8495        }
8496        if !self._unknown_fields.is_empty() {
8497            for (key, value) in self._unknown_fields.iter() {
8498                state.serialize_entry(key, &value)?;
8499            }
8500        }
8501        state.end()
8502    }
8503}
8504
8505impl std::fmt::Debug for StopConnectorRequest {
8506    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8507        let mut debug_struct = f.debug_struct("StopConnectorRequest");
8508        debug_struct.field("name", &self.name);
8509        if !self._unknown_fields.is_empty() {
8510            debug_struct.field("_unknown_fields", &self._unknown_fields);
8511        }
8512        debug_struct.finish()
8513    }
8514}
8515
8516/// Response for StopConnector.
8517#[derive(Clone, Default, PartialEq)]
8518#[non_exhaustive]
8519pub struct StopConnectorResponse {
8520    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8521}
8522
8523impl StopConnectorResponse {
8524    pub fn new() -> Self {
8525        std::default::Default::default()
8526    }
8527}
8528
8529impl wkt::message::Message for StopConnectorResponse {
8530    fn typename() -> &'static str {
8531        "type.googleapis.com/google.cloud.managedkafka.v1.StopConnectorResponse"
8532    }
8533}
8534
8535#[doc(hidden)]
8536impl<'de> serde::de::Deserialize<'de> for StopConnectorResponse {
8537    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8538    where
8539        D: serde::Deserializer<'de>,
8540    {
8541        #[allow(non_camel_case_types)]
8542        #[doc(hidden)]
8543        #[derive(PartialEq, Eq, Hash)]
8544        enum __FieldTag {
8545            Unknown(std::string::String),
8546        }
8547        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8548            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8549            where
8550                D: serde::Deserializer<'de>,
8551            {
8552                struct Visitor;
8553                impl<'de> serde::de::Visitor<'de> for Visitor {
8554                    type Value = __FieldTag;
8555                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8556                        formatter.write_str("a field name for StopConnectorResponse")
8557                    }
8558                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8559                    where
8560                        E: serde::de::Error,
8561                    {
8562                        use std::result::Result::Ok;
8563                        use std::string::ToString;
8564                        Ok(__FieldTag::Unknown(value.to_string()))
8565                    }
8566                }
8567                deserializer.deserialize_identifier(Visitor)
8568            }
8569        }
8570        struct Visitor;
8571        impl<'de> serde::de::Visitor<'de> for Visitor {
8572            type Value = StopConnectorResponse;
8573            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8574                formatter.write_str("struct StopConnectorResponse")
8575            }
8576            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8577            where
8578                A: serde::de::MapAccess<'de>,
8579            {
8580                #[allow(unused_imports)]
8581                use serde::de::Error;
8582                use std::option::Option::Some;
8583                let mut result = Self::Value::new();
8584                while let Some(tag) = map.next_key::<__FieldTag>()? {
8585                    #[allow(clippy::match_single_binding)]
8586                    match tag {
8587                        __FieldTag::Unknown(key) => {
8588                            let value = map.next_value::<serde_json::Value>()?;
8589                            result._unknown_fields.insert(key, value);
8590                        }
8591                    }
8592                }
8593                std::result::Result::Ok(result)
8594            }
8595        }
8596        deserializer.deserialize_any(Visitor)
8597    }
8598}
8599
8600#[doc(hidden)]
8601impl serde::ser::Serialize for StopConnectorResponse {
8602    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8603    where
8604        S: serde::ser::Serializer,
8605    {
8606        use serde::ser::SerializeMap;
8607        #[allow(unused_imports)]
8608        use std::option::Option::Some;
8609        let mut state = serializer.serialize_map(std::option::Option::None)?;
8610        if !self._unknown_fields.is_empty() {
8611            for (key, value) in self._unknown_fields.iter() {
8612                state.serialize_entry(key, &value)?;
8613            }
8614        }
8615        state.end()
8616    }
8617}
8618
8619impl std::fmt::Debug for StopConnectorResponse {
8620    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8621        let mut debug_struct = f.debug_struct("StopConnectorResponse");
8622        if !self._unknown_fields.is_empty() {
8623            debug_struct.field("_unknown_fields", &self._unknown_fields);
8624        }
8625        debug_struct.finish()
8626    }
8627}
8628
8629/// An Apache Kafka cluster deployed in a location.
8630#[derive(Clone, Default, PartialEq)]
8631#[non_exhaustive]
8632pub struct Cluster {
8633    /// Identifier. The name of the cluster. Structured like:
8634    /// projects/{project_number}/locations/{location}/clusters/{cluster_id}
8635    pub name: std::string::String,
8636
8637    /// Output only. The time when the cluster was created.
8638    pub create_time: std::option::Option<wkt::Timestamp>,
8639
8640    /// Output only. The time when the cluster was last updated.
8641    pub update_time: std::option::Option<wkt::Timestamp>,
8642
8643    /// Optional. Labels as key value pairs.
8644    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8645
8646    /// Required. Capacity configuration for the Kafka cluster.
8647    pub capacity_config: std::option::Option<crate::model::CapacityConfig>,
8648
8649    /// Optional. Rebalance configuration for the Kafka cluster.
8650    pub rebalance_config: std::option::Option<crate::model::RebalanceConfig>,
8651
8652    /// Output only. The current state of the cluster.
8653    pub state: crate::model::cluster::State,
8654
8655    /// Output only. Reserved for future use.
8656    pub satisfies_pzi: std::option::Option<bool>,
8657
8658    /// Output only. Reserved for future use.
8659    pub satisfies_pzs: std::option::Option<bool>,
8660
8661    /// Optional. TLS configuration for the Kafka cluster.
8662    pub tls_config: std::option::Option<crate::model::TlsConfig>,
8663
8664    /// Platform specific configuration properties for a Kafka cluster.
8665    pub platform_config: std::option::Option<crate::model::cluster::PlatformConfig>,
8666
8667    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8668}
8669
8670impl Cluster {
8671    pub fn new() -> Self {
8672        std::default::Default::default()
8673    }
8674
8675    /// Sets the value of [name][crate::model::Cluster::name].
8676    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8677        self.name = v.into();
8678        self
8679    }
8680
8681    /// Sets the value of [create_time][crate::model::Cluster::create_time].
8682    pub fn set_create_time<T>(mut self, v: T) -> Self
8683    where
8684        T: std::convert::Into<wkt::Timestamp>,
8685    {
8686        self.create_time = std::option::Option::Some(v.into());
8687        self
8688    }
8689
8690    /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
8691    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8692    where
8693        T: std::convert::Into<wkt::Timestamp>,
8694    {
8695        self.create_time = v.map(|x| x.into());
8696        self
8697    }
8698
8699    /// Sets the value of [update_time][crate::model::Cluster::update_time].
8700    pub fn set_update_time<T>(mut self, v: T) -> Self
8701    where
8702        T: std::convert::Into<wkt::Timestamp>,
8703    {
8704        self.update_time = std::option::Option::Some(v.into());
8705        self
8706    }
8707
8708    /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
8709    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8710    where
8711        T: std::convert::Into<wkt::Timestamp>,
8712    {
8713        self.update_time = v.map(|x| x.into());
8714        self
8715    }
8716
8717    /// Sets the value of [labels][crate::model::Cluster::labels].
8718    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8719    where
8720        T: std::iter::IntoIterator<Item = (K, V)>,
8721        K: std::convert::Into<std::string::String>,
8722        V: std::convert::Into<std::string::String>,
8723    {
8724        use std::iter::Iterator;
8725        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8726        self
8727    }
8728
8729    /// Sets the value of [capacity_config][crate::model::Cluster::capacity_config].
8730    pub fn set_capacity_config<T>(mut self, v: T) -> Self
8731    where
8732        T: std::convert::Into<crate::model::CapacityConfig>,
8733    {
8734        self.capacity_config = std::option::Option::Some(v.into());
8735        self
8736    }
8737
8738    /// Sets or clears the value of [capacity_config][crate::model::Cluster::capacity_config].
8739    pub fn set_or_clear_capacity_config<T>(mut self, v: std::option::Option<T>) -> Self
8740    where
8741        T: std::convert::Into<crate::model::CapacityConfig>,
8742    {
8743        self.capacity_config = v.map(|x| x.into());
8744        self
8745    }
8746
8747    /// Sets the value of [rebalance_config][crate::model::Cluster::rebalance_config].
8748    pub fn set_rebalance_config<T>(mut self, v: T) -> Self
8749    where
8750        T: std::convert::Into<crate::model::RebalanceConfig>,
8751    {
8752        self.rebalance_config = std::option::Option::Some(v.into());
8753        self
8754    }
8755
8756    /// Sets or clears the value of [rebalance_config][crate::model::Cluster::rebalance_config].
8757    pub fn set_or_clear_rebalance_config<T>(mut self, v: std::option::Option<T>) -> Self
8758    where
8759        T: std::convert::Into<crate::model::RebalanceConfig>,
8760    {
8761        self.rebalance_config = v.map(|x| x.into());
8762        self
8763    }
8764
8765    /// Sets the value of [state][crate::model::Cluster::state].
8766    pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
8767        self.state = v.into();
8768        self
8769    }
8770
8771    /// Sets the value of [satisfies_pzi][crate::model::Cluster::satisfies_pzi].
8772    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
8773    where
8774        T: std::convert::Into<bool>,
8775    {
8776        self.satisfies_pzi = std::option::Option::Some(v.into());
8777        self
8778    }
8779
8780    /// Sets or clears the value of [satisfies_pzi][crate::model::Cluster::satisfies_pzi].
8781    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
8782    where
8783        T: std::convert::Into<bool>,
8784    {
8785        self.satisfies_pzi = v.map(|x| x.into());
8786        self
8787    }
8788
8789    /// Sets the value of [satisfies_pzs][crate::model::Cluster::satisfies_pzs].
8790    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
8791    where
8792        T: std::convert::Into<bool>,
8793    {
8794        self.satisfies_pzs = std::option::Option::Some(v.into());
8795        self
8796    }
8797
8798    /// Sets or clears the value of [satisfies_pzs][crate::model::Cluster::satisfies_pzs].
8799    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
8800    where
8801        T: std::convert::Into<bool>,
8802    {
8803        self.satisfies_pzs = v.map(|x| x.into());
8804        self
8805    }
8806
8807    /// Sets the value of [tls_config][crate::model::Cluster::tls_config].
8808    pub fn set_tls_config<T>(mut self, v: T) -> Self
8809    where
8810        T: std::convert::Into<crate::model::TlsConfig>,
8811    {
8812        self.tls_config = std::option::Option::Some(v.into());
8813        self
8814    }
8815
8816    /// Sets or clears the value of [tls_config][crate::model::Cluster::tls_config].
8817    pub fn set_or_clear_tls_config<T>(mut self, v: std::option::Option<T>) -> Self
8818    where
8819        T: std::convert::Into<crate::model::TlsConfig>,
8820    {
8821        self.tls_config = v.map(|x| x.into());
8822        self
8823    }
8824
8825    /// Sets the value of [platform_config][crate::model::Cluster::platform_config].
8826    ///
8827    /// Note that all the setters affecting `platform_config` are mutually
8828    /// exclusive.
8829    pub fn set_platform_config<
8830        T: std::convert::Into<std::option::Option<crate::model::cluster::PlatformConfig>>,
8831    >(
8832        mut self,
8833        v: T,
8834    ) -> Self {
8835        self.platform_config = v.into();
8836        self
8837    }
8838
8839    /// The value of [platform_config][crate::model::Cluster::platform_config]
8840    /// if it holds a `GcpConfig`, `None` if the field is not set or
8841    /// holds a different branch.
8842    pub fn gcp_config(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcpConfig>> {
8843        #[allow(unreachable_patterns)]
8844        self.platform_config.as_ref().and_then(|v| match v {
8845            crate::model::cluster::PlatformConfig::GcpConfig(v) => std::option::Option::Some(v),
8846            _ => std::option::Option::None,
8847        })
8848    }
8849
8850    /// Sets the value of [platform_config][crate::model::Cluster::platform_config]
8851    /// to hold a `GcpConfig`.
8852    ///
8853    /// Note that all the setters affecting `platform_config` are
8854    /// mutually exclusive.
8855    pub fn set_gcp_config<T: std::convert::Into<std::boxed::Box<crate::model::GcpConfig>>>(
8856        mut self,
8857        v: T,
8858    ) -> Self {
8859        self.platform_config =
8860            std::option::Option::Some(crate::model::cluster::PlatformConfig::GcpConfig(v.into()));
8861        self
8862    }
8863}
8864
8865impl wkt::message::Message for Cluster {
8866    fn typename() -> &'static str {
8867        "type.googleapis.com/google.cloud.managedkafka.v1.Cluster"
8868    }
8869}
8870
8871#[doc(hidden)]
8872impl<'de> serde::de::Deserialize<'de> for Cluster {
8873    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8874    where
8875        D: serde::Deserializer<'de>,
8876    {
8877        #[allow(non_camel_case_types)]
8878        #[doc(hidden)]
8879        #[derive(PartialEq, Eq, Hash)]
8880        enum __FieldTag {
8881            __gcp_config,
8882            __name,
8883            __create_time,
8884            __update_time,
8885            __labels,
8886            __capacity_config,
8887            __rebalance_config,
8888            __state,
8889            __satisfies_pzi,
8890            __satisfies_pzs,
8891            __tls_config,
8892            Unknown(std::string::String),
8893        }
8894        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8895            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8896            where
8897                D: serde::Deserializer<'de>,
8898            {
8899                struct Visitor;
8900                impl<'de> serde::de::Visitor<'de> for Visitor {
8901                    type Value = __FieldTag;
8902                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8903                        formatter.write_str("a field name for Cluster")
8904                    }
8905                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8906                    where
8907                        E: serde::de::Error,
8908                    {
8909                        use std::result::Result::Ok;
8910                        use std::string::ToString;
8911                        match value {
8912                            "gcpConfig" => Ok(__FieldTag::__gcp_config),
8913                            "gcp_config" => Ok(__FieldTag::__gcp_config),
8914                            "name" => Ok(__FieldTag::__name),
8915                            "createTime" => Ok(__FieldTag::__create_time),
8916                            "create_time" => Ok(__FieldTag::__create_time),
8917                            "updateTime" => Ok(__FieldTag::__update_time),
8918                            "update_time" => Ok(__FieldTag::__update_time),
8919                            "labels" => Ok(__FieldTag::__labels),
8920                            "capacityConfig" => Ok(__FieldTag::__capacity_config),
8921                            "capacity_config" => Ok(__FieldTag::__capacity_config),
8922                            "rebalanceConfig" => Ok(__FieldTag::__rebalance_config),
8923                            "rebalance_config" => Ok(__FieldTag::__rebalance_config),
8924                            "state" => Ok(__FieldTag::__state),
8925                            "satisfiesPzi" => Ok(__FieldTag::__satisfies_pzi),
8926                            "satisfies_pzi" => Ok(__FieldTag::__satisfies_pzi),
8927                            "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
8928                            "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
8929                            "tlsConfig" => Ok(__FieldTag::__tls_config),
8930                            "tls_config" => Ok(__FieldTag::__tls_config),
8931                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8932                        }
8933                    }
8934                }
8935                deserializer.deserialize_identifier(Visitor)
8936            }
8937        }
8938        struct Visitor;
8939        impl<'de> serde::de::Visitor<'de> for Visitor {
8940            type Value = Cluster;
8941            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8942                formatter.write_str("struct Cluster")
8943            }
8944            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8945            where
8946                A: serde::de::MapAccess<'de>,
8947            {
8948                #[allow(unused_imports)]
8949                use serde::de::Error;
8950                use std::option::Option::Some;
8951                let mut fields = std::collections::HashSet::new();
8952                let mut result = Self::Value::new();
8953                while let Some(tag) = map.next_key::<__FieldTag>()? {
8954                    #[allow(clippy::match_single_binding)]
8955                    match tag {
8956                        __FieldTag::__gcp_config => {
8957                            if !fields.insert(__FieldTag::__gcp_config) {
8958                                return std::result::Result::Err(A::Error::duplicate_field(
8959                                    "multiple values for gcp_config",
8960                                ));
8961                            }
8962                            if result.platform_config.is_some() {
8963                                return std::result::Result::Err(A::Error::duplicate_field(
8964                                    "multiple values for `platform_config`, a oneof with full ID .google.cloud.managedkafka.v1.Cluster.gcp_config, latest field was gcpConfig",
8965                                ));
8966                            }
8967                            result.platform_config = std::option::Option::Some(
8968                                crate::model::cluster::PlatformConfig::GcpConfig(
8969                                    map.next_value::<std::option::Option<
8970                                        std::boxed::Box<crate::model::GcpConfig>,
8971                                    >>()?
8972                                    .unwrap_or_default(),
8973                                ),
8974                            );
8975                        }
8976                        __FieldTag::__name => {
8977                            if !fields.insert(__FieldTag::__name) {
8978                                return std::result::Result::Err(A::Error::duplicate_field(
8979                                    "multiple values for name",
8980                                ));
8981                            }
8982                            result.name = map
8983                                .next_value::<std::option::Option<std::string::String>>()?
8984                                .unwrap_or_default();
8985                        }
8986                        __FieldTag::__create_time => {
8987                            if !fields.insert(__FieldTag::__create_time) {
8988                                return std::result::Result::Err(A::Error::duplicate_field(
8989                                    "multiple values for create_time",
8990                                ));
8991                            }
8992                            result.create_time =
8993                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8994                        }
8995                        __FieldTag::__update_time => {
8996                            if !fields.insert(__FieldTag::__update_time) {
8997                                return std::result::Result::Err(A::Error::duplicate_field(
8998                                    "multiple values for update_time",
8999                                ));
9000                            }
9001                            result.update_time =
9002                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9003                        }
9004                        __FieldTag::__labels => {
9005                            if !fields.insert(__FieldTag::__labels) {
9006                                return std::result::Result::Err(A::Error::duplicate_field(
9007                                    "multiple values for labels",
9008                                ));
9009                            }
9010                            result.labels = map
9011                                .next_value::<std::option::Option<
9012                                    std::collections::HashMap<
9013                                        std::string::String,
9014                                        std::string::String,
9015                                    >,
9016                                >>()?
9017                                .unwrap_or_default();
9018                        }
9019                        __FieldTag::__capacity_config => {
9020                            if !fields.insert(__FieldTag::__capacity_config) {
9021                                return std::result::Result::Err(A::Error::duplicate_field(
9022                                    "multiple values for capacity_config",
9023                                ));
9024                            }
9025                            result.capacity_config = map
9026                                .next_value::<std::option::Option<crate::model::CapacityConfig>>(
9027                                )?;
9028                        }
9029                        __FieldTag::__rebalance_config => {
9030                            if !fields.insert(__FieldTag::__rebalance_config) {
9031                                return std::result::Result::Err(A::Error::duplicate_field(
9032                                    "multiple values for rebalance_config",
9033                                ));
9034                            }
9035                            result.rebalance_config = map
9036                                .next_value::<std::option::Option<crate::model::RebalanceConfig>>(
9037                                )?;
9038                        }
9039                        __FieldTag::__state => {
9040                            if !fields.insert(__FieldTag::__state) {
9041                                return std::result::Result::Err(A::Error::duplicate_field(
9042                                    "multiple values for state",
9043                                ));
9044                            }
9045                            result.state = map
9046                                .next_value::<std::option::Option<crate::model::cluster::State>>()?
9047                                .unwrap_or_default();
9048                        }
9049                        __FieldTag::__satisfies_pzi => {
9050                            if !fields.insert(__FieldTag::__satisfies_pzi) {
9051                                return std::result::Result::Err(A::Error::duplicate_field(
9052                                    "multiple values for satisfies_pzi",
9053                                ));
9054                            }
9055                            result.satisfies_pzi = map.next_value::<std::option::Option<bool>>()?;
9056                        }
9057                        __FieldTag::__satisfies_pzs => {
9058                            if !fields.insert(__FieldTag::__satisfies_pzs) {
9059                                return std::result::Result::Err(A::Error::duplicate_field(
9060                                    "multiple values for satisfies_pzs",
9061                                ));
9062                            }
9063                            result.satisfies_pzs = map.next_value::<std::option::Option<bool>>()?;
9064                        }
9065                        __FieldTag::__tls_config => {
9066                            if !fields.insert(__FieldTag::__tls_config) {
9067                                return std::result::Result::Err(A::Error::duplicate_field(
9068                                    "multiple values for tls_config",
9069                                ));
9070                            }
9071                            result.tls_config =
9072                                map.next_value::<std::option::Option<crate::model::TlsConfig>>()?;
9073                        }
9074                        __FieldTag::Unknown(key) => {
9075                            let value = map.next_value::<serde_json::Value>()?;
9076                            result._unknown_fields.insert(key, value);
9077                        }
9078                    }
9079                }
9080                std::result::Result::Ok(result)
9081            }
9082        }
9083        deserializer.deserialize_any(Visitor)
9084    }
9085}
9086
9087#[doc(hidden)]
9088impl serde::ser::Serialize for Cluster {
9089    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9090    where
9091        S: serde::ser::Serializer,
9092    {
9093        use serde::ser::SerializeMap;
9094        #[allow(unused_imports)]
9095        use std::option::Option::Some;
9096        let mut state = serializer.serialize_map(std::option::Option::None)?;
9097        if let Some(value) = self.gcp_config() {
9098            state.serialize_entry("gcpConfig", value)?;
9099        }
9100        if !self.name.is_empty() {
9101            state.serialize_entry("name", &self.name)?;
9102        }
9103        if self.create_time.is_some() {
9104            state.serialize_entry("createTime", &self.create_time)?;
9105        }
9106        if self.update_time.is_some() {
9107            state.serialize_entry("updateTime", &self.update_time)?;
9108        }
9109        if !self.labels.is_empty() {
9110            state.serialize_entry("labels", &self.labels)?;
9111        }
9112        if self.capacity_config.is_some() {
9113            state.serialize_entry("capacityConfig", &self.capacity_config)?;
9114        }
9115        if self.rebalance_config.is_some() {
9116            state.serialize_entry("rebalanceConfig", &self.rebalance_config)?;
9117        }
9118        if !wkt::internal::is_default(&self.state) {
9119            state.serialize_entry("state", &self.state)?;
9120        }
9121        if self.satisfies_pzi.is_some() {
9122            state.serialize_entry("satisfiesPzi", &self.satisfies_pzi)?;
9123        }
9124        if self.satisfies_pzs.is_some() {
9125            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
9126        }
9127        if self.tls_config.is_some() {
9128            state.serialize_entry("tlsConfig", &self.tls_config)?;
9129        }
9130        if !self._unknown_fields.is_empty() {
9131            for (key, value) in self._unknown_fields.iter() {
9132                state.serialize_entry(key, &value)?;
9133            }
9134        }
9135        state.end()
9136    }
9137}
9138
9139impl std::fmt::Debug for Cluster {
9140    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9141        let mut debug_struct = f.debug_struct("Cluster");
9142        debug_struct.field("name", &self.name);
9143        debug_struct.field("create_time", &self.create_time);
9144        debug_struct.field("update_time", &self.update_time);
9145        debug_struct.field("labels", &self.labels);
9146        debug_struct.field("capacity_config", &self.capacity_config);
9147        debug_struct.field("rebalance_config", &self.rebalance_config);
9148        debug_struct.field("state", &self.state);
9149        debug_struct.field("satisfies_pzi", &self.satisfies_pzi);
9150        debug_struct.field("satisfies_pzs", &self.satisfies_pzs);
9151        debug_struct.field("tls_config", &self.tls_config);
9152        debug_struct.field("platform_config", &self.platform_config);
9153        if !self._unknown_fields.is_empty() {
9154            debug_struct.field("_unknown_fields", &self._unknown_fields);
9155        }
9156        debug_struct.finish()
9157    }
9158}
9159
9160/// Defines additional types related to [Cluster].
9161pub mod cluster {
9162    #[allow(unused_imports)]
9163    use super::*;
9164
9165    /// The state of the cluster.
9166    ///
9167    /// # Working with unknown values
9168    ///
9169    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9170    /// additional enum variants at any time. Adding new variants is not considered
9171    /// a breaking change. Applications should write their code in anticipation of:
9172    ///
9173    /// - New values appearing in future releases of the client library, **and**
9174    /// - New values received dynamically, without application changes.
9175    ///
9176    /// Please consult the [Working with enums] section in the user guide for some
9177    /// guidelines.
9178    ///
9179    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9180    #[derive(Clone, Debug, PartialEq)]
9181    #[non_exhaustive]
9182    pub enum State {
9183        /// A state was not specified.
9184        Unspecified,
9185        /// The cluster is being created.
9186        Creating,
9187        /// The cluster is active.
9188        Active,
9189        /// The cluster is being deleted.
9190        Deleting,
9191        /// If set, the enum was initialized with an unknown value.
9192        ///
9193        /// Applications can examine the value using [State::value] or
9194        /// [State::name].
9195        UnknownValue(state::UnknownValue),
9196    }
9197
9198    #[doc(hidden)]
9199    pub mod state {
9200        #[allow(unused_imports)]
9201        use super::*;
9202        #[derive(Clone, Debug, PartialEq)]
9203        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9204    }
9205
9206    impl State {
9207        /// Gets the enum value.
9208        ///
9209        /// Returns `None` if the enum contains an unknown value deserialized from
9210        /// the string representation of enums.
9211        pub fn value(&self) -> std::option::Option<i32> {
9212            match self {
9213                Self::Unspecified => std::option::Option::Some(0),
9214                Self::Creating => std::option::Option::Some(1),
9215                Self::Active => std::option::Option::Some(2),
9216                Self::Deleting => std::option::Option::Some(3),
9217                Self::UnknownValue(u) => u.0.value(),
9218            }
9219        }
9220
9221        /// Gets the enum value as a string.
9222        ///
9223        /// Returns `None` if the enum contains an unknown value deserialized from
9224        /// the integer representation of enums.
9225        pub fn name(&self) -> std::option::Option<&str> {
9226            match self {
9227                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9228                Self::Creating => std::option::Option::Some("CREATING"),
9229                Self::Active => std::option::Option::Some("ACTIVE"),
9230                Self::Deleting => std::option::Option::Some("DELETING"),
9231                Self::UnknownValue(u) => u.0.name(),
9232            }
9233        }
9234    }
9235
9236    impl std::default::Default for State {
9237        fn default() -> Self {
9238            use std::convert::From;
9239            Self::from(0)
9240        }
9241    }
9242
9243    impl std::fmt::Display for State {
9244        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9245            wkt::internal::display_enum(f, self.name(), self.value())
9246        }
9247    }
9248
9249    impl std::convert::From<i32> for State {
9250        fn from(value: i32) -> Self {
9251            match value {
9252                0 => Self::Unspecified,
9253                1 => Self::Creating,
9254                2 => Self::Active,
9255                3 => Self::Deleting,
9256                _ => Self::UnknownValue(state::UnknownValue(
9257                    wkt::internal::UnknownEnumValue::Integer(value),
9258                )),
9259            }
9260        }
9261    }
9262
9263    impl std::convert::From<&str> for State {
9264        fn from(value: &str) -> Self {
9265            use std::string::ToString;
9266            match value {
9267                "STATE_UNSPECIFIED" => Self::Unspecified,
9268                "CREATING" => Self::Creating,
9269                "ACTIVE" => Self::Active,
9270                "DELETING" => Self::Deleting,
9271                _ => Self::UnknownValue(state::UnknownValue(
9272                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9273                )),
9274            }
9275        }
9276    }
9277
9278    impl serde::ser::Serialize for State {
9279        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9280        where
9281            S: serde::Serializer,
9282        {
9283            match self {
9284                Self::Unspecified => serializer.serialize_i32(0),
9285                Self::Creating => serializer.serialize_i32(1),
9286                Self::Active => serializer.serialize_i32(2),
9287                Self::Deleting => serializer.serialize_i32(3),
9288                Self::UnknownValue(u) => u.0.serialize(serializer),
9289            }
9290        }
9291    }
9292
9293    impl<'de> serde::de::Deserialize<'de> for State {
9294        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9295        where
9296            D: serde::Deserializer<'de>,
9297        {
9298            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9299                ".google.cloud.managedkafka.v1.Cluster.State",
9300            ))
9301        }
9302    }
9303
9304    /// Platform specific configuration properties for a Kafka cluster.
9305    #[derive(Clone, Debug, PartialEq)]
9306    #[non_exhaustive]
9307    pub enum PlatformConfig {
9308        /// Required. Configuration properties for a Kafka cluster deployed to Google
9309        /// Cloud Platform.
9310        GcpConfig(std::boxed::Box<crate::model::GcpConfig>),
9311    }
9312}
9313
9314/// A capacity configuration of a Kafka cluster.
9315#[derive(Clone, Default, PartialEq)]
9316#[non_exhaustive]
9317pub struct CapacityConfig {
9318    /// Required. The number of vCPUs to provision for the cluster. Minimum: 3.
9319    pub vcpu_count: i64,
9320
9321    /// Required. The memory to provision for the cluster in bytes.
9322    /// The CPU:memory ratio (vCPU:GiB) must be between 1:1 and 1:8.
9323    /// Minimum: 3221225472 (3 GiB).
9324    pub memory_bytes: i64,
9325
9326    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9327}
9328
9329impl CapacityConfig {
9330    pub fn new() -> Self {
9331        std::default::Default::default()
9332    }
9333
9334    /// Sets the value of [vcpu_count][crate::model::CapacityConfig::vcpu_count].
9335    pub fn set_vcpu_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9336        self.vcpu_count = v.into();
9337        self
9338    }
9339
9340    /// Sets the value of [memory_bytes][crate::model::CapacityConfig::memory_bytes].
9341    pub fn set_memory_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9342        self.memory_bytes = v.into();
9343        self
9344    }
9345}
9346
9347impl wkt::message::Message for CapacityConfig {
9348    fn typename() -> &'static str {
9349        "type.googleapis.com/google.cloud.managedkafka.v1.CapacityConfig"
9350    }
9351}
9352
9353#[doc(hidden)]
9354impl<'de> serde::de::Deserialize<'de> for CapacityConfig {
9355    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9356    where
9357        D: serde::Deserializer<'de>,
9358    {
9359        #[allow(non_camel_case_types)]
9360        #[doc(hidden)]
9361        #[derive(PartialEq, Eq, Hash)]
9362        enum __FieldTag {
9363            __vcpu_count,
9364            __memory_bytes,
9365            Unknown(std::string::String),
9366        }
9367        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9368            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9369            where
9370                D: serde::Deserializer<'de>,
9371            {
9372                struct Visitor;
9373                impl<'de> serde::de::Visitor<'de> for Visitor {
9374                    type Value = __FieldTag;
9375                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9376                        formatter.write_str("a field name for CapacityConfig")
9377                    }
9378                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9379                    where
9380                        E: serde::de::Error,
9381                    {
9382                        use std::result::Result::Ok;
9383                        use std::string::ToString;
9384                        match value {
9385                            "vcpuCount" => Ok(__FieldTag::__vcpu_count),
9386                            "vcpu_count" => Ok(__FieldTag::__vcpu_count),
9387                            "memoryBytes" => Ok(__FieldTag::__memory_bytes),
9388                            "memory_bytes" => Ok(__FieldTag::__memory_bytes),
9389                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9390                        }
9391                    }
9392                }
9393                deserializer.deserialize_identifier(Visitor)
9394            }
9395        }
9396        struct Visitor;
9397        impl<'de> serde::de::Visitor<'de> for Visitor {
9398            type Value = CapacityConfig;
9399            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9400                formatter.write_str("struct CapacityConfig")
9401            }
9402            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9403            where
9404                A: serde::de::MapAccess<'de>,
9405            {
9406                #[allow(unused_imports)]
9407                use serde::de::Error;
9408                use std::option::Option::Some;
9409                let mut fields = std::collections::HashSet::new();
9410                let mut result = Self::Value::new();
9411                while let Some(tag) = map.next_key::<__FieldTag>()? {
9412                    #[allow(clippy::match_single_binding)]
9413                    match tag {
9414                        __FieldTag::__vcpu_count => {
9415                            if !fields.insert(__FieldTag::__vcpu_count) {
9416                                return std::result::Result::Err(A::Error::duplicate_field(
9417                                    "multiple values for vcpu_count",
9418                                ));
9419                            }
9420                            struct __With(std::option::Option<i64>);
9421                            impl<'de> serde::de::Deserialize<'de> for __With {
9422                                fn deserialize<D>(
9423                                    deserializer: D,
9424                                ) -> std::result::Result<Self, D::Error>
9425                                where
9426                                    D: serde::de::Deserializer<'de>,
9427                                {
9428                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
9429                                }
9430                            }
9431                            result.vcpu_count = map.next_value::<__With>()?.0.unwrap_or_default();
9432                        }
9433                        __FieldTag::__memory_bytes => {
9434                            if !fields.insert(__FieldTag::__memory_bytes) {
9435                                return std::result::Result::Err(A::Error::duplicate_field(
9436                                    "multiple values for memory_bytes",
9437                                ));
9438                            }
9439                            struct __With(std::option::Option<i64>);
9440                            impl<'de> serde::de::Deserialize<'de> for __With {
9441                                fn deserialize<D>(
9442                                    deserializer: D,
9443                                ) -> std::result::Result<Self, D::Error>
9444                                where
9445                                    D: serde::de::Deserializer<'de>,
9446                                {
9447                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
9448                                }
9449                            }
9450                            result.memory_bytes = map.next_value::<__With>()?.0.unwrap_or_default();
9451                        }
9452                        __FieldTag::Unknown(key) => {
9453                            let value = map.next_value::<serde_json::Value>()?;
9454                            result._unknown_fields.insert(key, value);
9455                        }
9456                    }
9457                }
9458                std::result::Result::Ok(result)
9459            }
9460        }
9461        deserializer.deserialize_any(Visitor)
9462    }
9463}
9464
9465#[doc(hidden)]
9466impl serde::ser::Serialize for CapacityConfig {
9467    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9468    where
9469        S: serde::ser::Serializer,
9470    {
9471        use serde::ser::SerializeMap;
9472        #[allow(unused_imports)]
9473        use std::option::Option::Some;
9474        let mut state = serializer.serialize_map(std::option::Option::None)?;
9475        if !wkt::internal::is_default(&self.vcpu_count) {
9476            struct __With<'a>(&'a i64);
9477            impl<'a> serde::ser::Serialize for __With<'a> {
9478                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9479                where
9480                    S: serde::ser::Serializer,
9481                {
9482                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
9483                }
9484            }
9485            state.serialize_entry("vcpuCount", &__With(&self.vcpu_count))?;
9486        }
9487        if !wkt::internal::is_default(&self.memory_bytes) {
9488            struct __With<'a>(&'a i64);
9489            impl<'a> serde::ser::Serialize for __With<'a> {
9490                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9491                where
9492                    S: serde::ser::Serializer,
9493                {
9494                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
9495                }
9496            }
9497            state.serialize_entry("memoryBytes", &__With(&self.memory_bytes))?;
9498        }
9499        if !self._unknown_fields.is_empty() {
9500            for (key, value) in self._unknown_fields.iter() {
9501                state.serialize_entry(key, &value)?;
9502            }
9503        }
9504        state.end()
9505    }
9506}
9507
9508impl std::fmt::Debug for CapacityConfig {
9509    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9510        let mut debug_struct = f.debug_struct("CapacityConfig");
9511        debug_struct.field("vcpu_count", &self.vcpu_count);
9512        debug_struct.field("memory_bytes", &self.memory_bytes);
9513        if !self._unknown_fields.is_empty() {
9514            debug_struct.field("_unknown_fields", &self._unknown_fields);
9515        }
9516        debug_struct.finish()
9517    }
9518}
9519
9520/// Defines rebalancing behavior of a Kafka cluster.
9521#[derive(Clone, Default, PartialEq)]
9522#[non_exhaustive]
9523pub struct RebalanceConfig {
9524    /// Optional. The rebalance behavior for the cluster.
9525    /// When not specified, defaults to `NO_REBALANCE`.
9526    pub mode: crate::model::rebalance_config::Mode,
9527
9528    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9529}
9530
9531impl RebalanceConfig {
9532    pub fn new() -> Self {
9533        std::default::Default::default()
9534    }
9535
9536    /// Sets the value of [mode][crate::model::RebalanceConfig::mode].
9537    pub fn set_mode<T: std::convert::Into<crate::model::rebalance_config::Mode>>(
9538        mut self,
9539        v: T,
9540    ) -> Self {
9541        self.mode = v.into();
9542        self
9543    }
9544}
9545
9546impl wkt::message::Message for RebalanceConfig {
9547    fn typename() -> &'static str {
9548        "type.googleapis.com/google.cloud.managedkafka.v1.RebalanceConfig"
9549    }
9550}
9551
9552#[doc(hidden)]
9553impl<'de> serde::de::Deserialize<'de> for RebalanceConfig {
9554    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9555    where
9556        D: serde::Deserializer<'de>,
9557    {
9558        #[allow(non_camel_case_types)]
9559        #[doc(hidden)]
9560        #[derive(PartialEq, Eq, Hash)]
9561        enum __FieldTag {
9562            __mode,
9563            Unknown(std::string::String),
9564        }
9565        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9566            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9567            where
9568                D: serde::Deserializer<'de>,
9569            {
9570                struct Visitor;
9571                impl<'de> serde::de::Visitor<'de> for Visitor {
9572                    type Value = __FieldTag;
9573                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9574                        formatter.write_str("a field name for RebalanceConfig")
9575                    }
9576                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9577                    where
9578                        E: serde::de::Error,
9579                    {
9580                        use std::result::Result::Ok;
9581                        use std::string::ToString;
9582                        match value {
9583                            "mode" => Ok(__FieldTag::__mode),
9584                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9585                        }
9586                    }
9587                }
9588                deserializer.deserialize_identifier(Visitor)
9589            }
9590        }
9591        struct Visitor;
9592        impl<'de> serde::de::Visitor<'de> for Visitor {
9593            type Value = RebalanceConfig;
9594            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9595                formatter.write_str("struct RebalanceConfig")
9596            }
9597            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9598            where
9599                A: serde::de::MapAccess<'de>,
9600            {
9601                #[allow(unused_imports)]
9602                use serde::de::Error;
9603                use std::option::Option::Some;
9604                let mut fields = std::collections::HashSet::new();
9605                let mut result = Self::Value::new();
9606                while let Some(tag) = map.next_key::<__FieldTag>()? {
9607                    #[allow(clippy::match_single_binding)]
9608                    match tag {
9609                        __FieldTag::__mode => {
9610                            if !fields.insert(__FieldTag::__mode) {
9611                                return std::result::Result::Err(A::Error::duplicate_field(
9612                                    "multiple values for mode",
9613                                ));
9614                            }
9615                            result.mode = map.next_value::<std::option::Option<crate::model::rebalance_config::Mode>>()?.unwrap_or_default();
9616                        }
9617                        __FieldTag::Unknown(key) => {
9618                            let value = map.next_value::<serde_json::Value>()?;
9619                            result._unknown_fields.insert(key, value);
9620                        }
9621                    }
9622                }
9623                std::result::Result::Ok(result)
9624            }
9625        }
9626        deserializer.deserialize_any(Visitor)
9627    }
9628}
9629
9630#[doc(hidden)]
9631impl serde::ser::Serialize for RebalanceConfig {
9632    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9633    where
9634        S: serde::ser::Serializer,
9635    {
9636        use serde::ser::SerializeMap;
9637        #[allow(unused_imports)]
9638        use std::option::Option::Some;
9639        let mut state = serializer.serialize_map(std::option::Option::None)?;
9640        if !wkt::internal::is_default(&self.mode) {
9641            state.serialize_entry("mode", &self.mode)?;
9642        }
9643        if !self._unknown_fields.is_empty() {
9644            for (key, value) in self._unknown_fields.iter() {
9645                state.serialize_entry(key, &value)?;
9646            }
9647        }
9648        state.end()
9649    }
9650}
9651
9652impl std::fmt::Debug for RebalanceConfig {
9653    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9654        let mut debug_struct = f.debug_struct("RebalanceConfig");
9655        debug_struct.field("mode", &self.mode);
9656        if !self._unknown_fields.is_empty() {
9657            debug_struct.field("_unknown_fields", &self._unknown_fields);
9658        }
9659        debug_struct.finish()
9660    }
9661}
9662
9663/// Defines additional types related to [RebalanceConfig].
9664pub mod rebalance_config {
9665    #[allow(unused_imports)]
9666    use super::*;
9667
9668    /// The partition rebalance mode for the cluster.
9669    ///
9670    /// # Working with unknown values
9671    ///
9672    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9673    /// additional enum variants at any time. Adding new variants is not considered
9674    /// a breaking change. Applications should write their code in anticipation of:
9675    ///
9676    /// - New values appearing in future releases of the client library, **and**
9677    /// - New values received dynamically, without application changes.
9678    ///
9679    /// Please consult the [Working with enums] section in the user guide for some
9680    /// guidelines.
9681    ///
9682    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9683    #[derive(Clone, Debug, PartialEq)]
9684    #[non_exhaustive]
9685    pub enum Mode {
9686        /// A mode was not specified. Do not use.
9687        Unspecified,
9688        /// Do not rebalance automatically.
9689        NoRebalance,
9690        /// Automatically rebalance topic partitions among brokers when the
9691        /// cluster is scaled up.
9692        AutoRebalanceOnScaleUp,
9693        /// If set, the enum was initialized with an unknown value.
9694        ///
9695        /// Applications can examine the value using [Mode::value] or
9696        /// [Mode::name].
9697        UnknownValue(mode::UnknownValue),
9698    }
9699
9700    #[doc(hidden)]
9701    pub mod mode {
9702        #[allow(unused_imports)]
9703        use super::*;
9704        #[derive(Clone, Debug, PartialEq)]
9705        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9706    }
9707
9708    impl Mode {
9709        /// Gets the enum value.
9710        ///
9711        /// Returns `None` if the enum contains an unknown value deserialized from
9712        /// the string representation of enums.
9713        pub fn value(&self) -> std::option::Option<i32> {
9714            match self {
9715                Self::Unspecified => std::option::Option::Some(0),
9716                Self::NoRebalance => std::option::Option::Some(1),
9717                Self::AutoRebalanceOnScaleUp => std::option::Option::Some(2),
9718                Self::UnknownValue(u) => u.0.value(),
9719            }
9720        }
9721
9722        /// Gets the enum value as a string.
9723        ///
9724        /// Returns `None` if the enum contains an unknown value deserialized from
9725        /// the integer representation of enums.
9726        pub fn name(&self) -> std::option::Option<&str> {
9727            match self {
9728                Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
9729                Self::NoRebalance => std::option::Option::Some("NO_REBALANCE"),
9730                Self::AutoRebalanceOnScaleUp => {
9731                    std::option::Option::Some("AUTO_REBALANCE_ON_SCALE_UP")
9732                }
9733                Self::UnknownValue(u) => u.0.name(),
9734            }
9735        }
9736    }
9737
9738    impl std::default::Default for Mode {
9739        fn default() -> Self {
9740            use std::convert::From;
9741            Self::from(0)
9742        }
9743    }
9744
9745    impl std::fmt::Display for Mode {
9746        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9747            wkt::internal::display_enum(f, self.name(), self.value())
9748        }
9749    }
9750
9751    impl std::convert::From<i32> for Mode {
9752        fn from(value: i32) -> Self {
9753            match value {
9754                0 => Self::Unspecified,
9755                1 => Self::NoRebalance,
9756                2 => Self::AutoRebalanceOnScaleUp,
9757                _ => Self::UnknownValue(mode::UnknownValue(
9758                    wkt::internal::UnknownEnumValue::Integer(value),
9759                )),
9760            }
9761        }
9762    }
9763
9764    impl std::convert::From<&str> for Mode {
9765        fn from(value: &str) -> Self {
9766            use std::string::ToString;
9767            match value {
9768                "MODE_UNSPECIFIED" => Self::Unspecified,
9769                "NO_REBALANCE" => Self::NoRebalance,
9770                "AUTO_REBALANCE_ON_SCALE_UP" => Self::AutoRebalanceOnScaleUp,
9771                _ => Self::UnknownValue(mode::UnknownValue(
9772                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9773                )),
9774            }
9775        }
9776    }
9777
9778    impl serde::ser::Serialize for Mode {
9779        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9780        where
9781            S: serde::Serializer,
9782        {
9783            match self {
9784                Self::Unspecified => serializer.serialize_i32(0),
9785                Self::NoRebalance => serializer.serialize_i32(1),
9786                Self::AutoRebalanceOnScaleUp => serializer.serialize_i32(2),
9787                Self::UnknownValue(u) => u.0.serialize(serializer),
9788            }
9789        }
9790    }
9791
9792    impl<'de> serde::de::Deserialize<'de> for Mode {
9793        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9794        where
9795            D: serde::Deserializer<'de>,
9796        {
9797            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
9798                ".google.cloud.managedkafka.v1.RebalanceConfig.Mode",
9799            ))
9800        }
9801    }
9802}
9803
9804/// The configuration of a Virtual Private Cloud (VPC) network that can access
9805/// the Kafka cluster.
9806#[derive(Clone, Default, PartialEq)]
9807#[non_exhaustive]
9808pub struct NetworkConfig {
9809    /// Required. Name of the VPC subnet in which to create Private Service Connect
9810    /// (PSC) endpoints for the Kafka brokers and bootstrap address. Structured
9811    /// like: projects/{project}/regions/{region}/subnetworks/{subnet_id}
9812    ///
9813    /// The subnet must be located in the same region as the Kafka cluster. The
9814    /// project may differ. Multiple subnets from the same parent network must not
9815    /// be specified.
9816    pub subnet: std::string::String,
9817
9818    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9819}
9820
9821impl NetworkConfig {
9822    pub fn new() -> Self {
9823        std::default::Default::default()
9824    }
9825
9826    /// Sets the value of [subnet][crate::model::NetworkConfig::subnet].
9827    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9828        self.subnet = v.into();
9829        self
9830    }
9831}
9832
9833impl wkt::message::Message for NetworkConfig {
9834    fn typename() -> &'static str {
9835        "type.googleapis.com/google.cloud.managedkafka.v1.NetworkConfig"
9836    }
9837}
9838
9839#[doc(hidden)]
9840impl<'de> serde::de::Deserialize<'de> for NetworkConfig {
9841    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9842    where
9843        D: serde::Deserializer<'de>,
9844    {
9845        #[allow(non_camel_case_types)]
9846        #[doc(hidden)]
9847        #[derive(PartialEq, Eq, Hash)]
9848        enum __FieldTag {
9849            __subnet,
9850            Unknown(std::string::String),
9851        }
9852        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9853            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9854            where
9855                D: serde::Deserializer<'de>,
9856            {
9857                struct Visitor;
9858                impl<'de> serde::de::Visitor<'de> for Visitor {
9859                    type Value = __FieldTag;
9860                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9861                        formatter.write_str("a field name for NetworkConfig")
9862                    }
9863                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9864                    where
9865                        E: serde::de::Error,
9866                    {
9867                        use std::result::Result::Ok;
9868                        use std::string::ToString;
9869                        match value {
9870                            "subnet" => Ok(__FieldTag::__subnet),
9871                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9872                        }
9873                    }
9874                }
9875                deserializer.deserialize_identifier(Visitor)
9876            }
9877        }
9878        struct Visitor;
9879        impl<'de> serde::de::Visitor<'de> for Visitor {
9880            type Value = NetworkConfig;
9881            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9882                formatter.write_str("struct NetworkConfig")
9883            }
9884            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9885            where
9886                A: serde::de::MapAccess<'de>,
9887            {
9888                #[allow(unused_imports)]
9889                use serde::de::Error;
9890                use std::option::Option::Some;
9891                let mut fields = std::collections::HashSet::new();
9892                let mut result = Self::Value::new();
9893                while let Some(tag) = map.next_key::<__FieldTag>()? {
9894                    #[allow(clippy::match_single_binding)]
9895                    match tag {
9896                        __FieldTag::__subnet => {
9897                            if !fields.insert(__FieldTag::__subnet) {
9898                                return std::result::Result::Err(A::Error::duplicate_field(
9899                                    "multiple values for subnet",
9900                                ));
9901                            }
9902                            result.subnet = map
9903                                .next_value::<std::option::Option<std::string::String>>()?
9904                                .unwrap_or_default();
9905                        }
9906                        __FieldTag::Unknown(key) => {
9907                            let value = map.next_value::<serde_json::Value>()?;
9908                            result._unknown_fields.insert(key, value);
9909                        }
9910                    }
9911                }
9912                std::result::Result::Ok(result)
9913            }
9914        }
9915        deserializer.deserialize_any(Visitor)
9916    }
9917}
9918
9919#[doc(hidden)]
9920impl serde::ser::Serialize for NetworkConfig {
9921    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9922    where
9923        S: serde::ser::Serializer,
9924    {
9925        use serde::ser::SerializeMap;
9926        #[allow(unused_imports)]
9927        use std::option::Option::Some;
9928        let mut state = serializer.serialize_map(std::option::Option::None)?;
9929        if !self.subnet.is_empty() {
9930            state.serialize_entry("subnet", &self.subnet)?;
9931        }
9932        if !self._unknown_fields.is_empty() {
9933            for (key, value) in self._unknown_fields.iter() {
9934                state.serialize_entry(key, &value)?;
9935            }
9936        }
9937        state.end()
9938    }
9939}
9940
9941impl std::fmt::Debug for NetworkConfig {
9942    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9943        let mut debug_struct = f.debug_struct("NetworkConfig");
9944        debug_struct.field("subnet", &self.subnet);
9945        if !self._unknown_fields.is_empty() {
9946            debug_struct.field("_unknown_fields", &self._unknown_fields);
9947        }
9948        debug_struct.finish()
9949    }
9950}
9951
9952/// The configuration of access to the Kafka cluster.
9953#[derive(Clone, Default, PartialEq)]
9954#[non_exhaustive]
9955pub struct AccessConfig {
9956    /// Required. Virtual Private Cloud (VPC) networks that must be granted direct
9957    /// access to the Kafka cluster. Minimum of 1 network is required. Maximum 10
9958    /// networks can be specified.
9959    pub network_configs: std::vec::Vec<crate::model::NetworkConfig>,
9960
9961    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9962}
9963
9964impl AccessConfig {
9965    pub fn new() -> Self {
9966        std::default::Default::default()
9967    }
9968
9969    /// Sets the value of [network_configs][crate::model::AccessConfig::network_configs].
9970    pub fn set_network_configs<T, V>(mut self, v: T) -> Self
9971    where
9972        T: std::iter::IntoIterator<Item = V>,
9973        V: std::convert::Into<crate::model::NetworkConfig>,
9974    {
9975        use std::iter::Iterator;
9976        self.network_configs = v.into_iter().map(|i| i.into()).collect();
9977        self
9978    }
9979}
9980
9981impl wkt::message::Message for AccessConfig {
9982    fn typename() -> &'static str {
9983        "type.googleapis.com/google.cloud.managedkafka.v1.AccessConfig"
9984    }
9985}
9986
9987#[doc(hidden)]
9988impl<'de> serde::de::Deserialize<'de> for AccessConfig {
9989    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9990    where
9991        D: serde::Deserializer<'de>,
9992    {
9993        #[allow(non_camel_case_types)]
9994        #[doc(hidden)]
9995        #[derive(PartialEq, Eq, Hash)]
9996        enum __FieldTag {
9997            __network_configs,
9998            Unknown(std::string::String),
9999        }
10000        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10001            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10002            where
10003                D: serde::Deserializer<'de>,
10004            {
10005                struct Visitor;
10006                impl<'de> serde::de::Visitor<'de> for Visitor {
10007                    type Value = __FieldTag;
10008                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10009                        formatter.write_str("a field name for AccessConfig")
10010                    }
10011                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10012                    where
10013                        E: serde::de::Error,
10014                    {
10015                        use std::result::Result::Ok;
10016                        use std::string::ToString;
10017                        match value {
10018                            "networkConfigs" => Ok(__FieldTag::__network_configs),
10019                            "network_configs" => Ok(__FieldTag::__network_configs),
10020                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10021                        }
10022                    }
10023                }
10024                deserializer.deserialize_identifier(Visitor)
10025            }
10026        }
10027        struct Visitor;
10028        impl<'de> serde::de::Visitor<'de> for Visitor {
10029            type Value = AccessConfig;
10030            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10031                formatter.write_str("struct AccessConfig")
10032            }
10033            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10034            where
10035                A: serde::de::MapAccess<'de>,
10036            {
10037                #[allow(unused_imports)]
10038                use serde::de::Error;
10039                use std::option::Option::Some;
10040                let mut fields = std::collections::HashSet::new();
10041                let mut result = Self::Value::new();
10042                while let Some(tag) = map.next_key::<__FieldTag>()? {
10043                    #[allow(clippy::match_single_binding)]
10044                    match tag {
10045                        __FieldTag::__network_configs => {
10046                            if !fields.insert(__FieldTag::__network_configs) {
10047                                return std::result::Result::Err(A::Error::duplicate_field(
10048                                    "multiple values for network_configs",
10049                                ));
10050                            }
10051                            result.network_configs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::NetworkConfig>>>()?.unwrap_or_default();
10052                        }
10053                        __FieldTag::Unknown(key) => {
10054                            let value = map.next_value::<serde_json::Value>()?;
10055                            result._unknown_fields.insert(key, value);
10056                        }
10057                    }
10058                }
10059                std::result::Result::Ok(result)
10060            }
10061        }
10062        deserializer.deserialize_any(Visitor)
10063    }
10064}
10065
10066#[doc(hidden)]
10067impl serde::ser::Serialize for AccessConfig {
10068    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10069    where
10070        S: serde::ser::Serializer,
10071    {
10072        use serde::ser::SerializeMap;
10073        #[allow(unused_imports)]
10074        use std::option::Option::Some;
10075        let mut state = serializer.serialize_map(std::option::Option::None)?;
10076        if !self.network_configs.is_empty() {
10077            state.serialize_entry("networkConfigs", &self.network_configs)?;
10078        }
10079        if !self._unknown_fields.is_empty() {
10080            for (key, value) in self._unknown_fields.iter() {
10081                state.serialize_entry(key, &value)?;
10082            }
10083        }
10084        state.end()
10085    }
10086}
10087
10088impl std::fmt::Debug for AccessConfig {
10089    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10090        let mut debug_struct = f.debug_struct("AccessConfig");
10091        debug_struct.field("network_configs", &self.network_configs);
10092        if !self._unknown_fields.is_empty() {
10093            debug_struct.field("_unknown_fields", &self._unknown_fields);
10094        }
10095        debug_struct.finish()
10096    }
10097}
10098
10099/// Configuration properties for a Kafka cluster deployed to Google Cloud
10100/// Platform.
10101#[derive(Clone, Default, PartialEq)]
10102#[non_exhaustive]
10103pub struct GcpConfig {
10104    /// Required. Access configuration for the Kafka cluster.
10105    pub access_config: std::option::Option<crate::model::AccessConfig>,
10106
10107    /// Optional. Immutable. The Cloud KMS Key name to use for encryption. The key
10108    /// must be located in the same region as the cluster and cannot be changed.
10109    /// Structured like:
10110    /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
10111    pub kms_key: std::string::String,
10112
10113    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10114}
10115
10116impl GcpConfig {
10117    pub fn new() -> Self {
10118        std::default::Default::default()
10119    }
10120
10121    /// Sets the value of [access_config][crate::model::GcpConfig::access_config].
10122    pub fn set_access_config<T>(mut self, v: T) -> Self
10123    where
10124        T: std::convert::Into<crate::model::AccessConfig>,
10125    {
10126        self.access_config = std::option::Option::Some(v.into());
10127        self
10128    }
10129
10130    /// Sets or clears the value of [access_config][crate::model::GcpConfig::access_config].
10131    pub fn set_or_clear_access_config<T>(mut self, v: std::option::Option<T>) -> Self
10132    where
10133        T: std::convert::Into<crate::model::AccessConfig>,
10134    {
10135        self.access_config = v.map(|x| x.into());
10136        self
10137    }
10138
10139    /// Sets the value of [kms_key][crate::model::GcpConfig::kms_key].
10140    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10141        self.kms_key = v.into();
10142        self
10143    }
10144}
10145
10146impl wkt::message::Message for GcpConfig {
10147    fn typename() -> &'static str {
10148        "type.googleapis.com/google.cloud.managedkafka.v1.GcpConfig"
10149    }
10150}
10151
10152#[doc(hidden)]
10153impl<'de> serde::de::Deserialize<'de> for GcpConfig {
10154    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10155    where
10156        D: serde::Deserializer<'de>,
10157    {
10158        #[allow(non_camel_case_types)]
10159        #[doc(hidden)]
10160        #[derive(PartialEq, Eq, Hash)]
10161        enum __FieldTag {
10162            __access_config,
10163            __kms_key,
10164            Unknown(std::string::String),
10165        }
10166        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10167            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10168            where
10169                D: serde::Deserializer<'de>,
10170            {
10171                struct Visitor;
10172                impl<'de> serde::de::Visitor<'de> for Visitor {
10173                    type Value = __FieldTag;
10174                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10175                        formatter.write_str("a field name for GcpConfig")
10176                    }
10177                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10178                    where
10179                        E: serde::de::Error,
10180                    {
10181                        use std::result::Result::Ok;
10182                        use std::string::ToString;
10183                        match value {
10184                            "accessConfig" => Ok(__FieldTag::__access_config),
10185                            "access_config" => Ok(__FieldTag::__access_config),
10186                            "kmsKey" => Ok(__FieldTag::__kms_key),
10187                            "kms_key" => Ok(__FieldTag::__kms_key),
10188                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10189                        }
10190                    }
10191                }
10192                deserializer.deserialize_identifier(Visitor)
10193            }
10194        }
10195        struct Visitor;
10196        impl<'de> serde::de::Visitor<'de> for Visitor {
10197            type Value = GcpConfig;
10198            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10199                formatter.write_str("struct GcpConfig")
10200            }
10201            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10202            where
10203                A: serde::de::MapAccess<'de>,
10204            {
10205                #[allow(unused_imports)]
10206                use serde::de::Error;
10207                use std::option::Option::Some;
10208                let mut fields = std::collections::HashSet::new();
10209                let mut result = Self::Value::new();
10210                while let Some(tag) = map.next_key::<__FieldTag>()? {
10211                    #[allow(clippy::match_single_binding)]
10212                    match tag {
10213                        __FieldTag::__access_config => {
10214                            if !fields.insert(__FieldTag::__access_config) {
10215                                return std::result::Result::Err(A::Error::duplicate_field(
10216                                    "multiple values for access_config",
10217                                ));
10218                            }
10219                            result.access_config = map
10220                                .next_value::<std::option::Option<crate::model::AccessConfig>>()?;
10221                        }
10222                        __FieldTag::__kms_key => {
10223                            if !fields.insert(__FieldTag::__kms_key) {
10224                                return std::result::Result::Err(A::Error::duplicate_field(
10225                                    "multiple values for kms_key",
10226                                ));
10227                            }
10228                            result.kms_key = map
10229                                .next_value::<std::option::Option<std::string::String>>()?
10230                                .unwrap_or_default();
10231                        }
10232                        __FieldTag::Unknown(key) => {
10233                            let value = map.next_value::<serde_json::Value>()?;
10234                            result._unknown_fields.insert(key, value);
10235                        }
10236                    }
10237                }
10238                std::result::Result::Ok(result)
10239            }
10240        }
10241        deserializer.deserialize_any(Visitor)
10242    }
10243}
10244
10245#[doc(hidden)]
10246impl serde::ser::Serialize for GcpConfig {
10247    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10248    where
10249        S: serde::ser::Serializer,
10250    {
10251        use serde::ser::SerializeMap;
10252        #[allow(unused_imports)]
10253        use std::option::Option::Some;
10254        let mut state = serializer.serialize_map(std::option::Option::None)?;
10255        if self.access_config.is_some() {
10256            state.serialize_entry("accessConfig", &self.access_config)?;
10257        }
10258        if !self.kms_key.is_empty() {
10259            state.serialize_entry("kmsKey", &self.kms_key)?;
10260        }
10261        if !self._unknown_fields.is_empty() {
10262            for (key, value) in self._unknown_fields.iter() {
10263                state.serialize_entry(key, &value)?;
10264            }
10265        }
10266        state.end()
10267    }
10268}
10269
10270impl std::fmt::Debug for GcpConfig {
10271    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10272        let mut debug_struct = f.debug_struct("GcpConfig");
10273        debug_struct.field("access_config", &self.access_config);
10274        debug_struct.field("kms_key", &self.kms_key);
10275        if !self._unknown_fields.is_empty() {
10276            debug_struct.field("_unknown_fields", &self._unknown_fields);
10277        }
10278        debug_struct.finish()
10279    }
10280}
10281
10282/// The TLS configuration for the Kafka cluster.
10283#[derive(Clone, Default, PartialEq)]
10284#[non_exhaustive]
10285pub struct TlsConfig {
10286    /// Optional. The configuration of the broker truststore. If specified, clients
10287    /// can use mTLS for authentication.
10288    pub trust_config: std::option::Option<crate::model::TrustConfig>,
10289
10290    /// Optional. A list of rules for mapping from SSL principal names to
10291    /// short names. These are applied in order by Kafka.
10292    /// Refer to the Apache Kafka documentation for `ssl.principal.mapping.rules`
10293    /// for the precise formatting details and syntax.
10294    /// Example: "RULE:^CN=(.*?),OU=ServiceUsers.*$/$1@example.com/,DEFAULT"
10295    ///
10296    /// This is a static Kafka broker configuration. Setting or modifying this
10297    /// field will trigger a rolling restart of the Kafka brokers to apply
10298    /// the change. An empty string means no rules are applied (Kafka default).
10299    pub ssl_principal_mapping_rules: std::string::String,
10300
10301    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10302}
10303
10304impl TlsConfig {
10305    pub fn new() -> Self {
10306        std::default::Default::default()
10307    }
10308
10309    /// Sets the value of [trust_config][crate::model::TlsConfig::trust_config].
10310    pub fn set_trust_config<T>(mut self, v: T) -> Self
10311    where
10312        T: std::convert::Into<crate::model::TrustConfig>,
10313    {
10314        self.trust_config = std::option::Option::Some(v.into());
10315        self
10316    }
10317
10318    /// Sets or clears the value of [trust_config][crate::model::TlsConfig::trust_config].
10319    pub fn set_or_clear_trust_config<T>(mut self, v: std::option::Option<T>) -> Self
10320    where
10321        T: std::convert::Into<crate::model::TrustConfig>,
10322    {
10323        self.trust_config = v.map(|x| x.into());
10324        self
10325    }
10326
10327    /// Sets the value of [ssl_principal_mapping_rules][crate::model::TlsConfig::ssl_principal_mapping_rules].
10328    pub fn set_ssl_principal_mapping_rules<T: std::convert::Into<std::string::String>>(
10329        mut self,
10330        v: T,
10331    ) -> Self {
10332        self.ssl_principal_mapping_rules = v.into();
10333        self
10334    }
10335}
10336
10337impl wkt::message::Message for TlsConfig {
10338    fn typename() -> &'static str {
10339        "type.googleapis.com/google.cloud.managedkafka.v1.TlsConfig"
10340    }
10341}
10342
10343#[doc(hidden)]
10344impl<'de> serde::de::Deserialize<'de> for TlsConfig {
10345    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10346    where
10347        D: serde::Deserializer<'de>,
10348    {
10349        #[allow(non_camel_case_types)]
10350        #[doc(hidden)]
10351        #[derive(PartialEq, Eq, Hash)]
10352        enum __FieldTag {
10353            __trust_config,
10354            __ssl_principal_mapping_rules,
10355            Unknown(std::string::String),
10356        }
10357        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10358            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10359            where
10360                D: serde::Deserializer<'de>,
10361            {
10362                struct Visitor;
10363                impl<'de> serde::de::Visitor<'de> for Visitor {
10364                    type Value = __FieldTag;
10365                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10366                        formatter.write_str("a field name for TlsConfig")
10367                    }
10368                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10369                    where
10370                        E: serde::de::Error,
10371                    {
10372                        use std::result::Result::Ok;
10373                        use std::string::ToString;
10374                        match value {
10375                            "trustConfig" => Ok(__FieldTag::__trust_config),
10376                            "trust_config" => Ok(__FieldTag::__trust_config),
10377                            "sslPrincipalMappingRules" => {
10378                                Ok(__FieldTag::__ssl_principal_mapping_rules)
10379                            }
10380                            "ssl_principal_mapping_rules" => {
10381                                Ok(__FieldTag::__ssl_principal_mapping_rules)
10382                            }
10383                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10384                        }
10385                    }
10386                }
10387                deserializer.deserialize_identifier(Visitor)
10388            }
10389        }
10390        struct Visitor;
10391        impl<'de> serde::de::Visitor<'de> for Visitor {
10392            type Value = TlsConfig;
10393            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10394                formatter.write_str("struct TlsConfig")
10395            }
10396            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10397            where
10398                A: serde::de::MapAccess<'de>,
10399            {
10400                #[allow(unused_imports)]
10401                use serde::de::Error;
10402                use std::option::Option::Some;
10403                let mut fields = std::collections::HashSet::new();
10404                let mut result = Self::Value::new();
10405                while let Some(tag) = map.next_key::<__FieldTag>()? {
10406                    #[allow(clippy::match_single_binding)]
10407                    match tag {
10408                        __FieldTag::__trust_config => {
10409                            if !fields.insert(__FieldTag::__trust_config) {
10410                                return std::result::Result::Err(A::Error::duplicate_field(
10411                                    "multiple values for trust_config",
10412                                ));
10413                            }
10414                            result.trust_config =
10415                                map.next_value::<std::option::Option<crate::model::TrustConfig>>()?;
10416                        }
10417                        __FieldTag::__ssl_principal_mapping_rules => {
10418                            if !fields.insert(__FieldTag::__ssl_principal_mapping_rules) {
10419                                return std::result::Result::Err(A::Error::duplicate_field(
10420                                    "multiple values for ssl_principal_mapping_rules",
10421                                ));
10422                            }
10423                            result.ssl_principal_mapping_rules = map
10424                                .next_value::<std::option::Option<std::string::String>>()?
10425                                .unwrap_or_default();
10426                        }
10427                        __FieldTag::Unknown(key) => {
10428                            let value = map.next_value::<serde_json::Value>()?;
10429                            result._unknown_fields.insert(key, value);
10430                        }
10431                    }
10432                }
10433                std::result::Result::Ok(result)
10434            }
10435        }
10436        deserializer.deserialize_any(Visitor)
10437    }
10438}
10439
10440#[doc(hidden)]
10441impl serde::ser::Serialize for TlsConfig {
10442    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10443    where
10444        S: serde::ser::Serializer,
10445    {
10446        use serde::ser::SerializeMap;
10447        #[allow(unused_imports)]
10448        use std::option::Option::Some;
10449        let mut state = serializer.serialize_map(std::option::Option::None)?;
10450        if self.trust_config.is_some() {
10451            state.serialize_entry("trustConfig", &self.trust_config)?;
10452        }
10453        if !self.ssl_principal_mapping_rules.is_empty() {
10454            state.serialize_entry(
10455                "sslPrincipalMappingRules",
10456                &self.ssl_principal_mapping_rules,
10457            )?;
10458        }
10459        if !self._unknown_fields.is_empty() {
10460            for (key, value) in self._unknown_fields.iter() {
10461                state.serialize_entry(key, &value)?;
10462            }
10463        }
10464        state.end()
10465    }
10466}
10467
10468impl std::fmt::Debug for TlsConfig {
10469    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10470        let mut debug_struct = f.debug_struct("TlsConfig");
10471        debug_struct.field("trust_config", &self.trust_config);
10472        debug_struct.field(
10473            "ssl_principal_mapping_rules",
10474            &self.ssl_principal_mapping_rules,
10475        );
10476        if !self._unknown_fields.is_empty() {
10477            debug_struct.field("_unknown_fields", &self._unknown_fields);
10478        }
10479        debug_struct.finish()
10480    }
10481}
10482
10483/// Sources of CA certificates to install in the broker's truststore.
10484#[derive(Clone, Default, PartialEq)]
10485#[non_exhaustive]
10486pub struct TrustConfig {
10487    /// Optional. Configuration for the Google Certificate Authority Service.
10488    /// Maximum 10.
10489    pub cas_configs: std::vec::Vec<crate::model::trust_config::CertificateAuthorityServiceConfig>,
10490
10491    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10492}
10493
10494impl TrustConfig {
10495    pub fn new() -> Self {
10496        std::default::Default::default()
10497    }
10498
10499    /// Sets the value of [cas_configs][crate::model::TrustConfig::cas_configs].
10500    pub fn set_cas_configs<T, V>(mut self, v: T) -> Self
10501    where
10502        T: std::iter::IntoIterator<Item = V>,
10503        V: std::convert::Into<crate::model::trust_config::CertificateAuthorityServiceConfig>,
10504    {
10505        use std::iter::Iterator;
10506        self.cas_configs = v.into_iter().map(|i| i.into()).collect();
10507        self
10508    }
10509}
10510
10511impl wkt::message::Message for TrustConfig {
10512    fn typename() -> &'static str {
10513        "type.googleapis.com/google.cloud.managedkafka.v1.TrustConfig"
10514    }
10515}
10516
10517#[doc(hidden)]
10518impl<'de> serde::de::Deserialize<'de> for TrustConfig {
10519    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10520    where
10521        D: serde::Deserializer<'de>,
10522    {
10523        #[allow(non_camel_case_types)]
10524        #[doc(hidden)]
10525        #[derive(PartialEq, Eq, Hash)]
10526        enum __FieldTag {
10527            __cas_configs,
10528            Unknown(std::string::String),
10529        }
10530        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10531            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10532            where
10533                D: serde::Deserializer<'de>,
10534            {
10535                struct Visitor;
10536                impl<'de> serde::de::Visitor<'de> for Visitor {
10537                    type Value = __FieldTag;
10538                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10539                        formatter.write_str("a field name for TrustConfig")
10540                    }
10541                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10542                    where
10543                        E: serde::de::Error,
10544                    {
10545                        use std::result::Result::Ok;
10546                        use std::string::ToString;
10547                        match value {
10548                            "casConfigs" => Ok(__FieldTag::__cas_configs),
10549                            "cas_configs" => Ok(__FieldTag::__cas_configs),
10550                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10551                        }
10552                    }
10553                }
10554                deserializer.deserialize_identifier(Visitor)
10555            }
10556        }
10557        struct Visitor;
10558        impl<'de> serde::de::Visitor<'de> for Visitor {
10559            type Value = TrustConfig;
10560            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10561                formatter.write_str("struct TrustConfig")
10562            }
10563            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10564            where
10565                A: serde::de::MapAccess<'de>,
10566            {
10567                #[allow(unused_imports)]
10568                use serde::de::Error;
10569                use std::option::Option::Some;
10570                let mut fields = std::collections::HashSet::new();
10571                let mut result = Self::Value::new();
10572                while let Some(tag) = map.next_key::<__FieldTag>()? {
10573                    #[allow(clippy::match_single_binding)]
10574                    match tag {
10575                        __FieldTag::__cas_configs => {
10576                            if !fields.insert(__FieldTag::__cas_configs) {
10577                                return std::result::Result::Err(A::Error::duplicate_field(
10578                                    "multiple values for cas_configs",
10579                                ));
10580                            }
10581                            result.cas_configs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::trust_config::CertificateAuthorityServiceConfig>>>()?.unwrap_or_default();
10582                        }
10583                        __FieldTag::Unknown(key) => {
10584                            let value = map.next_value::<serde_json::Value>()?;
10585                            result._unknown_fields.insert(key, value);
10586                        }
10587                    }
10588                }
10589                std::result::Result::Ok(result)
10590            }
10591        }
10592        deserializer.deserialize_any(Visitor)
10593    }
10594}
10595
10596#[doc(hidden)]
10597impl serde::ser::Serialize for TrustConfig {
10598    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10599    where
10600        S: serde::ser::Serializer,
10601    {
10602        use serde::ser::SerializeMap;
10603        #[allow(unused_imports)]
10604        use std::option::Option::Some;
10605        let mut state = serializer.serialize_map(std::option::Option::None)?;
10606        if !self.cas_configs.is_empty() {
10607            state.serialize_entry("casConfigs", &self.cas_configs)?;
10608        }
10609        if !self._unknown_fields.is_empty() {
10610            for (key, value) in self._unknown_fields.iter() {
10611                state.serialize_entry(key, &value)?;
10612            }
10613        }
10614        state.end()
10615    }
10616}
10617
10618impl std::fmt::Debug for TrustConfig {
10619    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10620        let mut debug_struct = f.debug_struct("TrustConfig");
10621        debug_struct.field("cas_configs", &self.cas_configs);
10622        if !self._unknown_fields.is_empty() {
10623            debug_struct.field("_unknown_fields", &self._unknown_fields);
10624        }
10625        debug_struct.finish()
10626    }
10627}
10628
10629/// Defines additional types related to [TrustConfig].
10630pub mod trust_config {
10631    #[allow(unused_imports)]
10632    use super::*;
10633
10634    /// A configuration for the Google Certificate Authority Service.
10635    #[derive(Clone, Default, PartialEq)]
10636    #[non_exhaustive]
10637    pub struct CertificateAuthorityServiceConfig {
10638        /// Required. The name of the CA pool to pull CA certificates from.
10639        /// Structured like:
10640        /// projects/{project}/locations/{location}/caPools/{ca_pool}.
10641        /// The CA pool does not need to be in the same project or location as the
10642        /// Kafka cluster.
10643        pub ca_pool: std::string::String,
10644
10645        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10646    }
10647
10648    impl CertificateAuthorityServiceConfig {
10649        pub fn new() -> Self {
10650            std::default::Default::default()
10651        }
10652
10653        /// Sets the value of [ca_pool][crate::model::trust_config::CertificateAuthorityServiceConfig::ca_pool].
10654        pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10655            self.ca_pool = v.into();
10656            self
10657        }
10658    }
10659
10660    impl wkt::message::Message for CertificateAuthorityServiceConfig {
10661        fn typename() -> &'static str {
10662            "type.googleapis.com/google.cloud.managedkafka.v1.TrustConfig.CertificateAuthorityServiceConfig"
10663        }
10664    }
10665
10666    #[doc(hidden)]
10667    impl<'de> serde::de::Deserialize<'de> for CertificateAuthorityServiceConfig {
10668        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10669        where
10670            D: serde::Deserializer<'de>,
10671        {
10672            #[allow(non_camel_case_types)]
10673            #[doc(hidden)]
10674            #[derive(PartialEq, Eq, Hash)]
10675            enum __FieldTag {
10676                __ca_pool,
10677                Unknown(std::string::String),
10678            }
10679            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10680                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10681                where
10682                    D: serde::Deserializer<'de>,
10683                {
10684                    struct Visitor;
10685                    impl<'de> serde::de::Visitor<'de> for Visitor {
10686                        type Value = __FieldTag;
10687                        fn expecting(
10688                            &self,
10689                            formatter: &mut std::fmt::Formatter,
10690                        ) -> std::fmt::Result {
10691                            formatter
10692                                .write_str("a field name for CertificateAuthorityServiceConfig")
10693                        }
10694                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10695                        where
10696                            E: serde::de::Error,
10697                        {
10698                            use std::result::Result::Ok;
10699                            use std::string::ToString;
10700                            match value {
10701                                "caPool" => Ok(__FieldTag::__ca_pool),
10702                                "ca_pool" => Ok(__FieldTag::__ca_pool),
10703                                _ => Ok(__FieldTag::Unknown(value.to_string())),
10704                            }
10705                        }
10706                    }
10707                    deserializer.deserialize_identifier(Visitor)
10708                }
10709            }
10710            struct Visitor;
10711            impl<'de> serde::de::Visitor<'de> for Visitor {
10712                type Value = CertificateAuthorityServiceConfig;
10713                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10714                    formatter.write_str("struct CertificateAuthorityServiceConfig")
10715                }
10716                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10717                where
10718                    A: serde::de::MapAccess<'de>,
10719                {
10720                    #[allow(unused_imports)]
10721                    use serde::de::Error;
10722                    use std::option::Option::Some;
10723                    let mut fields = std::collections::HashSet::new();
10724                    let mut result = Self::Value::new();
10725                    while let Some(tag) = map.next_key::<__FieldTag>()? {
10726                        #[allow(clippy::match_single_binding)]
10727                        match tag {
10728                            __FieldTag::__ca_pool => {
10729                                if !fields.insert(__FieldTag::__ca_pool) {
10730                                    return std::result::Result::Err(A::Error::duplicate_field(
10731                                        "multiple values for ca_pool",
10732                                    ));
10733                                }
10734                                result.ca_pool = map
10735                                    .next_value::<std::option::Option<std::string::String>>()?
10736                                    .unwrap_or_default();
10737                            }
10738                            __FieldTag::Unknown(key) => {
10739                                let value = map.next_value::<serde_json::Value>()?;
10740                                result._unknown_fields.insert(key, value);
10741                            }
10742                        }
10743                    }
10744                    std::result::Result::Ok(result)
10745                }
10746            }
10747            deserializer.deserialize_any(Visitor)
10748        }
10749    }
10750
10751    #[doc(hidden)]
10752    impl serde::ser::Serialize for CertificateAuthorityServiceConfig {
10753        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10754        where
10755            S: serde::ser::Serializer,
10756        {
10757            use serde::ser::SerializeMap;
10758            #[allow(unused_imports)]
10759            use std::option::Option::Some;
10760            let mut state = serializer.serialize_map(std::option::Option::None)?;
10761            if !self.ca_pool.is_empty() {
10762                state.serialize_entry("caPool", &self.ca_pool)?;
10763            }
10764            if !self._unknown_fields.is_empty() {
10765                for (key, value) in self._unknown_fields.iter() {
10766                    state.serialize_entry(key, &value)?;
10767                }
10768            }
10769            state.end()
10770        }
10771    }
10772
10773    impl std::fmt::Debug for CertificateAuthorityServiceConfig {
10774        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10775            let mut debug_struct = f.debug_struct("CertificateAuthorityServiceConfig");
10776            debug_struct.field("ca_pool", &self.ca_pool);
10777            if !self._unknown_fields.is_empty() {
10778                debug_struct.field("_unknown_fields", &self._unknown_fields);
10779            }
10780            debug_struct.finish()
10781        }
10782    }
10783}
10784
10785/// A Kafka topic in a given cluster.
10786#[derive(Clone, Default, PartialEq)]
10787#[non_exhaustive]
10788pub struct Topic {
10789    /// Identifier. The name of the topic. The `topic` segment is used when
10790    /// connecting directly to the cluster. Structured like:
10791    /// projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
10792    pub name: std::string::String,
10793
10794    /// Required. The number of partitions this topic has. The partition count can
10795    /// only be increased, not decreased. Please note that if partitions are
10796    /// increased for a topic that has a key, the partitioning logic or the
10797    /// ordering of the messages will be affected.
10798    pub partition_count: i32,
10799
10800    /// Required. Immutable. The number of replicas of each partition. A
10801    /// replication factor of 3 is recommended for high availability.
10802    pub replication_factor: i32,
10803
10804    /// Optional. Configurations for the topic that are overridden from the cluster
10805    /// defaults. The key of the map is a Kafka topic property name, for example:
10806    /// `cleanup.policy`, `compression.type`.
10807    pub configs: std::collections::HashMap<std::string::String, std::string::String>,
10808
10809    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10810}
10811
10812impl Topic {
10813    pub fn new() -> Self {
10814        std::default::Default::default()
10815    }
10816
10817    /// Sets the value of [name][crate::model::Topic::name].
10818    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10819        self.name = v.into();
10820        self
10821    }
10822
10823    /// Sets the value of [partition_count][crate::model::Topic::partition_count].
10824    pub fn set_partition_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10825        self.partition_count = v.into();
10826        self
10827    }
10828
10829    /// Sets the value of [replication_factor][crate::model::Topic::replication_factor].
10830    pub fn set_replication_factor<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10831        self.replication_factor = v.into();
10832        self
10833    }
10834
10835    /// Sets the value of [configs][crate::model::Topic::configs].
10836    pub fn set_configs<T, K, V>(mut self, v: T) -> Self
10837    where
10838        T: std::iter::IntoIterator<Item = (K, V)>,
10839        K: std::convert::Into<std::string::String>,
10840        V: std::convert::Into<std::string::String>,
10841    {
10842        use std::iter::Iterator;
10843        self.configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10844        self
10845    }
10846}
10847
10848impl wkt::message::Message for Topic {
10849    fn typename() -> &'static str {
10850        "type.googleapis.com/google.cloud.managedkafka.v1.Topic"
10851    }
10852}
10853
10854#[doc(hidden)]
10855impl<'de> serde::de::Deserialize<'de> for Topic {
10856    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10857    where
10858        D: serde::Deserializer<'de>,
10859    {
10860        #[allow(non_camel_case_types)]
10861        #[doc(hidden)]
10862        #[derive(PartialEq, Eq, Hash)]
10863        enum __FieldTag {
10864            __name,
10865            __partition_count,
10866            __replication_factor,
10867            __configs,
10868            Unknown(std::string::String),
10869        }
10870        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10871            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10872            where
10873                D: serde::Deserializer<'de>,
10874            {
10875                struct Visitor;
10876                impl<'de> serde::de::Visitor<'de> for Visitor {
10877                    type Value = __FieldTag;
10878                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10879                        formatter.write_str("a field name for Topic")
10880                    }
10881                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10882                    where
10883                        E: serde::de::Error,
10884                    {
10885                        use std::result::Result::Ok;
10886                        use std::string::ToString;
10887                        match value {
10888                            "name" => Ok(__FieldTag::__name),
10889                            "partitionCount" => Ok(__FieldTag::__partition_count),
10890                            "partition_count" => Ok(__FieldTag::__partition_count),
10891                            "replicationFactor" => Ok(__FieldTag::__replication_factor),
10892                            "replication_factor" => Ok(__FieldTag::__replication_factor),
10893                            "configs" => Ok(__FieldTag::__configs),
10894                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10895                        }
10896                    }
10897                }
10898                deserializer.deserialize_identifier(Visitor)
10899            }
10900        }
10901        struct Visitor;
10902        impl<'de> serde::de::Visitor<'de> for Visitor {
10903            type Value = Topic;
10904            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10905                formatter.write_str("struct Topic")
10906            }
10907            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10908            where
10909                A: serde::de::MapAccess<'de>,
10910            {
10911                #[allow(unused_imports)]
10912                use serde::de::Error;
10913                use std::option::Option::Some;
10914                let mut fields = std::collections::HashSet::new();
10915                let mut result = Self::Value::new();
10916                while let Some(tag) = map.next_key::<__FieldTag>()? {
10917                    #[allow(clippy::match_single_binding)]
10918                    match tag {
10919                        __FieldTag::__name => {
10920                            if !fields.insert(__FieldTag::__name) {
10921                                return std::result::Result::Err(A::Error::duplicate_field(
10922                                    "multiple values for name",
10923                                ));
10924                            }
10925                            result.name = map
10926                                .next_value::<std::option::Option<std::string::String>>()?
10927                                .unwrap_or_default();
10928                        }
10929                        __FieldTag::__partition_count => {
10930                            if !fields.insert(__FieldTag::__partition_count) {
10931                                return std::result::Result::Err(A::Error::duplicate_field(
10932                                    "multiple values for partition_count",
10933                                ));
10934                            }
10935                            struct __With(std::option::Option<i32>);
10936                            impl<'de> serde::de::Deserialize<'de> for __With {
10937                                fn deserialize<D>(
10938                                    deserializer: D,
10939                                ) -> std::result::Result<Self, D::Error>
10940                                where
10941                                    D: serde::de::Deserializer<'de>,
10942                                {
10943                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10944                                }
10945                            }
10946                            result.partition_count =
10947                                map.next_value::<__With>()?.0.unwrap_or_default();
10948                        }
10949                        __FieldTag::__replication_factor => {
10950                            if !fields.insert(__FieldTag::__replication_factor) {
10951                                return std::result::Result::Err(A::Error::duplicate_field(
10952                                    "multiple values for replication_factor",
10953                                ));
10954                            }
10955                            struct __With(std::option::Option<i32>);
10956                            impl<'de> serde::de::Deserialize<'de> for __With {
10957                                fn deserialize<D>(
10958                                    deserializer: D,
10959                                ) -> std::result::Result<Self, D::Error>
10960                                where
10961                                    D: serde::de::Deserializer<'de>,
10962                                {
10963                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10964                                }
10965                            }
10966                            result.replication_factor =
10967                                map.next_value::<__With>()?.0.unwrap_or_default();
10968                        }
10969                        __FieldTag::__configs => {
10970                            if !fields.insert(__FieldTag::__configs) {
10971                                return std::result::Result::Err(A::Error::duplicate_field(
10972                                    "multiple values for configs",
10973                                ));
10974                            }
10975                            result.configs = map
10976                                .next_value::<std::option::Option<
10977                                    std::collections::HashMap<
10978                                        std::string::String,
10979                                        std::string::String,
10980                                    >,
10981                                >>()?
10982                                .unwrap_or_default();
10983                        }
10984                        __FieldTag::Unknown(key) => {
10985                            let value = map.next_value::<serde_json::Value>()?;
10986                            result._unknown_fields.insert(key, value);
10987                        }
10988                    }
10989                }
10990                std::result::Result::Ok(result)
10991            }
10992        }
10993        deserializer.deserialize_any(Visitor)
10994    }
10995}
10996
10997#[doc(hidden)]
10998impl serde::ser::Serialize for Topic {
10999    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11000    where
11001        S: serde::ser::Serializer,
11002    {
11003        use serde::ser::SerializeMap;
11004        #[allow(unused_imports)]
11005        use std::option::Option::Some;
11006        let mut state = serializer.serialize_map(std::option::Option::None)?;
11007        if !self.name.is_empty() {
11008            state.serialize_entry("name", &self.name)?;
11009        }
11010        if !wkt::internal::is_default(&self.partition_count) {
11011            struct __With<'a>(&'a i32);
11012            impl<'a> serde::ser::Serialize for __With<'a> {
11013                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11014                where
11015                    S: serde::ser::Serializer,
11016                {
11017                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11018                }
11019            }
11020            state.serialize_entry("partitionCount", &__With(&self.partition_count))?;
11021        }
11022        if !wkt::internal::is_default(&self.replication_factor) {
11023            struct __With<'a>(&'a i32);
11024            impl<'a> serde::ser::Serialize for __With<'a> {
11025                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11026                where
11027                    S: serde::ser::Serializer,
11028                {
11029                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11030                }
11031            }
11032            state.serialize_entry("replicationFactor", &__With(&self.replication_factor))?;
11033        }
11034        if !self.configs.is_empty() {
11035            state.serialize_entry("configs", &self.configs)?;
11036        }
11037        if !self._unknown_fields.is_empty() {
11038            for (key, value) in self._unknown_fields.iter() {
11039                state.serialize_entry(key, &value)?;
11040            }
11041        }
11042        state.end()
11043    }
11044}
11045
11046impl std::fmt::Debug for Topic {
11047    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11048        let mut debug_struct = f.debug_struct("Topic");
11049        debug_struct.field("name", &self.name);
11050        debug_struct.field("partition_count", &self.partition_count);
11051        debug_struct.field("replication_factor", &self.replication_factor);
11052        debug_struct.field("configs", &self.configs);
11053        if !self._unknown_fields.is_empty() {
11054            debug_struct.field("_unknown_fields", &self._unknown_fields);
11055        }
11056        debug_struct.finish()
11057    }
11058}
11059
11060/// Metadata for a consumer group corresponding to a specific topic.
11061#[derive(Clone, Default, PartialEq)]
11062#[non_exhaustive]
11063pub struct ConsumerTopicMetadata {
11064    /// Optional. Metadata for this consumer group and topic for all partition
11065    /// indexes it has metadata for.
11066    pub partitions: std::collections::HashMap<i32, crate::model::ConsumerPartitionMetadata>,
11067
11068    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11069}
11070
11071impl ConsumerTopicMetadata {
11072    pub fn new() -> Self {
11073        std::default::Default::default()
11074    }
11075
11076    /// Sets the value of [partitions][crate::model::ConsumerTopicMetadata::partitions].
11077    pub fn set_partitions<T, K, V>(mut self, v: T) -> Self
11078    where
11079        T: std::iter::IntoIterator<Item = (K, V)>,
11080        K: std::convert::Into<i32>,
11081        V: std::convert::Into<crate::model::ConsumerPartitionMetadata>,
11082    {
11083        use std::iter::Iterator;
11084        self.partitions = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11085        self
11086    }
11087}
11088
11089impl wkt::message::Message for ConsumerTopicMetadata {
11090    fn typename() -> &'static str {
11091        "type.googleapis.com/google.cloud.managedkafka.v1.ConsumerTopicMetadata"
11092    }
11093}
11094
11095#[doc(hidden)]
11096impl<'de> serde::de::Deserialize<'de> for ConsumerTopicMetadata {
11097    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11098    where
11099        D: serde::Deserializer<'de>,
11100    {
11101        #[allow(non_camel_case_types)]
11102        #[doc(hidden)]
11103        #[derive(PartialEq, Eq, Hash)]
11104        enum __FieldTag {
11105            __partitions,
11106            Unknown(std::string::String),
11107        }
11108        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11109            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11110            where
11111                D: serde::Deserializer<'de>,
11112            {
11113                struct Visitor;
11114                impl<'de> serde::de::Visitor<'de> for Visitor {
11115                    type Value = __FieldTag;
11116                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11117                        formatter.write_str("a field name for ConsumerTopicMetadata")
11118                    }
11119                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11120                    where
11121                        E: serde::de::Error,
11122                    {
11123                        use std::result::Result::Ok;
11124                        use std::string::ToString;
11125                        match value {
11126                            "partitions" => Ok(__FieldTag::__partitions),
11127                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11128                        }
11129                    }
11130                }
11131                deserializer.deserialize_identifier(Visitor)
11132            }
11133        }
11134        struct Visitor;
11135        impl<'de> serde::de::Visitor<'de> for Visitor {
11136            type Value = ConsumerTopicMetadata;
11137            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11138                formatter.write_str("struct ConsumerTopicMetadata")
11139            }
11140            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11141            where
11142                A: serde::de::MapAccess<'de>,
11143            {
11144                #[allow(unused_imports)]
11145                use serde::de::Error;
11146                use std::option::Option::Some;
11147                let mut fields = std::collections::HashSet::new();
11148                let mut result = Self::Value::new();
11149                while let Some(tag) = map.next_key::<__FieldTag>()? {
11150                    #[allow(clippy::match_single_binding)]
11151                    match tag {
11152                        __FieldTag::__partitions => {
11153                            if !fields.insert(__FieldTag::__partitions) {
11154                                return std::result::Result::Err(A::Error::duplicate_field(
11155                                    "multiple values for partitions",
11156                                ));
11157                            }
11158                            struct __With(
11159                                std::option::Option<
11160                                    std::collections::HashMap<
11161                                        i32,
11162                                        crate::model::ConsumerPartitionMetadata,
11163                                    >,
11164                                >,
11165                            );
11166                            impl<'de> serde::de::Deserialize<'de> for __With {
11167                                fn deserialize<D>(
11168                                    deserializer: D,
11169                                ) -> std::result::Result<Self, D::Error>
11170                                where
11171                                    D: serde::de::Deserializer<'de>,
11172                                {
11173                                    serde_with::As::<
11174                                        std::option::Option<
11175                                            std::collections::HashMap<
11176                                                wkt::internal::I32,
11177                                                serde_with::Same,
11178                                            >,
11179                                        >,
11180                                    >::deserialize(deserializer)
11181                                    .map(__With)
11182                                }
11183                            }
11184                            result.partitions = map.next_value::<__With>()?.0.unwrap_or_default();
11185                        }
11186                        __FieldTag::Unknown(key) => {
11187                            let value = map.next_value::<serde_json::Value>()?;
11188                            result._unknown_fields.insert(key, value);
11189                        }
11190                    }
11191                }
11192                std::result::Result::Ok(result)
11193            }
11194        }
11195        deserializer.deserialize_any(Visitor)
11196    }
11197}
11198
11199#[doc(hidden)]
11200impl serde::ser::Serialize for ConsumerTopicMetadata {
11201    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11202    where
11203        S: serde::ser::Serializer,
11204    {
11205        use serde::ser::SerializeMap;
11206        #[allow(unused_imports)]
11207        use std::option::Option::Some;
11208        let mut state = serializer.serialize_map(std::option::Option::None)?;
11209        if !self.partitions.is_empty() {
11210            struct __With<'a>(
11211                &'a std::collections::HashMap<i32, crate::model::ConsumerPartitionMetadata>,
11212            );
11213            impl<'a> serde::ser::Serialize for __With<'a> {
11214                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11215                where
11216                    S: serde::ser::Serializer,
11217                {
11218                    serde_with::As::< std::collections::HashMap<wkt::internal::I32, serde_with::Same> >::serialize(self.0, serializer)
11219                }
11220            }
11221            state.serialize_entry("partitions", &__With(&self.partitions))?;
11222        }
11223        if !self._unknown_fields.is_empty() {
11224            for (key, value) in self._unknown_fields.iter() {
11225                state.serialize_entry(key, &value)?;
11226            }
11227        }
11228        state.end()
11229    }
11230}
11231
11232impl std::fmt::Debug for ConsumerTopicMetadata {
11233    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11234        let mut debug_struct = f.debug_struct("ConsumerTopicMetadata");
11235        debug_struct.field("partitions", &self.partitions);
11236        if !self._unknown_fields.is_empty() {
11237            debug_struct.field("_unknown_fields", &self._unknown_fields);
11238        }
11239        debug_struct.finish()
11240    }
11241}
11242
11243/// Metadata for a consumer group corresponding to a specific partition.
11244#[derive(Clone, Default, PartialEq)]
11245#[non_exhaustive]
11246pub struct ConsumerPartitionMetadata {
11247    /// Required. The current offset for this partition, or 0 if no offset has been
11248    /// committed.
11249    pub offset: i64,
11250
11251    /// Optional. The associated metadata for this partition, or empty if it does
11252    /// not exist.
11253    pub metadata: std::string::String,
11254
11255    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11256}
11257
11258impl ConsumerPartitionMetadata {
11259    pub fn new() -> Self {
11260        std::default::Default::default()
11261    }
11262
11263    /// Sets the value of [offset][crate::model::ConsumerPartitionMetadata::offset].
11264    pub fn set_offset<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11265        self.offset = v.into();
11266        self
11267    }
11268
11269    /// Sets the value of [metadata][crate::model::ConsumerPartitionMetadata::metadata].
11270    pub fn set_metadata<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11271        self.metadata = v.into();
11272        self
11273    }
11274}
11275
11276impl wkt::message::Message for ConsumerPartitionMetadata {
11277    fn typename() -> &'static str {
11278        "type.googleapis.com/google.cloud.managedkafka.v1.ConsumerPartitionMetadata"
11279    }
11280}
11281
11282#[doc(hidden)]
11283impl<'de> serde::de::Deserialize<'de> for ConsumerPartitionMetadata {
11284    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11285    where
11286        D: serde::Deserializer<'de>,
11287    {
11288        #[allow(non_camel_case_types)]
11289        #[doc(hidden)]
11290        #[derive(PartialEq, Eq, Hash)]
11291        enum __FieldTag {
11292            __offset,
11293            __metadata,
11294            Unknown(std::string::String),
11295        }
11296        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11297            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11298            where
11299                D: serde::Deserializer<'de>,
11300            {
11301                struct Visitor;
11302                impl<'de> serde::de::Visitor<'de> for Visitor {
11303                    type Value = __FieldTag;
11304                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11305                        formatter.write_str("a field name for ConsumerPartitionMetadata")
11306                    }
11307                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11308                    where
11309                        E: serde::de::Error,
11310                    {
11311                        use std::result::Result::Ok;
11312                        use std::string::ToString;
11313                        match value {
11314                            "offset" => Ok(__FieldTag::__offset),
11315                            "metadata" => Ok(__FieldTag::__metadata),
11316                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11317                        }
11318                    }
11319                }
11320                deserializer.deserialize_identifier(Visitor)
11321            }
11322        }
11323        struct Visitor;
11324        impl<'de> serde::de::Visitor<'de> for Visitor {
11325            type Value = ConsumerPartitionMetadata;
11326            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11327                formatter.write_str("struct ConsumerPartitionMetadata")
11328            }
11329            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11330            where
11331                A: serde::de::MapAccess<'de>,
11332            {
11333                #[allow(unused_imports)]
11334                use serde::de::Error;
11335                use std::option::Option::Some;
11336                let mut fields = std::collections::HashSet::new();
11337                let mut result = Self::Value::new();
11338                while let Some(tag) = map.next_key::<__FieldTag>()? {
11339                    #[allow(clippy::match_single_binding)]
11340                    match tag {
11341                        __FieldTag::__offset => {
11342                            if !fields.insert(__FieldTag::__offset) {
11343                                return std::result::Result::Err(A::Error::duplicate_field(
11344                                    "multiple values for offset",
11345                                ));
11346                            }
11347                            struct __With(std::option::Option<i64>);
11348                            impl<'de> serde::de::Deserialize<'de> for __With {
11349                                fn deserialize<D>(
11350                                    deserializer: D,
11351                                ) -> std::result::Result<Self, D::Error>
11352                                where
11353                                    D: serde::de::Deserializer<'de>,
11354                                {
11355                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
11356                                }
11357                            }
11358                            result.offset = map.next_value::<__With>()?.0.unwrap_or_default();
11359                        }
11360                        __FieldTag::__metadata => {
11361                            if !fields.insert(__FieldTag::__metadata) {
11362                                return std::result::Result::Err(A::Error::duplicate_field(
11363                                    "multiple values for metadata",
11364                                ));
11365                            }
11366                            result.metadata = map
11367                                .next_value::<std::option::Option<std::string::String>>()?
11368                                .unwrap_or_default();
11369                        }
11370                        __FieldTag::Unknown(key) => {
11371                            let value = map.next_value::<serde_json::Value>()?;
11372                            result._unknown_fields.insert(key, value);
11373                        }
11374                    }
11375                }
11376                std::result::Result::Ok(result)
11377            }
11378        }
11379        deserializer.deserialize_any(Visitor)
11380    }
11381}
11382
11383#[doc(hidden)]
11384impl serde::ser::Serialize for ConsumerPartitionMetadata {
11385    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11386    where
11387        S: serde::ser::Serializer,
11388    {
11389        use serde::ser::SerializeMap;
11390        #[allow(unused_imports)]
11391        use std::option::Option::Some;
11392        let mut state = serializer.serialize_map(std::option::Option::None)?;
11393        if !wkt::internal::is_default(&self.offset) {
11394            struct __With<'a>(&'a i64);
11395            impl<'a> serde::ser::Serialize for __With<'a> {
11396                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11397                where
11398                    S: serde::ser::Serializer,
11399                {
11400                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
11401                }
11402            }
11403            state.serialize_entry("offset", &__With(&self.offset))?;
11404        }
11405        if !self.metadata.is_empty() {
11406            state.serialize_entry("metadata", &self.metadata)?;
11407        }
11408        if !self._unknown_fields.is_empty() {
11409            for (key, value) in self._unknown_fields.iter() {
11410                state.serialize_entry(key, &value)?;
11411            }
11412        }
11413        state.end()
11414    }
11415}
11416
11417impl std::fmt::Debug for ConsumerPartitionMetadata {
11418    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11419        let mut debug_struct = f.debug_struct("ConsumerPartitionMetadata");
11420        debug_struct.field("offset", &self.offset);
11421        debug_struct.field("metadata", &self.metadata);
11422        if !self._unknown_fields.is_empty() {
11423            debug_struct.field("_unknown_fields", &self._unknown_fields);
11424        }
11425        debug_struct.finish()
11426    }
11427}
11428
11429/// A Kafka consumer group in a given cluster.
11430#[derive(Clone, Default, PartialEq)]
11431#[non_exhaustive]
11432pub struct ConsumerGroup {
11433    /// Identifier. The name of the consumer group. The `consumer_group` segment is
11434    /// used when connecting directly to the cluster. Structured like:
11435    /// projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group}
11436    pub name: std::string::String,
11437
11438    /// Optional. Metadata for this consumer group for all topics it has metadata
11439    /// for. The key of the map is a topic name, structured like:
11440    /// projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
11441    pub topics: std::collections::HashMap<std::string::String, crate::model::ConsumerTopicMetadata>,
11442
11443    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11444}
11445
11446impl ConsumerGroup {
11447    pub fn new() -> Self {
11448        std::default::Default::default()
11449    }
11450
11451    /// Sets the value of [name][crate::model::ConsumerGroup::name].
11452    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11453        self.name = v.into();
11454        self
11455    }
11456
11457    /// Sets the value of [topics][crate::model::ConsumerGroup::topics].
11458    pub fn set_topics<T, K, V>(mut self, v: T) -> Self
11459    where
11460        T: std::iter::IntoIterator<Item = (K, V)>,
11461        K: std::convert::Into<std::string::String>,
11462        V: std::convert::Into<crate::model::ConsumerTopicMetadata>,
11463    {
11464        use std::iter::Iterator;
11465        self.topics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11466        self
11467    }
11468}
11469
11470impl wkt::message::Message for ConsumerGroup {
11471    fn typename() -> &'static str {
11472        "type.googleapis.com/google.cloud.managedkafka.v1.ConsumerGroup"
11473    }
11474}
11475
11476#[doc(hidden)]
11477impl<'de> serde::de::Deserialize<'de> for ConsumerGroup {
11478    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11479    where
11480        D: serde::Deserializer<'de>,
11481    {
11482        #[allow(non_camel_case_types)]
11483        #[doc(hidden)]
11484        #[derive(PartialEq, Eq, Hash)]
11485        enum __FieldTag {
11486            __name,
11487            __topics,
11488            Unknown(std::string::String),
11489        }
11490        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11491            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11492            where
11493                D: serde::Deserializer<'de>,
11494            {
11495                struct Visitor;
11496                impl<'de> serde::de::Visitor<'de> for Visitor {
11497                    type Value = __FieldTag;
11498                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11499                        formatter.write_str("a field name for ConsumerGroup")
11500                    }
11501                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11502                    where
11503                        E: serde::de::Error,
11504                    {
11505                        use std::result::Result::Ok;
11506                        use std::string::ToString;
11507                        match value {
11508                            "name" => Ok(__FieldTag::__name),
11509                            "topics" => Ok(__FieldTag::__topics),
11510                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11511                        }
11512                    }
11513                }
11514                deserializer.deserialize_identifier(Visitor)
11515            }
11516        }
11517        struct Visitor;
11518        impl<'de> serde::de::Visitor<'de> for Visitor {
11519            type Value = ConsumerGroup;
11520            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11521                formatter.write_str("struct ConsumerGroup")
11522            }
11523            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11524            where
11525                A: serde::de::MapAccess<'de>,
11526            {
11527                #[allow(unused_imports)]
11528                use serde::de::Error;
11529                use std::option::Option::Some;
11530                let mut fields = std::collections::HashSet::new();
11531                let mut result = Self::Value::new();
11532                while let Some(tag) = map.next_key::<__FieldTag>()? {
11533                    #[allow(clippy::match_single_binding)]
11534                    match tag {
11535                        __FieldTag::__name => {
11536                            if !fields.insert(__FieldTag::__name) {
11537                                return std::result::Result::Err(A::Error::duplicate_field(
11538                                    "multiple values for name",
11539                                ));
11540                            }
11541                            result.name = map
11542                                .next_value::<std::option::Option<std::string::String>>()?
11543                                .unwrap_or_default();
11544                        }
11545                        __FieldTag::__topics => {
11546                            if !fields.insert(__FieldTag::__topics) {
11547                                return std::result::Result::Err(A::Error::duplicate_field(
11548                                    "multiple values for topics",
11549                                ));
11550                            }
11551                            result.topics = map
11552                                .next_value::<std::option::Option<
11553                                    std::collections::HashMap<
11554                                        std::string::String,
11555                                        crate::model::ConsumerTopicMetadata,
11556                                    >,
11557                                >>()?
11558                                .unwrap_or_default();
11559                        }
11560                        __FieldTag::Unknown(key) => {
11561                            let value = map.next_value::<serde_json::Value>()?;
11562                            result._unknown_fields.insert(key, value);
11563                        }
11564                    }
11565                }
11566                std::result::Result::Ok(result)
11567            }
11568        }
11569        deserializer.deserialize_any(Visitor)
11570    }
11571}
11572
11573#[doc(hidden)]
11574impl serde::ser::Serialize for ConsumerGroup {
11575    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11576    where
11577        S: serde::ser::Serializer,
11578    {
11579        use serde::ser::SerializeMap;
11580        #[allow(unused_imports)]
11581        use std::option::Option::Some;
11582        let mut state = serializer.serialize_map(std::option::Option::None)?;
11583        if !self.name.is_empty() {
11584            state.serialize_entry("name", &self.name)?;
11585        }
11586        if !self.topics.is_empty() {
11587            state.serialize_entry("topics", &self.topics)?;
11588        }
11589        if !self._unknown_fields.is_empty() {
11590            for (key, value) in self._unknown_fields.iter() {
11591                state.serialize_entry(key, &value)?;
11592            }
11593        }
11594        state.end()
11595    }
11596}
11597
11598impl std::fmt::Debug for ConsumerGroup {
11599    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11600        let mut debug_struct = f.debug_struct("ConsumerGroup");
11601        debug_struct.field("name", &self.name);
11602        debug_struct.field("topics", &self.topics);
11603        if !self._unknown_fields.is_empty() {
11604            debug_struct.field("_unknown_fields", &self._unknown_fields);
11605        }
11606        debug_struct.finish()
11607    }
11608}
11609
11610/// Represents the metadata of the long-running operation.
11611#[derive(Clone, Default, PartialEq)]
11612#[non_exhaustive]
11613pub struct OperationMetadata {
11614    /// Output only. The time the operation was created.
11615    pub create_time: std::option::Option<wkt::Timestamp>,
11616
11617    /// Output only. The time the operation finished running.
11618    pub end_time: std::option::Option<wkt::Timestamp>,
11619
11620    /// Output only. Server-defined resource path for the target of the operation.
11621    pub target: std::string::String,
11622
11623    /// Output only. Name of the verb executed by the operation.
11624    pub verb: std::string::String,
11625
11626    /// Output only. Human-readable status of the operation, if any.
11627    pub status_message: std::string::String,
11628
11629    /// Output only. Identifies whether the user has requested cancellation
11630    /// of the operation. Operations that have been cancelled successfully
11631    /// have [Operation.error][] value with a
11632    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
11633    /// `Code.CANCELLED`.
11634    ///
11635    /// [google.rpc.Status.code]: rpc::model::Status::code
11636    pub requested_cancellation: bool,
11637
11638    /// Output only. API version used to start the operation.
11639    pub api_version: std::string::String,
11640
11641    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11642}
11643
11644impl OperationMetadata {
11645    pub fn new() -> Self {
11646        std::default::Default::default()
11647    }
11648
11649    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
11650    pub fn set_create_time<T>(mut self, v: T) -> Self
11651    where
11652        T: std::convert::Into<wkt::Timestamp>,
11653    {
11654        self.create_time = std::option::Option::Some(v.into());
11655        self
11656    }
11657
11658    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
11659    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11660    where
11661        T: std::convert::Into<wkt::Timestamp>,
11662    {
11663        self.create_time = v.map(|x| x.into());
11664        self
11665    }
11666
11667    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
11668    pub fn set_end_time<T>(mut self, v: T) -> Self
11669    where
11670        T: std::convert::Into<wkt::Timestamp>,
11671    {
11672        self.end_time = std::option::Option::Some(v.into());
11673        self
11674    }
11675
11676    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
11677    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
11678    where
11679        T: std::convert::Into<wkt::Timestamp>,
11680    {
11681        self.end_time = v.map(|x| x.into());
11682        self
11683    }
11684
11685    /// Sets the value of [target][crate::model::OperationMetadata::target].
11686    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11687        self.target = v.into();
11688        self
11689    }
11690
11691    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
11692    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11693        self.verb = v.into();
11694        self
11695    }
11696
11697    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
11698    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11699        self.status_message = v.into();
11700        self
11701    }
11702
11703    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
11704    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11705        self.requested_cancellation = v.into();
11706        self
11707    }
11708
11709    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
11710    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11711        self.api_version = v.into();
11712        self
11713    }
11714}
11715
11716impl wkt::message::Message for OperationMetadata {
11717    fn typename() -> &'static str {
11718        "type.googleapis.com/google.cloud.managedkafka.v1.OperationMetadata"
11719    }
11720}
11721
11722#[doc(hidden)]
11723impl<'de> serde::de::Deserialize<'de> for OperationMetadata {
11724    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11725    where
11726        D: serde::Deserializer<'de>,
11727    {
11728        #[allow(non_camel_case_types)]
11729        #[doc(hidden)]
11730        #[derive(PartialEq, Eq, Hash)]
11731        enum __FieldTag {
11732            __create_time,
11733            __end_time,
11734            __target,
11735            __verb,
11736            __status_message,
11737            __requested_cancellation,
11738            __api_version,
11739            Unknown(std::string::String),
11740        }
11741        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11742            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11743            where
11744                D: serde::Deserializer<'de>,
11745            {
11746                struct Visitor;
11747                impl<'de> serde::de::Visitor<'de> for Visitor {
11748                    type Value = __FieldTag;
11749                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11750                        formatter.write_str("a field name for OperationMetadata")
11751                    }
11752                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11753                    where
11754                        E: serde::de::Error,
11755                    {
11756                        use std::result::Result::Ok;
11757                        use std::string::ToString;
11758                        match value {
11759                            "createTime" => Ok(__FieldTag::__create_time),
11760                            "create_time" => Ok(__FieldTag::__create_time),
11761                            "endTime" => Ok(__FieldTag::__end_time),
11762                            "end_time" => Ok(__FieldTag::__end_time),
11763                            "target" => Ok(__FieldTag::__target),
11764                            "verb" => Ok(__FieldTag::__verb),
11765                            "statusMessage" => Ok(__FieldTag::__status_message),
11766                            "status_message" => Ok(__FieldTag::__status_message),
11767                            "requestedCancellation" => Ok(__FieldTag::__requested_cancellation),
11768                            "requested_cancellation" => Ok(__FieldTag::__requested_cancellation),
11769                            "apiVersion" => Ok(__FieldTag::__api_version),
11770                            "api_version" => Ok(__FieldTag::__api_version),
11771                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11772                        }
11773                    }
11774                }
11775                deserializer.deserialize_identifier(Visitor)
11776            }
11777        }
11778        struct Visitor;
11779        impl<'de> serde::de::Visitor<'de> for Visitor {
11780            type Value = OperationMetadata;
11781            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11782                formatter.write_str("struct OperationMetadata")
11783            }
11784            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11785            where
11786                A: serde::de::MapAccess<'de>,
11787            {
11788                #[allow(unused_imports)]
11789                use serde::de::Error;
11790                use std::option::Option::Some;
11791                let mut fields = std::collections::HashSet::new();
11792                let mut result = Self::Value::new();
11793                while let Some(tag) = map.next_key::<__FieldTag>()? {
11794                    #[allow(clippy::match_single_binding)]
11795                    match tag {
11796                        __FieldTag::__create_time => {
11797                            if !fields.insert(__FieldTag::__create_time) {
11798                                return std::result::Result::Err(A::Error::duplicate_field(
11799                                    "multiple values for create_time",
11800                                ));
11801                            }
11802                            result.create_time =
11803                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
11804                        }
11805                        __FieldTag::__end_time => {
11806                            if !fields.insert(__FieldTag::__end_time) {
11807                                return std::result::Result::Err(A::Error::duplicate_field(
11808                                    "multiple values for end_time",
11809                                ));
11810                            }
11811                            result.end_time =
11812                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
11813                        }
11814                        __FieldTag::__target => {
11815                            if !fields.insert(__FieldTag::__target) {
11816                                return std::result::Result::Err(A::Error::duplicate_field(
11817                                    "multiple values for target",
11818                                ));
11819                            }
11820                            result.target = map
11821                                .next_value::<std::option::Option<std::string::String>>()?
11822                                .unwrap_or_default();
11823                        }
11824                        __FieldTag::__verb => {
11825                            if !fields.insert(__FieldTag::__verb) {
11826                                return std::result::Result::Err(A::Error::duplicate_field(
11827                                    "multiple values for verb",
11828                                ));
11829                            }
11830                            result.verb = map
11831                                .next_value::<std::option::Option<std::string::String>>()?
11832                                .unwrap_or_default();
11833                        }
11834                        __FieldTag::__status_message => {
11835                            if !fields.insert(__FieldTag::__status_message) {
11836                                return std::result::Result::Err(A::Error::duplicate_field(
11837                                    "multiple values for status_message",
11838                                ));
11839                            }
11840                            result.status_message = map
11841                                .next_value::<std::option::Option<std::string::String>>()?
11842                                .unwrap_or_default();
11843                        }
11844                        __FieldTag::__requested_cancellation => {
11845                            if !fields.insert(__FieldTag::__requested_cancellation) {
11846                                return std::result::Result::Err(A::Error::duplicate_field(
11847                                    "multiple values for requested_cancellation",
11848                                ));
11849                            }
11850                            result.requested_cancellation = map
11851                                .next_value::<std::option::Option<bool>>()?
11852                                .unwrap_or_default();
11853                        }
11854                        __FieldTag::__api_version => {
11855                            if !fields.insert(__FieldTag::__api_version) {
11856                                return std::result::Result::Err(A::Error::duplicate_field(
11857                                    "multiple values for api_version",
11858                                ));
11859                            }
11860                            result.api_version = map
11861                                .next_value::<std::option::Option<std::string::String>>()?
11862                                .unwrap_or_default();
11863                        }
11864                        __FieldTag::Unknown(key) => {
11865                            let value = map.next_value::<serde_json::Value>()?;
11866                            result._unknown_fields.insert(key, value);
11867                        }
11868                    }
11869                }
11870                std::result::Result::Ok(result)
11871            }
11872        }
11873        deserializer.deserialize_any(Visitor)
11874    }
11875}
11876
11877#[doc(hidden)]
11878impl serde::ser::Serialize for OperationMetadata {
11879    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11880    where
11881        S: serde::ser::Serializer,
11882    {
11883        use serde::ser::SerializeMap;
11884        #[allow(unused_imports)]
11885        use std::option::Option::Some;
11886        let mut state = serializer.serialize_map(std::option::Option::None)?;
11887        if self.create_time.is_some() {
11888            state.serialize_entry("createTime", &self.create_time)?;
11889        }
11890        if self.end_time.is_some() {
11891            state.serialize_entry("endTime", &self.end_time)?;
11892        }
11893        if !self.target.is_empty() {
11894            state.serialize_entry("target", &self.target)?;
11895        }
11896        if !self.verb.is_empty() {
11897            state.serialize_entry("verb", &self.verb)?;
11898        }
11899        if !self.status_message.is_empty() {
11900            state.serialize_entry("statusMessage", &self.status_message)?;
11901        }
11902        if !wkt::internal::is_default(&self.requested_cancellation) {
11903            state.serialize_entry("requestedCancellation", &self.requested_cancellation)?;
11904        }
11905        if !self.api_version.is_empty() {
11906            state.serialize_entry("apiVersion", &self.api_version)?;
11907        }
11908        if !self._unknown_fields.is_empty() {
11909            for (key, value) in self._unknown_fields.iter() {
11910                state.serialize_entry(key, &value)?;
11911            }
11912        }
11913        state.end()
11914    }
11915}
11916
11917impl std::fmt::Debug for OperationMetadata {
11918    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11919        let mut debug_struct = f.debug_struct("OperationMetadata");
11920        debug_struct.field("create_time", &self.create_time);
11921        debug_struct.field("end_time", &self.end_time);
11922        debug_struct.field("target", &self.target);
11923        debug_struct.field("verb", &self.verb);
11924        debug_struct.field("status_message", &self.status_message);
11925        debug_struct.field("requested_cancellation", &self.requested_cancellation);
11926        debug_struct.field("api_version", &self.api_version);
11927        if !self._unknown_fields.is_empty() {
11928            debug_struct.field("_unknown_fields", &self._unknown_fields);
11929        }
11930        debug_struct.finish()
11931    }
11932}
11933
11934/// An Apache Kafka Connect cluster deployed in a location.
11935#[derive(Clone, Default, PartialEq)]
11936#[non_exhaustive]
11937pub struct ConnectCluster {
11938    /// Identifier. The name of the Kafka Connect cluster. Structured like:
11939    /// projects/{project_number}/locations/{location}/connectClusters/{connect_cluster_id}
11940    pub name: std::string::String,
11941
11942    /// Required. Immutable. The name of the Kafka cluster this Kafka Connect
11943    /// cluster is attached to. Structured like:
11944    /// projects/{project}/locations/{location}/clusters/{cluster}
11945    pub kafka_cluster: std::string::String,
11946
11947    /// Output only. The time when the cluster was created.
11948    pub create_time: std::option::Option<wkt::Timestamp>,
11949
11950    /// Output only. The time when the cluster was last updated.
11951    pub update_time: std::option::Option<wkt::Timestamp>,
11952
11953    /// Optional. Labels as key value pairs.
11954    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11955
11956    /// Required. Capacity configuration for the Kafka Connect cluster.
11957    pub capacity_config: std::option::Option<crate::model::CapacityConfig>,
11958
11959    /// Output only. The current state of the cluster.
11960    pub state: crate::model::connect_cluster::State,
11961
11962    /// Optional. Configurations for the worker that are overridden from the
11963    /// defaults. The key of the map is a Kafka Connect worker property name, for
11964    /// example: `exactly.once.source.support`.
11965    pub config: std::collections::HashMap<std::string::String, std::string::String>,
11966
11967    /// Platform specific configuration properties for a Kafka Connect cluster.
11968    pub platform_config: std::option::Option<crate::model::connect_cluster::PlatformConfig>,
11969
11970    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11971}
11972
11973impl ConnectCluster {
11974    pub fn new() -> Self {
11975        std::default::Default::default()
11976    }
11977
11978    /// Sets the value of [name][crate::model::ConnectCluster::name].
11979    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11980        self.name = v.into();
11981        self
11982    }
11983
11984    /// Sets the value of [kafka_cluster][crate::model::ConnectCluster::kafka_cluster].
11985    pub fn set_kafka_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11986        self.kafka_cluster = v.into();
11987        self
11988    }
11989
11990    /// Sets the value of [create_time][crate::model::ConnectCluster::create_time].
11991    pub fn set_create_time<T>(mut self, v: T) -> Self
11992    where
11993        T: std::convert::Into<wkt::Timestamp>,
11994    {
11995        self.create_time = std::option::Option::Some(v.into());
11996        self
11997    }
11998
11999    /// Sets or clears the value of [create_time][crate::model::ConnectCluster::create_time].
12000    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12001    where
12002        T: std::convert::Into<wkt::Timestamp>,
12003    {
12004        self.create_time = v.map(|x| x.into());
12005        self
12006    }
12007
12008    /// Sets the value of [update_time][crate::model::ConnectCluster::update_time].
12009    pub fn set_update_time<T>(mut self, v: T) -> Self
12010    where
12011        T: std::convert::Into<wkt::Timestamp>,
12012    {
12013        self.update_time = std::option::Option::Some(v.into());
12014        self
12015    }
12016
12017    /// Sets or clears the value of [update_time][crate::model::ConnectCluster::update_time].
12018    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12019    where
12020        T: std::convert::Into<wkt::Timestamp>,
12021    {
12022        self.update_time = v.map(|x| x.into());
12023        self
12024    }
12025
12026    /// Sets the value of [labels][crate::model::ConnectCluster::labels].
12027    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12028    where
12029        T: std::iter::IntoIterator<Item = (K, V)>,
12030        K: std::convert::Into<std::string::String>,
12031        V: std::convert::Into<std::string::String>,
12032    {
12033        use std::iter::Iterator;
12034        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12035        self
12036    }
12037
12038    /// Sets the value of [capacity_config][crate::model::ConnectCluster::capacity_config].
12039    pub fn set_capacity_config<T>(mut self, v: T) -> Self
12040    where
12041        T: std::convert::Into<crate::model::CapacityConfig>,
12042    {
12043        self.capacity_config = std::option::Option::Some(v.into());
12044        self
12045    }
12046
12047    /// Sets or clears the value of [capacity_config][crate::model::ConnectCluster::capacity_config].
12048    pub fn set_or_clear_capacity_config<T>(mut self, v: std::option::Option<T>) -> Self
12049    where
12050        T: std::convert::Into<crate::model::CapacityConfig>,
12051    {
12052        self.capacity_config = v.map(|x| x.into());
12053        self
12054    }
12055
12056    /// Sets the value of [state][crate::model::ConnectCluster::state].
12057    pub fn set_state<T: std::convert::Into<crate::model::connect_cluster::State>>(
12058        mut self,
12059        v: T,
12060    ) -> Self {
12061        self.state = v.into();
12062        self
12063    }
12064
12065    /// Sets the value of [config][crate::model::ConnectCluster::config].
12066    pub fn set_config<T, K, V>(mut self, v: T) -> Self
12067    where
12068        T: std::iter::IntoIterator<Item = (K, V)>,
12069        K: std::convert::Into<std::string::String>,
12070        V: std::convert::Into<std::string::String>,
12071    {
12072        use std::iter::Iterator;
12073        self.config = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12074        self
12075    }
12076
12077    /// Sets the value of [platform_config][crate::model::ConnectCluster::platform_config].
12078    ///
12079    /// Note that all the setters affecting `platform_config` are mutually
12080    /// exclusive.
12081    pub fn set_platform_config<
12082        T: std::convert::Into<std::option::Option<crate::model::connect_cluster::PlatformConfig>>,
12083    >(
12084        mut self,
12085        v: T,
12086    ) -> Self {
12087        self.platform_config = v.into();
12088        self
12089    }
12090
12091    /// The value of [platform_config][crate::model::ConnectCluster::platform_config]
12092    /// if it holds a `GcpConfig`, `None` if the field is not set or
12093    /// holds a different branch.
12094    pub fn gcp_config(
12095        &self,
12096    ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectGcpConfig>> {
12097        #[allow(unreachable_patterns)]
12098        self.platform_config.as_ref().and_then(|v| match v {
12099            crate::model::connect_cluster::PlatformConfig::GcpConfig(v) => {
12100                std::option::Option::Some(v)
12101            }
12102            _ => std::option::Option::None,
12103        })
12104    }
12105
12106    /// Sets the value of [platform_config][crate::model::ConnectCluster::platform_config]
12107    /// to hold a `GcpConfig`.
12108    ///
12109    /// Note that all the setters affecting `platform_config` are
12110    /// mutually exclusive.
12111    pub fn set_gcp_config<
12112        T: std::convert::Into<std::boxed::Box<crate::model::ConnectGcpConfig>>,
12113    >(
12114        mut self,
12115        v: T,
12116    ) -> Self {
12117        self.platform_config = std::option::Option::Some(
12118            crate::model::connect_cluster::PlatformConfig::GcpConfig(v.into()),
12119        );
12120        self
12121    }
12122}
12123
12124impl wkt::message::Message for ConnectCluster {
12125    fn typename() -> &'static str {
12126        "type.googleapis.com/google.cloud.managedkafka.v1.ConnectCluster"
12127    }
12128}
12129
12130#[doc(hidden)]
12131impl<'de> serde::de::Deserialize<'de> for ConnectCluster {
12132    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12133    where
12134        D: serde::Deserializer<'de>,
12135    {
12136        #[allow(non_camel_case_types)]
12137        #[doc(hidden)]
12138        #[derive(PartialEq, Eq, Hash)]
12139        enum __FieldTag {
12140            __gcp_config,
12141            __name,
12142            __kafka_cluster,
12143            __create_time,
12144            __update_time,
12145            __labels,
12146            __capacity_config,
12147            __state,
12148            __config,
12149            Unknown(std::string::String),
12150        }
12151        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12152            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12153            where
12154                D: serde::Deserializer<'de>,
12155            {
12156                struct Visitor;
12157                impl<'de> serde::de::Visitor<'de> for Visitor {
12158                    type Value = __FieldTag;
12159                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12160                        formatter.write_str("a field name for ConnectCluster")
12161                    }
12162                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12163                    where
12164                        E: serde::de::Error,
12165                    {
12166                        use std::result::Result::Ok;
12167                        use std::string::ToString;
12168                        match value {
12169                            "gcpConfig" => Ok(__FieldTag::__gcp_config),
12170                            "gcp_config" => Ok(__FieldTag::__gcp_config),
12171                            "name" => Ok(__FieldTag::__name),
12172                            "kafkaCluster" => Ok(__FieldTag::__kafka_cluster),
12173                            "kafka_cluster" => Ok(__FieldTag::__kafka_cluster),
12174                            "createTime" => Ok(__FieldTag::__create_time),
12175                            "create_time" => Ok(__FieldTag::__create_time),
12176                            "updateTime" => Ok(__FieldTag::__update_time),
12177                            "update_time" => Ok(__FieldTag::__update_time),
12178                            "labels" => Ok(__FieldTag::__labels),
12179                            "capacityConfig" => Ok(__FieldTag::__capacity_config),
12180                            "capacity_config" => Ok(__FieldTag::__capacity_config),
12181                            "state" => Ok(__FieldTag::__state),
12182                            "config" => Ok(__FieldTag::__config),
12183                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12184                        }
12185                    }
12186                }
12187                deserializer.deserialize_identifier(Visitor)
12188            }
12189        }
12190        struct Visitor;
12191        impl<'de> serde::de::Visitor<'de> for Visitor {
12192            type Value = ConnectCluster;
12193            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12194                formatter.write_str("struct ConnectCluster")
12195            }
12196            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12197            where
12198                A: serde::de::MapAccess<'de>,
12199            {
12200                #[allow(unused_imports)]
12201                use serde::de::Error;
12202                use std::option::Option::Some;
12203                let mut fields = std::collections::HashSet::new();
12204                let mut result = Self::Value::new();
12205                while let Some(tag) = map.next_key::<__FieldTag>()? {
12206                    #[allow(clippy::match_single_binding)]
12207                    match tag {
12208                        __FieldTag::__gcp_config => {
12209                            if !fields.insert(__FieldTag::__gcp_config) {
12210                                return std::result::Result::Err(A::Error::duplicate_field(
12211                                    "multiple values for gcp_config",
12212                                ));
12213                            }
12214                            if result.platform_config.is_some() {
12215                                return std::result::Result::Err(A::Error::duplicate_field(
12216                                    "multiple values for `platform_config`, a oneof with full ID .google.cloud.managedkafka.v1.ConnectCluster.gcp_config, latest field was gcpConfig",
12217                                ));
12218                            }
12219                            result.platform_config = std::option::Option::Some(
12220                                crate::model::connect_cluster::PlatformConfig::GcpConfig(
12221                                    map.next_value::<std::option::Option<
12222                                        std::boxed::Box<crate::model::ConnectGcpConfig>,
12223                                    >>()?
12224                                    .unwrap_or_default(),
12225                                ),
12226                            );
12227                        }
12228                        __FieldTag::__name => {
12229                            if !fields.insert(__FieldTag::__name) {
12230                                return std::result::Result::Err(A::Error::duplicate_field(
12231                                    "multiple values for name",
12232                                ));
12233                            }
12234                            result.name = map
12235                                .next_value::<std::option::Option<std::string::String>>()?
12236                                .unwrap_or_default();
12237                        }
12238                        __FieldTag::__kafka_cluster => {
12239                            if !fields.insert(__FieldTag::__kafka_cluster) {
12240                                return std::result::Result::Err(A::Error::duplicate_field(
12241                                    "multiple values for kafka_cluster",
12242                                ));
12243                            }
12244                            result.kafka_cluster = map
12245                                .next_value::<std::option::Option<std::string::String>>()?
12246                                .unwrap_or_default();
12247                        }
12248                        __FieldTag::__create_time => {
12249                            if !fields.insert(__FieldTag::__create_time) {
12250                                return std::result::Result::Err(A::Error::duplicate_field(
12251                                    "multiple values for create_time",
12252                                ));
12253                            }
12254                            result.create_time =
12255                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
12256                        }
12257                        __FieldTag::__update_time => {
12258                            if !fields.insert(__FieldTag::__update_time) {
12259                                return std::result::Result::Err(A::Error::duplicate_field(
12260                                    "multiple values for update_time",
12261                                ));
12262                            }
12263                            result.update_time =
12264                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
12265                        }
12266                        __FieldTag::__labels => {
12267                            if !fields.insert(__FieldTag::__labels) {
12268                                return std::result::Result::Err(A::Error::duplicate_field(
12269                                    "multiple values for labels",
12270                                ));
12271                            }
12272                            result.labels = map
12273                                .next_value::<std::option::Option<
12274                                    std::collections::HashMap<
12275                                        std::string::String,
12276                                        std::string::String,
12277                                    >,
12278                                >>()?
12279                                .unwrap_or_default();
12280                        }
12281                        __FieldTag::__capacity_config => {
12282                            if !fields.insert(__FieldTag::__capacity_config) {
12283                                return std::result::Result::Err(A::Error::duplicate_field(
12284                                    "multiple values for capacity_config",
12285                                ));
12286                            }
12287                            result.capacity_config = map
12288                                .next_value::<std::option::Option<crate::model::CapacityConfig>>(
12289                                )?;
12290                        }
12291                        __FieldTag::__state => {
12292                            if !fields.insert(__FieldTag::__state) {
12293                                return std::result::Result::Err(A::Error::duplicate_field(
12294                                    "multiple values for state",
12295                                ));
12296                            }
12297                            result.state = map.next_value::<std::option::Option<crate::model::connect_cluster::State>>()?.unwrap_or_default();
12298                        }
12299                        __FieldTag::__config => {
12300                            if !fields.insert(__FieldTag::__config) {
12301                                return std::result::Result::Err(A::Error::duplicate_field(
12302                                    "multiple values for config",
12303                                ));
12304                            }
12305                            result.config = map
12306                                .next_value::<std::option::Option<
12307                                    std::collections::HashMap<
12308                                        std::string::String,
12309                                        std::string::String,
12310                                    >,
12311                                >>()?
12312                                .unwrap_or_default();
12313                        }
12314                        __FieldTag::Unknown(key) => {
12315                            let value = map.next_value::<serde_json::Value>()?;
12316                            result._unknown_fields.insert(key, value);
12317                        }
12318                    }
12319                }
12320                std::result::Result::Ok(result)
12321            }
12322        }
12323        deserializer.deserialize_any(Visitor)
12324    }
12325}
12326
12327#[doc(hidden)]
12328impl serde::ser::Serialize for ConnectCluster {
12329    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12330    where
12331        S: serde::ser::Serializer,
12332    {
12333        use serde::ser::SerializeMap;
12334        #[allow(unused_imports)]
12335        use std::option::Option::Some;
12336        let mut state = serializer.serialize_map(std::option::Option::None)?;
12337        if let Some(value) = self.gcp_config() {
12338            state.serialize_entry("gcpConfig", value)?;
12339        }
12340        if !self.name.is_empty() {
12341            state.serialize_entry("name", &self.name)?;
12342        }
12343        if !self.kafka_cluster.is_empty() {
12344            state.serialize_entry("kafkaCluster", &self.kafka_cluster)?;
12345        }
12346        if self.create_time.is_some() {
12347            state.serialize_entry("createTime", &self.create_time)?;
12348        }
12349        if self.update_time.is_some() {
12350            state.serialize_entry("updateTime", &self.update_time)?;
12351        }
12352        if !self.labels.is_empty() {
12353            state.serialize_entry("labels", &self.labels)?;
12354        }
12355        if self.capacity_config.is_some() {
12356            state.serialize_entry("capacityConfig", &self.capacity_config)?;
12357        }
12358        if !wkt::internal::is_default(&self.state) {
12359            state.serialize_entry("state", &self.state)?;
12360        }
12361        if !self.config.is_empty() {
12362            state.serialize_entry("config", &self.config)?;
12363        }
12364        if !self._unknown_fields.is_empty() {
12365            for (key, value) in self._unknown_fields.iter() {
12366                state.serialize_entry(key, &value)?;
12367            }
12368        }
12369        state.end()
12370    }
12371}
12372
12373impl std::fmt::Debug for ConnectCluster {
12374    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12375        let mut debug_struct = f.debug_struct("ConnectCluster");
12376        debug_struct.field("name", &self.name);
12377        debug_struct.field("kafka_cluster", &self.kafka_cluster);
12378        debug_struct.field("create_time", &self.create_time);
12379        debug_struct.field("update_time", &self.update_time);
12380        debug_struct.field("labels", &self.labels);
12381        debug_struct.field("capacity_config", &self.capacity_config);
12382        debug_struct.field("state", &self.state);
12383        debug_struct.field("config", &self.config);
12384        debug_struct.field("platform_config", &self.platform_config);
12385        if !self._unknown_fields.is_empty() {
12386            debug_struct.field("_unknown_fields", &self._unknown_fields);
12387        }
12388        debug_struct.finish()
12389    }
12390}
12391
12392/// Defines additional types related to [ConnectCluster].
12393pub mod connect_cluster {
12394    #[allow(unused_imports)]
12395    use super::*;
12396
12397    /// The state of the cluster.
12398    ///
12399    /// # Working with unknown values
12400    ///
12401    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12402    /// additional enum variants at any time. Adding new variants is not considered
12403    /// a breaking change. Applications should write their code in anticipation of:
12404    ///
12405    /// - New values appearing in future releases of the client library, **and**
12406    /// - New values received dynamically, without application changes.
12407    ///
12408    /// Please consult the [Working with enums] section in the user guide for some
12409    /// guidelines.
12410    ///
12411    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12412    #[derive(Clone, Debug, PartialEq)]
12413    #[non_exhaustive]
12414    pub enum State {
12415        /// A state was not specified.
12416        Unspecified,
12417        /// The cluster is being created.
12418        Creating,
12419        /// The cluster is active.
12420        Active,
12421        /// The cluster is being deleted.
12422        Deleting,
12423        /// If set, the enum was initialized with an unknown value.
12424        ///
12425        /// Applications can examine the value using [State::value] or
12426        /// [State::name].
12427        UnknownValue(state::UnknownValue),
12428    }
12429
12430    #[doc(hidden)]
12431    pub mod state {
12432        #[allow(unused_imports)]
12433        use super::*;
12434        #[derive(Clone, Debug, PartialEq)]
12435        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12436    }
12437
12438    impl State {
12439        /// Gets the enum value.
12440        ///
12441        /// Returns `None` if the enum contains an unknown value deserialized from
12442        /// the string representation of enums.
12443        pub fn value(&self) -> std::option::Option<i32> {
12444            match self {
12445                Self::Unspecified => std::option::Option::Some(0),
12446                Self::Creating => std::option::Option::Some(1),
12447                Self::Active => std::option::Option::Some(2),
12448                Self::Deleting => std::option::Option::Some(3),
12449                Self::UnknownValue(u) => u.0.value(),
12450            }
12451        }
12452
12453        /// Gets the enum value as a string.
12454        ///
12455        /// Returns `None` if the enum contains an unknown value deserialized from
12456        /// the integer representation of enums.
12457        pub fn name(&self) -> std::option::Option<&str> {
12458            match self {
12459                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12460                Self::Creating => std::option::Option::Some("CREATING"),
12461                Self::Active => std::option::Option::Some("ACTIVE"),
12462                Self::Deleting => std::option::Option::Some("DELETING"),
12463                Self::UnknownValue(u) => u.0.name(),
12464            }
12465        }
12466    }
12467
12468    impl std::default::Default for State {
12469        fn default() -> Self {
12470            use std::convert::From;
12471            Self::from(0)
12472        }
12473    }
12474
12475    impl std::fmt::Display for State {
12476        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12477            wkt::internal::display_enum(f, self.name(), self.value())
12478        }
12479    }
12480
12481    impl std::convert::From<i32> for State {
12482        fn from(value: i32) -> Self {
12483            match value {
12484                0 => Self::Unspecified,
12485                1 => Self::Creating,
12486                2 => Self::Active,
12487                3 => Self::Deleting,
12488                _ => Self::UnknownValue(state::UnknownValue(
12489                    wkt::internal::UnknownEnumValue::Integer(value),
12490                )),
12491            }
12492        }
12493    }
12494
12495    impl std::convert::From<&str> for State {
12496        fn from(value: &str) -> Self {
12497            use std::string::ToString;
12498            match value {
12499                "STATE_UNSPECIFIED" => Self::Unspecified,
12500                "CREATING" => Self::Creating,
12501                "ACTIVE" => Self::Active,
12502                "DELETING" => Self::Deleting,
12503                _ => Self::UnknownValue(state::UnknownValue(
12504                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12505                )),
12506            }
12507        }
12508    }
12509
12510    impl serde::ser::Serialize for State {
12511        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12512        where
12513            S: serde::Serializer,
12514        {
12515            match self {
12516                Self::Unspecified => serializer.serialize_i32(0),
12517                Self::Creating => serializer.serialize_i32(1),
12518                Self::Active => serializer.serialize_i32(2),
12519                Self::Deleting => serializer.serialize_i32(3),
12520                Self::UnknownValue(u) => u.0.serialize(serializer),
12521            }
12522        }
12523    }
12524
12525    impl<'de> serde::de::Deserialize<'de> for State {
12526        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12527        where
12528            D: serde::Deserializer<'de>,
12529        {
12530            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12531                ".google.cloud.managedkafka.v1.ConnectCluster.State",
12532            ))
12533        }
12534    }
12535
12536    /// Platform specific configuration properties for a Kafka Connect cluster.
12537    #[derive(Clone, Debug, PartialEq)]
12538    #[non_exhaustive]
12539    pub enum PlatformConfig {
12540        /// Required. Configuration properties for a Kafka Connect cluster deployed
12541        /// to Google Cloud Platform.
12542        GcpConfig(std::boxed::Box<crate::model::ConnectGcpConfig>),
12543    }
12544}
12545
12546/// The configuration of a Virtual Private Cloud (VPC) network that can access
12547/// the Kafka Connect cluster.
12548#[derive(Clone, Default, PartialEq)]
12549#[non_exhaustive]
12550pub struct ConnectNetworkConfig {
12551    /// Required. VPC subnet to make available to the Kafka Connect cluster.
12552    /// Structured like:
12553    /// projects/{project}/regions/{region}/subnetworks/{subnet_id}
12554    ///
12555    /// It is used to create a Private Service Connect (PSC) interface for the
12556    /// Kafka Connect workers. It must be located in the same region as the
12557    /// Kafka Connect cluster.
12558    ///
12559    /// The CIDR range of the subnet must be within the IPv4 address ranges for
12560    /// private networks, as specified in RFC 1918. The primary subnet CIDR range
12561    /// must have a minimum size of /22 (1024 addresses).
12562    pub primary_subnet: std::string::String,
12563
12564    /// Optional. Additional subnets may be specified. They may be in another
12565    /// region, but must be in the same VPC network. The Connect workers can
12566    /// communicate with network endpoints in either the primary or additional
12567    /// subnets.
12568    pub additional_subnets: std::vec::Vec<std::string::String>,
12569
12570    /// Optional. Additional DNS domain names from the subnet's network to be made
12571    /// visible to the Connect Cluster. When using MirrorMaker2, it's necessary to
12572    /// add the bootstrap address's dns domain name of the target cluster to make
12573    /// it visible to the connector. For example:
12574    /// my-kafka-cluster.us-central1.managedkafka.my-project.cloud.goog
12575    pub dns_domain_names: std::vec::Vec<std::string::String>,
12576
12577    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12578}
12579
12580impl ConnectNetworkConfig {
12581    pub fn new() -> Self {
12582        std::default::Default::default()
12583    }
12584
12585    /// Sets the value of [primary_subnet][crate::model::ConnectNetworkConfig::primary_subnet].
12586    pub fn set_primary_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12587        self.primary_subnet = v.into();
12588        self
12589    }
12590
12591    /// Sets the value of [additional_subnets][crate::model::ConnectNetworkConfig::additional_subnets].
12592    pub fn set_additional_subnets<T, V>(mut self, v: T) -> Self
12593    where
12594        T: std::iter::IntoIterator<Item = V>,
12595        V: std::convert::Into<std::string::String>,
12596    {
12597        use std::iter::Iterator;
12598        self.additional_subnets = v.into_iter().map(|i| i.into()).collect();
12599        self
12600    }
12601
12602    /// Sets the value of [dns_domain_names][crate::model::ConnectNetworkConfig::dns_domain_names].
12603    pub fn set_dns_domain_names<T, V>(mut self, v: T) -> Self
12604    where
12605        T: std::iter::IntoIterator<Item = V>,
12606        V: std::convert::Into<std::string::String>,
12607    {
12608        use std::iter::Iterator;
12609        self.dns_domain_names = v.into_iter().map(|i| i.into()).collect();
12610        self
12611    }
12612}
12613
12614impl wkt::message::Message for ConnectNetworkConfig {
12615    fn typename() -> &'static str {
12616        "type.googleapis.com/google.cloud.managedkafka.v1.ConnectNetworkConfig"
12617    }
12618}
12619
12620#[doc(hidden)]
12621impl<'de> serde::de::Deserialize<'de> for ConnectNetworkConfig {
12622    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12623    where
12624        D: serde::Deserializer<'de>,
12625    {
12626        #[allow(non_camel_case_types)]
12627        #[doc(hidden)]
12628        #[derive(PartialEq, Eq, Hash)]
12629        enum __FieldTag {
12630            __primary_subnet,
12631            __additional_subnets,
12632            __dns_domain_names,
12633            Unknown(std::string::String),
12634        }
12635        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12636            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12637            where
12638                D: serde::Deserializer<'de>,
12639            {
12640                struct Visitor;
12641                impl<'de> serde::de::Visitor<'de> for Visitor {
12642                    type Value = __FieldTag;
12643                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12644                        formatter.write_str("a field name for ConnectNetworkConfig")
12645                    }
12646                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12647                    where
12648                        E: serde::de::Error,
12649                    {
12650                        use std::result::Result::Ok;
12651                        use std::string::ToString;
12652                        match value {
12653                            "primarySubnet" => Ok(__FieldTag::__primary_subnet),
12654                            "primary_subnet" => Ok(__FieldTag::__primary_subnet),
12655                            "additionalSubnets" => Ok(__FieldTag::__additional_subnets),
12656                            "additional_subnets" => Ok(__FieldTag::__additional_subnets),
12657                            "dnsDomainNames" => Ok(__FieldTag::__dns_domain_names),
12658                            "dns_domain_names" => Ok(__FieldTag::__dns_domain_names),
12659                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12660                        }
12661                    }
12662                }
12663                deserializer.deserialize_identifier(Visitor)
12664            }
12665        }
12666        struct Visitor;
12667        impl<'de> serde::de::Visitor<'de> for Visitor {
12668            type Value = ConnectNetworkConfig;
12669            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12670                formatter.write_str("struct ConnectNetworkConfig")
12671            }
12672            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12673            where
12674                A: serde::de::MapAccess<'de>,
12675            {
12676                #[allow(unused_imports)]
12677                use serde::de::Error;
12678                use std::option::Option::Some;
12679                let mut fields = std::collections::HashSet::new();
12680                let mut result = Self::Value::new();
12681                while let Some(tag) = map.next_key::<__FieldTag>()? {
12682                    #[allow(clippy::match_single_binding)]
12683                    match tag {
12684                        __FieldTag::__primary_subnet => {
12685                            if !fields.insert(__FieldTag::__primary_subnet) {
12686                                return std::result::Result::Err(A::Error::duplicate_field(
12687                                    "multiple values for primary_subnet",
12688                                ));
12689                            }
12690                            result.primary_subnet = map
12691                                .next_value::<std::option::Option<std::string::String>>()?
12692                                .unwrap_or_default();
12693                        }
12694                        __FieldTag::__additional_subnets => {
12695                            if !fields.insert(__FieldTag::__additional_subnets) {
12696                                return std::result::Result::Err(A::Error::duplicate_field(
12697                                    "multiple values for additional_subnets",
12698                                ));
12699                            }
12700                            result.additional_subnets = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
12701                        }
12702                        __FieldTag::__dns_domain_names => {
12703                            if !fields.insert(__FieldTag::__dns_domain_names) {
12704                                return std::result::Result::Err(A::Error::duplicate_field(
12705                                    "multiple values for dns_domain_names",
12706                                ));
12707                            }
12708                            result.dns_domain_names = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
12709                        }
12710                        __FieldTag::Unknown(key) => {
12711                            let value = map.next_value::<serde_json::Value>()?;
12712                            result._unknown_fields.insert(key, value);
12713                        }
12714                    }
12715                }
12716                std::result::Result::Ok(result)
12717            }
12718        }
12719        deserializer.deserialize_any(Visitor)
12720    }
12721}
12722
12723#[doc(hidden)]
12724impl serde::ser::Serialize for ConnectNetworkConfig {
12725    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12726    where
12727        S: serde::ser::Serializer,
12728    {
12729        use serde::ser::SerializeMap;
12730        #[allow(unused_imports)]
12731        use std::option::Option::Some;
12732        let mut state = serializer.serialize_map(std::option::Option::None)?;
12733        if !self.primary_subnet.is_empty() {
12734            state.serialize_entry("primarySubnet", &self.primary_subnet)?;
12735        }
12736        if !self.additional_subnets.is_empty() {
12737            state.serialize_entry("additionalSubnets", &self.additional_subnets)?;
12738        }
12739        if !self.dns_domain_names.is_empty() {
12740            state.serialize_entry("dnsDomainNames", &self.dns_domain_names)?;
12741        }
12742        if !self._unknown_fields.is_empty() {
12743            for (key, value) in self._unknown_fields.iter() {
12744                state.serialize_entry(key, &value)?;
12745            }
12746        }
12747        state.end()
12748    }
12749}
12750
12751impl std::fmt::Debug for ConnectNetworkConfig {
12752    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12753        let mut debug_struct = f.debug_struct("ConnectNetworkConfig");
12754        debug_struct.field("primary_subnet", &self.primary_subnet);
12755        debug_struct.field("additional_subnets", &self.additional_subnets);
12756        debug_struct.field("dns_domain_names", &self.dns_domain_names);
12757        if !self._unknown_fields.is_empty() {
12758            debug_struct.field("_unknown_fields", &self._unknown_fields);
12759        }
12760        debug_struct.finish()
12761    }
12762}
12763
12764/// The configuration of access to the Kafka Connect cluster.
12765#[derive(Clone, Default, PartialEq)]
12766#[non_exhaustive]
12767pub struct ConnectAccessConfig {
12768    /// Required.
12769    /// Virtual Private Cloud (VPC) networks that must be granted direct access to
12770    /// the Kafka Connect cluster. Minimum of 1 network is required. Maximum 10
12771    /// networks can be specified.
12772    pub network_configs: std::vec::Vec<crate::model::ConnectNetworkConfig>,
12773
12774    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12775}
12776
12777impl ConnectAccessConfig {
12778    pub fn new() -> Self {
12779        std::default::Default::default()
12780    }
12781
12782    /// Sets the value of [network_configs][crate::model::ConnectAccessConfig::network_configs].
12783    pub fn set_network_configs<T, V>(mut self, v: T) -> Self
12784    where
12785        T: std::iter::IntoIterator<Item = V>,
12786        V: std::convert::Into<crate::model::ConnectNetworkConfig>,
12787    {
12788        use std::iter::Iterator;
12789        self.network_configs = v.into_iter().map(|i| i.into()).collect();
12790        self
12791    }
12792}
12793
12794impl wkt::message::Message for ConnectAccessConfig {
12795    fn typename() -> &'static str {
12796        "type.googleapis.com/google.cloud.managedkafka.v1.ConnectAccessConfig"
12797    }
12798}
12799
12800#[doc(hidden)]
12801impl<'de> serde::de::Deserialize<'de> for ConnectAccessConfig {
12802    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12803    where
12804        D: serde::Deserializer<'de>,
12805    {
12806        #[allow(non_camel_case_types)]
12807        #[doc(hidden)]
12808        #[derive(PartialEq, Eq, Hash)]
12809        enum __FieldTag {
12810            __network_configs,
12811            Unknown(std::string::String),
12812        }
12813        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12814            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12815            where
12816                D: serde::Deserializer<'de>,
12817            {
12818                struct Visitor;
12819                impl<'de> serde::de::Visitor<'de> for Visitor {
12820                    type Value = __FieldTag;
12821                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12822                        formatter.write_str("a field name for ConnectAccessConfig")
12823                    }
12824                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12825                    where
12826                        E: serde::de::Error,
12827                    {
12828                        use std::result::Result::Ok;
12829                        use std::string::ToString;
12830                        match value {
12831                            "networkConfigs" => Ok(__FieldTag::__network_configs),
12832                            "network_configs" => Ok(__FieldTag::__network_configs),
12833                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12834                        }
12835                    }
12836                }
12837                deserializer.deserialize_identifier(Visitor)
12838            }
12839        }
12840        struct Visitor;
12841        impl<'de> serde::de::Visitor<'de> for Visitor {
12842            type Value = ConnectAccessConfig;
12843            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12844                formatter.write_str("struct ConnectAccessConfig")
12845            }
12846            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12847            where
12848                A: serde::de::MapAccess<'de>,
12849            {
12850                #[allow(unused_imports)]
12851                use serde::de::Error;
12852                use std::option::Option::Some;
12853                let mut fields = std::collections::HashSet::new();
12854                let mut result = Self::Value::new();
12855                while let Some(tag) = map.next_key::<__FieldTag>()? {
12856                    #[allow(clippy::match_single_binding)]
12857                    match tag {
12858                        __FieldTag::__network_configs => {
12859                            if !fields.insert(__FieldTag::__network_configs) {
12860                                return std::result::Result::Err(A::Error::duplicate_field(
12861                                    "multiple values for network_configs",
12862                                ));
12863                            }
12864                            result.network_configs = map
12865                                .next_value::<std::option::Option<
12866                                    std::vec::Vec<crate::model::ConnectNetworkConfig>,
12867                                >>()?
12868                                .unwrap_or_default();
12869                        }
12870                        __FieldTag::Unknown(key) => {
12871                            let value = map.next_value::<serde_json::Value>()?;
12872                            result._unknown_fields.insert(key, value);
12873                        }
12874                    }
12875                }
12876                std::result::Result::Ok(result)
12877            }
12878        }
12879        deserializer.deserialize_any(Visitor)
12880    }
12881}
12882
12883#[doc(hidden)]
12884impl serde::ser::Serialize for ConnectAccessConfig {
12885    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12886    where
12887        S: serde::ser::Serializer,
12888    {
12889        use serde::ser::SerializeMap;
12890        #[allow(unused_imports)]
12891        use std::option::Option::Some;
12892        let mut state = serializer.serialize_map(std::option::Option::None)?;
12893        if !self.network_configs.is_empty() {
12894            state.serialize_entry("networkConfigs", &self.network_configs)?;
12895        }
12896        if !self._unknown_fields.is_empty() {
12897            for (key, value) in self._unknown_fields.iter() {
12898                state.serialize_entry(key, &value)?;
12899            }
12900        }
12901        state.end()
12902    }
12903}
12904
12905impl std::fmt::Debug for ConnectAccessConfig {
12906    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12907        let mut debug_struct = f.debug_struct("ConnectAccessConfig");
12908        debug_struct.field("network_configs", &self.network_configs);
12909        if !self._unknown_fields.is_empty() {
12910            debug_struct.field("_unknown_fields", &self._unknown_fields);
12911        }
12912        debug_struct.finish()
12913    }
12914}
12915
12916/// Configuration properties for a Kafka Connect cluster deployed to Google Cloud
12917/// Platform.
12918#[derive(Clone, Default, PartialEq)]
12919#[non_exhaustive]
12920pub struct ConnectGcpConfig {
12921    /// Required. Access configuration for the Kafka Connect cluster.
12922    pub access_config: std::option::Option<crate::model::ConnectAccessConfig>,
12923
12924    /// Optional. Secrets to load into workers. Exact SecretVersions from Secret
12925    /// Manager must be provided -- aliases are not supported. Up to 32 secrets may
12926    /// be loaded into one cluster. Format:
12927    /// projects/\<project-id\>/secrets/\<secret-name\>/versions/\<version-id\>
12928    pub secret_paths: std::vec::Vec<std::string::String>,
12929
12930    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12931}
12932
12933impl ConnectGcpConfig {
12934    pub fn new() -> Self {
12935        std::default::Default::default()
12936    }
12937
12938    /// Sets the value of [access_config][crate::model::ConnectGcpConfig::access_config].
12939    pub fn set_access_config<T>(mut self, v: T) -> Self
12940    where
12941        T: std::convert::Into<crate::model::ConnectAccessConfig>,
12942    {
12943        self.access_config = std::option::Option::Some(v.into());
12944        self
12945    }
12946
12947    /// Sets or clears the value of [access_config][crate::model::ConnectGcpConfig::access_config].
12948    pub fn set_or_clear_access_config<T>(mut self, v: std::option::Option<T>) -> Self
12949    where
12950        T: std::convert::Into<crate::model::ConnectAccessConfig>,
12951    {
12952        self.access_config = v.map(|x| x.into());
12953        self
12954    }
12955
12956    /// Sets the value of [secret_paths][crate::model::ConnectGcpConfig::secret_paths].
12957    pub fn set_secret_paths<T, V>(mut self, v: T) -> Self
12958    where
12959        T: std::iter::IntoIterator<Item = V>,
12960        V: std::convert::Into<std::string::String>,
12961    {
12962        use std::iter::Iterator;
12963        self.secret_paths = v.into_iter().map(|i| i.into()).collect();
12964        self
12965    }
12966}
12967
12968impl wkt::message::Message for ConnectGcpConfig {
12969    fn typename() -> &'static str {
12970        "type.googleapis.com/google.cloud.managedkafka.v1.ConnectGcpConfig"
12971    }
12972}
12973
12974#[doc(hidden)]
12975impl<'de> serde::de::Deserialize<'de> for ConnectGcpConfig {
12976    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12977    where
12978        D: serde::Deserializer<'de>,
12979    {
12980        #[allow(non_camel_case_types)]
12981        #[doc(hidden)]
12982        #[derive(PartialEq, Eq, Hash)]
12983        enum __FieldTag {
12984            __access_config,
12985            __secret_paths,
12986            Unknown(std::string::String),
12987        }
12988        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12989            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12990            where
12991                D: serde::Deserializer<'de>,
12992            {
12993                struct Visitor;
12994                impl<'de> serde::de::Visitor<'de> for Visitor {
12995                    type Value = __FieldTag;
12996                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12997                        formatter.write_str("a field name for ConnectGcpConfig")
12998                    }
12999                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13000                    where
13001                        E: serde::de::Error,
13002                    {
13003                        use std::result::Result::Ok;
13004                        use std::string::ToString;
13005                        match value {
13006                            "accessConfig" => Ok(__FieldTag::__access_config),
13007                            "access_config" => Ok(__FieldTag::__access_config),
13008                            "secretPaths" => Ok(__FieldTag::__secret_paths),
13009                            "secret_paths" => Ok(__FieldTag::__secret_paths),
13010                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13011                        }
13012                    }
13013                }
13014                deserializer.deserialize_identifier(Visitor)
13015            }
13016        }
13017        struct Visitor;
13018        impl<'de> serde::de::Visitor<'de> for Visitor {
13019            type Value = ConnectGcpConfig;
13020            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13021                formatter.write_str("struct ConnectGcpConfig")
13022            }
13023            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13024            where
13025                A: serde::de::MapAccess<'de>,
13026            {
13027                #[allow(unused_imports)]
13028                use serde::de::Error;
13029                use std::option::Option::Some;
13030                let mut fields = std::collections::HashSet::new();
13031                let mut result = Self::Value::new();
13032                while let Some(tag) = map.next_key::<__FieldTag>()? {
13033                    #[allow(clippy::match_single_binding)]
13034                    match tag {
13035                        __FieldTag::__access_config => {
13036                            if !fields.insert(__FieldTag::__access_config) {
13037                                return std::result::Result::Err(A::Error::duplicate_field(
13038                                    "multiple values for access_config",
13039                                ));
13040                            }
13041                            result.access_config = map.next_value::<std::option::Option<crate::model::ConnectAccessConfig>>()?
13042                                ;
13043                        }
13044                        __FieldTag::__secret_paths => {
13045                            if !fields.insert(__FieldTag::__secret_paths) {
13046                                return std::result::Result::Err(A::Error::duplicate_field(
13047                                    "multiple values for secret_paths",
13048                                ));
13049                            }
13050                            result.secret_paths = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
13051                        }
13052                        __FieldTag::Unknown(key) => {
13053                            let value = map.next_value::<serde_json::Value>()?;
13054                            result._unknown_fields.insert(key, value);
13055                        }
13056                    }
13057                }
13058                std::result::Result::Ok(result)
13059            }
13060        }
13061        deserializer.deserialize_any(Visitor)
13062    }
13063}
13064
13065#[doc(hidden)]
13066impl serde::ser::Serialize for ConnectGcpConfig {
13067    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13068    where
13069        S: serde::ser::Serializer,
13070    {
13071        use serde::ser::SerializeMap;
13072        #[allow(unused_imports)]
13073        use std::option::Option::Some;
13074        let mut state = serializer.serialize_map(std::option::Option::None)?;
13075        if self.access_config.is_some() {
13076            state.serialize_entry("accessConfig", &self.access_config)?;
13077        }
13078        if !self.secret_paths.is_empty() {
13079            state.serialize_entry("secretPaths", &self.secret_paths)?;
13080        }
13081        if !self._unknown_fields.is_empty() {
13082            for (key, value) in self._unknown_fields.iter() {
13083                state.serialize_entry(key, &value)?;
13084            }
13085        }
13086        state.end()
13087    }
13088}
13089
13090impl std::fmt::Debug for ConnectGcpConfig {
13091    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13092        let mut debug_struct = f.debug_struct("ConnectGcpConfig");
13093        debug_struct.field("access_config", &self.access_config);
13094        debug_struct.field("secret_paths", &self.secret_paths);
13095        if !self._unknown_fields.is_empty() {
13096            debug_struct.field("_unknown_fields", &self._unknown_fields);
13097        }
13098        debug_struct.finish()
13099    }
13100}
13101
13102/// A Kafka Connect connector in a given ConnectCluster.
13103#[derive(Clone, Default, PartialEq)]
13104#[non_exhaustive]
13105pub struct Connector {
13106    /// Identifier. The name of the connector.
13107    /// Structured like:
13108    /// projects/{project}/locations/{location}/connectClusters/{connect_cluster}/connectors/{connector}
13109    pub name: std::string::String,
13110
13111    /// Optional. Connector config as keys/values.
13112    /// The keys of the map are connector property names, for example:
13113    /// `connector.class`, `tasks.max`, `key.converter`.
13114    pub configs: std::collections::HashMap<std::string::String, std::string::String>,
13115
13116    /// Output only. The current state of the connector.
13117    pub state: crate::model::connector::State,
13118
13119    /// A policy that specifies how to restart the failed connectors/tasks in a
13120    /// Cluster resource. If not set, the failed connectors/tasks won't be
13121    /// restarted.
13122    pub restart_policy: std::option::Option<crate::model::connector::RestartPolicy>,
13123
13124    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13125}
13126
13127impl Connector {
13128    pub fn new() -> Self {
13129        std::default::Default::default()
13130    }
13131
13132    /// Sets the value of [name][crate::model::Connector::name].
13133    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13134        self.name = v.into();
13135        self
13136    }
13137
13138    /// Sets the value of [configs][crate::model::Connector::configs].
13139    pub fn set_configs<T, K, V>(mut self, v: T) -> Self
13140    where
13141        T: std::iter::IntoIterator<Item = (K, V)>,
13142        K: std::convert::Into<std::string::String>,
13143        V: std::convert::Into<std::string::String>,
13144    {
13145        use std::iter::Iterator;
13146        self.configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13147        self
13148    }
13149
13150    /// Sets the value of [state][crate::model::Connector::state].
13151    pub fn set_state<T: std::convert::Into<crate::model::connector::State>>(
13152        mut self,
13153        v: T,
13154    ) -> Self {
13155        self.state = v.into();
13156        self
13157    }
13158
13159    /// Sets the value of [restart_policy][crate::model::Connector::restart_policy].
13160    ///
13161    /// Note that all the setters affecting `restart_policy` are mutually
13162    /// exclusive.
13163    pub fn set_restart_policy<
13164        T: std::convert::Into<std::option::Option<crate::model::connector::RestartPolicy>>,
13165    >(
13166        mut self,
13167        v: T,
13168    ) -> Self {
13169        self.restart_policy = v.into();
13170        self
13171    }
13172
13173    /// The value of [restart_policy][crate::model::Connector::restart_policy]
13174    /// if it holds a `TaskRestartPolicy`, `None` if the field is not set or
13175    /// holds a different branch.
13176    pub fn task_restart_policy(
13177        &self,
13178    ) -> std::option::Option<&std::boxed::Box<crate::model::TaskRetryPolicy>> {
13179        #[allow(unreachable_patterns)]
13180        self.restart_policy.as_ref().and_then(|v| match v {
13181            crate::model::connector::RestartPolicy::TaskRestartPolicy(v) => {
13182                std::option::Option::Some(v)
13183            }
13184            _ => std::option::Option::None,
13185        })
13186    }
13187
13188    /// Sets the value of [restart_policy][crate::model::Connector::restart_policy]
13189    /// to hold a `TaskRestartPolicy`.
13190    ///
13191    /// Note that all the setters affecting `restart_policy` are
13192    /// mutually exclusive.
13193    pub fn set_task_restart_policy<
13194        T: std::convert::Into<std::boxed::Box<crate::model::TaskRetryPolicy>>,
13195    >(
13196        mut self,
13197        v: T,
13198    ) -> Self {
13199        self.restart_policy = std::option::Option::Some(
13200            crate::model::connector::RestartPolicy::TaskRestartPolicy(v.into()),
13201        );
13202        self
13203    }
13204}
13205
13206impl wkt::message::Message for Connector {
13207    fn typename() -> &'static str {
13208        "type.googleapis.com/google.cloud.managedkafka.v1.Connector"
13209    }
13210}
13211
13212#[doc(hidden)]
13213impl<'de> serde::de::Deserialize<'de> for Connector {
13214    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13215    where
13216        D: serde::Deserializer<'de>,
13217    {
13218        #[allow(non_camel_case_types)]
13219        #[doc(hidden)]
13220        #[derive(PartialEq, Eq, Hash)]
13221        enum __FieldTag {
13222            __task_restart_policy,
13223            __name,
13224            __configs,
13225            __state,
13226            Unknown(std::string::String),
13227        }
13228        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13229            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13230            where
13231                D: serde::Deserializer<'de>,
13232            {
13233                struct Visitor;
13234                impl<'de> serde::de::Visitor<'de> for Visitor {
13235                    type Value = __FieldTag;
13236                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13237                        formatter.write_str("a field name for Connector")
13238                    }
13239                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13240                    where
13241                        E: serde::de::Error,
13242                    {
13243                        use std::result::Result::Ok;
13244                        use std::string::ToString;
13245                        match value {
13246                            "taskRestartPolicy" => Ok(__FieldTag::__task_restart_policy),
13247                            "task_restart_policy" => Ok(__FieldTag::__task_restart_policy),
13248                            "name" => Ok(__FieldTag::__name),
13249                            "configs" => Ok(__FieldTag::__configs),
13250                            "state" => Ok(__FieldTag::__state),
13251                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13252                        }
13253                    }
13254                }
13255                deserializer.deserialize_identifier(Visitor)
13256            }
13257        }
13258        struct Visitor;
13259        impl<'de> serde::de::Visitor<'de> for Visitor {
13260            type Value = Connector;
13261            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13262                formatter.write_str("struct Connector")
13263            }
13264            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13265            where
13266                A: serde::de::MapAccess<'de>,
13267            {
13268                #[allow(unused_imports)]
13269                use serde::de::Error;
13270                use std::option::Option::Some;
13271                let mut fields = std::collections::HashSet::new();
13272                let mut result = Self::Value::new();
13273                while let Some(tag) = map.next_key::<__FieldTag>()? {
13274                    #[allow(clippy::match_single_binding)]
13275                    match tag {
13276                        __FieldTag::__task_restart_policy => {
13277                            if !fields.insert(__FieldTag::__task_restart_policy) {
13278                                return std::result::Result::Err(A::Error::duplicate_field(
13279                                    "multiple values for task_restart_policy",
13280                                ));
13281                            }
13282                            if result.restart_policy.is_some() {
13283                                return std::result::Result::Err(A::Error::duplicate_field(
13284                                    "multiple values for `restart_policy`, a oneof with full ID .google.cloud.managedkafka.v1.Connector.task_restart_policy, latest field was taskRestartPolicy",
13285                                ));
13286                            }
13287                            result.restart_policy = std::option::Option::Some(
13288                                crate::model::connector::RestartPolicy::TaskRestartPolicy(
13289                                    map.next_value::<std::option::Option<
13290                                        std::boxed::Box<crate::model::TaskRetryPolicy>,
13291                                    >>()?
13292                                    .unwrap_or_default(),
13293                                ),
13294                            );
13295                        }
13296                        __FieldTag::__name => {
13297                            if !fields.insert(__FieldTag::__name) {
13298                                return std::result::Result::Err(A::Error::duplicate_field(
13299                                    "multiple values for name",
13300                                ));
13301                            }
13302                            result.name = map
13303                                .next_value::<std::option::Option<std::string::String>>()?
13304                                .unwrap_or_default();
13305                        }
13306                        __FieldTag::__configs => {
13307                            if !fields.insert(__FieldTag::__configs) {
13308                                return std::result::Result::Err(A::Error::duplicate_field(
13309                                    "multiple values for configs",
13310                                ));
13311                            }
13312                            result.configs = map
13313                                .next_value::<std::option::Option<
13314                                    std::collections::HashMap<
13315                                        std::string::String,
13316                                        std::string::String,
13317                                    >,
13318                                >>()?
13319                                .unwrap_or_default();
13320                        }
13321                        __FieldTag::__state => {
13322                            if !fields.insert(__FieldTag::__state) {
13323                                return std::result::Result::Err(A::Error::duplicate_field(
13324                                    "multiple values for state",
13325                                ));
13326                            }
13327                            result.state = map
13328                                .next_value::<std::option::Option<crate::model::connector::State>>(
13329                                )?
13330                                .unwrap_or_default();
13331                        }
13332                        __FieldTag::Unknown(key) => {
13333                            let value = map.next_value::<serde_json::Value>()?;
13334                            result._unknown_fields.insert(key, value);
13335                        }
13336                    }
13337                }
13338                std::result::Result::Ok(result)
13339            }
13340        }
13341        deserializer.deserialize_any(Visitor)
13342    }
13343}
13344
13345#[doc(hidden)]
13346impl serde::ser::Serialize for Connector {
13347    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13348    where
13349        S: serde::ser::Serializer,
13350    {
13351        use serde::ser::SerializeMap;
13352        #[allow(unused_imports)]
13353        use std::option::Option::Some;
13354        let mut state = serializer.serialize_map(std::option::Option::None)?;
13355        if let Some(value) = self.task_restart_policy() {
13356            state.serialize_entry("taskRestartPolicy", value)?;
13357        }
13358        if !self.name.is_empty() {
13359            state.serialize_entry("name", &self.name)?;
13360        }
13361        if !self.configs.is_empty() {
13362            state.serialize_entry("configs", &self.configs)?;
13363        }
13364        if !wkt::internal::is_default(&self.state) {
13365            state.serialize_entry("state", &self.state)?;
13366        }
13367        if !self._unknown_fields.is_empty() {
13368            for (key, value) in self._unknown_fields.iter() {
13369                state.serialize_entry(key, &value)?;
13370            }
13371        }
13372        state.end()
13373    }
13374}
13375
13376impl std::fmt::Debug for Connector {
13377    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13378        let mut debug_struct = f.debug_struct("Connector");
13379        debug_struct.field("name", &self.name);
13380        debug_struct.field("configs", &self.configs);
13381        debug_struct.field("state", &self.state);
13382        debug_struct.field("restart_policy", &self.restart_policy);
13383        if !self._unknown_fields.is_empty() {
13384            debug_struct.field("_unknown_fields", &self._unknown_fields);
13385        }
13386        debug_struct.finish()
13387    }
13388}
13389
13390/// Defines additional types related to [Connector].
13391pub mod connector {
13392    #[allow(unused_imports)]
13393    use super::*;
13394
13395    /// The state of the connector.
13396    ///
13397    /// # Working with unknown values
13398    ///
13399    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13400    /// additional enum variants at any time. Adding new variants is not considered
13401    /// a breaking change. Applications should write their code in anticipation of:
13402    ///
13403    /// - New values appearing in future releases of the client library, **and**
13404    /// - New values received dynamically, without application changes.
13405    ///
13406    /// Please consult the [Working with enums] section in the user guide for some
13407    /// guidelines.
13408    ///
13409    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13410    #[derive(Clone, Debug, PartialEq)]
13411    #[non_exhaustive]
13412    pub enum State {
13413        /// A state was not specified.
13414        Unspecified,
13415        /// The connector is not assigned to any tasks, usually transient.
13416        Unassigned,
13417        /// The connector is running.
13418        Running,
13419        /// The connector has been paused.
13420        Paused,
13421        /// The connector has failed. See logs for why.
13422        Failed,
13423        /// The connector is restarting.
13424        Restarting,
13425        /// The connector has been stopped.
13426        Stopped,
13427        /// If set, the enum was initialized with an unknown value.
13428        ///
13429        /// Applications can examine the value using [State::value] or
13430        /// [State::name].
13431        UnknownValue(state::UnknownValue),
13432    }
13433
13434    #[doc(hidden)]
13435    pub mod state {
13436        #[allow(unused_imports)]
13437        use super::*;
13438        #[derive(Clone, Debug, PartialEq)]
13439        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13440    }
13441
13442    impl State {
13443        /// Gets the enum value.
13444        ///
13445        /// Returns `None` if the enum contains an unknown value deserialized from
13446        /// the string representation of enums.
13447        pub fn value(&self) -> std::option::Option<i32> {
13448            match self {
13449                Self::Unspecified => std::option::Option::Some(0),
13450                Self::Unassigned => std::option::Option::Some(1),
13451                Self::Running => std::option::Option::Some(2),
13452                Self::Paused => std::option::Option::Some(3),
13453                Self::Failed => std::option::Option::Some(4),
13454                Self::Restarting => std::option::Option::Some(5),
13455                Self::Stopped => std::option::Option::Some(6),
13456                Self::UnknownValue(u) => u.0.value(),
13457            }
13458        }
13459
13460        /// Gets the enum value as a string.
13461        ///
13462        /// Returns `None` if the enum contains an unknown value deserialized from
13463        /// the integer representation of enums.
13464        pub fn name(&self) -> std::option::Option<&str> {
13465            match self {
13466                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13467                Self::Unassigned => std::option::Option::Some("UNASSIGNED"),
13468                Self::Running => std::option::Option::Some("RUNNING"),
13469                Self::Paused => std::option::Option::Some("PAUSED"),
13470                Self::Failed => std::option::Option::Some("FAILED"),
13471                Self::Restarting => std::option::Option::Some("RESTARTING"),
13472                Self::Stopped => std::option::Option::Some("STOPPED"),
13473                Self::UnknownValue(u) => u.0.name(),
13474            }
13475        }
13476    }
13477
13478    impl std::default::Default for State {
13479        fn default() -> Self {
13480            use std::convert::From;
13481            Self::from(0)
13482        }
13483    }
13484
13485    impl std::fmt::Display for State {
13486        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13487            wkt::internal::display_enum(f, self.name(), self.value())
13488        }
13489    }
13490
13491    impl std::convert::From<i32> for State {
13492        fn from(value: i32) -> Self {
13493            match value {
13494                0 => Self::Unspecified,
13495                1 => Self::Unassigned,
13496                2 => Self::Running,
13497                3 => Self::Paused,
13498                4 => Self::Failed,
13499                5 => Self::Restarting,
13500                6 => Self::Stopped,
13501                _ => Self::UnknownValue(state::UnknownValue(
13502                    wkt::internal::UnknownEnumValue::Integer(value),
13503                )),
13504            }
13505        }
13506    }
13507
13508    impl std::convert::From<&str> for State {
13509        fn from(value: &str) -> Self {
13510            use std::string::ToString;
13511            match value {
13512                "STATE_UNSPECIFIED" => Self::Unspecified,
13513                "UNASSIGNED" => Self::Unassigned,
13514                "RUNNING" => Self::Running,
13515                "PAUSED" => Self::Paused,
13516                "FAILED" => Self::Failed,
13517                "RESTARTING" => Self::Restarting,
13518                "STOPPED" => Self::Stopped,
13519                _ => Self::UnknownValue(state::UnknownValue(
13520                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13521                )),
13522            }
13523        }
13524    }
13525
13526    impl serde::ser::Serialize for State {
13527        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13528        where
13529            S: serde::Serializer,
13530        {
13531            match self {
13532                Self::Unspecified => serializer.serialize_i32(0),
13533                Self::Unassigned => serializer.serialize_i32(1),
13534                Self::Running => serializer.serialize_i32(2),
13535                Self::Paused => serializer.serialize_i32(3),
13536                Self::Failed => serializer.serialize_i32(4),
13537                Self::Restarting => serializer.serialize_i32(5),
13538                Self::Stopped => serializer.serialize_i32(6),
13539                Self::UnknownValue(u) => u.0.serialize(serializer),
13540            }
13541        }
13542    }
13543
13544    impl<'de> serde::de::Deserialize<'de> for State {
13545        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13546        where
13547            D: serde::Deserializer<'de>,
13548        {
13549            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13550                ".google.cloud.managedkafka.v1.Connector.State",
13551            ))
13552        }
13553    }
13554
13555    /// A policy that specifies how to restart the failed connectors/tasks in a
13556    /// Cluster resource. If not set, the failed connectors/tasks won't be
13557    /// restarted.
13558    #[derive(Clone, Debug, PartialEq)]
13559    #[non_exhaustive]
13560    pub enum RestartPolicy {
13561        /// Optional. Restarts the individual tasks of a Connector.
13562        TaskRestartPolicy(std::boxed::Box<crate::model::TaskRetryPolicy>),
13563    }
13564}
13565
13566/// Task Retry Policy is implemented on a best-effort
13567/// basis.
13568/// Retry delay will be exponential based on provided minimum and maximum
13569/// backoffs. <https://en.wikipedia.org/wiki/Exponential_backoff>.
13570/// Note that the delay between consecutive task restarts may not always
13571/// precisely match the configured settings. This can happen when the
13572/// ConnectCluster is in rebalancing state or if the ConnectCluster is
13573/// unresponsive etc. The default values for minimum and maximum backoffs are
13574/// 60 seconds and 30 minutes respectively.
13575#[derive(Clone, Default, PartialEq)]
13576#[non_exhaustive]
13577pub struct TaskRetryPolicy {
13578    /// Optional. The minimum amount of time to wait before retrying a failed task.
13579    /// This sets a lower bound for the backoff delay.
13580    pub minimum_backoff: std::option::Option<wkt::Duration>,
13581
13582    /// Optional. The maximum amount of time to wait before retrying a failed task.
13583    /// This sets an upper bound for the backoff delay.
13584    pub maximum_backoff: std::option::Option<wkt::Duration>,
13585
13586    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13587}
13588
13589impl TaskRetryPolicy {
13590    pub fn new() -> Self {
13591        std::default::Default::default()
13592    }
13593
13594    /// Sets the value of [minimum_backoff][crate::model::TaskRetryPolicy::minimum_backoff].
13595    pub fn set_minimum_backoff<T>(mut self, v: T) -> Self
13596    where
13597        T: std::convert::Into<wkt::Duration>,
13598    {
13599        self.minimum_backoff = std::option::Option::Some(v.into());
13600        self
13601    }
13602
13603    /// Sets or clears the value of [minimum_backoff][crate::model::TaskRetryPolicy::minimum_backoff].
13604    pub fn set_or_clear_minimum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
13605    where
13606        T: std::convert::Into<wkt::Duration>,
13607    {
13608        self.minimum_backoff = v.map(|x| x.into());
13609        self
13610    }
13611
13612    /// Sets the value of [maximum_backoff][crate::model::TaskRetryPolicy::maximum_backoff].
13613    pub fn set_maximum_backoff<T>(mut self, v: T) -> Self
13614    where
13615        T: std::convert::Into<wkt::Duration>,
13616    {
13617        self.maximum_backoff = std::option::Option::Some(v.into());
13618        self
13619    }
13620
13621    /// Sets or clears the value of [maximum_backoff][crate::model::TaskRetryPolicy::maximum_backoff].
13622    pub fn set_or_clear_maximum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
13623    where
13624        T: std::convert::Into<wkt::Duration>,
13625    {
13626        self.maximum_backoff = v.map(|x| x.into());
13627        self
13628    }
13629}
13630
13631impl wkt::message::Message for TaskRetryPolicy {
13632    fn typename() -> &'static str {
13633        "type.googleapis.com/google.cloud.managedkafka.v1.TaskRetryPolicy"
13634    }
13635}
13636
13637#[doc(hidden)]
13638impl<'de> serde::de::Deserialize<'de> for TaskRetryPolicy {
13639    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13640    where
13641        D: serde::Deserializer<'de>,
13642    {
13643        #[allow(non_camel_case_types)]
13644        #[doc(hidden)]
13645        #[derive(PartialEq, Eq, Hash)]
13646        enum __FieldTag {
13647            __minimum_backoff,
13648            __maximum_backoff,
13649            Unknown(std::string::String),
13650        }
13651        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13652            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13653            where
13654                D: serde::Deserializer<'de>,
13655            {
13656                struct Visitor;
13657                impl<'de> serde::de::Visitor<'de> for Visitor {
13658                    type Value = __FieldTag;
13659                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13660                        formatter.write_str("a field name for TaskRetryPolicy")
13661                    }
13662                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13663                    where
13664                        E: serde::de::Error,
13665                    {
13666                        use std::result::Result::Ok;
13667                        use std::string::ToString;
13668                        match value {
13669                            "minimumBackoff" => Ok(__FieldTag::__minimum_backoff),
13670                            "minimum_backoff" => Ok(__FieldTag::__minimum_backoff),
13671                            "maximumBackoff" => Ok(__FieldTag::__maximum_backoff),
13672                            "maximum_backoff" => Ok(__FieldTag::__maximum_backoff),
13673                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13674                        }
13675                    }
13676                }
13677                deserializer.deserialize_identifier(Visitor)
13678            }
13679        }
13680        struct Visitor;
13681        impl<'de> serde::de::Visitor<'de> for Visitor {
13682            type Value = TaskRetryPolicy;
13683            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13684                formatter.write_str("struct TaskRetryPolicy")
13685            }
13686            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13687            where
13688                A: serde::de::MapAccess<'de>,
13689            {
13690                #[allow(unused_imports)]
13691                use serde::de::Error;
13692                use std::option::Option::Some;
13693                let mut fields = std::collections::HashSet::new();
13694                let mut result = Self::Value::new();
13695                while let Some(tag) = map.next_key::<__FieldTag>()? {
13696                    #[allow(clippy::match_single_binding)]
13697                    match tag {
13698                        __FieldTag::__minimum_backoff => {
13699                            if !fields.insert(__FieldTag::__minimum_backoff) {
13700                                return std::result::Result::Err(A::Error::duplicate_field(
13701                                    "multiple values for minimum_backoff",
13702                                ));
13703                            }
13704                            result.minimum_backoff =
13705                                map.next_value::<std::option::Option<wkt::Duration>>()?;
13706                        }
13707                        __FieldTag::__maximum_backoff => {
13708                            if !fields.insert(__FieldTag::__maximum_backoff) {
13709                                return std::result::Result::Err(A::Error::duplicate_field(
13710                                    "multiple values for maximum_backoff",
13711                                ));
13712                            }
13713                            result.maximum_backoff =
13714                                map.next_value::<std::option::Option<wkt::Duration>>()?;
13715                        }
13716                        __FieldTag::Unknown(key) => {
13717                            let value = map.next_value::<serde_json::Value>()?;
13718                            result._unknown_fields.insert(key, value);
13719                        }
13720                    }
13721                }
13722                std::result::Result::Ok(result)
13723            }
13724        }
13725        deserializer.deserialize_any(Visitor)
13726    }
13727}
13728
13729#[doc(hidden)]
13730impl serde::ser::Serialize for TaskRetryPolicy {
13731    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13732    where
13733        S: serde::ser::Serializer,
13734    {
13735        use serde::ser::SerializeMap;
13736        #[allow(unused_imports)]
13737        use std::option::Option::Some;
13738        let mut state = serializer.serialize_map(std::option::Option::None)?;
13739        if self.minimum_backoff.is_some() {
13740            state.serialize_entry("minimumBackoff", &self.minimum_backoff)?;
13741        }
13742        if self.maximum_backoff.is_some() {
13743            state.serialize_entry("maximumBackoff", &self.maximum_backoff)?;
13744        }
13745        if !self._unknown_fields.is_empty() {
13746            for (key, value) in self._unknown_fields.iter() {
13747                state.serialize_entry(key, &value)?;
13748            }
13749        }
13750        state.end()
13751    }
13752}
13753
13754impl std::fmt::Debug for TaskRetryPolicy {
13755    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13756        let mut debug_struct = f.debug_struct("TaskRetryPolicy");
13757        debug_struct.field("minimum_backoff", &self.minimum_backoff);
13758        debug_struct.field("maximum_backoff", &self.maximum_backoff);
13759        if !self._unknown_fields.is_empty() {
13760            debug_struct.field("_unknown_fields", &self._unknown_fields);
13761        }
13762        debug_struct.finish()
13763    }
13764}
13765
13766/// Represents the set of ACLs for a given Kafka Resource Pattern, which consists
13767/// of resource_type, resource_name and pattern_type.
13768#[derive(Clone, Default, PartialEq)]
13769#[non_exhaustive]
13770pub struct Acl {
13771    /// Identifier. The name for the acl. Represents a single Resource Pattern.
13772    /// Structured like:
13773    /// projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}
13774    ///
13775    /// The structure of `acl_id` defines the Resource Pattern (resource_type,
13776    /// resource_name, pattern_type) of the acl. `acl_id` is structured like one of
13777    /// the following:
13778    ///
13779    /// For acls on the cluster:
13780    /// `cluster`
13781    ///
13782    /// For acls on a single resource within the cluster:
13783    /// `topic/{resource_name}`
13784    /// `consumerGroup/{resource_name}`
13785    /// `transactionalId/{resource_name}`
13786    ///
13787    /// For acls on all resources that match a prefix:
13788    /// `topicPrefixed/{resource_name}`
13789    /// `consumerGroupPrefixed/{resource_name}`
13790    /// `transactionalIdPrefixed/{resource_name}`
13791    ///
13792    /// For acls on all resources of a given type (i.e. the wildcard literal "*"):
13793    /// `allTopics` (represents `topic/*`)
13794    /// `allConsumerGroups` (represents `consumerGroup/*`)
13795    /// `allTransactionalIds` (represents `transactionalId/*`)
13796    pub name: std::string::String,
13797
13798    /// Required. The ACL entries that apply to the resource pattern. The maximum
13799    /// number of allowed entries 100.
13800    pub acl_entries: std::vec::Vec<crate::model::AclEntry>,
13801
13802    /// Optional. `etag` is used for concurrency control. An `etag` is returned in
13803    /// the response to `GetAcl` and `CreateAcl`. Callers are required to put that
13804    /// etag in the request to `UpdateAcl` to ensure that their change will be
13805    /// applied to the same version of the acl that exists in the Kafka Cluster.
13806    ///
13807    /// A terminal 'T' character in the etag indicates that the AclEntries were
13808    /// truncated; more entries for the Acl exist on the Kafka Cluster, but can't
13809    /// be returned in the Acl due to repeated field limits.
13810    pub etag: std::string::String,
13811
13812    /// Output only. The ACL resource type derived from the name. One of: CLUSTER,
13813    /// TOPIC, GROUP, TRANSACTIONAL_ID.
13814    pub resource_type: std::string::String,
13815
13816    /// Output only. The ACL resource name derived from the name. For cluster
13817    /// resource_type, this is always "kafka-cluster". Can be the wildcard literal
13818    /// "*".
13819    pub resource_name: std::string::String,
13820
13821    /// Output only. The ACL pattern type derived from the name. One of: LITERAL,
13822    /// PREFIXED.
13823    pub pattern_type: std::string::String,
13824
13825    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13826}
13827
13828impl Acl {
13829    pub fn new() -> Self {
13830        std::default::Default::default()
13831    }
13832
13833    /// Sets the value of [name][crate::model::Acl::name].
13834    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13835        self.name = v.into();
13836        self
13837    }
13838
13839    /// Sets the value of [acl_entries][crate::model::Acl::acl_entries].
13840    pub fn set_acl_entries<T, V>(mut self, v: T) -> Self
13841    where
13842        T: std::iter::IntoIterator<Item = V>,
13843        V: std::convert::Into<crate::model::AclEntry>,
13844    {
13845        use std::iter::Iterator;
13846        self.acl_entries = v.into_iter().map(|i| i.into()).collect();
13847        self
13848    }
13849
13850    /// Sets the value of [etag][crate::model::Acl::etag].
13851    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13852        self.etag = v.into();
13853        self
13854    }
13855
13856    /// Sets the value of [resource_type][crate::model::Acl::resource_type].
13857    pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13858        self.resource_type = v.into();
13859        self
13860    }
13861
13862    /// Sets the value of [resource_name][crate::model::Acl::resource_name].
13863    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13864        self.resource_name = v.into();
13865        self
13866    }
13867
13868    /// Sets the value of [pattern_type][crate::model::Acl::pattern_type].
13869    pub fn set_pattern_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13870        self.pattern_type = v.into();
13871        self
13872    }
13873}
13874
13875impl wkt::message::Message for Acl {
13876    fn typename() -> &'static str {
13877        "type.googleapis.com/google.cloud.managedkafka.v1.Acl"
13878    }
13879}
13880
13881#[doc(hidden)]
13882impl<'de> serde::de::Deserialize<'de> for Acl {
13883    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13884    where
13885        D: serde::Deserializer<'de>,
13886    {
13887        #[allow(non_camel_case_types)]
13888        #[doc(hidden)]
13889        #[derive(PartialEq, Eq, Hash)]
13890        enum __FieldTag {
13891            __name,
13892            __acl_entries,
13893            __etag,
13894            __resource_type,
13895            __resource_name,
13896            __pattern_type,
13897            Unknown(std::string::String),
13898        }
13899        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13900            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13901            where
13902                D: serde::Deserializer<'de>,
13903            {
13904                struct Visitor;
13905                impl<'de> serde::de::Visitor<'de> for Visitor {
13906                    type Value = __FieldTag;
13907                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13908                        formatter.write_str("a field name for Acl")
13909                    }
13910                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13911                    where
13912                        E: serde::de::Error,
13913                    {
13914                        use std::result::Result::Ok;
13915                        use std::string::ToString;
13916                        match value {
13917                            "name" => Ok(__FieldTag::__name),
13918                            "aclEntries" => Ok(__FieldTag::__acl_entries),
13919                            "acl_entries" => Ok(__FieldTag::__acl_entries),
13920                            "etag" => Ok(__FieldTag::__etag),
13921                            "resourceType" => Ok(__FieldTag::__resource_type),
13922                            "resource_type" => Ok(__FieldTag::__resource_type),
13923                            "resourceName" => Ok(__FieldTag::__resource_name),
13924                            "resource_name" => Ok(__FieldTag::__resource_name),
13925                            "patternType" => Ok(__FieldTag::__pattern_type),
13926                            "pattern_type" => Ok(__FieldTag::__pattern_type),
13927                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13928                        }
13929                    }
13930                }
13931                deserializer.deserialize_identifier(Visitor)
13932            }
13933        }
13934        struct Visitor;
13935        impl<'de> serde::de::Visitor<'de> for Visitor {
13936            type Value = Acl;
13937            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13938                formatter.write_str("struct Acl")
13939            }
13940            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13941            where
13942                A: serde::de::MapAccess<'de>,
13943            {
13944                #[allow(unused_imports)]
13945                use serde::de::Error;
13946                use std::option::Option::Some;
13947                let mut fields = std::collections::HashSet::new();
13948                let mut result = Self::Value::new();
13949                while let Some(tag) = map.next_key::<__FieldTag>()? {
13950                    #[allow(clippy::match_single_binding)]
13951                    match tag {
13952                        __FieldTag::__name => {
13953                            if !fields.insert(__FieldTag::__name) {
13954                                return std::result::Result::Err(A::Error::duplicate_field(
13955                                    "multiple values for name",
13956                                ));
13957                            }
13958                            result.name = map
13959                                .next_value::<std::option::Option<std::string::String>>()?
13960                                .unwrap_or_default();
13961                        }
13962                        __FieldTag::__acl_entries => {
13963                            if !fields.insert(__FieldTag::__acl_entries) {
13964                                return std::result::Result::Err(A::Error::duplicate_field(
13965                                    "multiple values for acl_entries",
13966                                ));
13967                            }
13968                            result.acl_entries = map.next_value::<std::option::Option<std::vec::Vec<crate::model::AclEntry>>>()?.unwrap_or_default();
13969                        }
13970                        __FieldTag::__etag => {
13971                            if !fields.insert(__FieldTag::__etag) {
13972                                return std::result::Result::Err(A::Error::duplicate_field(
13973                                    "multiple values for etag",
13974                                ));
13975                            }
13976                            result.etag = map
13977                                .next_value::<std::option::Option<std::string::String>>()?
13978                                .unwrap_or_default();
13979                        }
13980                        __FieldTag::__resource_type => {
13981                            if !fields.insert(__FieldTag::__resource_type) {
13982                                return std::result::Result::Err(A::Error::duplicate_field(
13983                                    "multiple values for resource_type",
13984                                ));
13985                            }
13986                            result.resource_type = map
13987                                .next_value::<std::option::Option<std::string::String>>()?
13988                                .unwrap_or_default();
13989                        }
13990                        __FieldTag::__resource_name => {
13991                            if !fields.insert(__FieldTag::__resource_name) {
13992                                return std::result::Result::Err(A::Error::duplicate_field(
13993                                    "multiple values for resource_name",
13994                                ));
13995                            }
13996                            result.resource_name = map
13997                                .next_value::<std::option::Option<std::string::String>>()?
13998                                .unwrap_or_default();
13999                        }
14000                        __FieldTag::__pattern_type => {
14001                            if !fields.insert(__FieldTag::__pattern_type) {
14002                                return std::result::Result::Err(A::Error::duplicate_field(
14003                                    "multiple values for pattern_type",
14004                                ));
14005                            }
14006                            result.pattern_type = map
14007                                .next_value::<std::option::Option<std::string::String>>()?
14008                                .unwrap_or_default();
14009                        }
14010                        __FieldTag::Unknown(key) => {
14011                            let value = map.next_value::<serde_json::Value>()?;
14012                            result._unknown_fields.insert(key, value);
14013                        }
14014                    }
14015                }
14016                std::result::Result::Ok(result)
14017            }
14018        }
14019        deserializer.deserialize_any(Visitor)
14020    }
14021}
14022
14023#[doc(hidden)]
14024impl serde::ser::Serialize for Acl {
14025    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14026    where
14027        S: serde::ser::Serializer,
14028    {
14029        use serde::ser::SerializeMap;
14030        #[allow(unused_imports)]
14031        use std::option::Option::Some;
14032        let mut state = serializer.serialize_map(std::option::Option::None)?;
14033        if !self.name.is_empty() {
14034            state.serialize_entry("name", &self.name)?;
14035        }
14036        if !self.acl_entries.is_empty() {
14037            state.serialize_entry("aclEntries", &self.acl_entries)?;
14038        }
14039        if !self.etag.is_empty() {
14040            state.serialize_entry("etag", &self.etag)?;
14041        }
14042        if !self.resource_type.is_empty() {
14043            state.serialize_entry("resourceType", &self.resource_type)?;
14044        }
14045        if !self.resource_name.is_empty() {
14046            state.serialize_entry("resourceName", &self.resource_name)?;
14047        }
14048        if !self.pattern_type.is_empty() {
14049            state.serialize_entry("patternType", &self.pattern_type)?;
14050        }
14051        if !self._unknown_fields.is_empty() {
14052            for (key, value) in self._unknown_fields.iter() {
14053                state.serialize_entry(key, &value)?;
14054            }
14055        }
14056        state.end()
14057    }
14058}
14059
14060impl std::fmt::Debug for Acl {
14061    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14062        let mut debug_struct = f.debug_struct("Acl");
14063        debug_struct.field("name", &self.name);
14064        debug_struct.field("acl_entries", &self.acl_entries);
14065        debug_struct.field("etag", &self.etag);
14066        debug_struct.field("resource_type", &self.resource_type);
14067        debug_struct.field("resource_name", &self.resource_name);
14068        debug_struct.field("pattern_type", &self.pattern_type);
14069        if !self._unknown_fields.is_empty() {
14070            debug_struct.field("_unknown_fields", &self._unknown_fields);
14071        }
14072        debug_struct.finish()
14073    }
14074}
14075
14076/// Represents the access granted for a given Resource Pattern in an ACL.
14077#[derive(Clone, Default, PartialEq)]
14078#[non_exhaustive]
14079pub struct AclEntry {
14080    /// Required. The principal. Specified as Google Cloud account, with the Kafka
14081    /// StandardAuthorizer prefix "User:". For example:
14082    /// "User:test-kafka-client@test-project.iam.gserviceaccount.com".
14083    /// Can be the wildcard "User:*" to refer to all users.
14084    pub principal: std::string::String,
14085
14086    /// Required. The permission type. Accepted values are (case insensitive):
14087    /// ALLOW, DENY.
14088    pub permission_type: std::string::String,
14089
14090    /// Required. The operation type. Allowed values are (case insensitive): ALL,
14091    /// READ, WRITE, CREATE, DELETE, ALTER, DESCRIBE, CLUSTER_ACTION,
14092    /// DESCRIBE_CONFIGS, ALTER_CONFIGS, and IDEMPOTENT_WRITE. See
14093    /// <https://kafka.apache.org/documentation/#operations_resources_and_protocols>
14094    /// for valid combinations of resource_type and operation for different Kafka
14095    /// API requests.
14096    pub operation: std::string::String,
14097
14098    /// Required. The host. Must be set to "*" for Managed Service for Apache
14099    /// Kafka.
14100    pub host: std::string::String,
14101
14102    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14103}
14104
14105impl AclEntry {
14106    pub fn new() -> Self {
14107        std::default::Default::default()
14108    }
14109
14110    /// Sets the value of [principal][crate::model::AclEntry::principal].
14111    pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14112        self.principal = v.into();
14113        self
14114    }
14115
14116    /// Sets the value of [permission_type][crate::model::AclEntry::permission_type].
14117    pub fn set_permission_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14118        self.permission_type = v.into();
14119        self
14120    }
14121
14122    /// Sets the value of [operation][crate::model::AclEntry::operation].
14123    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14124        self.operation = v.into();
14125        self
14126    }
14127
14128    /// Sets the value of [host][crate::model::AclEntry::host].
14129    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14130        self.host = v.into();
14131        self
14132    }
14133}
14134
14135impl wkt::message::Message for AclEntry {
14136    fn typename() -> &'static str {
14137        "type.googleapis.com/google.cloud.managedkafka.v1.AclEntry"
14138    }
14139}
14140
14141#[doc(hidden)]
14142impl<'de> serde::de::Deserialize<'de> for AclEntry {
14143    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14144    where
14145        D: serde::Deserializer<'de>,
14146    {
14147        #[allow(non_camel_case_types)]
14148        #[doc(hidden)]
14149        #[derive(PartialEq, Eq, Hash)]
14150        enum __FieldTag {
14151            __principal,
14152            __permission_type,
14153            __operation,
14154            __host,
14155            Unknown(std::string::String),
14156        }
14157        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14158            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14159            where
14160                D: serde::Deserializer<'de>,
14161            {
14162                struct Visitor;
14163                impl<'de> serde::de::Visitor<'de> for Visitor {
14164                    type Value = __FieldTag;
14165                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14166                        formatter.write_str("a field name for AclEntry")
14167                    }
14168                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14169                    where
14170                        E: serde::de::Error,
14171                    {
14172                        use std::result::Result::Ok;
14173                        use std::string::ToString;
14174                        match value {
14175                            "principal" => Ok(__FieldTag::__principal),
14176                            "permissionType" => Ok(__FieldTag::__permission_type),
14177                            "permission_type" => Ok(__FieldTag::__permission_type),
14178                            "operation" => Ok(__FieldTag::__operation),
14179                            "host" => Ok(__FieldTag::__host),
14180                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14181                        }
14182                    }
14183                }
14184                deserializer.deserialize_identifier(Visitor)
14185            }
14186        }
14187        struct Visitor;
14188        impl<'de> serde::de::Visitor<'de> for Visitor {
14189            type Value = AclEntry;
14190            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14191                formatter.write_str("struct AclEntry")
14192            }
14193            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14194            where
14195                A: serde::de::MapAccess<'de>,
14196            {
14197                #[allow(unused_imports)]
14198                use serde::de::Error;
14199                use std::option::Option::Some;
14200                let mut fields = std::collections::HashSet::new();
14201                let mut result = Self::Value::new();
14202                while let Some(tag) = map.next_key::<__FieldTag>()? {
14203                    #[allow(clippy::match_single_binding)]
14204                    match tag {
14205                        __FieldTag::__principal => {
14206                            if !fields.insert(__FieldTag::__principal) {
14207                                return std::result::Result::Err(A::Error::duplicate_field(
14208                                    "multiple values for principal",
14209                                ));
14210                            }
14211                            result.principal = map
14212                                .next_value::<std::option::Option<std::string::String>>()?
14213                                .unwrap_or_default();
14214                        }
14215                        __FieldTag::__permission_type => {
14216                            if !fields.insert(__FieldTag::__permission_type) {
14217                                return std::result::Result::Err(A::Error::duplicate_field(
14218                                    "multiple values for permission_type",
14219                                ));
14220                            }
14221                            result.permission_type = map
14222                                .next_value::<std::option::Option<std::string::String>>()?
14223                                .unwrap_or_default();
14224                        }
14225                        __FieldTag::__operation => {
14226                            if !fields.insert(__FieldTag::__operation) {
14227                                return std::result::Result::Err(A::Error::duplicate_field(
14228                                    "multiple values for operation",
14229                                ));
14230                            }
14231                            result.operation = map
14232                                .next_value::<std::option::Option<std::string::String>>()?
14233                                .unwrap_or_default();
14234                        }
14235                        __FieldTag::__host => {
14236                            if !fields.insert(__FieldTag::__host) {
14237                                return std::result::Result::Err(A::Error::duplicate_field(
14238                                    "multiple values for host",
14239                                ));
14240                            }
14241                            result.host = map
14242                                .next_value::<std::option::Option<std::string::String>>()?
14243                                .unwrap_or_default();
14244                        }
14245                        __FieldTag::Unknown(key) => {
14246                            let value = map.next_value::<serde_json::Value>()?;
14247                            result._unknown_fields.insert(key, value);
14248                        }
14249                    }
14250                }
14251                std::result::Result::Ok(result)
14252            }
14253        }
14254        deserializer.deserialize_any(Visitor)
14255    }
14256}
14257
14258#[doc(hidden)]
14259impl serde::ser::Serialize for AclEntry {
14260    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14261    where
14262        S: serde::ser::Serializer,
14263    {
14264        use serde::ser::SerializeMap;
14265        #[allow(unused_imports)]
14266        use std::option::Option::Some;
14267        let mut state = serializer.serialize_map(std::option::Option::None)?;
14268        if !self.principal.is_empty() {
14269            state.serialize_entry("principal", &self.principal)?;
14270        }
14271        if !self.permission_type.is_empty() {
14272            state.serialize_entry("permissionType", &self.permission_type)?;
14273        }
14274        if !self.operation.is_empty() {
14275            state.serialize_entry("operation", &self.operation)?;
14276        }
14277        if !self.host.is_empty() {
14278            state.serialize_entry("host", &self.host)?;
14279        }
14280        if !self._unknown_fields.is_empty() {
14281            for (key, value) in self._unknown_fields.iter() {
14282                state.serialize_entry(key, &value)?;
14283            }
14284        }
14285        state.end()
14286    }
14287}
14288
14289impl std::fmt::Debug for AclEntry {
14290    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14291        let mut debug_struct = f.debug_struct("AclEntry");
14292        debug_struct.field("principal", &self.principal);
14293        debug_struct.field("permission_type", &self.permission_type);
14294        debug_struct.field("operation", &self.operation);
14295        debug_struct.field("host", &self.host);
14296        if !self._unknown_fields.is_empty() {
14297            debug_struct.field("_unknown_fields", &self._unknown_fields);
14298        }
14299        debug_struct.finish()
14300    }
14301}