1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate 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#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ListClustersRequest {
44 pub parent: std::string::String,
47
48 pub page_size: i32,
52
53 pub page_token: std::string::String,
59
60 pub filter: std::string::String,
62
63 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
113#[non_exhaustive]
114pub struct ListClustersResponse {
115 pub clusters: std::vec::Vec<crate::model::Cluster>,
117
118 pub next_page_token: std::string::String,
121
122 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 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 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 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#[derive(Clone, Default, PartialEq)]
184#[non_exhaustive]
185pub struct GetClusterRequest {
186 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 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#[derive(Clone, Default, PartialEq)]
212#[non_exhaustive]
213pub struct CreateClusterRequest {
214 pub parent: std::string::String,
217
218 pub cluster_id: std::string::String,
225
226 pub cluster: std::option::Option<crate::model::Cluster>,
229
230 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
299#[non_exhaustive]
300pub struct UpdateClusterRequest {
301 pub update_mask: std::option::Option<wkt::FieldMask>,
307
308 pub cluster: std::option::Option<crate::model::Cluster>,
310
311 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
386#[non_exhaustive]
387pub struct DeleteClusterRequest {
388 pub name: std::string::String,
390
391 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 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 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#[derive(Clone, Default, PartialEq)]
436#[non_exhaustive]
437pub struct ListTopicsRequest {
438 pub parent: std::string::String,
441
442 pub page_size: i32,
446
447 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 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 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 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#[derive(Clone, Default, PartialEq)]
489#[non_exhaustive]
490pub struct ListTopicsResponse {
491 pub topics: std::vec::Vec<crate::model::Topic>,
494
495 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 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 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#[derive(Clone, Default, PartialEq)]
547#[non_exhaustive]
548pub struct GetTopicRequest {
549 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 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#[derive(Clone, Default, PartialEq)]
577#[non_exhaustive]
578pub struct CreateTopicRequest {
579 pub parent: std::string::String,
583
584 pub topic_id: std::string::String,
589
590 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
641#[non_exhaustive]
642pub struct UpdateTopicRequest {
643 pub update_mask: std::option::Option<wkt::FieldMask>,
649
650 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
706#[non_exhaustive]
707pub struct DeleteTopicRequest {
708 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 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#[derive(Clone, Default, PartialEq)]
735#[non_exhaustive]
736pub struct ListConsumerGroupsRequest {
737 pub parent: std::string::String,
741
742 pub page_size: i32,
746
747 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 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 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 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#[derive(Clone, Default, PartialEq)]
789#[non_exhaustive]
790pub struct ListConsumerGroupsResponse {
791 pub consumer_groups: std::vec::Vec<crate::model::ConsumerGroup>,
794
795 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 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 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#[derive(Clone, Default, PartialEq)]
847#[non_exhaustive]
848pub struct GetConsumerGroupRequest {
849 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 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#[derive(Clone, Default, PartialEq)]
876#[non_exhaustive]
877pub struct UpdateConsumerGroupRequest {
878 pub update_mask: std::option::Option<wkt::FieldMask>,
884
885 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
941#[non_exhaustive]
942pub struct DeleteConsumerGroupRequest {
943 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 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#[derive(Clone, Default, PartialEq)]
970#[non_exhaustive]
971pub struct ListAclsRequest {
972 pub parent: std::string::String,
976
977 pub page_size: i32,
981
982 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 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 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 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#[derive(Clone, Default, PartialEq)]
1024#[non_exhaustive]
1025pub struct ListAclsResponse {
1026 pub acls: std::vec::Vec<crate::model::Acl>,
1029
1030 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 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 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#[derive(Clone, Default, PartialEq)]
1082#[non_exhaustive]
1083pub struct GetAclRequest {
1084 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 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#[derive(Clone, Default, PartialEq)]
1116#[non_exhaustive]
1117pub struct CreateAclRequest {
1118 pub parent: std::string::String,
1122
1123 pub acl_id: std::string::String,
1146
1147 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
1197#[non_exhaustive]
1198pub struct UpdateAclRequest {
1199 pub acl: std::option::Option<crate::model::Acl>,
1203
1204 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
1263#[non_exhaustive]
1264pub struct DeleteAclRequest {
1265 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 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#[derive(Clone, Default, PartialEq)]
1296#[non_exhaustive]
1297pub struct AddAclEntryRequest {
1298 pub acl: std::string::String,
1306
1307 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 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 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 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#[derive(Clone, Default, PartialEq)]
1351#[non_exhaustive]
1352pub struct AddAclEntryResponse {
1353 pub acl: std::option::Option<crate::model::Acl>,
1355
1356 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 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 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 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#[derive(Clone, Default, PartialEq)]
1400#[non_exhaustive]
1401pub struct RemoveAclEntryRequest {
1402 pub acl: std::string::String,
1410
1411 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 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 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 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#[derive(Clone, Default, PartialEq)]
1455#[non_exhaustive]
1456pub struct RemoveAclEntryResponse {
1457 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 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 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 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 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 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
1541pub mod remove_acl_entry_response {
1543 #[allow(unused_imports)]
1544 use super::*;
1545
1546 #[derive(Clone, Debug, PartialEq)]
1549 #[non_exhaustive]
1550 pub enum Result {
1551 Acl(std::boxed::Box<crate::model::Acl>),
1554 AclDeleted(bool),
1557 }
1558}
1559
1560#[derive(Clone, Default, PartialEq)]
1562#[non_exhaustive]
1563pub struct GetConnectClusterRequest {
1564 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 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#[derive(Clone, Default, PartialEq)]
1592#[non_exhaustive]
1593pub struct CreateConnectClusterRequest {
1594 pub parent: std::string::String,
1598
1599 pub connect_cluster_id: std::string::String,
1606
1607 pub connect_cluster: std::option::Option<crate::model::ConnectCluster>,
1610
1611 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
1683#[non_exhaustive]
1684pub struct UpdateConnectClusterRequest {
1685 pub update_mask: std::option::Option<wkt::FieldMask>,
1691
1692 pub connect_cluster: std::option::Option<crate::model::ConnectCluster>,
1695
1696 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
1771#[non_exhaustive]
1772pub struct DeleteConnectClusterRequest {
1773 pub name: std::string::String,
1777
1778 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 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 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#[derive(Clone, Default, PartialEq)]
1823#[non_exhaustive]
1824pub struct ListConnectClustersRequest {
1825 pub parent: std::string::String,
1828
1829 pub page_size: i32,
1833
1834 pub page_token: std::string::String,
1840
1841 pub filter: std::string::String,
1843
1844 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
1894#[non_exhaustive]
1895pub struct ListConnectClustersResponse {
1896 pub connect_clusters: std::vec::Vec<crate::model::ConnectCluster>,
1898
1899 pub next_page_token: std::string::String,
1902
1903 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 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 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 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#[derive(Clone, Default, PartialEq)]
1965#[non_exhaustive]
1966pub struct GetConnectorRequest {
1967 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 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#[derive(Clone, Default, PartialEq)]
1995#[non_exhaustive]
1996pub struct CreateConnectorRequest {
1997 pub parent: std::string::String,
2001
2002 pub connector_id: std::string::String,
2009
2010 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
2060#[non_exhaustive]
2061pub struct UpdateConnectorRequest {
2062 pub update_mask: std::option::Option<wkt::FieldMask>,
2068
2069 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
2125#[non_exhaustive]
2126pub struct DeleteConnectorRequest {
2127 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 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#[derive(Clone, Default, PartialEq)]
2155#[non_exhaustive]
2156pub struct ListConnectorsRequest {
2157 pub parent: std::string::String,
2161
2162 pub page_size: i32,
2166
2167 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 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 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 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#[derive(Clone, Default, PartialEq)]
2209#[non_exhaustive]
2210pub struct ListConnectorsResponse {
2211 pub connectors: std::vec::Vec<crate::model::Connector>,
2213
2214 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 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 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#[derive(Clone, Default, PartialEq)]
2266#[non_exhaustive]
2267pub struct PauseConnectorRequest {
2268 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 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#[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#[derive(Clone, Default, PartialEq)]
2315#[non_exhaustive]
2316pub struct ResumeConnectorRequest {
2317 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 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#[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#[derive(Clone, Default, PartialEq)]
2364#[non_exhaustive]
2365pub struct RestartConnectorRequest {
2366 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 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#[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#[derive(Clone, Default, PartialEq)]
2413#[non_exhaustive]
2414pub struct StopConnectorRequest {
2415 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 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#[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#[derive(Clone, Default, PartialEq)]
2462#[non_exhaustive]
2463pub struct Cluster {
2464 pub name: std::string::String,
2467
2468 pub create_time: std::option::Option<wkt::Timestamp>,
2470
2471 pub update_time: std::option::Option<wkt::Timestamp>,
2473
2474 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2476
2477 pub capacity_config: std::option::Option<crate::model::CapacityConfig>,
2479
2480 pub rebalance_config: std::option::Option<crate::model::RebalanceConfig>,
2482
2483 pub state: crate::model::cluster::State,
2485
2486 pub satisfies_pzi: std::option::Option<bool>,
2488
2489 pub satisfies_pzs: std::option::Option<bool>,
2491
2492 pub tls_config: std::option::Option<crate::model::TlsConfig>,
2494
2495 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
2702pub mod cluster {
2704 #[allow(unused_imports)]
2705 use super::*;
2706
2707 #[derive(Clone, Debug, PartialEq)]
2723 #[non_exhaustive]
2724 pub enum State {
2725 Unspecified,
2727 Creating,
2729 Active,
2731 Deleting,
2733 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 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 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 #[derive(Clone, Debug, PartialEq)]
2848 #[non_exhaustive]
2849 pub enum PlatformConfig {
2850 GcpConfig(std::boxed::Box<crate::model::GcpConfig>),
2853 }
2854}
2855
2856#[derive(Clone, Default, PartialEq)]
2858#[non_exhaustive]
2859pub struct CapacityConfig {
2860 pub vcpu_count: i64,
2862
2863 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 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 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#[derive(Clone, Default, PartialEq)]
2897#[non_exhaustive]
2898pub struct RebalanceConfig {
2899 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 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
2927pub mod rebalance_config {
2929 #[allow(unused_imports)]
2930 use super::*;
2931
2932 #[derive(Clone, Debug, PartialEq)]
2948 #[non_exhaustive]
2949 pub enum Mode {
2950 Unspecified,
2952 NoRebalance,
2954 AutoRebalanceOnScaleUp,
2957 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 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 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#[derive(Clone, Default, PartialEq)]
3071#[non_exhaustive]
3072pub struct NetworkConfig {
3073 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 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#[derive(Clone, Default, PartialEq)]
3105#[non_exhaustive]
3106pub struct AccessConfig {
3107 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 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#[derive(Clone, Default, PartialEq)]
3141#[non_exhaustive]
3142pub struct GcpConfig {
3143 pub access_config: std::option::Option<crate::model::AccessConfig>,
3145
3146 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 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 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 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#[derive(Clone, Default, PartialEq)]
3193#[non_exhaustive]
3194pub struct TlsConfig {
3195 pub trust_config: std::option::Option<crate::model::TrustConfig>,
3198
3199 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 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 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 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#[derive(Clone, Default, PartialEq)]
3254#[non_exhaustive]
3255pub struct TrustConfig {
3256 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 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
3286pub mod trust_config {
3288 #[allow(unused_imports)]
3289 use super::*;
3290
3291 #[derive(Clone, Default, PartialEq)]
3293 #[non_exhaustive]
3294 pub struct CertificateAuthorityServiceConfig {
3295 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 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#[derive(Clone, Default, PartialEq)]
3326#[non_exhaustive]
3327pub struct Topic {
3328 pub name: std::string::String,
3332
3333 pub partition_count: i32,
3338
3339 pub replication_factor: i32,
3342
3343 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
3395#[non_exhaustive]
3396pub struct ConsumerTopicMetadata {
3397 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 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#[derive(Clone, Default, PartialEq)]
3430#[non_exhaustive]
3431pub struct ConsumerPartitionMetadata {
3432 pub offset: i64,
3435
3436 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 pub fn set_offset<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3450 self.offset = v.into();
3451 self
3452 }
3453
3454 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#[derive(Clone, Default, PartialEq)]
3469#[non_exhaustive]
3470pub struct ConsumerGroup {
3471 pub name: std::string::String,
3475
3476 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 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 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#[derive(Clone, Default, PartialEq)]
3516#[non_exhaustive]
3517pub struct OperationMetadata {
3518 pub create_time: std::option::Option<wkt::Timestamp>,
3520
3521 pub end_time: std::option::Option<wkt::Timestamp>,
3523
3524 pub target: std::string::String,
3526
3527 pub verb: std::string::String,
3529
3530 pub status_message: std::string::String,
3532
3533 pub requested_cancellation: bool,
3541
3542 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 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 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 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 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
3628#[non_exhaustive]
3629pub struct ConnectCluster {
3630 pub name: std::string::String,
3633
3634 pub kafka_cluster: std::string::String,
3638
3639 pub create_time: std::option::Option<wkt::Timestamp>,
3641
3642 pub update_time: std::option::Option<wkt::Timestamp>,
3644
3645 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3647
3648 pub capacity_config: std::option::Option<crate::model::CapacityConfig>,
3650
3651 pub state: crate::model::connect_cluster::State,
3653
3654 pub config: std::collections::HashMap<std::string::String, std::string::String>,
3658
3659 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
3822pub mod connect_cluster {
3824 #[allow(unused_imports)]
3825 use super::*;
3826
3827 #[derive(Clone, Debug, PartialEq)]
3843 #[non_exhaustive]
3844 pub enum State {
3845 Unspecified,
3847 Creating,
3849 Active,
3851 Deleting,
3853 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 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 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 #[derive(Clone, Debug, PartialEq)]
3968 #[non_exhaustive]
3969 pub enum PlatformConfig {
3970 GcpConfig(std::boxed::Box<crate::model::ConnectGcpConfig>),
3973 }
3974}
3975
3976#[derive(Clone, Default, PartialEq)]
3979#[non_exhaustive]
3980pub struct ConnectNetworkConfig {
3981 pub primary_subnet: std::string::String,
3993
3994 pub additional_subnets: std::vec::Vec<std::string::String>,
3999
4000 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 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 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 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#[derive(Clone, Default, PartialEq)]
4052#[non_exhaustive]
4053pub struct ConnectAccessConfig {
4054 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 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#[derive(Clone, Default, PartialEq)]
4089#[non_exhaustive]
4090pub struct ConnectGcpConfig {
4091 pub access_config: std::option::Option<crate::model::ConnectAccessConfig>,
4093
4094 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 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 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 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#[derive(Clone, Default, PartialEq)]
4146#[non_exhaustive]
4147pub struct Connector {
4148 pub name: std::string::String,
4152
4153 pub configs: std::collections::HashMap<std::string::String, std::string::String>,
4157
4158 pub state: crate::model::connector::State,
4160
4161 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 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 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 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 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 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 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
4254pub mod connector {
4256 #[allow(unused_imports)]
4257 use super::*;
4258
4259 #[derive(Clone, Debug, PartialEq)]
4275 #[non_exhaustive]
4276 pub enum State {
4277 Unspecified,
4279 Unassigned,
4281 Running,
4283 Paused,
4285 Failed,
4287 Restarting,
4289 Stopped,
4291 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 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 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 #[derive(Clone, Debug, PartialEq)]
4423 #[non_exhaustive]
4424 pub enum RestartPolicy {
4425 TaskRestartPolicy(std::boxed::Box<crate::model::TaskRetryPolicy>),
4427 }
4428}
4429
4430#[derive(Clone, Default, PartialEq)]
4440#[non_exhaustive]
4441pub struct TaskRetryPolicy {
4442 pub minimum_backoff: std::option::Option<wkt::Duration>,
4445
4446 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
4504#[non_exhaustive]
4505pub struct Acl {
4506 pub name: std::string::String,
4532
4533 pub acl_entries: std::vec::Vec<crate::model::AclEntry>,
4536
4537 pub etag: std::string::String,
4546
4547 pub resource_type: std::string::String,
4550
4551 pub resource_name: std::string::String,
4555
4556 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 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
4618#[non_exhaustive]
4619pub struct AclEntry {
4620 pub principal: std::string::String,
4625
4626 pub permission_type: std::string::String,
4629
4630 pub operation: std::string::String,
4637
4638 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 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 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 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 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}