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
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Request for ListClusters.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ListClustersRequest {
44    /// Required. The parent location whose clusters are to be listed. Structured
45    /// like `projects/{project}/locations/{location}`.
46    pub parent: std::string::String,
47
48    /// Optional. The maximum number of clusters to return. The service may return
49    /// fewer than this value. If unspecified, server will pick an appropriate
50    /// default.
51    pub page_size: i32,
52
53    /// Optional. A page token, received from a previous `ListClusters` call.
54    /// Provide this to retrieve the subsequent page.
55    ///
56    /// When paginating, all other parameters provided to `ListClusters` must match
57    /// the call that provided the page token.
58    pub page_token: std::string::String,
59
60    /// Optional. Filter expression for the result.
61    pub filter: std::string::String,
62
63    /// Optional. Order by fields for the result.
64    pub order_by: std::string::String,
65
66    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
67}
68
69impl ListClustersRequest {
70    pub fn new() -> Self {
71        std::default::Default::default()
72    }
73
74    /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
75    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76        self.parent = v.into();
77        self
78    }
79
80    /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
81    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
82        self.page_size = v.into();
83        self
84    }
85
86    /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
87    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
88        self.page_token = v.into();
89        self
90    }
91
92    /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
93    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
94        self.filter = v.into();
95        self
96    }
97
98    /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
99    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100        self.order_by = v.into();
101        self
102    }
103}
104
105impl wkt::message::Message for ListClustersRequest {
106    fn typename() -> &'static str {
107        "type.googleapis.com/google.cloud.managedkafka.v1.ListClustersRequest"
108    }
109}
110
111/// Response for ListClusters.
112#[derive(Clone, Default, PartialEq)]
113#[non_exhaustive]
114pub struct ListClustersResponse {
115    /// The list of Clusters in the requested parent.
116    pub clusters: std::vec::Vec<crate::model::Cluster>,
117
118    /// A token that can be sent as `page_token` to retrieve the next page of
119    /// results. If this field is omitted, there are no more results.
120    pub next_page_token: std::string::String,
121
122    /// Locations that could not be reached.
123    pub unreachable: std::vec::Vec<std::string::String>,
124
125    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
126}
127
128impl ListClustersResponse {
129    pub fn new() -> Self {
130        std::default::Default::default()
131    }
132
133    /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
134    pub fn set_clusters<T, V>(mut self, v: T) -> Self
135    where
136        T: std::iter::IntoIterator<Item = V>,
137        V: std::convert::Into<crate::model::Cluster>,
138    {
139        use std::iter::Iterator;
140        self.clusters = v.into_iter().map(|i| i.into()).collect();
141        self
142    }
143
144    /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
145    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
146        self.next_page_token = v.into();
147        self
148    }
149
150    /// Sets the value of [unreachable][crate::model::ListClustersResponse::unreachable].
151    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
152    where
153        T: std::iter::IntoIterator<Item = V>,
154        V: std::convert::Into<std::string::String>,
155    {
156        use std::iter::Iterator;
157        self.unreachable = v.into_iter().map(|i| i.into()).collect();
158        self
159    }
160}
161
162impl wkt::message::Message for ListClustersResponse {
163    fn typename() -> &'static str {
164        "type.googleapis.com/google.cloud.managedkafka.v1.ListClustersResponse"
165    }
166}
167
168#[doc(hidden)]
169impl gax::paginator::internal::PageableResponse for ListClustersResponse {
170    type PageItem = crate::model::Cluster;
171
172    fn items(self) -> std::vec::Vec<Self::PageItem> {
173        self.clusters
174    }
175
176    fn next_page_token(&self) -> std::string::String {
177        use std::clone::Clone;
178        self.next_page_token.clone()
179    }
180}
181
182/// Request for GetCluster.
183#[derive(Clone, Default, PartialEq)]
184#[non_exhaustive]
185pub struct GetClusterRequest {
186    /// Required. The name of the cluster whose configuration to return.
187    pub name: std::string::String,
188
189    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
190}
191
192impl GetClusterRequest {
193    pub fn new() -> Self {
194        std::default::Default::default()
195    }
196
197    /// Sets the value of [name][crate::model::GetClusterRequest::name].
198    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
199        self.name = v.into();
200        self
201    }
202}
203
204impl wkt::message::Message for GetClusterRequest {
205    fn typename() -> &'static str {
206        "type.googleapis.com/google.cloud.managedkafka.v1.GetClusterRequest"
207    }
208}
209
210/// Request for CreateCluster.
211#[derive(Clone, Default, PartialEq)]
212#[non_exhaustive]
213pub struct CreateClusterRequest {
214    /// Required. The parent region in which to create the cluster. Structured like
215    /// `projects/{project}/locations/{location}`.
216    pub parent: std::string::String,
217
218    /// Required. The ID to use for the cluster, which will become the final
219    /// component of the cluster's name. The ID must be 1-63 characters long, and
220    /// match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with
221    /// RFC 1035.
222    ///
223    /// This value is structured like: `my-cluster-id`.
224    pub cluster_id: std::string::String,
225
226    /// Required. Configuration of the cluster to create. Its `name` field is
227    /// ignored.
228    pub cluster: std::option::Option<crate::model::Cluster>,
229
230    /// Optional. An optional request ID to identify requests. Specify a unique
231    /// request ID to avoid duplication of requests. If a request times out or
232    /// fails, retrying with the same ID allows the server to recognize the
233    /// previous attempt. For at least 60 minutes, the server ignores duplicate
234    /// requests bearing the same ID.
235    ///
236    /// For example, consider a situation where you make an initial request and the
237    /// request times out. If you make the request again with the same request ID
238    /// within 60 minutes of the last request, the server checks if an original
239    /// operation with the same request ID was received. If so, the server ignores
240    /// the second request.
241    ///
242    /// The request ID must be a valid UUID. A zero UUID is not supported
243    /// (00000000-0000-0000-0000-000000000000).
244    pub request_id: std::string::String,
245
246    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
247}
248
249impl CreateClusterRequest {
250    pub fn new() -> Self {
251        std::default::Default::default()
252    }
253
254    /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
255    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
256        self.parent = v.into();
257        self
258    }
259
260    /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
261    pub fn set_cluster_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
262        self.cluster_id = v.into();
263        self
264    }
265
266    /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
267    pub fn set_cluster<T>(mut self, v: T) -> Self
268    where
269        T: std::convert::Into<crate::model::Cluster>,
270    {
271        self.cluster = std::option::Option::Some(v.into());
272        self
273    }
274
275    /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
276    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
277    where
278        T: std::convert::Into<crate::model::Cluster>,
279    {
280        self.cluster = v.map(|x| x.into());
281        self
282    }
283
284    /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
285    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
286        self.request_id = v.into();
287        self
288    }
289}
290
291impl wkt::message::Message for CreateClusterRequest {
292    fn typename() -> &'static str {
293        "type.googleapis.com/google.cloud.managedkafka.v1.CreateClusterRequest"
294    }
295}
296
297/// Request for UpdateCluster.
298#[derive(Clone, Default, PartialEq)]
299#[non_exhaustive]
300pub struct UpdateClusterRequest {
301    /// Required. Field mask is used to specify the fields to be overwritten in the
302    /// cluster resource by the update. The fields specified in the update_mask are
303    /// relative to the resource, not the full request. A field will be overwritten
304    /// if it is in the mask. The mask is required and a value of * will update all
305    /// fields.
306    pub update_mask: std::option::Option<wkt::FieldMask>,
307
308    /// Required. The cluster to update. Its `name` field must be populated.
309    pub cluster: std::option::Option<crate::model::Cluster>,
310
311    /// Optional. An optional request ID to identify requests. Specify a unique
312    /// request ID to avoid duplication of requests. If a request times out or
313    /// fails, retrying with the same ID allows the server to recognize the
314    /// previous attempt. For at least 60 minutes, the server ignores duplicate
315    /// requests bearing the same ID.
316    ///
317    /// For example, consider a situation where you make an initial request and the
318    /// request times out. If you make the request again with the same request ID
319    /// within 60 minutes of the last request, the server checks if an original
320    /// operation with the same request ID was received. If so, the server ignores
321    /// the second request.
322    ///
323    /// The request ID must be a valid UUID. A zero UUID is not supported
324    /// (00000000-0000-0000-0000-000000000000).
325    pub request_id: std::string::String,
326
327    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
328}
329
330impl UpdateClusterRequest {
331    pub fn new() -> Self {
332        std::default::Default::default()
333    }
334
335    /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
336    pub fn set_update_mask<T>(mut self, v: T) -> Self
337    where
338        T: std::convert::Into<wkt::FieldMask>,
339    {
340        self.update_mask = std::option::Option::Some(v.into());
341        self
342    }
343
344    /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
345    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
346    where
347        T: std::convert::Into<wkt::FieldMask>,
348    {
349        self.update_mask = v.map(|x| x.into());
350        self
351    }
352
353    /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
354    pub fn set_cluster<T>(mut self, v: T) -> Self
355    where
356        T: std::convert::Into<crate::model::Cluster>,
357    {
358        self.cluster = std::option::Option::Some(v.into());
359        self
360    }
361
362    /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
363    pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
364    where
365        T: std::convert::Into<crate::model::Cluster>,
366    {
367        self.cluster = v.map(|x| x.into());
368        self
369    }
370
371    /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
372    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
373        self.request_id = v.into();
374        self
375    }
376}
377
378impl wkt::message::Message for UpdateClusterRequest {
379    fn typename() -> &'static str {
380        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateClusterRequest"
381    }
382}
383
384/// Request for DeleteCluster.
385#[derive(Clone, Default, PartialEq)]
386#[non_exhaustive]
387pub struct DeleteClusterRequest {
388    /// Required. The name of the cluster to delete.
389    pub name: std::string::String,
390
391    /// Optional. An optional request ID to identify requests. Specify a unique
392    /// request ID to avoid duplication of requests. If a request times out or
393    /// fails, retrying with the same ID allows the server to recognize the
394    /// previous attempt. For at least 60 minutes, the server ignores duplicate
395    /// requests bearing the same ID.
396    ///
397    /// For example, consider a situation where you make an initial request and the
398    /// request times out. If you make the request again with the same request ID
399    /// within 60 minutes of the last request, the server checks if an original
400    /// operation with the same request ID was received. If so, the server ignores
401    /// the second request.
402    ///
403    /// The request ID must be a valid UUID. A zero UUID is not supported
404    /// (00000000-0000-0000-0000-000000000000).
405    pub request_id: std::string::String,
406
407    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
408}
409
410impl DeleteClusterRequest {
411    pub fn new() -> Self {
412        std::default::Default::default()
413    }
414
415    /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
416    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
417        self.name = v.into();
418        self
419    }
420
421    /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
422    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
423        self.request_id = v.into();
424        self
425    }
426}
427
428impl wkt::message::Message for DeleteClusterRequest {
429    fn typename() -> &'static str {
430        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteClusterRequest"
431    }
432}
433
434/// Request for ListTopics.
435#[derive(Clone, Default, PartialEq)]
436#[non_exhaustive]
437pub struct ListTopicsRequest {
438    /// Required. The parent cluster whose topics are to be listed. Structured like
439    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
440    pub parent: std::string::String,
441
442    /// Optional. The maximum number of topics to return. The service may return
443    /// fewer than this value. If unset or zero, all topics for the parent is
444    /// returned.
445    pub page_size: i32,
446
447    /// Optional. A page token, received from a previous `ListTopics` call.
448    /// Provide this to retrieve the subsequent page.
449    ///
450    /// When paginating, all other parameters provided to `ListTopics` must match
451    /// the call that provided the page token.
452    pub page_token: std::string::String,
453
454    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
455}
456
457impl ListTopicsRequest {
458    pub fn new() -> Self {
459        std::default::Default::default()
460    }
461
462    /// Sets the value of [parent][crate::model::ListTopicsRequest::parent].
463    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
464        self.parent = v.into();
465        self
466    }
467
468    /// Sets the value of [page_size][crate::model::ListTopicsRequest::page_size].
469    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
470        self.page_size = v.into();
471        self
472    }
473
474    /// Sets the value of [page_token][crate::model::ListTopicsRequest::page_token].
475    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
476        self.page_token = v.into();
477        self
478    }
479}
480
481impl wkt::message::Message for ListTopicsRequest {
482    fn typename() -> &'static str {
483        "type.googleapis.com/google.cloud.managedkafka.v1.ListTopicsRequest"
484    }
485}
486
487/// Response for ListTopics.
488#[derive(Clone, Default, PartialEq)]
489#[non_exhaustive]
490pub struct ListTopicsResponse {
491    /// The list of topics in the requested parent. The order of the topics is
492    /// unspecified.
493    pub topics: std::vec::Vec<crate::model::Topic>,
494
495    /// A token that can be sent as `page_token` to retrieve the next page of
496    /// results. If this field is omitted, there are no more results.
497    pub next_page_token: std::string::String,
498
499    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
500}
501
502impl ListTopicsResponse {
503    pub fn new() -> Self {
504        std::default::Default::default()
505    }
506
507    /// Sets the value of [topics][crate::model::ListTopicsResponse::topics].
508    pub fn set_topics<T, V>(mut self, v: T) -> Self
509    where
510        T: std::iter::IntoIterator<Item = V>,
511        V: std::convert::Into<crate::model::Topic>,
512    {
513        use std::iter::Iterator;
514        self.topics = v.into_iter().map(|i| i.into()).collect();
515        self
516    }
517
518    /// Sets the value of [next_page_token][crate::model::ListTopicsResponse::next_page_token].
519    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
520        self.next_page_token = v.into();
521        self
522    }
523}
524
525impl wkt::message::Message for ListTopicsResponse {
526    fn typename() -> &'static str {
527        "type.googleapis.com/google.cloud.managedkafka.v1.ListTopicsResponse"
528    }
529}
530
531#[doc(hidden)]
532impl gax::paginator::internal::PageableResponse for ListTopicsResponse {
533    type PageItem = crate::model::Topic;
534
535    fn items(self) -> std::vec::Vec<Self::PageItem> {
536        self.topics
537    }
538
539    fn next_page_token(&self) -> std::string::String {
540        use std::clone::Clone;
541        self.next_page_token.clone()
542    }
543}
544
545/// Request for GetTopic.
546#[derive(Clone, Default, PartialEq)]
547#[non_exhaustive]
548pub struct GetTopicRequest {
549    /// Required. The name of the topic whose configuration to return. Structured
550    /// like:
551    /// projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}.
552    pub name: std::string::String,
553
554    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
555}
556
557impl GetTopicRequest {
558    pub fn new() -> Self {
559        std::default::Default::default()
560    }
561
562    /// Sets the value of [name][crate::model::GetTopicRequest::name].
563    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
564        self.name = v.into();
565        self
566    }
567}
568
569impl wkt::message::Message for GetTopicRequest {
570    fn typename() -> &'static str {
571        "type.googleapis.com/google.cloud.managedkafka.v1.GetTopicRequest"
572    }
573}
574
575/// Request for CreateTopic.
576#[derive(Clone, Default, PartialEq)]
577#[non_exhaustive]
578pub struct CreateTopicRequest {
579    /// Required. The parent cluster in which to create the topic.
580    /// Structured like
581    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
582    pub parent: std::string::String,
583
584    /// Required. The ID to use for the topic, which will become the final
585    /// component of the topic's name.
586    ///
587    /// This value is structured like: `my-topic-name`.
588    pub topic_id: std::string::String,
589
590    /// Required. Configuration of the topic to create. Its `name` field is
591    /// ignored.
592    pub topic: std::option::Option<crate::model::Topic>,
593
594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
595}
596
597impl CreateTopicRequest {
598    pub fn new() -> Self {
599        std::default::Default::default()
600    }
601
602    /// Sets the value of [parent][crate::model::CreateTopicRequest::parent].
603    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
604        self.parent = v.into();
605        self
606    }
607
608    /// Sets the value of [topic_id][crate::model::CreateTopicRequest::topic_id].
609    pub fn set_topic_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
610        self.topic_id = v.into();
611        self
612    }
613
614    /// Sets the value of [topic][crate::model::CreateTopicRequest::topic].
615    pub fn set_topic<T>(mut self, v: T) -> Self
616    where
617        T: std::convert::Into<crate::model::Topic>,
618    {
619        self.topic = std::option::Option::Some(v.into());
620        self
621    }
622
623    /// Sets or clears the value of [topic][crate::model::CreateTopicRequest::topic].
624    pub fn set_or_clear_topic<T>(mut self, v: std::option::Option<T>) -> Self
625    where
626        T: std::convert::Into<crate::model::Topic>,
627    {
628        self.topic = v.map(|x| x.into());
629        self
630    }
631}
632
633impl wkt::message::Message for CreateTopicRequest {
634    fn typename() -> &'static str {
635        "type.googleapis.com/google.cloud.managedkafka.v1.CreateTopicRequest"
636    }
637}
638
639/// Request for UpdateTopic.
640#[derive(Clone, Default, PartialEq)]
641#[non_exhaustive]
642pub struct UpdateTopicRequest {
643    /// Required. Field mask is used to specify the fields to be overwritten in the
644    /// Topic resource by the update. The fields specified in the update_mask are
645    /// relative to the resource, not the full request. A field will be overwritten
646    /// if it is in the mask. The mask is required and a value of * will update all
647    /// fields.
648    pub update_mask: std::option::Option<wkt::FieldMask>,
649
650    /// Required. The topic to update. Its `name` field must be populated.
651    pub topic: std::option::Option<crate::model::Topic>,
652
653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
654}
655
656impl UpdateTopicRequest {
657    pub fn new() -> Self {
658        std::default::Default::default()
659    }
660
661    /// Sets the value of [update_mask][crate::model::UpdateTopicRequest::update_mask].
662    pub fn set_update_mask<T>(mut self, v: T) -> Self
663    where
664        T: std::convert::Into<wkt::FieldMask>,
665    {
666        self.update_mask = std::option::Option::Some(v.into());
667        self
668    }
669
670    /// Sets or clears the value of [update_mask][crate::model::UpdateTopicRequest::update_mask].
671    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
672    where
673        T: std::convert::Into<wkt::FieldMask>,
674    {
675        self.update_mask = v.map(|x| x.into());
676        self
677    }
678
679    /// Sets the value of [topic][crate::model::UpdateTopicRequest::topic].
680    pub fn set_topic<T>(mut self, v: T) -> Self
681    where
682        T: std::convert::Into<crate::model::Topic>,
683    {
684        self.topic = std::option::Option::Some(v.into());
685        self
686    }
687
688    /// Sets or clears the value of [topic][crate::model::UpdateTopicRequest::topic].
689    pub fn set_or_clear_topic<T>(mut self, v: std::option::Option<T>) -> Self
690    where
691        T: std::convert::Into<crate::model::Topic>,
692    {
693        self.topic = v.map(|x| x.into());
694        self
695    }
696}
697
698impl wkt::message::Message for UpdateTopicRequest {
699    fn typename() -> &'static str {
700        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateTopicRequest"
701    }
702}
703
704/// Request for DeleteTopic.
705#[derive(Clone, Default, PartialEq)]
706#[non_exhaustive]
707pub struct DeleteTopicRequest {
708    /// Required. The name of the topic to delete.
709    /// `projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}`.
710    pub name: std::string::String,
711
712    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
713}
714
715impl DeleteTopicRequest {
716    pub fn new() -> Self {
717        std::default::Default::default()
718    }
719
720    /// Sets the value of [name][crate::model::DeleteTopicRequest::name].
721    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
722        self.name = v.into();
723        self
724    }
725}
726
727impl wkt::message::Message for DeleteTopicRequest {
728    fn typename() -> &'static str {
729        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteTopicRequest"
730    }
731}
732
733/// Request for ListConsumerGroups.
734#[derive(Clone, Default, PartialEq)]
735#[non_exhaustive]
736pub struct ListConsumerGroupsRequest {
737    /// Required. The parent cluster whose consumer groups are to be listed.
738    /// Structured like
739    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
740    pub parent: std::string::String,
741
742    /// Optional. The maximum number of consumer groups to return. The service may
743    /// return fewer than this value. If unset or zero, all consumer groups for the
744    /// parent is returned.
745    pub page_size: i32,
746
747    /// Optional. A page token, received from a previous `ListConsumerGroups` call.
748    /// Provide this to retrieve the subsequent page.
749    ///
750    /// When paginating, all other parameters provided to `ListConsumerGroups` must
751    /// match the call that provided the page token.
752    pub page_token: std::string::String,
753
754    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
755}
756
757impl ListConsumerGroupsRequest {
758    pub fn new() -> Self {
759        std::default::Default::default()
760    }
761
762    /// Sets the value of [parent][crate::model::ListConsumerGroupsRequest::parent].
763    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
764        self.parent = v.into();
765        self
766    }
767
768    /// Sets the value of [page_size][crate::model::ListConsumerGroupsRequest::page_size].
769    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
770        self.page_size = v.into();
771        self
772    }
773
774    /// Sets the value of [page_token][crate::model::ListConsumerGroupsRequest::page_token].
775    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
776        self.page_token = v.into();
777        self
778    }
779}
780
781impl wkt::message::Message for ListConsumerGroupsRequest {
782    fn typename() -> &'static str {
783        "type.googleapis.com/google.cloud.managedkafka.v1.ListConsumerGroupsRequest"
784    }
785}
786
787/// Response for ListConsumerGroups.
788#[derive(Clone, Default, PartialEq)]
789#[non_exhaustive]
790pub struct ListConsumerGroupsResponse {
791    /// The list of consumer group in the requested parent. The order of the
792    /// consumer groups is unspecified.
793    pub consumer_groups: std::vec::Vec<crate::model::ConsumerGroup>,
794
795    /// A token that can be sent as `page_token` to retrieve the next page of
796    /// results. If this field is omitted, there are no more results.
797    pub next_page_token: std::string::String,
798
799    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
800}
801
802impl ListConsumerGroupsResponse {
803    pub fn new() -> Self {
804        std::default::Default::default()
805    }
806
807    /// Sets the value of [consumer_groups][crate::model::ListConsumerGroupsResponse::consumer_groups].
808    pub fn set_consumer_groups<T, V>(mut self, v: T) -> Self
809    where
810        T: std::iter::IntoIterator<Item = V>,
811        V: std::convert::Into<crate::model::ConsumerGroup>,
812    {
813        use std::iter::Iterator;
814        self.consumer_groups = v.into_iter().map(|i| i.into()).collect();
815        self
816    }
817
818    /// Sets the value of [next_page_token][crate::model::ListConsumerGroupsResponse::next_page_token].
819    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
820        self.next_page_token = v.into();
821        self
822    }
823}
824
825impl wkt::message::Message for ListConsumerGroupsResponse {
826    fn typename() -> &'static str {
827        "type.googleapis.com/google.cloud.managedkafka.v1.ListConsumerGroupsResponse"
828    }
829}
830
831#[doc(hidden)]
832impl gax::paginator::internal::PageableResponse for ListConsumerGroupsResponse {
833    type PageItem = crate::model::ConsumerGroup;
834
835    fn items(self) -> std::vec::Vec<Self::PageItem> {
836        self.consumer_groups
837    }
838
839    fn next_page_token(&self) -> std::string::String {
840        use std::clone::Clone;
841        self.next_page_token.clone()
842    }
843}
844
845/// Request for GetConsumerGroup.
846#[derive(Clone, Default, PartialEq)]
847#[non_exhaustive]
848pub struct GetConsumerGroupRequest {
849    /// Required. The name of the consumer group whose configuration to return.
850    /// `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`.
851    pub name: std::string::String,
852
853    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
854}
855
856impl GetConsumerGroupRequest {
857    pub fn new() -> Self {
858        std::default::Default::default()
859    }
860
861    /// Sets the value of [name][crate::model::GetConsumerGroupRequest::name].
862    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
863        self.name = v.into();
864        self
865    }
866}
867
868impl wkt::message::Message for GetConsumerGroupRequest {
869    fn typename() -> &'static str {
870        "type.googleapis.com/google.cloud.managedkafka.v1.GetConsumerGroupRequest"
871    }
872}
873
874/// Request for UpdateConsumerGroup.
875#[derive(Clone, Default, PartialEq)]
876#[non_exhaustive]
877pub struct UpdateConsumerGroupRequest {
878    /// Required. Field mask is used to specify the fields to be overwritten in the
879    /// ConsumerGroup resource by the update.
880    /// The fields specified in the update_mask are relative to the resource, not
881    /// the full request. A field will be overwritten if it is in the mask. The
882    /// mask is required and a value of * will update all fields.
883    pub update_mask: std::option::Option<wkt::FieldMask>,
884
885    /// Required. The consumer group to update. Its `name` field must be populated.
886    pub consumer_group: std::option::Option<crate::model::ConsumerGroup>,
887
888    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
889}
890
891impl UpdateConsumerGroupRequest {
892    pub fn new() -> Self {
893        std::default::Default::default()
894    }
895
896    /// Sets the value of [update_mask][crate::model::UpdateConsumerGroupRequest::update_mask].
897    pub fn set_update_mask<T>(mut self, v: T) -> Self
898    where
899        T: std::convert::Into<wkt::FieldMask>,
900    {
901        self.update_mask = std::option::Option::Some(v.into());
902        self
903    }
904
905    /// Sets or clears the value of [update_mask][crate::model::UpdateConsumerGroupRequest::update_mask].
906    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
907    where
908        T: std::convert::Into<wkt::FieldMask>,
909    {
910        self.update_mask = v.map(|x| x.into());
911        self
912    }
913
914    /// Sets the value of [consumer_group][crate::model::UpdateConsumerGroupRequest::consumer_group].
915    pub fn set_consumer_group<T>(mut self, v: T) -> Self
916    where
917        T: std::convert::Into<crate::model::ConsumerGroup>,
918    {
919        self.consumer_group = std::option::Option::Some(v.into());
920        self
921    }
922
923    /// Sets or clears the value of [consumer_group][crate::model::UpdateConsumerGroupRequest::consumer_group].
924    pub fn set_or_clear_consumer_group<T>(mut self, v: std::option::Option<T>) -> Self
925    where
926        T: std::convert::Into<crate::model::ConsumerGroup>,
927    {
928        self.consumer_group = v.map(|x| x.into());
929        self
930    }
931}
932
933impl wkt::message::Message for UpdateConsumerGroupRequest {
934    fn typename() -> &'static str {
935        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateConsumerGroupRequest"
936    }
937}
938
939/// Request for DeleteConsumerGroup.
940#[derive(Clone, Default, PartialEq)]
941#[non_exhaustive]
942pub struct DeleteConsumerGroupRequest {
943    /// Required. The name of the consumer group to delete.
944    /// `projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}`.
945    pub name: std::string::String,
946
947    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
948}
949
950impl DeleteConsumerGroupRequest {
951    pub fn new() -> Self {
952        std::default::Default::default()
953    }
954
955    /// Sets the value of [name][crate::model::DeleteConsumerGroupRequest::name].
956    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
957        self.name = v.into();
958        self
959    }
960}
961
962impl wkt::message::Message for DeleteConsumerGroupRequest {
963    fn typename() -> &'static str {
964        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteConsumerGroupRequest"
965    }
966}
967
968/// Request for ListAcls.
969#[derive(Clone, Default, PartialEq)]
970#[non_exhaustive]
971pub struct ListAclsRequest {
972    /// Required. The parent cluster whose acls are to be listed.
973    /// Structured like
974    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
975    pub parent: std::string::String,
976
977    /// Optional. The maximum number of acls to return. The service may return
978    /// fewer than this value. If unset or zero, all acls for the parent is
979    /// returned.
980    pub page_size: i32,
981
982    /// Optional. A page token, received from a previous `ListAcls` call.
983    /// Provide this to retrieve the subsequent page.
984    ///
985    /// When paginating, all other parameters provided to `ListAcls` must match
986    /// the call that provided the page token.
987    pub page_token: std::string::String,
988
989    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
990}
991
992impl ListAclsRequest {
993    pub fn new() -> Self {
994        std::default::Default::default()
995    }
996
997    /// Sets the value of [parent][crate::model::ListAclsRequest::parent].
998    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
999        self.parent = v.into();
1000        self
1001    }
1002
1003    /// Sets the value of [page_size][crate::model::ListAclsRequest::page_size].
1004    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1005        self.page_size = v.into();
1006        self
1007    }
1008
1009    /// Sets the value of [page_token][crate::model::ListAclsRequest::page_token].
1010    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1011        self.page_token = v.into();
1012        self
1013    }
1014}
1015
1016impl wkt::message::Message for ListAclsRequest {
1017    fn typename() -> &'static str {
1018        "type.googleapis.com/google.cloud.managedkafka.v1.ListAclsRequest"
1019    }
1020}
1021
1022/// Response for ListAcls.
1023#[derive(Clone, Default, PartialEq)]
1024#[non_exhaustive]
1025pub struct ListAclsResponse {
1026    /// The list of acls in the requested parent. The order of the acls is
1027    /// unspecified.
1028    pub acls: std::vec::Vec<crate::model::Acl>,
1029
1030    /// A token that can be sent as `page_token` to retrieve the next page of
1031    /// results. If this field is omitted, there are no more results.
1032    pub next_page_token: std::string::String,
1033
1034    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1035}
1036
1037impl ListAclsResponse {
1038    pub fn new() -> Self {
1039        std::default::Default::default()
1040    }
1041
1042    /// Sets the value of [acls][crate::model::ListAclsResponse::acls].
1043    pub fn set_acls<T, V>(mut self, v: T) -> Self
1044    where
1045        T: std::iter::IntoIterator<Item = V>,
1046        V: std::convert::Into<crate::model::Acl>,
1047    {
1048        use std::iter::Iterator;
1049        self.acls = v.into_iter().map(|i| i.into()).collect();
1050        self
1051    }
1052
1053    /// Sets the value of [next_page_token][crate::model::ListAclsResponse::next_page_token].
1054    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1055        self.next_page_token = v.into();
1056        self
1057    }
1058}
1059
1060impl wkt::message::Message for ListAclsResponse {
1061    fn typename() -> &'static str {
1062        "type.googleapis.com/google.cloud.managedkafka.v1.ListAclsResponse"
1063    }
1064}
1065
1066#[doc(hidden)]
1067impl gax::paginator::internal::PageableResponse for ListAclsResponse {
1068    type PageItem = crate::model::Acl;
1069
1070    fn items(self) -> std::vec::Vec<Self::PageItem> {
1071        self.acls
1072    }
1073
1074    fn next_page_token(&self) -> std::string::String {
1075        use std::clone::Clone;
1076        self.next_page_token.clone()
1077    }
1078}
1079
1080/// Request for GetAcl.
1081#[derive(Clone, Default, PartialEq)]
1082#[non_exhaustive]
1083pub struct GetAclRequest {
1084    /// Required. The name of the acl to return.
1085    /// Structured like:
1086    /// `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
1087    ///
1088    /// The structure of `acl_id` defines the Resource Pattern (resource_type,
1089    /// resource_name, pattern_type) of the acl. See `Acl.name` for
1090    /// details.
1091    pub name: std::string::String,
1092
1093    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1094}
1095
1096impl GetAclRequest {
1097    pub fn new() -> Self {
1098        std::default::Default::default()
1099    }
1100
1101    /// Sets the value of [name][crate::model::GetAclRequest::name].
1102    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1103        self.name = v.into();
1104        self
1105    }
1106}
1107
1108impl wkt::message::Message for GetAclRequest {
1109    fn typename() -> &'static str {
1110        "type.googleapis.com/google.cloud.managedkafka.v1.GetAclRequest"
1111    }
1112}
1113
1114/// Request for CreateAcl.
1115#[derive(Clone, Default, PartialEq)]
1116#[non_exhaustive]
1117pub struct CreateAclRequest {
1118    /// Required. The parent cluster in which to create the acl.
1119    /// Structured like
1120    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
1121    pub parent: std::string::String,
1122
1123    /// Required. The ID to use for the acl, which will become the final component
1124    /// of the acl's name. The structure of `acl_id` defines the Resource Pattern
1125    /// (resource_type, resource_name, pattern_type) of the acl. `acl_id` is
1126    /// structured like one of the following:
1127    ///
1128    /// For acls on the cluster:
1129    /// `cluster`
1130    ///
1131    /// For acls on a single resource within the cluster:
1132    /// `topic/{resource_name}`
1133    /// `consumerGroup/{resource_name}`
1134    /// `transactionalId/{resource_name}`
1135    ///
1136    /// For acls on all resources that match a prefix:
1137    /// `topicPrefixed/{resource_name}`
1138    /// `consumerGroupPrefixed/{resource_name}`
1139    /// `transactionalIdPrefixed/{resource_name}`
1140    ///
1141    /// For acls on all resources of a given type (i.e. the wildcard literal "*"):
1142    /// `allTopics` (represents `topic/*`)
1143    /// `allConsumerGroups` (represents `consumerGroup/*`)
1144    /// `allTransactionalIds` (represents `transactionalId/*`)
1145    pub acl_id: std::string::String,
1146
1147    /// Required. Configuration of the acl to create. Its `name` field is ignored.
1148    pub acl: std::option::Option<crate::model::Acl>,
1149
1150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1151}
1152
1153impl CreateAclRequest {
1154    pub fn new() -> Self {
1155        std::default::Default::default()
1156    }
1157
1158    /// Sets the value of [parent][crate::model::CreateAclRequest::parent].
1159    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1160        self.parent = v.into();
1161        self
1162    }
1163
1164    /// Sets the value of [acl_id][crate::model::CreateAclRequest::acl_id].
1165    pub fn set_acl_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1166        self.acl_id = v.into();
1167        self
1168    }
1169
1170    /// Sets the value of [acl][crate::model::CreateAclRequest::acl].
1171    pub fn set_acl<T>(mut self, v: T) -> Self
1172    where
1173        T: std::convert::Into<crate::model::Acl>,
1174    {
1175        self.acl = std::option::Option::Some(v.into());
1176        self
1177    }
1178
1179    /// Sets or clears the value of [acl][crate::model::CreateAclRequest::acl].
1180    pub fn set_or_clear_acl<T>(mut self, v: std::option::Option<T>) -> Self
1181    where
1182        T: std::convert::Into<crate::model::Acl>,
1183    {
1184        self.acl = v.map(|x| x.into());
1185        self
1186    }
1187}
1188
1189impl wkt::message::Message for CreateAclRequest {
1190    fn typename() -> &'static str {
1191        "type.googleapis.com/google.cloud.managedkafka.v1.CreateAclRequest"
1192    }
1193}
1194
1195/// Request for UpdateAcl.
1196#[derive(Clone, Default, PartialEq)]
1197#[non_exhaustive]
1198pub struct UpdateAclRequest {
1199    /// Required. The updated acl. Its `name` and `etag` fields must be populated.
1200    /// `acl_entries` must not be empty in the updated acl; to remove all acl
1201    /// entries for an acl, use DeleteAcl.
1202    pub acl: std::option::Option<crate::model::Acl>,
1203
1204    /// Optional. Field mask is used to specify the fields to be overwritten in the
1205    /// Acl resource by the update. The fields specified in the update_mask are
1206    /// relative to the resource, not the full request. A field will be overwritten
1207    /// if it is in the mask.
1208    pub update_mask: std::option::Option<wkt::FieldMask>,
1209
1210    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1211}
1212
1213impl UpdateAclRequest {
1214    pub fn new() -> Self {
1215        std::default::Default::default()
1216    }
1217
1218    /// Sets the value of [acl][crate::model::UpdateAclRequest::acl].
1219    pub fn set_acl<T>(mut self, v: T) -> Self
1220    where
1221        T: std::convert::Into<crate::model::Acl>,
1222    {
1223        self.acl = std::option::Option::Some(v.into());
1224        self
1225    }
1226
1227    /// Sets or clears the value of [acl][crate::model::UpdateAclRequest::acl].
1228    pub fn set_or_clear_acl<T>(mut self, v: std::option::Option<T>) -> Self
1229    where
1230        T: std::convert::Into<crate::model::Acl>,
1231    {
1232        self.acl = v.map(|x| x.into());
1233        self
1234    }
1235
1236    /// Sets the value of [update_mask][crate::model::UpdateAclRequest::update_mask].
1237    pub fn set_update_mask<T>(mut self, v: T) -> Self
1238    where
1239        T: std::convert::Into<wkt::FieldMask>,
1240    {
1241        self.update_mask = std::option::Option::Some(v.into());
1242        self
1243    }
1244
1245    /// Sets or clears the value of [update_mask][crate::model::UpdateAclRequest::update_mask].
1246    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1247    where
1248        T: std::convert::Into<wkt::FieldMask>,
1249    {
1250        self.update_mask = v.map(|x| x.into());
1251        self
1252    }
1253}
1254
1255impl wkt::message::Message for UpdateAclRequest {
1256    fn typename() -> &'static str {
1257        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateAclRequest"
1258    }
1259}
1260
1261/// Request for DeleteAcl.
1262#[derive(Clone, Default, PartialEq)]
1263#[non_exhaustive]
1264pub struct DeleteAclRequest {
1265    /// Required. The name of the acl to delete.
1266    /// Structured like:
1267    /// `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
1268    ///
1269    /// The structure of `acl_id` defines the Resource Pattern (resource_type,
1270    /// resource_name, pattern_type) of the acl. See `Acl.name` for details.
1271    pub name: std::string::String,
1272
1273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1274}
1275
1276impl DeleteAclRequest {
1277    pub fn new() -> Self {
1278        std::default::Default::default()
1279    }
1280
1281    /// Sets the value of [name][crate::model::DeleteAclRequest::name].
1282    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1283        self.name = v.into();
1284        self
1285    }
1286}
1287
1288impl wkt::message::Message for DeleteAclRequest {
1289    fn typename() -> &'static str {
1290        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteAclRequest"
1291    }
1292}
1293
1294/// Request for AddAclEntry.
1295#[derive(Clone, Default, PartialEq)]
1296#[non_exhaustive]
1297pub struct AddAclEntryRequest {
1298    /// Required. The name of the acl to add the acl entry to.
1299    /// Structured like:
1300    /// `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
1301    ///
1302    /// The structure of `acl_id` defines the Resource Pattern (resource_type,
1303    /// resource_name, pattern_type) of the acl. See `Acl.name` for
1304    /// details.
1305    pub acl: std::string::String,
1306
1307    /// Required. The acl entry to add.
1308    pub acl_entry: std::option::Option<crate::model::AclEntry>,
1309
1310    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1311}
1312
1313impl AddAclEntryRequest {
1314    pub fn new() -> Self {
1315        std::default::Default::default()
1316    }
1317
1318    /// Sets the value of [acl][crate::model::AddAclEntryRequest::acl].
1319    pub fn set_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1320        self.acl = v.into();
1321        self
1322    }
1323
1324    /// Sets the value of [acl_entry][crate::model::AddAclEntryRequest::acl_entry].
1325    pub fn set_acl_entry<T>(mut self, v: T) -> Self
1326    where
1327        T: std::convert::Into<crate::model::AclEntry>,
1328    {
1329        self.acl_entry = std::option::Option::Some(v.into());
1330        self
1331    }
1332
1333    /// Sets or clears the value of [acl_entry][crate::model::AddAclEntryRequest::acl_entry].
1334    pub fn set_or_clear_acl_entry<T>(mut self, v: std::option::Option<T>) -> Self
1335    where
1336        T: std::convert::Into<crate::model::AclEntry>,
1337    {
1338        self.acl_entry = v.map(|x| x.into());
1339        self
1340    }
1341}
1342
1343impl wkt::message::Message for AddAclEntryRequest {
1344    fn typename() -> &'static str {
1345        "type.googleapis.com/google.cloud.managedkafka.v1.AddAclEntryRequest"
1346    }
1347}
1348
1349/// Response for AddAclEntry.
1350#[derive(Clone, Default, PartialEq)]
1351#[non_exhaustive]
1352pub struct AddAclEntryResponse {
1353    /// The updated acl.
1354    pub acl: std::option::Option<crate::model::Acl>,
1355
1356    /// Whether the acl was created as a result of adding the acl entry.
1357    pub acl_created: bool,
1358
1359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1360}
1361
1362impl AddAclEntryResponse {
1363    pub fn new() -> Self {
1364        std::default::Default::default()
1365    }
1366
1367    /// Sets the value of [acl][crate::model::AddAclEntryResponse::acl].
1368    pub fn set_acl<T>(mut self, v: T) -> Self
1369    where
1370        T: std::convert::Into<crate::model::Acl>,
1371    {
1372        self.acl = std::option::Option::Some(v.into());
1373        self
1374    }
1375
1376    /// Sets or clears the value of [acl][crate::model::AddAclEntryResponse::acl].
1377    pub fn set_or_clear_acl<T>(mut self, v: std::option::Option<T>) -> Self
1378    where
1379        T: std::convert::Into<crate::model::Acl>,
1380    {
1381        self.acl = v.map(|x| x.into());
1382        self
1383    }
1384
1385    /// Sets the value of [acl_created][crate::model::AddAclEntryResponse::acl_created].
1386    pub fn set_acl_created<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1387        self.acl_created = v.into();
1388        self
1389    }
1390}
1391
1392impl wkt::message::Message for AddAclEntryResponse {
1393    fn typename() -> &'static str {
1394        "type.googleapis.com/google.cloud.managedkafka.v1.AddAclEntryResponse"
1395    }
1396}
1397
1398/// Request for RemoveAclEntry.
1399#[derive(Clone, Default, PartialEq)]
1400#[non_exhaustive]
1401pub struct RemoveAclEntryRequest {
1402    /// Required. The name of the acl to remove the acl entry from.
1403    /// Structured like:
1404    /// `projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}`.
1405    ///
1406    /// The structure of `acl_id` defines the Resource Pattern (resource_type,
1407    /// resource_name, pattern_type) of the acl. See `Acl.name` for
1408    /// details.
1409    pub acl: std::string::String,
1410
1411    /// Required. The acl entry to remove.
1412    pub acl_entry: std::option::Option<crate::model::AclEntry>,
1413
1414    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1415}
1416
1417impl RemoveAclEntryRequest {
1418    pub fn new() -> Self {
1419        std::default::Default::default()
1420    }
1421
1422    /// Sets the value of [acl][crate::model::RemoveAclEntryRequest::acl].
1423    pub fn set_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1424        self.acl = v.into();
1425        self
1426    }
1427
1428    /// Sets the value of [acl_entry][crate::model::RemoveAclEntryRequest::acl_entry].
1429    pub fn set_acl_entry<T>(mut self, v: T) -> Self
1430    where
1431        T: std::convert::Into<crate::model::AclEntry>,
1432    {
1433        self.acl_entry = std::option::Option::Some(v.into());
1434        self
1435    }
1436
1437    /// Sets or clears the value of [acl_entry][crate::model::RemoveAclEntryRequest::acl_entry].
1438    pub fn set_or_clear_acl_entry<T>(mut self, v: std::option::Option<T>) -> Self
1439    where
1440        T: std::convert::Into<crate::model::AclEntry>,
1441    {
1442        self.acl_entry = v.map(|x| x.into());
1443        self
1444    }
1445}
1446
1447impl wkt::message::Message for RemoveAclEntryRequest {
1448    fn typename() -> &'static str {
1449        "type.googleapis.com/google.cloud.managedkafka.v1.RemoveAclEntryRequest"
1450    }
1451}
1452
1453/// Response for RemoveAclEntry.
1454#[derive(Clone, Default, PartialEq)]
1455#[non_exhaustive]
1456pub struct RemoveAclEntryResponse {
1457    /// The result of removing the acl entry, depending on whether the acl was
1458    /// deleted as a result of removing the acl entry.
1459    pub result: std::option::Option<crate::model::remove_acl_entry_response::Result>,
1460
1461    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1462}
1463
1464impl RemoveAclEntryResponse {
1465    pub fn new() -> Self {
1466        std::default::Default::default()
1467    }
1468
1469    /// Sets the value of [result][crate::model::RemoveAclEntryResponse::result].
1470    ///
1471    /// Note that all the setters affecting `result` are mutually
1472    /// exclusive.
1473    pub fn set_result<
1474        T: std::convert::Into<std::option::Option<crate::model::remove_acl_entry_response::Result>>,
1475    >(
1476        mut self,
1477        v: T,
1478    ) -> Self {
1479        self.result = v.into();
1480        self
1481    }
1482
1483    /// The value of [result][crate::model::RemoveAclEntryResponse::result]
1484    /// if it holds a `Acl`, `None` if the field is not set or
1485    /// holds a different branch.
1486    pub fn acl(&self) -> std::option::Option<&std::boxed::Box<crate::model::Acl>> {
1487        #[allow(unreachable_patterns)]
1488        self.result.as_ref().and_then(|v| match v {
1489            crate::model::remove_acl_entry_response::Result::Acl(v) => std::option::Option::Some(v),
1490            _ => std::option::Option::None,
1491        })
1492    }
1493
1494    /// Sets the value of [result][crate::model::RemoveAclEntryResponse::result]
1495    /// to hold a `Acl`.
1496    ///
1497    /// Note that all the setters affecting `result` are
1498    /// mutually exclusive.
1499    pub fn set_acl<T: std::convert::Into<std::boxed::Box<crate::model::Acl>>>(
1500        mut self,
1501        v: T,
1502    ) -> Self {
1503        self.result = std::option::Option::Some(
1504            crate::model::remove_acl_entry_response::Result::Acl(v.into()),
1505        );
1506        self
1507    }
1508
1509    /// The value of [result][crate::model::RemoveAclEntryResponse::result]
1510    /// if it holds a `AclDeleted`, `None` if the field is not set or
1511    /// holds a different branch.
1512    pub fn acl_deleted(&self) -> std::option::Option<&bool> {
1513        #[allow(unreachable_patterns)]
1514        self.result.as_ref().and_then(|v| match v {
1515            crate::model::remove_acl_entry_response::Result::AclDeleted(v) => {
1516                std::option::Option::Some(v)
1517            }
1518            _ => std::option::Option::None,
1519        })
1520    }
1521
1522    /// Sets the value of [result][crate::model::RemoveAclEntryResponse::result]
1523    /// to hold a `AclDeleted`.
1524    ///
1525    /// Note that all the setters affecting `result` are
1526    /// mutually exclusive.
1527    pub fn set_acl_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1528        self.result = std::option::Option::Some(
1529            crate::model::remove_acl_entry_response::Result::AclDeleted(v.into()),
1530        );
1531        self
1532    }
1533}
1534
1535impl wkt::message::Message for RemoveAclEntryResponse {
1536    fn typename() -> &'static str {
1537        "type.googleapis.com/google.cloud.managedkafka.v1.RemoveAclEntryResponse"
1538    }
1539}
1540
1541/// Defines additional types related to [RemoveAclEntryResponse].
1542pub mod remove_acl_entry_response {
1543    #[allow(unused_imports)]
1544    use super::*;
1545
1546    /// The result of removing the acl entry, depending on whether the acl was
1547    /// deleted as a result of removing the acl entry.
1548    #[derive(Clone, Debug, PartialEq)]
1549    #[non_exhaustive]
1550    pub enum Result {
1551        /// The updated acl. Returned if the removed acl entry was not the last entry
1552        /// in the acl.
1553        Acl(std::boxed::Box<crate::model::Acl>),
1554        /// Returned with value true if the removed acl entry was the last entry in
1555        /// the acl, resulting in acl deletion.
1556        AclDeleted(bool),
1557    }
1558}
1559
1560/// Request for GetConnectCluster.
1561#[derive(Clone, Default, PartialEq)]
1562#[non_exhaustive]
1563pub struct GetConnectClusterRequest {
1564    /// Required. The name of the Kafka Connect cluster whose configuration to
1565    /// return. Structured like
1566    /// `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.
1567    pub name: std::string::String,
1568
1569    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1570}
1571
1572impl GetConnectClusterRequest {
1573    pub fn new() -> Self {
1574        std::default::Default::default()
1575    }
1576
1577    /// Sets the value of [name][crate::model::GetConnectClusterRequest::name].
1578    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1579        self.name = v.into();
1580        self
1581    }
1582}
1583
1584impl wkt::message::Message for GetConnectClusterRequest {
1585    fn typename() -> &'static str {
1586        "type.googleapis.com/google.cloud.managedkafka.v1.GetConnectClusterRequest"
1587    }
1588}
1589
1590/// Request for CreateConnectCluster.
1591#[derive(Clone, Default, PartialEq)]
1592#[non_exhaustive]
1593pub struct CreateConnectClusterRequest {
1594    /// Required. The parent project/location in which to create the Kafka Connect
1595    /// cluster. Structured like
1596    /// `projects/{project}/locations/{location}/`.
1597    pub parent: std::string::String,
1598
1599    /// Required. The ID to use for the Connect cluster, which will become the
1600    /// final component of the cluster's name. The ID must be 1-63 characters long,
1601    /// and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply
1602    /// with RFC 1035.
1603    ///
1604    /// This value is structured like: `my-cluster-id`.
1605    pub connect_cluster_id: std::string::String,
1606
1607    /// Required. Configuration of the Kafka Connect cluster to create. Its `name`
1608    /// field is ignored.
1609    pub connect_cluster: std::option::Option<crate::model::ConnectCluster>,
1610
1611    /// Optional. An optional request ID to identify requests. Specify a unique
1612    /// request ID to avoid duplication of requests. If a request times out or
1613    /// fails, retrying with the same ID allows the server to recognize the
1614    /// previous attempt. For at least 60 minutes, the server ignores duplicate
1615    /// requests bearing the same ID.
1616    ///
1617    /// For example, consider a situation where you make an initial request and the
1618    /// request times out. If you make the request again with the same request ID
1619    /// within 60 minutes of the last request, the server checks if an original
1620    /// operation with the same request ID was received. If so, the server ignores
1621    /// the second request.
1622    ///
1623    /// The request ID must be a valid UUID. A zero UUID is not supported
1624    /// (00000000-0000-0000-0000-000000000000).
1625    pub request_id: std::string::String,
1626
1627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1628}
1629
1630impl CreateConnectClusterRequest {
1631    pub fn new() -> Self {
1632        std::default::Default::default()
1633    }
1634
1635    /// Sets the value of [parent][crate::model::CreateConnectClusterRequest::parent].
1636    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1637        self.parent = v.into();
1638        self
1639    }
1640
1641    /// Sets the value of [connect_cluster_id][crate::model::CreateConnectClusterRequest::connect_cluster_id].
1642    pub fn set_connect_cluster_id<T: std::convert::Into<std::string::String>>(
1643        mut self,
1644        v: T,
1645    ) -> Self {
1646        self.connect_cluster_id = v.into();
1647        self
1648    }
1649
1650    /// Sets the value of [connect_cluster][crate::model::CreateConnectClusterRequest::connect_cluster].
1651    pub fn set_connect_cluster<T>(mut self, v: T) -> Self
1652    where
1653        T: std::convert::Into<crate::model::ConnectCluster>,
1654    {
1655        self.connect_cluster = std::option::Option::Some(v.into());
1656        self
1657    }
1658
1659    /// Sets or clears the value of [connect_cluster][crate::model::CreateConnectClusterRequest::connect_cluster].
1660    pub fn set_or_clear_connect_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1661    where
1662        T: std::convert::Into<crate::model::ConnectCluster>,
1663    {
1664        self.connect_cluster = v.map(|x| x.into());
1665        self
1666    }
1667
1668    /// Sets the value of [request_id][crate::model::CreateConnectClusterRequest::request_id].
1669    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1670        self.request_id = v.into();
1671        self
1672    }
1673}
1674
1675impl wkt::message::Message for CreateConnectClusterRequest {
1676    fn typename() -> &'static str {
1677        "type.googleapis.com/google.cloud.managedkafka.v1.CreateConnectClusterRequest"
1678    }
1679}
1680
1681/// Request for UpdateConnectCluster.
1682#[derive(Clone, Default, PartialEq)]
1683#[non_exhaustive]
1684pub struct UpdateConnectClusterRequest {
1685    /// Required. Field mask is used to specify the fields to be overwritten in the
1686    /// cluster resource by the update. The fields specified in the update_mask are
1687    /// relative to the resource, not the full request. A field will be overwritten
1688    /// if it is in the mask. The mask is required and a value of * will update all
1689    /// fields.
1690    pub update_mask: std::option::Option<wkt::FieldMask>,
1691
1692    /// Required. The Kafka Connect cluster to update. Its `name` field must be
1693    /// populated.
1694    pub connect_cluster: std::option::Option<crate::model::ConnectCluster>,
1695
1696    /// Optional. An optional request ID to identify requests. Specify a unique
1697    /// request ID to avoid duplication of requests. If a request times out or
1698    /// fails, retrying with the same ID allows the server to recognize the
1699    /// previous attempt. For at least 60 minutes, the server ignores duplicate
1700    /// requests bearing the same ID.
1701    ///
1702    /// For example, consider a situation where you make an initial request and the
1703    /// request times out. If you make the request again with the same request ID
1704    /// within 60 minutes of the last request, the server checks if an original
1705    /// operation with the same request ID was received. If so, the server ignores
1706    /// the second request.
1707    ///
1708    /// The request ID must be a valid UUID. A zero UUID is not supported
1709    /// (00000000-0000-0000-0000-000000000000).
1710    pub request_id: std::string::String,
1711
1712    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1713}
1714
1715impl UpdateConnectClusterRequest {
1716    pub fn new() -> Self {
1717        std::default::Default::default()
1718    }
1719
1720    /// Sets the value of [update_mask][crate::model::UpdateConnectClusterRequest::update_mask].
1721    pub fn set_update_mask<T>(mut self, v: T) -> Self
1722    where
1723        T: std::convert::Into<wkt::FieldMask>,
1724    {
1725        self.update_mask = std::option::Option::Some(v.into());
1726        self
1727    }
1728
1729    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectClusterRequest::update_mask].
1730    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1731    where
1732        T: std::convert::Into<wkt::FieldMask>,
1733    {
1734        self.update_mask = v.map(|x| x.into());
1735        self
1736    }
1737
1738    /// Sets the value of [connect_cluster][crate::model::UpdateConnectClusterRequest::connect_cluster].
1739    pub fn set_connect_cluster<T>(mut self, v: T) -> Self
1740    where
1741        T: std::convert::Into<crate::model::ConnectCluster>,
1742    {
1743        self.connect_cluster = std::option::Option::Some(v.into());
1744        self
1745    }
1746
1747    /// Sets or clears the value of [connect_cluster][crate::model::UpdateConnectClusterRequest::connect_cluster].
1748    pub fn set_or_clear_connect_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1749    where
1750        T: std::convert::Into<crate::model::ConnectCluster>,
1751    {
1752        self.connect_cluster = v.map(|x| x.into());
1753        self
1754    }
1755
1756    /// Sets the value of [request_id][crate::model::UpdateConnectClusterRequest::request_id].
1757    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1758        self.request_id = v.into();
1759        self
1760    }
1761}
1762
1763impl wkt::message::Message for UpdateConnectClusterRequest {
1764    fn typename() -> &'static str {
1765        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateConnectClusterRequest"
1766    }
1767}
1768
1769/// Request for DeleteConnectCluster.
1770#[derive(Clone, Default, PartialEq)]
1771#[non_exhaustive]
1772pub struct DeleteConnectClusterRequest {
1773    /// Required. The name of the Kafka Connect cluster to delete.
1774    /// Structured like
1775    /// `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.
1776    pub name: std::string::String,
1777
1778    /// Optional. An optional request ID to identify requests. Specify a unique
1779    /// request ID to avoid duplication of requests. If a request times out or
1780    /// fails, retrying with the same ID allows the server to recognize the
1781    /// previous attempt. For at least 60 minutes, the server ignores duplicate
1782    /// requests bearing the same ID.
1783    ///
1784    /// For example, consider a situation where you make an initial request and the
1785    /// request times out. If you make the request again with the same request ID
1786    /// within 60 minutes of the last request, the server checks if an original
1787    /// operation with the same request ID was received. If so, the server ignores
1788    /// the second request.
1789    ///
1790    /// The request ID must be a valid UUID. A zero UUID is not supported
1791    /// (00000000-0000-0000-0000-000000000000).
1792    pub request_id: std::string::String,
1793
1794    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1795}
1796
1797impl DeleteConnectClusterRequest {
1798    pub fn new() -> Self {
1799        std::default::Default::default()
1800    }
1801
1802    /// Sets the value of [name][crate::model::DeleteConnectClusterRequest::name].
1803    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1804        self.name = v.into();
1805        self
1806    }
1807
1808    /// Sets the value of [request_id][crate::model::DeleteConnectClusterRequest::request_id].
1809    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1810        self.request_id = v.into();
1811        self
1812    }
1813}
1814
1815impl wkt::message::Message for DeleteConnectClusterRequest {
1816    fn typename() -> &'static str {
1817        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteConnectClusterRequest"
1818    }
1819}
1820
1821/// Request for ListConnectClusters.
1822#[derive(Clone, Default, PartialEq)]
1823#[non_exhaustive]
1824pub struct ListConnectClustersRequest {
1825    /// Required. The parent project/location whose Connect clusters are to be
1826    /// listed. Structured like `projects/{project}/locations/{location}`.
1827    pub parent: std::string::String,
1828
1829    /// Optional. The maximum number of Connect clusters to return. The service may
1830    /// return fewer than this value. If unspecified, server will pick an
1831    /// appropriate default.
1832    pub page_size: i32,
1833
1834    /// Optional. A page token, received from a previous `ListConnectClusters`
1835    /// call. Provide this to retrieve the subsequent page.
1836    ///
1837    /// When paginating, all other parameters provided to `ListConnectClusters`
1838    /// must match the call that provided the page token.
1839    pub page_token: std::string::String,
1840
1841    /// Optional. Filter expression for the result.
1842    pub filter: std::string::String,
1843
1844    /// Optional. Order by fields for the result.
1845    pub order_by: std::string::String,
1846
1847    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1848}
1849
1850impl ListConnectClustersRequest {
1851    pub fn new() -> Self {
1852        std::default::Default::default()
1853    }
1854
1855    /// Sets the value of [parent][crate::model::ListConnectClustersRequest::parent].
1856    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1857        self.parent = v.into();
1858        self
1859    }
1860
1861    /// Sets the value of [page_size][crate::model::ListConnectClustersRequest::page_size].
1862    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1863        self.page_size = v.into();
1864        self
1865    }
1866
1867    /// Sets the value of [page_token][crate::model::ListConnectClustersRequest::page_token].
1868    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1869        self.page_token = v.into();
1870        self
1871    }
1872
1873    /// Sets the value of [filter][crate::model::ListConnectClustersRequest::filter].
1874    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1875        self.filter = v.into();
1876        self
1877    }
1878
1879    /// Sets the value of [order_by][crate::model::ListConnectClustersRequest::order_by].
1880    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1881        self.order_by = v.into();
1882        self
1883    }
1884}
1885
1886impl wkt::message::Message for ListConnectClustersRequest {
1887    fn typename() -> &'static str {
1888        "type.googleapis.com/google.cloud.managedkafka.v1.ListConnectClustersRequest"
1889    }
1890}
1891
1892/// Response for ListConnectClusters.
1893#[derive(Clone, Default, PartialEq)]
1894#[non_exhaustive]
1895pub struct ListConnectClustersResponse {
1896    /// The list of Connect clusters in the requested parent.
1897    pub connect_clusters: std::vec::Vec<crate::model::ConnectCluster>,
1898
1899    /// A token that can be sent as `page_token` to retrieve the next page of
1900    /// results. If this field is omitted, there are no more results.
1901    pub next_page_token: std::string::String,
1902
1903    /// Locations that could not be reached.
1904    pub unreachable: std::vec::Vec<std::string::String>,
1905
1906    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1907}
1908
1909impl ListConnectClustersResponse {
1910    pub fn new() -> Self {
1911        std::default::Default::default()
1912    }
1913
1914    /// Sets the value of [connect_clusters][crate::model::ListConnectClustersResponse::connect_clusters].
1915    pub fn set_connect_clusters<T, V>(mut self, v: T) -> Self
1916    where
1917        T: std::iter::IntoIterator<Item = V>,
1918        V: std::convert::Into<crate::model::ConnectCluster>,
1919    {
1920        use std::iter::Iterator;
1921        self.connect_clusters = v.into_iter().map(|i| i.into()).collect();
1922        self
1923    }
1924
1925    /// Sets the value of [next_page_token][crate::model::ListConnectClustersResponse::next_page_token].
1926    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1927        self.next_page_token = v.into();
1928        self
1929    }
1930
1931    /// Sets the value of [unreachable][crate::model::ListConnectClustersResponse::unreachable].
1932    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1933    where
1934        T: std::iter::IntoIterator<Item = V>,
1935        V: std::convert::Into<std::string::String>,
1936    {
1937        use std::iter::Iterator;
1938        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1939        self
1940    }
1941}
1942
1943impl wkt::message::Message for ListConnectClustersResponse {
1944    fn typename() -> &'static str {
1945        "type.googleapis.com/google.cloud.managedkafka.v1.ListConnectClustersResponse"
1946    }
1947}
1948
1949#[doc(hidden)]
1950impl gax::paginator::internal::PageableResponse for ListConnectClustersResponse {
1951    type PageItem = crate::model::ConnectCluster;
1952
1953    fn items(self) -> std::vec::Vec<Self::PageItem> {
1954        self.connect_clusters
1955    }
1956
1957    fn next_page_token(&self) -> std::string::String {
1958        use std::clone::Clone;
1959        self.next_page_token.clone()
1960    }
1961}
1962
1963/// Request for GetConnector.
1964#[derive(Clone, Default, PartialEq)]
1965#[non_exhaustive]
1966pub struct GetConnectorRequest {
1967    /// Required. The name of the connector whose configuration to return.
1968    /// Structured like:
1969    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
1970    pub name: std::string::String,
1971
1972    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1973}
1974
1975impl GetConnectorRequest {
1976    pub fn new() -> Self {
1977        std::default::Default::default()
1978    }
1979
1980    /// Sets the value of [name][crate::model::GetConnectorRequest::name].
1981    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1982        self.name = v.into();
1983        self
1984    }
1985}
1986
1987impl wkt::message::Message for GetConnectorRequest {
1988    fn typename() -> &'static str {
1989        "type.googleapis.com/google.cloud.managedkafka.v1.GetConnectorRequest"
1990    }
1991}
1992
1993/// Request for CreateConnector.
1994#[derive(Clone, Default, PartialEq)]
1995#[non_exhaustive]
1996pub struct CreateConnectorRequest {
1997    /// Required. The parent Connect cluster in which to create the connector.
1998    /// Structured like
1999    /// `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.
2000    pub parent: std::string::String,
2001
2002    /// Required. The ID to use for the connector, which will become the final
2003    /// component of the connector's name. The ID must be 1-63 characters long, and
2004    /// match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` to comply with
2005    /// RFC 1035.
2006    ///
2007    /// This value is structured like: `my-connector-id`.
2008    pub connector_id: std::string::String,
2009
2010    /// Required. The connector to create.
2011    pub connector: std::option::Option<crate::model::Connector>,
2012
2013    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2014}
2015
2016impl CreateConnectorRequest {
2017    pub fn new() -> Self {
2018        std::default::Default::default()
2019    }
2020
2021    /// Sets the value of [parent][crate::model::CreateConnectorRequest::parent].
2022    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2023        self.parent = v.into();
2024        self
2025    }
2026
2027    /// Sets the value of [connector_id][crate::model::CreateConnectorRequest::connector_id].
2028    pub fn set_connector_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2029        self.connector_id = v.into();
2030        self
2031    }
2032
2033    /// Sets the value of [connector][crate::model::CreateConnectorRequest::connector].
2034    pub fn set_connector<T>(mut self, v: T) -> Self
2035    where
2036        T: std::convert::Into<crate::model::Connector>,
2037    {
2038        self.connector = std::option::Option::Some(v.into());
2039        self
2040    }
2041
2042    /// Sets or clears the value of [connector][crate::model::CreateConnectorRequest::connector].
2043    pub fn set_or_clear_connector<T>(mut self, v: std::option::Option<T>) -> Self
2044    where
2045        T: std::convert::Into<crate::model::Connector>,
2046    {
2047        self.connector = v.map(|x| x.into());
2048        self
2049    }
2050}
2051
2052impl wkt::message::Message for CreateConnectorRequest {
2053    fn typename() -> &'static str {
2054        "type.googleapis.com/google.cloud.managedkafka.v1.CreateConnectorRequest"
2055    }
2056}
2057
2058/// Request for UpdateConnector.
2059#[derive(Clone, Default, PartialEq)]
2060#[non_exhaustive]
2061pub struct UpdateConnectorRequest {
2062    /// Required. Field mask is used to specify the fields to be overwritten in the
2063    /// cluster resource by the update. The fields specified in the update_mask are
2064    /// relative to the resource, not the full request. A field will be overwritten
2065    /// if it is in the mask. The mask is required and a value of * will update all
2066    /// fields.
2067    pub update_mask: std::option::Option<wkt::FieldMask>,
2068
2069    /// Required. The connector to update. Its `name` field must be populated.
2070    pub connector: std::option::Option<crate::model::Connector>,
2071
2072    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2073}
2074
2075impl UpdateConnectorRequest {
2076    pub fn new() -> Self {
2077        std::default::Default::default()
2078    }
2079
2080    /// Sets the value of [update_mask][crate::model::UpdateConnectorRequest::update_mask].
2081    pub fn set_update_mask<T>(mut self, v: T) -> Self
2082    where
2083        T: std::convert::Into<wkt::FieldMask>,
2084    {
2085        self.update_mask = std::option::Option::Some(v.into());
2086        self
2087    }
2088
2089    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectorRequest::update_mask].
2090    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2091    where
2092        T: std::convert::Into<wkt::FieldMask>,
2093    {
2094        self.update_mask = v.map(|x| x.into());
2095        self
2096    }
2097
2098    /// Sets the value of [connector][crate::model::UpdateConnectorRequest::connector].
2099    pub fn set_connector<T>(mut self, v: T) -> Self
2100    where
2101        T: std::convert::Into<crate::model::Connector>,
2102    {
2103        self.connector = std::option::Option::Some(v.into());
2104        self
2105    }
2106
2107    /// Sets or clears the value of [connector][crate::model::UpdateConnectorRequest::connector].
2108    pub fn set_or_clear_connector<T>(mut self, v: std::option::Option<T>) -> Self
2109    where
2110        T: std::convert::Into<crate::model::Connector>,
2111    {
2112        self.connector = v.map(|x| x.into());
2113        self
2114    }
2115}
2116
2117impl wkt::message::Message for UpdateConnectorRequest {
2118    fn typename() -> &'static str {
2119        "type.googleapis.com/google.cloud.managedkafka.v1.UpdateConnectorRequest"
2120    }
2121}
2122
2123/// Request for DeleteConnector.
2124#[derive(Clone, Default, PartialEq)]
2125#[non_exhaustive]
2126pub struct DeleteConnectorRequest {
2127    /// Required. The name of the connector to delete.
2128    /// Structured like:
2129    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
2130    pub name: std::string::String,
2131
2132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2133}
2134
2135impl DeleteConnectorRequest {
2136    pub fn new() -> Self {
2137        std::default::Default::default()
2138    }
2139
2140    /// Sets the value of [name][crate::model::DeleteConnectorRequest::name].
2141    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2142        self.name = v.into();
2143        self
2144    }
2145}
2146
2147impl wkt::message::Message for DeleteConnectorRequest {
2148    fn typename() -> &'static str {
2149        "type.googleapis.com/google.cloud.managedkafka.v1.DeleteConnectorRequest"
2150    }
2151}
2152
2153/// Request for ListConnectors.
2154#[derive(Clone, Default, PartialEq)]
2155#[non_exhaustive]
2156pub struct ListConnectorsRequest {
2157    /// Required. The parent Connect cluster whose connectors are to be listed.
2158    /// Structured like
2159    /// `projects/{project}/locations/{location}/connectClusters/{connect_cluster_id}`.
2160    pub parent: std::string::String,
2161
2162    /// Optional. The maximum number of connectors to return. The service may
2163    /// return fewer than this value. If unspecified, server will pick an
2164    /// appropriate default.
2165    pub page_size: i32,
2166
2167    /// Optional. A page token, received from a previous `ListConnectors` call.
2168    /// Provide this to retrieve the subsequent page.
2169    ///
2170    /// When paginating, all other parameters provided to `ListConnectors`
2171    /// must match the call that provided the page token.
2172    pub page_token: std::string::String,
2173
2174    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2175}
2176
2177impl ListConnectorsRequest {
2178    pub fn new() -> Self {
2179        std::default::Default::default()
2180    }
2181
2182    /// Sets the value of [parent][crate::model::ListConnectorsRequest::parent].
2183    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2184        self.parent = v.into();
2185        self
2186    }
2187
2188    /// Sets the value of [page_size][crate::model::ListConnectorsRequest::page_size].
2189    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2190        self.page_size = v.into();
2191        self
2192    }
2193
2194    /// Sets the value of [page_token][crate::model::ListConnectorsRequest::page_token].
2195    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2196        self.page_token = v.into();
2197        self
2198    }
2199}
2200
2201impl wkt::message::Message for ListConnectorsRequest {
2202    fn typename() -> &'static str {
2203        "type.googleapis.com/google.cloud.managedkafka.v1.ListConnectorsRequest"
2204    }
2205}
2206
2207/// Response for ListConnectors.
2208#[derive(Clone, Default, PartialEq)]
2209#[non_exhaustive]
2210pub struct ListConnectorsResponse {
2211    /// The list of connectors in the requested parent.
2212    pub connectors: std::vec::Vec<crate::model::Connector>,
2213
2214    /// A token that can be sent as `page_token` to retrieve the next page of
2215    /// results. If this field is omitted, there are no more results.
2216    pub next_page_token: std::string::String,
2217
2218    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2219}
2220
2221impl ListConnectorsResponse {
2222    pub fn new() -> Self {
2223        std::default::Default::default()
2224    }
2225
2226    /// Sets the value of [connectors][crate::model::ListConnectorsResponse::connectors].
2227    pub fn set_connectors<T, V>(mut self, v: T) -> Self
2228    where
2229        T: std::iter::IntoIterator<Item = V>,
2230        V: std::convert::Into<crate::model::Connector>,
2231    {
2232        use std::iter::Iterator;
2233        self.connectors = v.into_iter().map(|i| i.into()).collect();
2234        self
2235    }
2236
2237    /// Sets the value of [next_page_token][crate::model::ListConnectorsResponse::next_page_token].
2238    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2239        self.next_page_token = v.into();
2240        self
2241    }
2242}
2243
2244impl wkt::message::Message for ListConnectorsResponse {
2245    fn typename() -> &'static str {
2246        "type.googleapis.com/google.cloud.managedkafka.v1.ListConnectorsResponse"
2247    }
2248}
2249
2250#[doc(hidden)]
2251impl gax::paginator::internal::PageableResponse for ListConnectorsResponse {
2252    type PageItem = crate::model::Connector;
2253
2254    fn items(self) -> std::vec::Vec<Self::PageItem> {
2255        self.connectors
2256    }
2257
2258    fn next_page_token(&self) -> std::string::String {
2259        use std::clone::Clone;
2260        self.next_page_token.clone()
2261    }
2262}
2263
2264/// Request for PauseConnector.
2265#[derive(Clone, Default, PartialEq)]
2266#[non_exhaustive]
2267pub struct PauseConnectorRequest {
2268    /// Required. The name of the connector to pause.
2269    /// Structured like:
2270    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
2271    pub name: std::string::String,
2272
2273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2274}
2275
2276impl PauseConnectorRequest {
2277    pub fn new() -> Self {
2278        std::default::Default::default()
2279    }
2280
2281    /// Sets the value of [name][crate::model::PauseConnectorRequest::name].
2282    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2283        self.name = v.into();
2284        self
2285    }
2286}
2287
2288impl wkt::message::Message for PauseConnectorRequest {
2289    fn typename() -> &'static str {
2290        "type.googleapis.com/google.cloud.managedkafka.v1.PauseConnectorRequest"
2291    }
2292}
2293
2294/// Response for PauseConnector.
2295#[derive(Clone, Default, PartialEq)]
2296#[non_exhaustive]
2297pub struct PauseConnectorResponse {
2298    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2299}
2300
2301impl PauseConnectorResponse {
2302    pub fn new() -> Self {
2303        std::default::Default::default()
2304    }
2305}
2306
2307impl wkt::message::Message for PauseConnectorResponse {
2308    fn typename() -> &'static str {
2309        "type.googleapis.com/google.cloud.managedkafka.v1.PauseConnectorResponse"
2310    }
2311}
2312
2313/// Request for ResumeConnector.
2314#[derive(Clone, Default, PartialEq)]
2315#[non_exhaustive]
2316pub struct ResumeConnectorRequest {
2317    /// Required. The name of the connector to pause.
2318    /// Structured like:
2319    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
2320    pub name: std::string::String,
2321
2322    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2323}
2324
2325impl ResumeConnectorRequest {
2326    pub fn new() -> Self {
2327        std::default::Default::default()
2328    }
2329
2330    /// Sets the value of [name][crate::model::ResumeConnectorRequest::name].
2331    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2332        self.name = v.into();
2333        self
2334    }
2335}
2336
2337impl wkt::message::Message for ResumeConnectorRequest {
2338    fn typename() -> &'static str {
2339        "type.googleapis.com/google.cloud.managedkafka.v1.ResumeConnectorRequest"
2340    }
2341}
2342
2343/// Response for ResumeConnector.
2344#[derive(Clone, Default, PartialEq)]
2345#[non_exhaustive]
2346pub struct ResumeConnectorResponse {
2347    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2348}
2349
2350impl ResumeConnectorResponse {
2351    pub fn new() -> Self {
2352        std::default::Default::default()
2353    }
2354}
2355
2356impl wkt::message::Message for ResumeConnectorResponse {
2357    fn typename() -> &'static str {
2358        "type.googleapis.com/google.cloud.managedkafka.v1.ResumeConnectorResponse"
2359    }
2360}
2361
2362/// Request for RestartConnector.
2363#[derive(Clone, Default, PartialEq)]
2364#[non_exhaustive]
2365pub struct RestartConnectorRequest {
2366    /// Required. The name of the connector to restart.
2367    /// Structured like:
2368    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
2369    pub name: std::string::String,
2370
2371    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2372}
2373
2374impl RestartConnectorRequest {
2375    pub fn new() -> Self {
2376        std::default::Default::default()
2377    }
2378
2379    /// Sets the value of [name][crate::model::RestartConnectorRequest::name].
2380    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2381        self.name = v.into();
2382        self
2383    }
2384}
2385
2386impl wkt::message::Message for RestartConnectorRequest {
2387    fn typename() -> &'static str {
2388        "type.googleapis.com/google.cloud.managedkafka.v1.RestartConnectorRequest"
2389    }
2390}
2391
2392/// Response for RestartConnector.
2393#[derive(Clone, Default, PartialEq)]
2394#[non_exhaustive]
2395pub struct RestartConnectorResponse {
2396    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2397}
2398
2399impl RestartConnectorResponse {
2400    pub fn new() -> Self {
2401        std::default::Default::default()
2402    }
2403}
2404
2405impl wkt::message::Message for RestartConnectorResponse {
2406    fn typename() -> &'static str {
2407        "type.googleapis.com/google.cloud.managedkafka.v1.RestartConnectorResponse"
2408    }
2409}
2410
2411/// Request for StopConnector.
2412#[derive(Clone, Default, PartialEq)]
2413#[non_exhaustive]
2414pub struct StopConnectorRequest {
2415    /// Required. The name of the connector to stop.
2416    /// Structured like:
2417    /// projects/{project}/locations/{location}/connectClusters/{connectCluster}/connectors/{connector}
2418    pub name: std::string::String,
2419
2420    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2421}
2422
2423impl StopConnectorRequest {
2424    pub fn new() -> Self {
2425        std::default::Default::default()
2426    }
2427
2428    /// Sets the value of [name][crate::model::StopConnectorRequest::name].
2429    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2430        self.name = v.into();
2431        self
2432    }
2433}
2434
2435impl wkt::message::Message for StopConnectorRequest {
2436    fn typename() -> &'static str {
2437        "type.googleapis.com/google.cloud.managedkafka.v1.StopConnectorRequest"
2438    }
2439}
2440
2441/// Response for StopConnector.
2442#[derive(Clone, Default, PartialEq)]
2443#[non_exhaustive]
2444pub struct StopConnectorResponse {
2445    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2446}
2447
2448impl StopConnectorResponse {
2449    pub fn new() -> Self {
2450        std::default::Default::default()
2451    }
2452}
2453
2454impl wkt::message::Message for StopConnectorResponse {
2455    fn typename() -> &'static str {
2456        "type.googleapis.com/google.cloud.managedkafka.v1.StopConnectorResponse"
2457    }
2458}
2459
2460/// An Apache Kafka cluster deployed in a location.
2461#[derive(Clone, Default, PartialEq)]
2462#[non_exhaustive]
2463pub struct Cluster {
2464    /// Identifier. The name of the cluster. Structured like:
2465    /// projects/{project_number}/locations/{location}/clusters/{cluster_id}
2466    pub name: std::string::String,
2467
2468    /// Output only. The time when the cluster was created.
2469    pub create_time: std::option::Option<wkt::Timestamp>,
2470
2471    /// Output only. The time when the cluster was last updated.
2472    pub update_time: std::option::Option<wkt::Timestamp>,
2473
2474    /// Optional. Labels as key value pairs.
2475    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2476
2477    /// Required. Capacity configuration for the Kafka cluster.
2478    pub capacity_config: std::option::Option<crate::model::CapacityConfig>,
2479
2480    /// Optional. Rebalance configuration for the Kafka cluster.
2481    pub rebalance_config: std::option::Option<crate::model::RebalanceConfig>,
2482
2483    /// Output only. The current state of the cluster.
2484    pub state: crate::model::cluster::State,
2485
2486    /// Output only. Reserved for future use.
2487    pub satisfies_pzi: std::option::Option<bool>,
2488
2489    /// Output only. Reserved for future use.
2490    pub satisfies_pzs: std::option::Option<bool>,
2491
2492    /// Optional. TLS configuration for the Kafka cluster.
2493    pub tls_config: std::option::Option<crate::model::TlsConfig>,
2494
2495    /// Platform specific configuration properties for a Kafka cluster.
2496    pub platform_config: std::option::Option<crate::model::cluster::PlatformConfig>,
2497
2498    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2499}
2500
2501impl Cluster {
2502    pub fn new() -> Self {
2503        std::default::Default::default()
2504    }
2505
2506    /// Sets the value of [name][crate::model::Cluster::name].
2507    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2508        self.name = v.into();
2509        self
2510    }
2511
2512    /// Sets the value of [create_time][crate::model::Cluster::create_time].
2513    pub fn set_create_time<T>(mut self, v: T) -> Self
2514    where
2515        T: std::convert::Into<wkt::Timestamp>,
2516    {
2517        self.create_time = std::option::Option::Some(v.into());
2518        self
2519    }
2520
2521    /// Sets or clears the value of [create_time][crate::model::Cluster::create_time].
2522    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2523    where
2524        T: std::convert::Into<wkt::Timestamp>,
2525    {
2526        self.create_time = v.map(|x| x.into());
2527        self
2528    }
2529
2530    /// Sets the value of [update_time][crate::model::Cluster::update_time].
2531    pub fn set_update_time<T>(mut self, v: T) -> Self
2532    where
2533        T: std::convert::Into<wkt::Timestamp>,
2534    {
2535        self.update_time = std::option::Option::Some(v.into());
2536        self
2537    }
2538
2539    /// Sets or clears the value of [update_time][crate::model::Cluster::update_time].
2540    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2541    where
2542        T: std::convert::Into<wkt::Timestamp>,
2543    {
2544        self.update_time = v.map(|x| x.into());
2545        self
2546    }
2547
2548    /// Sets the value of [labels][crate::model::Cluster::labels].
2549    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2550    where
2551        T: std::iter::IntoIterator<Item = (K, V)>,
2552        K: std::convert::Into<std::string::String>,
2553        V: std::convert::Into<std::string::String>,
2554    {
2555        use std::iter::Iterator;
2556        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2557        self
2558    }
2559
2560    /// Sets the value of [capacity_config][crate::model::Cluster::capacity_config].
2561    pub fn set_capacity_config<T>(mut self, v: T) -> Self
2562    where
2563        T: std::convert::Into<crate::model::CapacityConfig>,
2564    {
2565        self.capacity_config = std::option::Option::Some(v.into());
2566        self
2567    }
2568
2569    /// Sets or clears the value of [capacity_config][crate::model::Cluster::capacity_config].
2570    pub fn set_or_clear_capacity_config<T>(mut self, v: std::option::Option<T>) -> Self
2571    where
2572        T: std::convert::Into<crate::model::CapacityConfig>,
2573    {
2574        self.capacity_config = v.map(|x| x.into());
2575        self
2576    }
2577
2578    /// Sets the value of [rebalance_config][crate::model::Cluster::rebalance_config].
2579    pub fn set_rebalance_config<T>(mut self, v: T) -> Self
2580    where
2581        T: std::convert::Into<crate::model::RebalanceConfig>,
2582    {
2583        self.rebalance_config = std::option::Option::Some(v.into());
2584        self
2585    }
2586
2587    /// Sets or clears the value of [rebalance_config][crate::model::Cluster::rebalance_config].
2588    pub fn set_or_clear_rebalance_config<T>(mut self, v: std::option::Option<T>) -> Self
2589    where
2590        T: std::convert::Into<crate::model::RebalanceConfig>,
2591    {
2592        self.rebalance_config = v.map(|x| x.into());
2593        self
2594    }
2595
2596    /// Sets the value of [state][crate::model::Cluster::state].
2597    pub fn set_state<T: std::convert::Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
2598        self.state = v.into();
2599        self
2600    }
2601
2602    /// Sets the value of [satisfies_pzi][crate::model::Cluster::satisfies_pzi].
2603    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
2604    where
2605        T: std::convert::Into<bool>,
2606    {
2607        self.satisfies_pzi = std::option::Option::Some(v.into());
2608        self
2609    }
2610
2611    /// Sets or clears the value of [satisfies_pzi][crate::model::Cluster::satisfies_pzi].
2612    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
2613    where
2614        T: std::convert::Into<bool>,
2615    {
2616        self.satisfies_pzi = v.map(|x| x.into());
2617        self
2618    }
2619
2620    /// Sets the value of [satisfies_pzs][crate::model::Cluster::satisfies_pzs].
2621    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
2622    where
2623        T: std::convert::Into<bool>,
2624    {
2625        self.satisfies_pzs = std::option::Option::Some(v.into());
2626        self
2627    }
2628
2629    /// Sets or clears the value of [satisfies_pzs][crate::model::Cluster::satisfies_pzs].
2630    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
2631    where
2632        T: std::convert::Into<bool>,
2633    {
2634        self.satisfies_pzs = v.map(|x| x.into());
2635        self
2636    }
2637
2638    /// Sets the value of [tls_config][crate::model::Cluster::tls_config].
2639    pub fn set_tls_config<T>(mut self, v: T) -> Self
2640    where
2641        T: std::convert::Into<crate::model::TlsConfig>,
2642    {
2643        self.tls_config = std::option::Option::Some(v.into());
2644        self
2645    }
2646
2647    /// Sets or clears the value of [tls_config][crate::model::Cluster::tls_config].
2648    pub fn set_or_clear_tls_config<T>(mut self, v: std::option::Option<T>) -> Self
2649    where
2650        T: std::convert::Into<crate::model::TlsConfig>,
2651    {
2652        self.tls_config = v.map(|x| x.into());
2653        self
2654    }
2655
2656    /// Sets the value of [platform_config][crate::model::Cluster::platform_config].
2657    ///
2658    /// Note that all the setters affecting `platform_config` are mutually
2659    /// exclusive.
2660    pub fn set_platform_config<
2661        T: std::convert::Into<std::option::Option<crate::model::cluster::PlatformConfig>>,
2662    >(
2663        mut self,
2664        v: T,
2665    ) -> Self {
2666        self.platform_config = v.into();
2667        self
2668    }
2669
2670    /// The value of [platform_config][crate::model::Cluster::platform_config]
2671    /// if it holds a `GcpConfig`, `None` if the field is not set or
2672    /// holds a different branch.
2673    pub fn gcp_config(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcpConfig>> {
2674        #[allow(unreachable_patterns)]
2675        self.platform_config.as_ref().and_then(|v| match v {
2676            crate::model::cluster::PlatformConfig::GcpConfig(v) => std::option::Option::Some(v),
2677            _ => std::option::Option::None,
2678        })
2679    }
2680
2681    /// Sets the value of [platform_config][crate::model::Cluster::platform_config]
2682    /// to hold a `GcpConfig`.
2683    ///
2684    /// Note that all the setters affecting `platform_config` are
2685    /// mutually exclusive.
2686    pub fn set_gcp_config<T: std::convert::Into<std::boxed::Box<crate::model::GcpConfig>>>(
2687        mut self,
2688        v: T,
2689    ) -> Self {
2690        self.platform_config =
2691            std::option::Option::Some(crate::model::cluster::PlatformConfig::GcpConfig(v.into()));
2692        self
2693    }
2694}
2695
2696impl wkt::message::Message for Cluster {
2697    fn typename() -> &'static str {
2698        "type.googleapis.com/google.cloud.managedkafka.v1.Cluster"
2699    }
2700}
2701
2702/// Defines additional types related to [Cluster].
2703pub mod cluster {
2704    #[allow(unused_imports)]
2705    use super::*;
2706
2707    /// The state of the cluster.
2708    ///
2709    /// # Working with unknown values
2710    ///
2711    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2712    /// additional enum variants at any time. Adding new variants is not considered
2713    /// a breaking change. Applications should write their code in anticipation of:
2714    ///
2715    /// - New values appearing in future releases of the client library, **and**
2716    /// - New values received dynamically, without application changes.
2717    ///
2718    /// Please consult the [Working with enums] section in the user guide for some
2719    /// guidelines.
2720    ///
2721    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2722    #[derive(Clone, Debug, PartialEq)]
2723    #[non_exhaustive]
2724    pub enum State {
2725        /// A state was not specified.
2726        Unspecified,
2727        /// The cluster is being created.
2728        Creating,
2729        /// The cluster is active.
2730        Active,
2731        /// The cluster is being deleted.
2732        Deleting,
2733        /// If set, the enum was initialized with an unknown value.
2734        ///
2735        /// Applications can examine the value using [State::value] or
2736        /// [State::name].
2737        UnknownValue(state::UnknownValue),
2738    }
2739
2740    #[doc(hidden)]
2741    pub mod state {
2742        #[allow(unused_imports)]
2743        use super::*;
2744        #[derive(Clone, Debug, PartialEq)]
2745        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2746    }
2747
2748    impl State {
2749        /// Gets the enum value.
2750        ///
2751        /// Returns `None` if the enum contains an unknown value deserialized from
2752        /// the string representation of enums.
2753        pub fn value(&self) -> std::option::Option<i32> {
2754            match self {
2755                Self::Unspecified => std::option::Option::Some(0),
2756                Self::Creating => std::option::Option::Some(1),
2757                Self::Active => std::option::Option::Some(2),
2758                Self::Deleting => std::option::Option::Some(3),
2759                Self::UnknownValue(u) => u.0.value(),
2760            }
2761        }
2762
2763        /// Gets the enum value as a string.
2764        ///
2765        /// Returns `None` if the enum contains an unknown value deserialized from
2766        /// the integer representation of enums.
2767        pub fn name(&self) -> std::option::Option<&str> {
2768            match self {
2769                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2770                Self::Creating => std::option::Option::Some("CREATING"),
2771                Self::Active => std::option::Option::Some("ACTIVE"),
2772                Self::Deleting => std::option::Option::Some("DELETING"),
2773                Self::UnknownValue(u) => u.0.name(),
2774            }
2775        }
2776    }
2777
2778    impl std::default::Default for State {
2779        fn default() -> Self {
2780            use std::convert::From;
2781            Self::from(0)
2782        }
2783    }
2784
2785    impl std::fmt::Display for State {
2786        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2787            wkt::internal::display_enum(f, self.name(), self.value())
2788        }
2789    }
2790
2791    impl std::convert::From<i32> for State {
2792        fn from(value: i32) -> Self {
2793            match value {
2794                0 => Self::Unspecified,
2795                1 => Self::Creating,
2796                2 => Self::Active,
2797                3 => Self::Deleting,
2798                _ => Self::UnknownValue(state::UnknownValue(
2799                    wkt::internal::UnknownEnumValue::Integer(value),
2800                )),
2801            }
2802        }
2803    }
2804
2805    impl std::convert::From<&str> for State {
2806        fn from(value: &str) -> Self {
2807            use std::string::ToString;
2808            match value {
2809                "STATE_UNSPECIFIED" => Self::Unspecified,
2810                "CREATING" => Self::Creating,
2811                "ACTIVE" => Self::Active,
2812                "DELETING" => Self::Deleting,
2813                _ => Self::UnknownValue(state::UnknownValue(
2814                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2815                )),
2816            }
2817        }
2818    }
2819
2820    impl serde::ser::Serialize for State {
2821        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2822        where
2823            S: serde::Serializer,
2824        {
2825            match self {
2826                Self::Unspecified => serializer.serialize_i32(0),
2827                Self::Creating => serializer.serialize_i32(1),
2828                Self::Active => serializer.serialize_i32(2),
2829                Self::Deleting => serializer.serialize_i32(3),
2830                Self::UnknownValue(u) => u.0.serialize(serializer),
2831            }
2832        }
2833    }
2834
2835    impl<'de> serde::de::Deserialize<'de> for State {
2836        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2837        where
2838            D: serde::Deserializer<'de>,
2839        {
2840            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2841                ".google.cloud.managedkafka.v1.Cluster.State",
2842            ))
2843        }
2844    }
2845
2846    /// Platform specific configuration properties for a Kafka cluster.
2847    #[derive(Clone, Debug, PartialEq)]
2848    #[non_exhaustive]
2849    pub enum PlatformConfig {
2850        /// Required. Configuration properties for a Kafka cluster deployed to Google
2851        /// Cloud Platform.
2852        GcpConfig(std::boxed::Box<crate::model::GcpConfig>),
2853    }
2854}
2855
2856/// A capacity configuration of a Kafka cluster.
2857#[derive(Clone, Default, PartialEq)]
2858#[non_exhaustive]
2859pub struct CapacityConfig {
2860    /// Required. The number of vCPUs to provision for the cluster. Minimum: 3.
2861    pub vcpu_count: i64,
2862
2863    /// Required. The memory to provision for the cluster in bytes.
2864    /// The CPU:memory ratio (vCPU:GiB) must be between 1:1 and 1:8.
2865    /// Minimum: 3221225472 (3 GiB).
2866    pub memory_bytes: i64,
2867
2868    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2869}
2870
2871impl CapacityConfig {
2872    pub fn new() -> Self {
2873        std::default::Default::default()
2874    }
2875
2876    /// Sets the value of [vcpu_count][crate::model::CapacityConfig::vcpu_count].
2877    pub fn set_vcpu_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2878        self.vcpu_count = v.into();
2879        self
2880    }
2881
2882    /// Sets the value of [memory_bytes][crate::model::CapacityConfig::memory_bytes].
2883    pub fn set_memory_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2884        self.memory_bytes = v.into();
2885        self
2886    }
2887}
2888
2889impl wkt::message::Message for CapacityConfig {
2890    fn typename() -> &'static str {
2891        "type.googleapis.com/google.cloud.managedkafka.v1.CapacityConfig"
2892    }
2893}
2894
2895/// Defines rebalancing behavior of a Kafka cluster.
2896#[derive(Clone, Default, PartialEq)]
2897#[non_exhaustive]
2898pub struct RebalanceConfig {
2899    /// Optional. The rebalance behavior for the cluster.
2900    /// When not specified, defaults to `NO_REBALANCE`.
2901    pub mode: crate::model::rebalance_config::Mode,
2902
2903    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2904}
2905
2906impl RebalanceConfig {
2907    pub fn new() -> Self {
2908        std::default::Default::default()
2909    }
2910
2911    /// Sets the value of [mode][crate::model::RebalanceConfig::mode].
2912    pub fn set_mode<T: std::convert::Into<crate::model::rebalance_config::Mode>>(
2913        mut self,
2914        v: T,
2915    ) -> Self {
2916        self.mode = v.into();
2917        self
2918    }
2919}
2920
2921impl wkt::message::Message for RebalanceConfig {
2922    fn typename() -> &'static str {
2923        "type.googleapis.com/google.cloud.managedkafka.v1.RebalanceConfig"
2924    }
2925}
2926
2927/// Defines additional types related to [RebalanceConfig].
2928pub mod rebalance_config {
2929    #[allow(unused_imports)]
2930    use super::*;
2931
2932    /// The partition rebalance mode for the cluster.
2933    ///
2934    /// # Working with unknown values
2935    ///
2936    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2937    /// additional enum variants at any time. Adding new variants is not considered
2938    /// a breaking change. Applications should write their code in anticipation of:
2939    ///
2940    /// - New values appearing in future releases of the client library, **and**
2941    /// - New values received dynamically, without application changes.
2942    ///
2943    /// Please consult the [Working with enums] section in the user guide for some
2944    /// guidelines.
2945    ///
2946    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2947    #[derive(Clone, Debug, PartialEq)]
2948    #[non_exhaustive]
2949    pub enum Mode {
2950        /// A mode was not specified. Do not use.
2951        Unspecified,
2952        /// Do not rebalance automatically.
2953        NoRebalance,
2954        /// Automatically rebalance topic partitions among brokers when the
2955        /// cluster is scaled up.
2956        AutoRebalanceOnScaleUp,
2957        /// If set, the enum was initialized with an unknown value.
2958        ///
2959        /// Applications can examine the value using [Mode::value] or
2960        /// [Mode::name].
2961        UnknownValue(mode::UnknownValue),
2962    }
2963
2964    #[doc(hidden)]
2965    pub mod mode {
2966        #[allow(unused_imports)]
2967        use super::*;
2968        #[derive(Clone, Debug, PartialEq)]
2969        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2970    }
2971
2972    impl Mode {
2973        /// Gets the enum value.
2974        ///
2975        /// Returns `None` if the enum contains an unknown value deserialized from
2976        /// the string representation of enums.
2977        pub fn value(&self) -> std::option::Option<i32> {
2978            match self {
2979                Self::Unspecified => std::option::Option::Some(0),
2980                Self::NoRebalance => std::option::Option::Some(1),
2981                Self::AutoRebalanceOnScaleUp => std::option::Option::Some(2),
2982                Self::UnknownValue(u) => u.0.value(),
2983            }
2984        }
2985
2986        /// Gets the enum value as a string.
2987        ///
2988        /// Returns `None` if the enum contains an unknown value deserialized from
2989        /// the integer representation of enums.
2990        pub fn name(&self) -> std::option::Option<&str> {
2991            match self {
2992                Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
2993                Self::NoRebalance => std::option::Option::Some("NO_REBALANCE"),
2994                Self::AutoRebalanceOnScaleUp => {
2995                    std::option::Option::Some("AUTO_REBALANCE_ON_SCALE_UP")
2996                }
2997                Self::UnknownValue(u) => u.0.name(),
2998            }
2999        }
3000    }
3001
3002    impl std::default::Default for Mode {
3003        fn default() -> Self {
3004            use std::convert::From;
3005            Self::from(0)
3006        }
3007    }
3008
3009    impl std::fmt::Display for Mode {
3010        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3011            wkt::internal::display_enum(f, self.name(), self.value())
3012        }
3013    }
3014
3015    impl std::convert::From<i32> for Mode {
3016        fn from(value: i32) -> Self {
3017            match value {
3018                0 => Self::Unspecified,
3019                1 => Self::NoRebalance,
3020                2 => Self::AutoRebalanceOnScaleUp,
3021                _ => Self::UnknownValue(mode::UnknownValue(
3022                    wkt::internal::UnknownEnumValue::Integer(value),
3023                )),
3024            }
3025        }
3026    }
3027
3028    impl std::convert::From<&str> for Mode {
3029        fn from(value: &str) -> Self {
3030            use std::string::ToString;
3031            match value {
3032                "MODE_UNSPECIFIED" => Self::Unspecified,
3033                "NO_REBALANCE" => Self::NoRebalance,
3034                "AUTO_REBALANCE_ON_SCALE_UP" => Self::AutoRebalanceOnScaleUp,
3035                _ => Self::UnknownValue(mode::UnknownValue(
3036                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3037                )),
3038            }
3039        }
3040    }
3041
3042    impl serde::ser::Serialize for Mode {
3043        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3044        where
3045            S: serde::Serializer,
3046        {
3047            match self {
3048                Self::Unspecified => serializer.serialize_i32(0),
3049                Self::NoRebalance => serializer.serialize_i32(1),
3050                Self::AutoRebalanceOnScaleUp => serializer.serialize_i32(2),
3051                Self::UnknownValue(u) => u.0.serialize(serializer),
3052            }
3053        }
3054    }
3055
3056    impl<'de> serde::de::Deserialize<'de> for Mode {
3057        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3058        where
3059            D: serde::Deserializer<'de>,
3060        {
3061            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
3062                ".google.cloud.managedkafka.v1.RebalanceConfig.Mode",
3063            ))
3064        }
3065    }
3066}
3067
3068/// The configuration of a Virtual Private Cloud (VPC) network that can access
3069/// the Kafka cluster.
3070#[derive(Clone, Default, PartialEq)]
3071#[non_exhaustive]
3072pub struct NetworkConfig {
3073    /// Required. Name of the VPC subnet in which to create Private Service Connect
3074    /// (PSC) endpoints for the Kafka brokers and bootstrap address. Structured
3075    /// like: projects/{project}/regions/{region}/subnetworks/{subnet_id}
3076    ///
3077    /// The subnet must be located in the same region as the Kafka cluster. The
3078    /// project may differ. Multiple subnets from the same parent network must not
3079    /// be specified.
3080    pub subnet: std::string::String,
3081
3082    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3083}
3084
3085impl NetworkConfig {
3086    pub fn new() -> Self {
3087        std::default::Default::default()
3088    }
3089
3090    /// Sets the value of [subnet][crate::model::NetworkConfig::subnet].
3091    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3092        self.subnet = v.into();
3093        self
3094    }
3095}
3096
3097impl wkt::message::Message for NetworkConfig {
3098    fn typename() -> &'static str {
3099        "type.googleapis.com/google.cloud.managedkafka.v1.NetworkConfig"
3100    }
3101}
3102
3103/// The configuration of access to the Kafka cluster.
3104#[derive(Clone, Default, PartialEq)]
3105#[non_exhaustive]
3106pub struct AccessConfig {
3107    /// Required. Virtual Private Cloud (VPC) networks that must be granted direct
3108    /// access to the Kafka cluster. Minimum of 1 network is required. Maximum 10
3109    /// networks can be specified.
3110    pub network_configs: std::vec::Vec<crate::model::NetworkConfig>,
3111
3112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3113}
3114
3115impl AccessConfig {
3116    pub fn new() -> Self {
3117        std::default::Default::default()
3118    }
3119
3120    /// Sets the value of [network_configs][crate::model::AccessConfig::network_configs].
3121    pub fn set_network_configs<T, V>(mut self, v: T) -> Self
3122    where
3123        T: std::iter::IntoIterator<Item = V>,
3124        V: std::convert::Into<crate::model::NetworkConfig>,
3125    {
3126        use std::iter::Iterator;
3127        self.network_configs = v.into_iter().map(|i| i.into()).collect();
3128        self
3129    }
3130}
3131
3132impl wkt::message::Message for AccessConfig {
3133    fn typename() -> &'static str {
3134        "type.googleapis.com/google.cloud.managedkafka.v1.AccessConfig"
3135    }
3136}
3137
3138/// Configuration properties for a Kafka cluster deployed to Google Cloud
3139/// Platform.
3140#[derive(Clone, Default, PartialEq)]
3141#[non_exhaustive]
3142pub struct GcpConfig {
3143    /// Required. Access configuration for the Kafka cluster.
3144    pub access_config: std::option::Option<crate::model::AccessConfig>,
3145
3146    /// Optional. Immutable. The Cloud KMS Key name to use for encryption. The key
3147    /// must be located in the same region as the cluster and cannot be changed.
3148    /// Structured like:
3149    /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
3150    pub kms_key: std::string::String,
3151
3152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3153}
3154
3155impl GcpConfig {
3156    pub fn new() -> Self {
3157        std::default::Default::default()
3158    }
3159
3160    /// Sets the value of [access_config][crate::model::GcpConfig::access_config].
3161    pub fn set_access_config<T>(mut self, v: T) -> Self
3162    where
3163        T: std::convert::Into<crate::model::AccessConfig>,
3164    {
3165        self.access_config = std::option::Option::Some(v.into());
3166        self
3167    }
3168
3169    /// Sets or clears the value of [access_config][crate::model::GcpConfig::access_config].
3170    pub fn set_or_clear_access_config<T>(mut self, v: std::option::Option<T>) -> Self
3171    where
3172        T: std::convert::Into<crate::model::AccessConfig>,
3173    {
3174        self.access_config = v.map(|x| x.into());
3175        self
3176    }
3177
3178    /// Sets the value of [kms_key][crate::model::GcpConfig::kms_key].
3179    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3180        self.kms_key = v.into();
3181        self
3182    }
3183}
3184
3185impl wkt::message::Message for GcpConfig {
3186    fn typename() -> &'static str {
3187        "type.googleapis.com/google.cloud.managedkafka.v1.GcpConfig"
3188    }
3189}
3190
3191/// The TLS configuration for the Kafka cluster.
3192#[derive(Clone, Default, PartialEq)]
3193#[non_exhaustive]
3194pub struct TlsConfig {
3195    /// Optional. The configuration of the broker truststore. If specified, clients
3196    /// can use mTLS for authentication.
3197    pub trust_config: std::option::Option<crate::model::TrustConfig>,
3198
3199    /// Optional. A list of rules for mapping from SSL principal names to
3200    /// short names. These are applied in order by Kafka.
3201    /// Refer to the Apache Kafka documentation for `ssl.principal.mapping.rules`
3202    /// for the precise formatting details and syntax.
3203    /// Example: "RULE:^CN=(.*?),OU=ServiceUsers.*$/$1@example.com/,DEFAULT"
3204    ///
3205    /// This is a static Kafka broker configuration. Setting or modifying this
3206    /// field will trigger a rolling restart of the Kafka brokers to apply
3207    /// the change. An empty string means no rules are applied (Kafka default).
3208    pub ssl_principal_mapping_rules: std::string::String,
3209
3210    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3211}
3212
3213impl TlsConfig {
3214    pub fn new() -> Self {
3215        std::default::Default::default()
3216    }
3217
3218    /// Sets the value of [trust_config][crate::model::TlsConfig::trust_config].
3219    pub fn set_trust_config<T>(mut self, v: T) -> Self
3220    where
3221        T: std::convert::Into<crate::model::TrustConfig>,
3222    {
3223        self.trust_config = std::option::Option::Some(v.into());
3224        self
3225    }
3226
3227    /// Sets or clears the value of [trust_config][crate::model::TlsConfig::trust_config].
3228    pub fn set_or_clear_trust_config<T>(mut self, v: std::option::Option<T>) -> Self
3229    where
3230        T: std::convert::Into<crate::model::TrustConfig>,
3231    {
3232        self.trust_config = v.map(|x| x.into());
3233        self
3234    }
3235
3236    /// Sets the value of [ssl_principal_mapping_rules][crate::model::TlsConfig::ssl_principal_mapping_rules].
3237    pub fn set_ssl_principal_mapping_rules<T: std::convert::Into<std::string::String>>(
3238        mut self,
3239        v: T,
3240    ) -> Self {
3241        self.ssl_principal_mapping_rules = v.into();
3242        self
3243    }
3244}
3245
3246impl wkt::message::Message for TlsConfig {
3247    fn typename() -> &'static str {
3248        "type.googleapis.com/google.cloud.managedkafka.v1.TlsConfig"
3249    }
3250}
3251
3252/// Sources of CA certificates to install in the broker's truststore.
3253#[derive(Clone, Default, PartialEq)]
3254#[non_exhaustive]
3255pub struct TrustConfig {
3256    /// Optional. Configuration for the Google Certificate Authority Service.
3257    /// Maximum 10.
3258    pub cas_configs: std::vec::Vec<crate::model::trust_config::CertificateAuthorityServiceConfig>,
3259
3260    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3261}
3262
3263impl TrustConfig {
3264    pub fn new() -> Self {
3265        std::default::Default::default()
3266    }
3267
3268    /// Sets the value of [cas_configs][crate::model::TrustConfig::cas_configs].
3269    pub fn set_cas_configs<T, V>(mut self, v: T) -> Self
3270    where
3271        T: std::iter::IntoIterator<Item = V>,
3272        V: std::convert::Into<crate::model::trust_config::CertificateAuthorityServiceConfig>,
3273    {
3274        use std::iter::Iterator;
3275        self.cas_configs = v.into_iter().map(|i| i.into()).collect();
3276        self
3277    }
3278}
3279
3280impl wkt::message::Message for TrustConfig {
3281    fn typename() -> &'static str {
3282        "type.googleapis.com/google.cloud.managedkafka.v1.TrustConfig"
3283    }
3284}
3285
3286/// Defines additional types related to [TrustConfig].
3287pub mod trust_config {
3288    #[allow(unused_imports)]
3289    use super::*;
3290
3291    /// A configuration for the Google Certificate Authority Service.
3292    #[derive(Clone, Default, PartialEq)]
3293    #[non_exhaustive]
3294    pub struct CertificateAuthorityServiceConfig {
3295        /// Required. The name of the CA pool to pull CA certificates from.
3296        /// Structured like:
3297        /// projects/{project}/locations/{location}/caPools/{ca_pool}.
3298        /// The CA pool does not need to be in the same project or location as the
3299        /// Kafka cluster.
3300        pub ca_pool: std::string::String,
3301
3302        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3303    }
3304
3305    impl CertificateAuthorityServiceConfig {
3306        pub fn new() -> Self {
3307            std::default::Default::default()
3308        }
3309
3310        /// Sets the value of [ca_pool][crate::model::trust_config::CertificateAuthorityServiceConfig::ca_pool].
3311        pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3312            self.ca_pool = v.into();
3313            self
3314        }
3315    }
3316
3317    impl wkt::message::Message for CertificateAuthorityServiceConfig {
3318        fn typename() -> &'static str {
3319            "type.googleapis.com/google.cloud.managedkafka.v1.TrustConfig.CertificateAuthorityServiceConfig"
3320        }
3321    }
3322}
3323
3324/// A Kafka topic in a given cluster.
3325#[derive(Clone, Default, PartialEq)]
3326#[non_exhaustive]
3327pub struct Topic {
3328    /// Identifier. The name of the topic. The `topic` segment is used when
3329    /// connecting directly to the cluster. Structured like:
3330    /// projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
3331    pub name: std::string::String,
3332
3333    /// Required. The number of partitions this topic has. The partition count can
3334    /// only be increased, not decreased. Please note that if partitions are
3335    /// increased for a topic that has a key, the partitioning logic or the
3336    /// ordering of the messages will be affected.
3337    pub partition_count: i32,
3338
3339    /// Required. Immutable. The number of replicas of each partition. A
3340    /// replication factor of 3 is recommended for high availability.
3341    pub replication_factor: i32,
3342
3343    /// Optional. Configurations for the topic that are overridden from the cluster
3344    /// defaults. The key of the map is a Kafka topic property name, for example:
3345    /// `cleanup.policy`, `compression.type`.
3346    pub configs: std::collections::HashMap<std::string::String, std::string::String>,
3347
3348    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3349}
3350
3351impl Topic {
3352    pub fn new() -> Self {
3353        std::default::Default::default()
3354    }
3355
3356    /// Sets the value of [name][crate::model::Topic::name].
3357    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3358        self.name = v.into();
3359        self
3360    }
3361
3362    /// Sets the value of [partition_count][crate::model::Topic::partition_count].
3363    pub fn set_partition_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3364        self.partition_count = v.into();
3365        self
3366    }
3367
3368    /// Sets the value of [replication_factor][crate::model::Topic::replication_factor].
3369    pub fn set_replication_factor<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3370        self.replication_factor = v.into();
3371        self
3372    }
3373
3374    /// Sets the value of [configs][crate::model::Topic::configs].
3375    pub fn set_configs<T, K, V>(mut self, v: T) -> Self
3376    where
3377        T: std::iter::IntoIterator<Item = (K, V)>,
3378        K: std::convert::Into<std::string::String>,
3379        V: std::convert::Into<std::string::String>,
3380    {
3381        use std::iter::Iterator;
3382        self.configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3383        self
3384    }
3385}
3386
3387impl wkt::message::Message for Topic {
3388    fn typename() -> &'static str {
3389        "type.googleapis.com/google.cloud.managedkafka.v1.Topic"
3390    }
3391}
3392
3393/// Metadata for a consumer group corresponding to a specific topic.
3394#[derive(Clone, Default, PartialEq)]
3395#[non_exhaustive]
3396pub struct ConsumerTopicMetadata {
3397    /// Optional. Metadata for this consumer group and topic for all partition
3398    /// indexes it has metadata for.
3399    pub partitions: std::collections::HashMap<i32, crate::model::ConsumerPartitionMetadata>,
3400
3401    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3402}
3403
3404impl ConsumerTopicMetadata {
3405    pub fn new() -> Self {
3406        std::default::Default::default()
3407    }
3408
3409    /// Sets the value of [partitions][crate::model::ConsumerTopicMetadata::partitions].
3410    pub fn set_partitions<T, K, V>(mut self, v: T) -> Self
3411    where
3412        T: std::iter::IntoIterator<Item = (K, V)>,
3413        K: std::convert::Into<i32>,
3414        V: std::convert::Into<crate::model::ConsumerPartitionMetadata>,
3415    {
3416        use std::iter::Iterator;
3417        self.partitions = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3418        self
3419    }
3420}
3421
3422impl wkt::message::Message for ConsumerTopicMetadata {
3423    fn typename() -> &'static str {
3424        "type.googleapis.com/google.cloud.managedkafka.v1.ConsumerTopicMetadata"
3425    }
3426}
3427
3428/// Metadata for a consumer group corresponding to a specific partition.
3429#[derive(Clone, Default, PartialEq)]
3430#[non_exhaustive]
3431pub struct ConsumerPartitionMetadata {
3432    /// Required. The current offset for this partition, or 0 if no offset has been
3433    /// committed.
3434    pub offset: i64,
3435
3436    /// Optional. The associated metadata for this partition, or empty if it does
3437    /// not exist.
3438    pub metadata: std::string::String,
3439
3440    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3441}
3442
3443impl ConsumerPartitionMetadata {
3444    pub fn new() -> Self {
3445        std::default::Default::default()
3446    }
3447
3448    /// Sets the value of [offset][crate::model::ConsumerPartitionMetadata::offset].
3449    pub fn set_offset<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3450        self.offset = v.into();
3451        self
3452    }
3453
3454    /// Sets the value of [metadata][crate::model::ConsumerPartitionMetadata::metadata].
3455    pub fn set_metadata<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3456        self.metadata = v.into();
3457        self
3458    }
3459}
3460
3461impl wkt::message::Message for ConsumerPartitionMetadata {
3462    fn typename() -> &'static str {
3463        "type.googleapis.com/google.cloud.managedkafka.v1.ConsumerPartitionMetadata"
3464    }
3465}
3466
3467/// A Kafka consumer group in a given cluster.
3468#[derive(Clone, Default, PartialEq)]
3469#[non_exhaustive]
3470pub struct ConsumerGroup {
3471    /// Identifier. The name of the consumer group. The `consumer_group` segment is
3472    /// used when connecting directly to the cluster. Structured like:
3473    /// projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group}
3474    pub name: std::string::String,
3475
3476    /// Optional. Metadata for this consumer group for all topics it has metadata
3477    /// for. The key of the map is a topic name, structured like:
3478    /// projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
3479    pub topics: std::collections::HashMap<std::string::String, crate::model::ConsumerTopicMetadata>,
3480
3481    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3482}
3483
3484impl ConsumerGroup {
3485    pub fn new() -> Self {
3486        std::default::Default::default()
3487    }
3488
3489    /// Sets the value of [name][crate::model::ConsumerGroup::name].
3490    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3491        self.name = v.into();
3492        self
3493    }
3494
3495    /// Sets the value of [topics][crate::model::ConsumerGroup::topics].
3496    pub fn set_topics<T, K, V>(mut self, v: T) -> Self
3497    where
3498        T: std::iter::IntoIterator<Item = (K, V)>,
3499        K: std::convert::Into<std::string::String>,
3500        V: std::convert::Into<crate::model::ConsumerTopicMetadata>,
3501    {
3502        use std::iter::Iterator;
3503        self.topics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3504        self
3505    }
3506}
3507
3508impl wkt::message::Message for ConsumerGroup {
3509    fn typename() -> &'static str {
3510        "type.googleapis.com/google.cloud.managedkafka.v1.ConsumerGroup"
3511    }
3512}
3513
3514/// Represents the metadata of the long-running operation.
3515#[derive(Clone, Default, PartialEq)]
3516#[non_exhaustive]
3517pub struct OperationMetadata {
3518    /// Output only. The time the operation was created.
3519    pub create_time: std::option::Option<wkt::Timestamp>,
3520
3521    /// Output only. The time the operation finished running.
3522    pub end_time: std::option::Option<wkt::Timestamp>,
3523
3524    /// Output only. Server-defined resource path for the target of the operation.
3525    pub target: std::string::String,
3526
3527    /// Output only. Name of the verb executed by the operation.
3528    pub verb: std::string::String,
3529
3530    /// Output only. Human-readable status of the operation, if any.
3531    pub status_message: std::string::String,
3532
3533    /// Output only. Identifies whether the user has requested cancellation
3534    /// of the operation. Operations that have been cancelled successfully
3535    /// have [Operation.error][] value with a
3536    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3537    /// `Code.CANCELLED`.
3538    ///
3539    /// [google.rpc.Status.code]: rpc::model::Status::code
3540    pub requested_cancellation: bool,
3541
3542    /// Output only. API version used to start the operation.
3543    pub api_version: std::string::String,
3544
3545    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3546}
3547
3548impl OperationMetadata {
3549    pub fn new() -> Self {
3550        std::default::Default::default()
3551    }
3552
3553    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3554    pub fn set_create_time<T>(mut self, v: T) -> Self
3555    where
3556        T: std::convert::Into<wkt::Timestamp>,
3557    {
3558        self.create_time = std::option::Option::Some(v.into());
3559        self
3560    }
3561
3562    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3563    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3564    where
3565        T: std::convert::Into<wkt::Timestamp>,
3566    {
3567        self.create_time = v.map(|x| x.into());
3568        self
3569    }
3570
3571    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3572    pub fn set_end_time<T>(mut self, v: T) -> Self
3573    where
3574        T: std::convert::Into<wkt::Timestamp>,
3575    {
3576        self.end_time = std::option::Option::Some(v.into());
3577        self
3578    }
3579
3580    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3581    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3582    where
3583        T: std::convert::Into<wkt::Timestamp>,
3584    {
3585        self.end_time = v.map(|x| x.into());
3586        self
3587    }
3588
3589    /// Sets the value of [target][crate::model::OperationMetadata::target].
3590    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3591        self.target = v.into();
3592        self
3593    }
3594
3595    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3596    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3597        self.verb = v.into();
3598        self
3599    }
3600
3601    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3602    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3603        self.status_message = v.into();
3604        self
3605    }
3606
3607    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3608    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3609        self.requested_cancellation = v.into();
3610        self
3611    }
3612
3613    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3614    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3615        self.api_version = v.into();
3616        self
3617    }
3618}
3619
3620impl wkt::message::Message for OperationMetadata {
3621    fn typename() -> &'static str {
3622        "type.googleapis.com/google.cloud.managedkafka.v1.OperationMetadata"
3623    }
3624}
3625
3626/// An Apache Kafka Connect cluster deployed in a location.
3627#[derive(Clone, Default, PartialEq)]
3628#[non_exhaustive]
3629pub struct ConnectCluster {
3630    /// Identifier. The name of the Kafka Connect cluster. Structured like:
3631    /// projects/{project_number}/locations/{location}/connectClusters/{connect_cluster_id}
3632    pub name: std::string::String,
3633
3634    /// Required. Immutable. The name of the Kafka cluster this Kafka Connect
3635    /// cluster is attached to. Structured like:
3636    /// projects/{project}/locations/{location}/clusters/{cluster}
3637    pub kafka_cluster: std::string::String,
3638
3639    /// Output only. The time when the cluster was created.
3640    pub create_time: std::option::Option<wkt::Timestamp>,
3641
3642    /// Output only. The time when the cluster was last updated.
3643    pub update_time: std::option::Option<wkt::Timestamp>,
3644
3645    /// Optional. Labels as key value pairs.
3646    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3647
3648    /// Required. Capacity configuration for the Kafka Connect cluster.
3649    pub capacity_config: std::option::Option<crate::model::CapacityConfig>,
3650
3651    /// Output only. The current state of the cluster.
3652    pub state: crate::model::connect_cluster::State,
3653
3654    /// Optional. Configurations for the worker that are overridden from the
3655    /// defaults. The key of the map is a Kafka Connect worker property name, for
3656    /// example: `exactly.once.source.support`.
3657    pub config: std::collections::HashMap<std::string::String, std::string::String>,
3658
3659    /// Platform specific configuration properties for a Kafka Connect cluster.
3660    pub platform_config: std::option::Option<crate::model::connect_cluster::PlatformConfig>,
3661
3662    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3663}
3664
3665impl ConnectCluster {
3666    pub fn new() -> Self {
3667        std::default::Default::default()
3668    }
3669
3670    /// Sets the value of [name][crate::model::ConnectCluster::name].
3671    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3672        self.name = v.into();
3673        self
3674    }
3675
3676    /// Sets the value of [kafka_cluster][crate::model::ConnectCluster::kafka_cluster].
3677    pub fn set_kafka_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3678        self.kafka_cluster = v.into();
3679        self
3680    }
3681
3682    /// Sets the value of [create_time][crate::model::ConnectCluster::create_time].
3683    pub fn set_create_time<T>(mut self, v: T) -> Self
3684    where
3685        T: std::convert::Into<wkt::Timestamp>,
3686    {
3687        self.create_time = std::option::Option::Some(v.into());
3688        self
3689    }
3690
3691    /// Sets or clears the value of [create_time][crate::model::ConnectCluster::create_time].
3692    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3693    where
3694        T: std::convert::Into<wkt::Timestamp>,
3695    {
3696        self.create_time = v.map(|x| x.into());
3697        self
3698    }
3699
3700    /// Sets the value of [update_time][crate::model::ConnectCluster::update_time].
3701    pub fn set_update_time<T>(mut self, v: T) -> Self
3702    where
3703        T: std::convert::Into<wkt::Timestamp>,
3704    {
3705        self.update_time = std::option::Option::Some(v.into());
3706        self
3707    }
3708
3709    /// Sets or clears the value of [update_time][crate::model::ConnectCluster::update_time].
3710    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3711    where
3712        T: std::convert::Into<wkt::Timestamp>,
3713    {
3714        self.update_time = v.map(|x| x.into());
3715        self
3716    }
3717
3718    /// Sets the value of [labels][crate::model::ConnectCluster::labels].
3719    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3720    where
3721        T: std::iter::IntoIterator<Item = (K, V)>,
3722        K: std::convert::Into<std::string::String>,
3723        V: std::convert::Into<std::string::String>,
3724    {
3725        use std::iter::Iterator;
3726        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3727        self
3728    }
3729
3730    /// Sets the value of [capacity_config][crate::model::ConnectCluster::capacity_config].
3731    pub fn set_capacity_config<T>(mut self, v: T) -> Self
3732    where
3733        T: std::convert::Into<crate::model::CapacityConfig>,
3734    {
3735        self.capacity_config = std::option::Option::Some(v.into());
3736        self
3737    }
3738
3739    /// Sets or clears the value of [capacity_config][crate::model::ConnectCluster::capacity_config].
3740    pub fn set_or_clear_capacity_config<T>(mut self, v: std::option::Option<T>) -> Self
3741    where
3742        T: std::convert::Into<crate::model::CapacityConfig>,
3743    {
3744        self.capacity_config = v.map(|x| x.into());
3745        self
3746    }
3747
3748    /// Sets the value of [state][crate::model::ConnectCluster::state].
3749    pub fn set_state<T: std::convert::Into<crate::model::connect_cluster::State>>(
3750        mut self,
3751        v: T,
3752    ) -> Self {
3753        self.state = v.into();
3754        self
3755    }
3756
3757    /// Sets the value of [config][crate::model::ConnectCluster::config].
3758    pub fn set_config<T, K, V>(mut self, v: T) -> Self
3759    where
3760        T: std::iter::IntoIterator<Item = (K, V)>,
3761        K: std::convert::Into<std::string::String>,
3762        V: std::convert::Into<std::string::String>,
3763    {
3764        use std::iter::Iterator;
3765        self.config = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3766        self
3767    }
3768
3769    /// Sets the value of [platform_config][crate::model::ConnectCluster::platform_config].
3770    ///
3771    /// Note that all the setters affecting `platform_config` are mutually
3772    /// exclusive.
3773    pub fn set_platform_config<
3774        T: std::convert::Into<std::option::Option<crate::model::connect_cluster::PlatformConfig>>,
3775    >(
3776        mut self,
3777        v: T,
3778    ) -> Self {
3779        self.platform_config = v.into();
3780        self
3781    }
3782
3783    /// The value of [platform_config][crate::model::ConnectCluster::platform_config]
3784    /// if it holds a `GcpConfig`, `None` if the field is not set or
3785    /// holds a different branch.
3786    pub fn gcp_config(
3787        &self,
3788    ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectGcpConfig>> {
3789        #[allow(unreachable_patterns)]
3790        self.platform_config.as_ref().and_then(|v| match v {
3791            crate::model::connect_cluster::PlatformConfig::GcpConfig(v) => {
3792                std::option::Option::Some(v)
3793            }
3794            _ => std::option::Option::None,
3795        })
3796    }
3797
3798    /// Sets the value of [platform_config][crate::model::ConnectCluster::platform_config]
3799    /// to hold a `GcpConfig`.
3800    ///
3801    /// Note that all the setters affecting `platform_config` are
3802    /// mutually exclusive.
3803    pub fn set_gcp_config<
3804        T: std::convert::Into<std::boxed::Box<crate::model::ConnectGcpConfig>>,
3805    >(
3806        mut self,
3807        v: T,
3808    ) -> Self {
3809        self.platform_config = std::option::Option::Some(
3810            crate::model::connect_cluster::PlatformConfig::GcpConfig(v.into()),
3811        );
3812        self
3813    }
3814}
3815
3816impl wkt::message::Message for ConnectCluster {
3817    fn typename() -> &'static str {
3818        "type.googleapis.com/google.cloud.managedkafka.v1.ConnectCluster"
3819    }
3820}
3821
3822/// Defines additional types related to [ConnectCluster].
3823pub mod connect_cluster {
3824    #[allow(unused_imports)]
3825    use super::*;
3826
3827    /// The state of the cluster.
3828    ///
3829    /// # Working with unknown values
3830    ///
3831    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3832    /// additional enum variants at any time. Adding new variants is not considered
3833    /// a breaking change. Applications should write their code in anticipation of:
3834    ///
3835    /// - New values appearing in future releases of the client library, **and**
3836    /// - New values received dynamically, without application changes.
3837    ///
3838    /// Please consult the [Working with enums] section in the user guide for some
3839    /// guidelines.
3840    ///
3841    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3842    #[derive(Clone, Debug, PartialEq)]
3843    #[non_exhaustive]
3844    pub enum State {
3845        /// A state was not specified.
3846        Unspecified,
3847        /// The cluster is being created.
3848        Creating,
3849        /// The cluster is active.
3850        Active,
3851        /// The cluster is being deleted.
3852        Deleting,
3853        /// If set, the enum was initialized with an unknown value.
3854        ///
3855        /// Applications can examine the value using [State::value] or
3856        /// [State::name].
3857        UnknownValue(state::UnknownValue),
3858    }
3859
3860    #[doc(hidden)]
3861    pub mod state {
3862        #[allow(unused_imports)]
3863        use super::*;
3864        #[derive(Clone, Debug, PartialEq)]
3865        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3866    }
3867
3868    impl State {
3869        /// Gets the enum value.
3870        ///
3871        /// Returns `None` if the enum contains an unknown value deserialized from
3872        /// the string representation of enums.
3873        pub fn value(&self) -> std::option::Option<i32> {
3874            match self {
3875                Self::Unspecified => std::option::Option::Some(0),
3876                Self::Creating => std::option::Option::Some(1),
3877                Self::Active => std::option::Option::Some(2),
3878                Self::Deleting => std::option::Option::Some(3),
3879                Self::UnknownValue(u) => u.0.value(),
3880            }
3881        }
3882
3883        /// Gets the enum value as a string.
3884        ///
3885        /// Returns `None` if the enum contains an unknown value deserialized from
3886        /// the integer representation of enums.
3887        pub fn name(&self) -> std::option::Option<&str> {
3888            match self {
3889                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3890                Self::Creating => std::option::Option::Some("CREATING"),
3891                Self::Active => std::option::Option::Some("ACTIVE"),
3892                Self::Deleting => std::option::Option::Some("DELETING"),
3893                Self::UnknownValue(u) => u.0.name(),
3894            }
3895        }
3896    }
3897
3898    impl std::default::Default for State {
3899        fn default() -> Self {
3900            use std::convert::From;
3901            Self::from(0)
3902        }
3903    }
3904
3905    impl std::fmt::Display for State {
3906        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3907            wkt::internal::display_enum(f, self.name(), self.value())
3908        }
3909    }
3910
3911    impl std::convert::From<i32> for State {
3912        fn from(value: i32) -> Self {
3913            match value {
3914                0 => Self::Unspecified,
3915                1 => Self::Creating,
3916                2 => Self::Active,
3917                3 => Self::Deleting,
3918                _ => Self::UnknownValue(state::UnknownValue(
3919                    wkt::internal::UnknownEnumValue::Integer(value),
3920                )),
3921            }
3922        }
3923    }
3924
3925    impl std::convert::From<&str> for State {
3926        fn from(value: &str) -> Self {
3927            use std::string::ToString;
3928            match value {
3929                "STATE_UNSPECIFIED" => Self::Unspecified,
3930                "CREATING" => Self::Creating,
3931                "ACTIVE" => Self::Active,
3932                "DELETING" => Self::Deleting,
3933                _ => Self::UnknownValue(state::UnknownValue(
3934                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3935                )),
3936            }
3937        }
3938    }
3939
3940    impl serde::ser::Serialize for State {
3941        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3942        where
3943            S: serde::Serializer,
3944        {
3945            match self {
3946                Self::Unspecified => serializer.serialize_i32(0),
3947                Self::Creating => serializer.serialize_i32(1),
3948                Self::Active => serializer.serialize_i32(2),
3949                Self::Deleting => serializer.serialize_i32(3),
3950                Self::UnknownValue(u) => u.0.serialize(serializer),
3951            }
3952        }
3953    }
3954
3955    impl<'de> serde::de::Deserialize<'de> for State {
3956        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3957        where
3958            D: serde::Deserializer<'de>,
3959        {
3960            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3961                ".google.cloud.managedkafka.v1.ConnectCluster.State",
3962            ))
3963        }
3964    }
3965
3966    /// Platform specific configuration properties for a Kafka Connect cluster.
3967    #[derive(Clone, Debug, PartialEq)]
3968    #[non_exhaustive]
3969    pub enum PlatformConfig {
3970        /// Required. Configuration properties for a Kafka Connect cluster deployed
3971        /// to Google Cloud Platform.
3972        GcpConfig(std::boxed::Box<crate::model::ConnectGcpConfig>),
3973    }
3974}
3975
3976/// The configuration of a Virtual Private Cloud (VPC) network that can access
3977/// the Kafka Connect cluster.
3978#[derive(Clone, Default, PartialEq)]
3979#[non_exhaustive]
3980pub struct ConnectNetworkConfig {
3981    /// Required. VPC subnet to make available to the Kafka Connect cluster.
3982    /// Structured like:
3983    /// projects/{project}/regions/{region}/subnetworks/{subnet_id}
3984    ///
3985    /// It is used to create a Private Service Connect (PSC) interface for the
3986    /// Kafka Connect workers. It must be located in the same region as the
3987    /// Kafka Connect cluster.
3988    ///
3989    /// The CIDR range of the subnet must be within the IPv4 address ranges for
3990    /// private networks, as specified in RFC 1918. The primary subnet CIDR range
3991    /// must have a minimum size of /22 (1024 addresses).
3992    pub primary_subnet: std::string::String,
3993
3994    /// Optional. Additional subnets may be specified. They may be in another
3995    /// region, but must be in the same VPC network. The Connect workers can
3996    /// communicate with network endpoints in either the primary or additional
3997    /// subnets.
3998    pub additional_subnets: std::vec::Vec<std::string::String>,
3999
4000    /// Optional. Additional DNS domain names from the subnet's network to be made
4001    /// visible to the Connect Cluster. When using MirrorMaker2, it's necessary to
4002    /// add the bootstrap address's dns domain name of the target cluster to make
4003    /// it visible to the connector. For example:
4004    /// my-kafka-cluster.us-central1.managedkafka.my-project.cloud.goog
4005    pub dns_domain_names: std::vec::Vec<std::string::String>,
4006
4007    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4008}
4009
4010impl ConnectNetworkConfig {
4011    pub fn new() -> Self {
4012        std::default::Default::default()
4013    }
4014
4015    /// Sets the value of [primary_subnet][crate::model::ConnectNetworkConfig::primary_subnet].
4016    pub fn set_primary_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4017        self.primary_subnet = v.into();
4018        self
4019    }
4020
4021    /// Sets the value of [additional_subnets][crate::model::ConnectNetworkConfig::additional_subnets].
4022    pub fn set_additional_subnets<T, V>(mut self, v: T) -> Self
4023    where
4024        T: std::iter::IntoIterator<Item = V>,
4025        V: std::convert::Into<std::string::String>,
4026    {
4027        use std::iter::Iterator;
4028        self.additional_subnets = v.into_iter().map(|i| i.into()).collect();
4029        self
4030    }
4031
4032    /// Sets the value of [dns_domain_names][crate::model::ConnectNetworkConfig::dns_domain_names].
4033    pub fn set_dns_domain_names<T, V>(mut self, v: T) -> Self
4034    where
4035        T: std::iter::IntoIterator<Item = V>,
4036        V: std::convert::Into<std::string::String>,
4037    {
4038        use std::iter::Iterator;
4039        self.dns_domain_names = v.into_iter().map(|i| i.into()).collect();
4040        self
4041    }
4042}
4043
4044impl wkt::message::Message for ConnectNetworkConfig {
4045    fn typename() -> &'static str {
4046        "type.googleapis.com/google.cloud.managedkafka.v1.ConnectNetworkConfig"
4047    }
4048}
4049
4050/// The configuration of access to the Kafka Connect cluster.
4051#[derive(Clone, Default, PartialEq)]
4052#[non_exhaustive]
4053pub struct ConnectAccessConfig {
4054    /// Required.
4055    /// Virtual Private Cloud (VPC) networks that must be granted direct access to
4056    /// the Kafka Connect cluster. Minimum of 1 network is required. Maximum 10
4057    /// networks can be specified.
4058    pub network_configs: std::vec::Vec<crate::model::ConnectNetworkConfig>,
4059
4060    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4061}
4062
4063impl ConnectAccessConfig {
4064    pub fn new() -> Self {
4065        std::default::Default::default()
4066    }
4067
4068    /// Sets the value of [network_configs][crate::model::ConnectAccessConfig::network_configs].
4069    pub fn set_network_configs<T, V>(mut self, v: T) -> Self
4070    where
4071        T: std::iter::IntoIterator<Item = V>,
4072        V: std::convert::Into<crate::model::ConnectNetworkConfig>,
4073    {
4074        use std::iter::Iterator;
4075        self.network_configs = v.into_iter().map(|i| i.into()).collect();
4076        self
4077    }
4078}
4079
4080impl wkt::message::Message for ConnectAccessConfig {
4081    fn typename() -> &'static str {
4082        "type.googleapis.com/google.cloud.managedkafka.v1.ConnectAccessConfig"
4083    }
4084}
4085
4086/// Configuration properties for a Kafka Connect cluster deployed to Google Cloud
4087/// Platform.
4088#[derive(Clone, Default, PartialEq)]
4089#[non_exhaustive]
4090pub struct ConnectGcpConfig {
4091    /// Required. Access configuration for the Kafka Connect cluster.
4092    pub access_config: std::option::Option<crate::model::ConnectAccessConfig>,
4093
4094    /// Optional. Secrets to load into workers. Exact SecretVersions from Secret
4095    /// Manager must be provided -- aliases are not supported. Up to 32 secrets may
4096    /// be loaded into one cluster. Format:
4097    /// projects/\<project-id\>/secrets/\<secret-name\>/versions/\<version-id\>
4098    pub secret_paths: std::vec::Vec<std::string::String>,
4099
4100    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4101}
4102
4103impl ConnectGcpConfig {
4104    pub fn new() -> Self {
4105        std::default::Default::default()
4106    }
4107
4108    /// Sets the value of [access_config][crate::model::ConnectGcpConfig::access_config].
4109    pub fn set_access_config<T>(mut self, v: T) -> Self
4110    where
4111        T: std::convert::Into<crate::model::ConnectAccessConfig>,
4112    {
4113        self.access_config = std::option::Option::Some(v.into());
4114        self
4115    }
4116
4117    /// Sets or clears the value of [access_config][crate::model::ConnectGcpConfig::access_config].
4118    pub fn set_or_clear_access_config<T>(mut self, v: std::option::Option<T>) -> Self
4119    where
4120        T: std::convert::Into<crate::model::ConnectAccessConfig>,
4121    {
4122        self.access_config = v.map(|x| x.into());
4123        self
4124    }
4125
4126    /// Sets the value of [secret_paths][crate::model::ConnectGcpConfig::secret_paths].
4127    pub fn set_secret_paths<T, V>(mut self, v: T) -> Self
4128    where
4129        T: std::iter::IntoIterator<Item = V>,
4130        V: std::convert::Into<std::string::String>,
4131    {
4132        use std::iter::Iterator;
4133        self.secret_paths = v.into_iter().map(|i| i.into()).collect();
4134        self
4135    }
4136}
4137
4138impl wkt::message::Message for ConnectGcpConfig {
4139    fn typename() -> &'static str {
4140        "type.googleapis.com/google.cloud.managedkafka.v1.ConnectGcpConfig"
4141    }
4142}
4143
4144/// A Kafka Connect connector in a given ConnectCluster.
4145#[derive(Clone, Default, PartialEq)]
4146#[non_exhaustive]
4147pub struct Connector {
4148    /// Identifier. The name of the connector.
4149    /// Structured like:
4150    /// projects/{project}/locations/{location}/connectClusters/{connect_cluster}/connectors/{connector}
4151    pub name: std::string::String,
4152
4153    /// Optional. Connector config as keys/values.
4154    /// The keys of the map are connector property names, for example:
4155    /// `connector.class`, `tasks.max`, `key.converter`.
4156    pub configs: std::collections::HashMap<std::string::String, std::string::String>,
4157
4158    /// Output only. The current state of the connector.
4159    pub state: crate::model::connector::State,
4160
4161    /// A policy that specifies how to restart the failed connectors/tasks in a
4162    /// Cluster resource. If not set, the failed connectors/tasks won't be
4163    /// restarted.
4164    pub restart_policy: std::option::Option<crate::model::connector::RestartPolicy>,
4165
4166    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4167}
4168
4169impl Connector {
4170    pub fn new() -> Self {
4171        std::default::Default::default()
4172    }
4173
4174    /// Sets the value of [name][crate::model::Connector::name].
4175    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4176        self.name = v.into();
4177        self
4178    }
4179
4180    /// Sets the value of [configs][crate::model::Connector::configs].
4181    pub fn set_configs<T, K, V>(mut self, v: T) -> Self
4182    where
4183        T: std::iter::IntoIterator<Item = (K, V)>,
4184        K: std::convert::Into<std::string::String>,
4185        V: std::convert::Into<std::string::String>,
4186    {
4187        use std::iter::Iterator;
4188        self.configs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4189        self
4190    }
4191
4192    /// Sets the value of [state][crate::model::Connector::state].
4193    pub fn set_state<T: std::convert::Into<crate::model::connector::State>>(
4194        mut self,
4195        v: T,
4196    ) -> Self {
4197        self.state = v.into();
4198        self
4199    }
4200
4201    /// Sets the value of [restart_policy][crate::model::Connector::restart_policy].
4202    ///
4203    /// Note that all the setters affecting `restart_policy` are mutually
4204    /// exclusive.
4205    pub fn set_restart_policy<
4206        T: std::convert::Into<std::option::Option<crate::model::connector::RestartPolicy>>,
4207    >(
4208        mut self,
4209        v: T,
4210    ) -> Self {
4211        self.restart_policy = v.into();
4212        self
4213    }
4214
4215    /// The value of [restart_policy][crate::model::Connector::restart_policy]
4216    /// if it holds a `TaskRestartPolicy`, `None` if the field is not set or
4217    /// holds a different branch.
4218    pub fn task_restart_policy(
4219        &self,
4220    ) -> std::option::Option<&std::boxed::Box<crate::model::TaskRetryPolicy>> {
4221        #[allow(unreachable_patterns)]
4222        self.restart_policy.as_ref().and_then(|v| match v {
4223            crate::model::connector::RestartPolicy::TaskRestartPolicy(v) => {
4224                std::option::Option::Some(v)
4225            }
4226            _ => std::option::Option::None,
4227        })
4228    }
4229
4230    /// Sets the value of [restart_policy][crate::model::Connector::restart_policy]
4231    /// to hold a `TaskRestartPolicy`.
4232    ///
4233    /// Note that all the setters affecting `restart_policy` are
4234    /// mutually exclusive.
4235    pub fn set_task_restart_policy<
4236        T: std::convert::Into<std::boxed::Box<crate::model::TaskRetryPolicy>>,
4237    >(
4238        mut self,
4239        v: T,
4240    ) -> Self {
4241        self.restart_policy = std::option::Option::Some(
4242            crate::model::connector::RestartPolicy::TaskRestartPolicy(v.into()),
4243        );
4244        self
4245    }
4246}
4247
4248impl wkt::message::Message for Connector {
4249    fn typename() -> &'static str {
4250        "type.googleapis.com/google.cloud.managedkafka.v1.Connector"
4251    }
4252}
4253
4254/// Defines additional types related to [Connector].
4255pub mod connector {
4256    #[allow(unused_imports)]
4257    use super::*;
4258
4259    /// The state of the connector.
4260    ///
4261    /// # Working with unknown values
4262    ///
4263    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4264    /// additional enum variants at any time. Adding new variants is not considered
4265    /// a breaking change. Applications should write their code in anticipation of:
4266    ///
4267    /// - New values appearing in future releases of the client library, **and**
4268    /// - New values received dynamically, without application changes.
4269    ///
4270    /// Please consult the [Working with enums] section in the user guide for some
4271    /// guidelines.
4272    ///
4273    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4274    #[derive(Clone, Debug, PartialEq)]
4275    #[non_exhaustive]
4276    pub enum State {
4277        /// A state was not specified.
4278        Unspecified,
4279        /// The connector is not assigned to any tasks, usually transient.
4280        Unassigned,
4281        /// The connector is running.
4282        Running,
4283        /// The connector has been paused.
4284        Paused,
4285        /// The connector has failed. See logs for why.
4286        Failed,
4287        /// The connector is restarting.
4288        Restarting,
4289        /// The connector has been stopped.
4290        Stopped,
4291        /// If set, the enum was initialized with an unknown value.
4292        ///
4293        /// Applications can examine the value using [State::value] or
4294        /// [State::name].
4295        UnknownValue(state::UnknownValue),
4296    }
4297
4298    #[doc(hidden)]
4299    pub mod state {
4300        #[allow(unused_imports)]
4301        use super::*;
4302        #[derive(Clone, Debug, PartialEq)]
4303        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4304    }
4305
4306    impl State {
4307        /// Gets the enum value.
4308        ///
4309        /// Returns `None` if the enum contains an unknown value deserialized from
4310        /// the string representation of enums.
4311        pub fn value(&self) -> std::option::Option<i32> {
4312            match self {
4313                Self::Unspecified => std::option::Option::Some(0),
4314                Self::Unassigned => std::option::Option::Some(1),
4315                Self::Running => std::option::Option::Some(2),
4316                Self::Paused => std::option::Option::Some(3),
4317                Self::Failed => std::option::Option::Some(4),
4318                Self::Restarting => std::option::Option::Some(5),
4319                Self::Stopped => std::option::Option::Some(6),
4320                Self::UnknownValue(u) => u.0.value(),
4321            }
4322        }
4323
4324        /// Gets the enum value as a string.
4325        ///
4326        /// Returns `None` if the enum contains an unknown value deserialized from
4327        /// the integer representation of enums.
4328        pub fn name(&self) -> std::option::Option<&str> {
4329            match self {
4330                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4331                Self::Unassigned => std::option::Option::Some("UNASSIGNED"),
4332                Self::Running => std::option::Option::Some("RUNNING"),
4333                Self::Paused => std::option::Option::Some("PAUSED"),
4334                Self::Failed => std::option::Option::Some("FAILED"),
4335                Self::Restarting => std::option::Option::Some("RESTARTING"),
4336                Self::Stopped => std::option::Option::Some("STOPPED"),
4337                Self::UnknownValue(u) => u.0.name(),
4338            }
4339        }
4340    }
4341
4342    impl std::default::Default for State {
4343        fn default() -> Self {
4344            use std::convert::From;
4345            Self::from(0)
4346        }
4347    }
4348
4349    impl std::fmt::Display for State {
4350        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4351            wkt::internal::display_enum(f, self.name(), self.value())
4352        }
4353    }
4354
4355    impl std::convert::From<i32> for State {
4356        fn from(value: i32) -> Self {
4357            match value {
4358                0 => Self::Unspecified,
4359                1 => Self::Unassigned,
4360                2 => Self::Running,
4361                3 => Self::Paused,
4362                4 => Self::Failed,
4363                5 => Self::Restarting,
4364                6 => Self::Stopped,
4365                _ => Self::UnknownValue(state::UnknownValue(
4366                    wkt::internal::UnknownEnumValue::Integer(value),
4367                )),
4368            }
4369        }
4370    }
4371
4372    impl std::convert::From<&str> for State {
4373        fn from(value: &str) -> Self {
4374            use std::string::ToString;
4375            match value {
4376                "STATE_UNSPECIFIED" => Self::Unspecified,
4377                "UNASSIGNED" => Self::Unassigned,
4378                "RUNNING" => Self::Running,
4379                "PAUSED" => Self::Paused,
4380                "FAILED" => Self::Failed,
4381                "RESTARTING" => Self::Restarting,
4382                "STOPPED" => Self::Stopped,
4383                _ => Self::UnknownValue(state::UnknownValue(
4384                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4385                )),
4386            }
4387        }
4388    }
4389
4390    impl serde::ser::Serialize for State {
4391        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4392        where
4393            S: serde::Serializer,
4394        {
4395            match self {
4396                Self::Unspecified => serializer.serialize_i32(0),
4397                Self::Unassigned => serializer.serialize_i32(1),
4398                Self::Running => serializer.serialize_i32(2),
4399                Self::Paused => serializer.serialize_i32(3),
4400                Self::Failed => serializer.serialize_i32(4),
4401                Self::Restarting => serializer.serialize_i32(5),
4402                Self::Stopped => serializer.serialize_i32(6),
4403                Self::UnknownValue(u) => u.0.serialize(serializer),
4404            }
4405        }
4406    }
4407
4408    impl<'de> serde::de::Deserialize<'de> for State {
4409        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4410        where
4411            D: serde::Deserializer<'de>,
4412        {
4413            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4414                ".google.cloud.managedkafka.v1.Connector.State",
4415            ))
4416        }
4417    }
4418
4419    /// A policy that specifies how to restart the failed connectors/tasks in a
4420    /// Cluster resource. If not set, the failed connectors/tasks won't be
4421    /// restarted.
4422    #[derive(Clone, Debug, PartialEq)]
4423    #[non_exhaustive]
4424    pub enum RestartPolicy {
4425        /// Optional. Restarts the individual tasks of a Connector.
4426        TaskRestartPolicy(std::boxed::Box<crate::model::TaskRetryPolicy>),
4427    }
4428}
4429
4430/// Task Retry Policy is implemented on a best-effort
4431/// basis.
4432/// Retry delay will be exponential based on provided minimum and maximum
4433/// backoffs. <https://en.wikipedia.org/wiki/Exponential_backoff>.
4434/// Note that the delay between consecutive task restarts may not always
4435/// precisely match the configured settings. This can happen when the
4436/// ConnectCluster is in rebalancing state or if the ConnectCluster is
4437/// unresponsive etc. The default values for minimum and maximum backoffs are
4438/// 60 seconds and 30 minutes respectively.
4439#[derive(Clone, Default, PartialEq)]
4440#[non_exhaustive]
4441pub struct TaskRetryPolicy {
4442    /// Optional. The minimum amount of time to wait before retrying a failed task.
4443    /// This sets a lower bound for the backoff delay.
4444    pub minimum_backoff: std::option::Option<wkt::Duration>,
4445
4446    /// Optional. The maximum amount of time to wait before retrying a failed task.
4447    /// This sets an upper bound for the backoff delay.
4448    pub maximum_backoff: std::option::Option<wkt::Duration>,
4449
4450    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4451}
4452
4453impl TaskRetryPolicy {
4454    pub fn new() -> Self {
4455        std::default::Default::default()
4456    }
4457
4458    /// Sets the value of [minimum_backoff][crate::model::TaskRetryPolicy::minimum_backoff].
4459    pub fn set_minimum_backoff<T>(mut self, v: T) -> Self
4460    where
4461        T: std::convert::Into<wkt::Duration>,
4462    {
4463        self.minimum_backoff = std::option::Option::Some(v.into());
4464        self
4465    }
4466
4467    /// Sets or clears the value of [minimum_backoff][crate::model::TaskRetryPolicy::minimum_backoff].
4468    pub fn set_or_clear_minimum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
4469    where
4470        T: std::convert::Into<wkt::Duration>,
4471    {
4472        self.minimum_backoff = v.map(|x| x.into());
4473        self
4474    }
4475
4476    /// Sets the value of [maximum_backoff][crate::model::TaskRetryPolicy::maximum_backoff].
4477    pub fn set_maximum_backoff<T>(mut self, v: T) -> Self
4478    where
4479        T: std::convert::Into<wkt::Duration>,
4480    {
4481        self.maximum_backoff = std::option::Option::Some(v.into());
4482        self
4483    }
4484
4485    /// Sets or clears the value of [maximum_backoff][crate::model::TaskRetryPolicy::maximum_backoff].
4486    pub fn set_or_clear_maximum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
4487    where
4488        T: std::convert::Into<wkt::Duration>,
4489    {
4490        self.maximum_backoff = v.map(|x| x.into());
4491        self
4492    }
4493}
4494
4495impl wkt::message::Message for TaskRetryPolicy {
4496    fn typename() -> &'static str {
4497        "type.googleapis.com/google.cloud.managedkafka.v1.TaskRetryPolicy"
4498    }
4499}
4500
4501/// Represents the set of ACLs for a given Kafka Resource Pattern, which consists
4502/// of resource_type, resource_name and pattern_type.
4503#[derive(Clone, Default, PartialEq)]
4504#[non_exhaustive]
4505pub struct Acl {
4506    /// Identifier. The name for the acl. Represents a single Resource Pattern.
4507    /// Structured like:
4508    /// projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id}
4509    ///
4510    /// The structure of `acl_id` defines the Resource Pattern (resource_type,
4511    /// resource_name, pattern_type) of the acl. `acl_id` is structured like one of
4512    /// the following:
4513    ///
4514    /// For acls on the cluster:
4515    /// `cluster`
4516    ///
4517    /// For acls on a single resource within the cluster:
4518    /// `topic/{resource_name}`
4519    /// `consumerGroup/{resource_name}`
4520    /// `transactionalId/{resource_name}`
4521    ///
4522    /// For acls on all resources that match a prefix:
4523    /// `topicPrefixed/{resource_name}`
4524    /// `consumerGroupPrefixed/{resource_name}`
4525    /// `transactionalIdPrefixed/{resource_name}`
4526    ///
4527    /// For acls on all resources of a given type (i.e. the wildcard literal "*"):
4528    /// `allTopics` (represents `topic/*`)
4529    /// `allConsumerGroups` (represents `consumerGroup/*`)
4530    /// `allTransactionalIds` (represents `transactionalId/*`)
4531    pub name: std::string::String,
4532
4533    /// Required. The ACL entries that apply to the resource pattern. The maximum
4534    /// number of allowed entries 100.
4535    pub acl_entries: std::vec::Vec<crate::model::AclEntry>,
4536
4537    /// Optional. `etag` is used for concurrency control. An `etag` is returned in
4538    /// the response to `GetAcl` and `CreateAcl`. Callers are required to put that
4539    /// etag in the request to `UpdateAcl` to ensure that their change will be
4540    /// applied to the same version of the acl that exists in the Kafka Cluster.
4541    ///
4542    /// A terminal 'T' character in the etag indicates that the AclEntries were
4543    /// truncated; more entries for the Acl exist on the Kafka Cluster, but can't
4544    /// be returned in the Acl due to repeated field limits.
4545    pub etag: std::string::String,
4546
4547    /// Output only. The ACL resource type derived from the name. One of: CLUSTER,
4548    /// TOPIC, GROUP, TRANSACTIONAL_ID.
4549    pub resource_type: std::string::String,
4550
4551    /// Output only. The ACL resource name derived from the name. For cluster
4552    /// resource_type, this is always "kafka-cluster". Can be the wildcard literal
4553    /// "*".
4554    pub resource_name: std::string::String,
4555
4556    /// Output only. The ACL pattern type derived from the name. One of: LITERAL,
4557    /// PREFIXED.
4558    pub pattern_type: std::string::String,
4559
4560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4561}
4562
4563impl Acl {
4564    pub fn new() -> Self {
4565        std::default::Default::default()
4566    }
4567
4568    /// Sets the value of [name][crate::model::Acl::name].
4569    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4570        self.name = v.into();
4571        self
4572    }
4573
4574    /// Sets the value of [acl_entries][crate::model::Acl::acl_entries].
4575    pub fn set_acl_entries<T, V>(mut self, v: T) -> Self
4576    where
4577        T: std::iter::IntoIterator<Item = V>,
4578        V: std::convert::Into<crate::model::AclEntry>,
4579    {
4580        use std::iter::Iterator;
4581        self.acl_entries = v.into_iter().map(|i| i.into()).collect();
4582        self
4583    }
4584
4585    /// Sets the value of [etag][crate::model::Acl::etag].
4586    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4587        self.etag = v.into();
4588        self
4589    }
4590
4591    /// Sets the value of [resource_type][crate::model::Acl::resource_type].
4592    pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4593        self.resource_type = v.into();
4594        self
4595    }
4596
4597    /// Sets the value of [resource_name][crate::model::Acl::resource_name].
4598    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4599        self.resource_name = v.into();
4600        self
4601    }
4602
4603    /// Sets the value of [pattern_type][crate::model::Acl::pattern_type].
4604    pub fn set_pattern_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4605        self.pattern_type = v.into();
4606        self
4607    }
4608}
4609
4610impl wkt::message::Message for Acl {
4611    fn typename() -> &'static str {
4612        "type.googleapis.com/google.cloud.managedkafka.v1.Acl"
4613    }
4614}
4615
4616/// Represents the access granted for a given Resource Pattern in an ACL.
4617#[derive(Clone, Default, PartialEq)]
4618#[non_exhaustive]
4619pub struct AclEntry {
4620    /// Required. The principal. Specified as Google Cloud account, with the Kafka
4621    /// StandardAuthorizer prefix "User:". For example:
4622    /// "User:test-kafka-client@test-project.iam.gserviceaccount.com".
4623    /// Can be the wildcard "User:*" to refer to all users.
4624    pub principal: std::string::String,
4625
4626    /// Required. The permission type. Accepted values are (case insensitive):
4627    /// ALLOW, DENY.
4628    pub permission_type: std::string::String,
4629
4630    /// Required. The operation type. Allowed values are (case insensitive): ALL,
4631    /// READ, WRITE, CREATE, DELETE, ALTER, DESCRIBE, CLUSTER_ACTION,
4632    /// DESCRIBE_CONFIGS, ALTER_CONFIGS, and IDEMPOTENT_WRITE. See
4633    /// <https://kafka.apache.org/documentation/#operations_resources_and_protocols>
4634    /// for valid combinations of resource_type and operation for different Kafka
4635    /// API requests.
4636    pub operation: std::string::String,
4637
4638    /// Required. The host. Must be set to "*" for Managed Service for Apache
4639    /// Kafka.
4640    pub host: std::string::String,
4641
4642    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4643}
4644
4645impl AclEntry {
4646    pub fn new() -> Self {
4647        std::default::Default::default()
4648    }
4649
4650    /// Sets the value of [principal][crate::model::AclEntry::principal].
4651    pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4652        self.principal = v.into();
4653        self
4654    }
4655
4656    /// Sets the value of [permission_type][crate::model::AclEntry::permission_type].
4657    pub fn set_permission_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4658        self.permission_type = v.into();
4659        self
4660    }
4661
4662    /// Sets the value of [operation][crate::model::AclEntry::operation].
4663    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4664        self.operation = v.into();
4665        self
4666    }
4667
4668    /// Sets the value of [host][crate::model::AclEntry::host].
4669    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4670        self.host = v.into();
4671        self
4672    }
4673}
4674
4675impl wkt::message::Message for AclEntry {
4676    fn typename() -> &'static str {
4677        "type.googleapis.com/google.cloud.managedkafka.v1.AclEntry"
4678    }
4679}