1pub mod cluster_manager {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::ClusterManager;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = ClusterManager;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
92
93 impl ListClusters {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
114 (*self.0.stub)
115 .list_clusters(self.0.request, self.0.options)
116 .await
117 .map(crate::Response::into_body)
118 }
119
120 #[deprecated]
122 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
123 self.0.request.project_id = v.into();
124 self
125 }
126
127 #[deprecated]
129 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
130 self.0.request.zone = v.into();
131 self
132 }
133
134 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
136 self.0.request.parent = v.into();
137 self
138 }
139 }
140
141 #[doc(hidden)]
142 impl crate::RequestBuilder for ListClusters {
143 fn request_options(&mut self) -> &mut crate::RequestOptions {
144 &mut self.0.options
145 }
146 }
147
148 #[derive(Clone, Debug)]
165 pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
166
167 impl GetCluster {
168 pub(crate) fn new(
169 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
170 ) -> Self {
171 Self(RequestBuilder::new(stub))
172 }
173
174 pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
176 self.0.request = v.into();
177 self
178 }
179
180 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
182 self.0.options = v.into();
183 self
184 }
185
186 pub async fn send(self) -> Result<crate::model::Cluster> {
188 (*self.0.stub)
189 .get_cluster(self.0.request, self.0.options)
190 .await
191 .map(crate::Response::into_body)
192 }
193
194 #[deprecated]
196 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
197 self.0.request.project_id = v.into();
198 self
199 }
200
201 #[deprecated]
203 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
204 self.0.request.zone = v.into();
205 self
206 }
207
208 #[deprecated]
210 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
211 self.0.request.cluster_id = v.into();
212 self
213 }
214
215 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
217 self.0.request.name = v.into();
218 self
219 }
220 }
221
222 #[doc(hidden)]
223 impl crate::RequestBuilder for GetCluster {
224 fn request_options(&mut self) -> &mut crate::RequestOptions {
225 &mut self.0.options
226 }
227 }
228
229 #[derive(Clone, Debug)]
246 pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
247
248 impl CreateCluster {
249 pub(crate) fn new(
250 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
251 ) -> Self {
252 Self(RequestBuilder::new(stub))
253 }
254
255 pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
257 self.0.request = v.into();
258 self
259 }
260
261 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
263 self.0.options = v.into();
264 self
265 }
266
267 pub async fn send(self) -> Result<crate::model::Operation> {
269 (*self.0.stub)
270 .create_cluster(self.0.request, self.0.options)
271 .await
272 .map(crate::Response::into_body)
273 }
274
275 #[deprecated]
277 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
278 self.0.request.project_id = v.into();
279 self
280 }
281
282 #[deprecated]
284 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
285 self.0.request.zone = v.into();
286 self
287 }
288
289 pub fn set_cluster<T>(mut self, v: T) -> Self
293 where
294 T: std::convert::Into<crate::model::Cluster>,
295 {
296 self.0.request.cluster = std::option::Option::Some(v.into());
297 self
298 }
299
300 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
304 where
305 T: std::convert::Into<crate::model::Cluster>,
306 {
307 self.0.request.cluster = v.map(|x| x.into());
308 self
309 }
310
311 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
313 self.0.request.parent = v.into();
314 self
315 }
316 }
317
318 #[doc(hidden)]
319 impl crate::RequestBuilder for CreateCluster {
320 fn request_options(&mut self) -> &mut crate::RequestOptions {
321 &mut self.0.options
322 }
323 }
324
325 #[derive(Clone, Debug)]
342 pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
343
344 impl UpdateCluster {
345 pub(crate) fn new(
346 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
347 ) -> Self {
348 Self(RequestBuilder::new(stub))
349 }
350
351 pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
353 self.0.request = v.into();
354 self
355 }
356
357 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
359 self.0.options = v.into();
360 self
361 }
362
363 pub async fn send(self) -> Result<crate::model::Operation> {
365 (*self.0.stub)
366 .update_cluster(self.0.request, self.0.options)
367 .await
368 .map(crate::Response::into_body)
369 }
370
371 #[deprecated]
373 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
374 self.0.request.project_id = v.into();
375 self
376 }
377
378 #[deprecated]
380 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
381 self.0.request.zone = v.into();
382 self
383 }
384
385 #[deprecated]
387 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
388 self.0.request.cluster_id = v.into();
389 self
390 }
391
392 pub fn set_update<T>(mut self, v: T) -> Self
396 where
397 T: std::convert::Into<crate::model::ClusterUpdate>,
398 {
399 self.0.request.update = std::option::Option::Some(v.into());
400 self
401 }
402
403 pub fn set_or_clear_update<T>(mut self, v: std::option::Option<T>) -> Self
407 where
408 T: std::convert::Into<crate::model::ClusterUpdate>,
409 {
410 self.0.request.update = v.map(|x| x.into());
411 self
412 }
413
414 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
416 self.0.request.name = v.into();
417 self
418 }
419 }
420
421 #[doc(hidden)]
422 impl crate::RequestBuilder for UpdateCluster {
423 fn request_options(&mut self) -> &mut crate::RequestOptions {
424 &mut self.0.options
425 }
426 }
427
428 #[derive(Clone, Debug)]
445 pub struct UpdateNodePool(RequestBuilder<crate::model::UpdateNodePoolRequest>);
446
447 impl UpdateNodePool {
448 pub(crate) fn new(
449 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
450 ) -> Self {
451 Self(RequestBuilder::new(stub))
452 }
453
454 pub fn with_request<V: Into<crate::model::UpdateNodePoolRequest>>(mut self, v: V) -> Self {
456 self.0.request = v.into();
457 self
458 }
459
460 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
462 self.0.options = v.into();
463 self
464 }
465
466 pub async fn send(self) -> Result<crate::model::Operation> {
468 (*self.0.stub)
469 .update_node_pool(self.0.request, self.0.options)
470 .await
471 .map(crate::Response::into_body)
472 }
473
474 #[deprecated]
476 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
477 self.0.request.project_id = v.into();
478 self
479 }
480
481 #[deprecated]
483 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
484 self.0.request.zone = v.into();
485 self
486 }
487
488 #[deprecated]
490 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
491 self.0.request.cluster_id = v.into();
492 self
493 }
494
495 #[deprecated]
497 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
498 self.0.request.node_pool_id = v.into();
499 self
500 }
501
502 pub fn set_node_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
506 self.0.request.node_version = v.into();
507 self
508 }
509
510 pub fn set_image_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
514 self.0.request.image_type = v.into();
515 self
516 }
517
518 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
520 self.0.request.name = v.into();
521 self
522 }
523
524 pub fn set_image<T: Into<std::string::String>>(mut self, v: T) -> Self {
526 self.0.request.image = v.into();
527 self
528 }
529
530 pub fn set_image_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
532 self.0.request.image_project = v.into();
533 self
534 }
535
536 pub fn set_locations<T, V>(mut self, v: T) -> Self
538 where
539 T: std::iter::IntoIterator<Item = V>,
540 V: std::convert::Into<std::string::String>,
541 {
542 use std::iter::Iterator;
543 self.0.request.locations = v.into_iter().map(|i| i.into()).collect();
544 self
545 }
546
547 pub fn set_workload_metadata_config<T>(mut self, v: T) -> Self
549 where
550 T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
551 {
552 self.0.request.workload_metadata_config = std::option::Option::Some(v.into());
553 self
554 }
555
556 pub fn set_or_clear_workload_metadata_config<T>(mut self, v: std::option::Option<T>) -> Self
558 where
559 T: std::convert::Into<crate::model::WorkloadMetadataConfig>,
560 {
561 self.0.request.workload_metadata_config = v.map(|x| x.into());
562 self
563 }
564
565 pub fn set_upgrade_settings<T>(mut self, v: T) -> Self
567 where
568 T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
569 {
570 self.0.request.upgrade_settings = std::option::Option::Some(v.into());
571 self
572 }
573
574 pub fn set_or_clear_upgrade_settings<T>(mut self, v: std::option::Option<T>) -> Self
576 where
577 T: std::convert::Into<crate::model::node_pool::UpgradeSettings>,
578 {
579 self.0.request.upgrade_settings = v.map(|x| x.into());
580 self
581 }
582
583 pub fn set_tags<T>(mut self, v: T) -> Self
585 where
586 T: std::convert::Into<crate::model::NetworkTags>,
587 {
588 self.0.request.tags = std::option::Option::Some(v.into());
589 self
590 }
591
592 pub fn set_or_clear_tags<T>(mut self, v: std::option::Option<T>) -> Self
594 where
595 T: std::convert::Into<crate::model::NetworkTags>,
596 {
597 self.0.request.tags = v.map(|x| x.into());
598 self
599 }
600
601 pub fn set_taints<T>(mut self, v: T) -> Self
603 where
604 T: std::convert::Into<crate::model::NodeTaints>,
605 {
606 self.0.request.taints = std::option::Option::Some(v.into());
607 self
608 }
609
610 pub fn set_or_clear_taints<T>(mut self, v: std::option::Option<T>) -> Self
612 where
613 T: std::convert::Into<crate::model::NodeTaints>,
614 {
615 self.0.request.taints = v.map(|x| x.into());
616 self
617 }
618
619 pub fn set_labels<T>(mut self, v: T) -> Self
621 where
622 T: std::convert::Into<crate::model::NodeLabels>,
623 {
624 self.0.request.labels = std::option::Option::Some(v.into());
625 self
626 }
627
628 pub fn set_or_clear_labels<T>(mut self, v: std::option::Option<T>) -> Self
630 where
631 T: std::convert::Into<crate::model::NodeLabels>,
632 {
633 self.0.request.labels = v.map(|x| x.into());
634 self
635 }
636
637 pub fn set_linux_node_config<T>(mut self, v: T) -> Self
639 where
640 T: std::convert::Into<crate::model::LinuxNodeConfig>,
641 {
642 self.0.request.linux_node_config = std::option::Option::Some(v.into());
643 self
644 }
645
646 pub fn set_or_clear_linux_node_config<T>(mut self, v: std::option::Option<T>) -> Self
648 where
649 T: std::convert::Into<crate::model::LinuxNodeConfig>,
650 {
651 self.0.request.linux_node_config = v.map(|x| x.into());
652 self
653 }
654
655 pub fn set_kubelet_config<T>(mut self, v: T) -> Self
657 where
658 T: std::convert::Into<crate::model::NodeKubeletConfig>,
659 {
660 self.0.request.kubelet_config = std::option::Option::Some(v.into());
661 self
662 }
663
664 pub fn set_or_clear_kubelet_config<T>(mut self, v: std::option::Option<T>) -> Self
666 where
667 T: std::convert::Into<crate::model::NodeKubeletConfig>,
668 {
669 self.0.request.kubelet_config = v.map(|x| x.into());
670 self
671 }
672
673 pub fn set_node_network_config<T>(mut self, v: T) -> Self
675 where
676 T: std::convert::Into<crate::model::NodeNetworkConfig>,
677 {
678 self.0.request.node_network_config = std::option::Option::Some(v.into());
679 self
680 }
681
682 pub fn set_or_clear_node_network_config<T>(mut self, v: std::option::Option<T>) -> Self
684 where
685 T: std::convert::Into<crate::model::NodeNetworkConfig>,
686 {
687 self.0.request.node_network_config = v.map(|x| x.into());
688 self
689 }
690
691 pub fn set_gcfs_config<T>(mut self, v: T) -> Self
693 where
694 T: std::convert::Into<crate::model::GcfsConfig>,
695 {
696 self.0.request.gcfs_config = std::option::Option::Some(v.into());
697 self
698 }
699
700 pub fn set_or_clear_gcfs_config<T>(mut self, v: std::option::Option<T>) -> Self
702 where
703 T: std::convert::Into<crate::model::GcfsConfig>,
704 {
705 self.0.request.gcfs_config = v.map(|x| x.into());
706 self
707 }
708
709 pub fn set_confidential_nodes<T>(mut self, v: T) -> Self
711 where
712 T: std::convert::Into<crate::model::ConfidentialNodes>,
713 {
714 self.0.request.confidential_nodes = std::option::Option::Some(v.into());
715 self
716 }
717
718 pub fn set_or_clear_confidential_nodes<T>(mut self, v: std::option::Option<T>) -> Self
720 where
721 T: std::convert::Into<crate::model::ConfidentialNodes>,
722 {
723 self.0.request.confidential_nodes = v.map(|x| x.into());
724 self
725 }
726
727 pub fn set_gvnic<T>(mut self, v: T) -> Self
729 where
730 T: std::convert::Into<crate::model::VirtualNIC>,
731 {
732 self.0.request.gvnic = std::option::Option::Some(v.into());
733 self
734 }
735
736 pub fn set_or_clear_gvnic<T>(mut self, v: std::option::Option<T>) -> Self
738 where
739 T: std::convert::Into<crate::model::VirtualNIC>,
740 {
741 self.0.request.gvnic = v.map(|x| x.into());
742 self
743 }
744
745 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
747 self.0.request.etag = v.into();
748 self
749 }
750
751 pub fn set_fast_socket<T>(mut self, v: T) -> Self
753 where
754 T: std::convert::Into<crate::model::FastSocket>,
755 {
756 self.0.request.fast_socket = std::option::Option::Some(v.into());
757 self
758 }
759
760 pub fn set_or_clear_fast_socket<T>(mut self, v: std::option::Option<T>) -> Self
762 where
763 T: std::convert::Into<crate::model::FastSocket>,
764 {
765 self.0.request.fast_socket = v.map(|x| x.into());
766 self
767 }
768
769 pub fn set_logging_config<T>(mut self, v: T) -> Self
771 where
772 T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
773 {
774 self.0.request.logging_config = std::option::Option::Some(v.into());
775 self
776 }
777
778 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
780 where
781 T: std::convert::Into<crate::model::NodePoolLoggingConfig>,
782 {
783 self.0.request.logging_config = v.map(|x| x.into());
784 self
785 }
786
787 pub fn set_resource_labels<T>(mut self, v: T) -> Self
789 where
790 T: std::convert::Into<crate::model::ResourceLabels>,
791 {
792 self.0.request.resource_labels = std::option::Option::Some(v.into());
793 self
794 }
795
796 pub fn set_or_clear_resource_labels<T>(mut self, v: std::option::Option<T>) -> Self
798 where
799 T: std::convert::Into<crate::model::ResourceLabels>,
800 {
801 self.0.request.resource_labels = v.map(|x| x.into());
802 self
803 }
804
805 pub fn set_windows_node_config<T>(mut self, v: T) -> Self
807 where
808 T: std::convert::Into<crate::model::WindowsNodeConfig>,
809 {
810 self.0.request.windows_node_config = std::option::Option::Some(v.into());
811 self
812 }
813
814 pub fn set_or_clear_windows_node_config<T>(mut self, v: std::option::Option<T>) -> Self
816 where
817 T: std::convert::Into<crate::model::WindowsNodeConfig>,
818 {
819 self.0.request.windows_node_config = v.map(|x| x.into());
820 self
821 }
822
823 pub fn set_accelerators<T, V>(mut self, v: T) -> Self
825 where
826 T: std::iter::IntoIterator<Item = V>,
827 V: std::convert::Into<crate::model::AcceleratorConfig>,
828 {
829 use std::iter::Iterator;
830 self.0.request.accelerators = v.into_iter().map(|i| i.into()).collect();
831 self
832 }
833
834 pub fn set_machine_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
836 self.0.request.machine_type = v.into();
837 self
838 }
839
840 pub fn set_disk_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
842 self.0.request.disk_type = v.into();
843 self
844 }
845
846 pub fn set_disk_size_gb<T: Into<i64>>(mut self, v: T) -> Self {
848 self.0.request.disk_size_gb = v.into();
849 self
850 }
851
852 pub fn set_resource_manager_tags<T>(mut self, v: T) -> Self
854 where
855 T: std::convert::Into<crate::model::ResourceManagerTags>,
856 {
857 self.0.request.resource_manager_tags = std::option::Option::Some(v.into());
858 self
859 }
860
861 pub fn set_or_clear_resource_manager_tags<T>(mut self, v: std::option::Option<T>) -> Self
863 where
864 T: std::convert::Into<crate::model::ResourceManagerTags>,
865 {
866 self.0.request.resource_manager_tags = v.map(|x| x.into());
867 self
868 }
869
870 pub fn set_containerd_config<T>(mut self, v: T) -> Self
872 where
873 T: std::convert::Into<crate::model::ContainerdConfig>,
874 {
875 self.0.request.containerd_config = std::option::Option::Some(v.into());
876 self
877 }
878
879 pub fn set_or_clear_containerd_config<T>(mut self, v: std::option::Option<T>) -> Self
881 where
882 T: std::convert::Into<crate::model::ContainerdConfig>,
883 {
884 self.0.request.containerd_config = v.map(|x| x.into());
885 self
886 }
887
888 pub fn set_queued_provisioning<T>(mut self, v: T) -> Self
890 where
891 T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
892 {
893 self.0.request.queued_provisioning = std::option::Option::Some(v.into());
894 self
895 }
896
897 pub fn set_or_clear_queued_provisioning<T>(mut self, v: std::option::Option<T>) -> Self
899 where
900 T: std::convert::Into<crate::model::node_pool::QueuedProvisioning>,
901 {
902 self.0.request.queued_provisioning = v.map(|x| x.into());
903 self
904 }
905
906 pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
908 where
909 T: std::iter::IntoIterator<Item = V>,
910 V: std::convert::Into<std::string::String>,
911 {
912 use std::iter::Iterator;
913 self.0.request.storage_pools = v.into_iter().map(|i| i.into()).collect();
914 self
915 }
916
917 pub fn set_max_run_duration<T>(mut self, v: T) -> Self
919 where
920 T: std::convert::Into<wkt::Duration>,
921 {
922 self.0.request.max_run_duration = std::option::Option::Some(v.into());
923 self
924 }
925
926 pub fn set_or_clear_max_run_duration<T>(mut self, v: std::option::Option<T>) -> Self
928 where
929 T: std::convert::Into<wkt::Duration>,
930 {
931 self.0.request.max_run_duration = v.map(|x| x.into());
932 self
933 }
934
935 pub fn set_flex_start<T>(mut self, v: T) -> Self
937 where
938 T: std::convert::Into<bool>,
939 {
940 self.0.request.flex_start = std::option::Option::Some(v.into());
941 self
942 }
943
944 pub fn set_or_clear_flex_start<T>(mut self, v: std::option::Option<T>) -> Self
946 where
947 T: std::convert::Into<bool>,
948 {
949 self.0.request.flex_start = v.map(|x| x.into());
950 self
951 }
952
953 pub fn set_boot_disk<T>(mut self, v: T) -> Self
955 where
956 T: std::convert::Into<crate::model::BootDisk>,
957 {
958 self.0.request.boot_disk = std::option::Option::Some(v.into());
959 self
960 }
961
962 pub fn set_or_clear_boot_disk<T>(mut self, v: std::option::Option<T>) -> Self
964 where
965 T: std::convert::Into<crate::model::BootDisk>,
966 {
967 self.0.request.boot_disk = v.map(|x| x.into());
968 self
969 }
970
971 pub fn set_node_drain_config<T>(mut self, v: T) -> Self
973 where
974 T: std::convert::Into<crate::model::node_pool::NodeDrainConfig>,
975 {
976 self.0.request.node_drain_config = std::option::Option::Some(v.into());
977 self
978 }
979
980 pub fn set_or_clear_node_drain_config<T>(mut self, v: std::option::Option<T>) -> Self
982 where
983 T: std::convert::Into<crate::model::node_pool::NodeDrainConfig>,
984 {
985 self.0.request.node_drain_config = v.map(|x| x.into());
986 self
987 }
988
989 pub fn set_consolidation_delay<T>(mut self, v: T) -> Self
991 where
992 T: std::convert::Into<wkt::Duration>,
993 {
994 self.0.request.consolidation_delay = std::option::Option::Some(v.into());
995 self
996 }
997
998 pub fn set_or_clear_consolidation_delay<T>(mut self, v: std::option::Option<T>) -> Self
1000 where
1001 T: std::convert::Into<wkt::Duration>,
1002 {
1003 self.0.request.consolidation_delay = v.map(|x| x.into());
1004 self
1005 }
1006
1007 pub fn set_taint_config<T>(mut self, v: T) -> Self
1009 where
1010 T: std::convert::Into<crate::model::TaintConfig>,
1011 {
1012 self.0.request.taint_config = std::option::Option::Some(v.into());
1013 self
1014 }
1015
1016 pub fn set_or_clear_taint_config<T>(mut self, v: std::option::Option<T>) -> Self
1018 where
1019 T: std::convert::Into<crate::model::TaintConfig>,
1020 {
1021 self.0.request.taint_config = v.map(|x| x.into());
1022 self
1023 }
1024 }
1025
1026 #[doc(hidden)]
1027 impl crate::RequestBuilder for UpdateNodePool {
1028 fn request_options(&mut self) -> &mut crate::RequestOptions {
1029 &mut self.0.options
1030 }
1031 }
1032
1033 #[derive(Clone, Debug)]
1050 pub struct SetNodePoolAutoscaling(RequestBuilder<crate::model::SetNodePoolAutoscalingRequest>);
1051
1052 impl SetNodePoolAutoscaling {
1053 pub(crate) fn new(
1054 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1055 ) -> Self {
1056 Self(RequestBuilder::new(stub))
1057 }
1058
1059 pub fn with_request<V: Into<crate::model::SetNodePoolAutoscalingRequest>>(
1061 mut self,
1062 v: V,
1063 ) -> Self {
1064 self.0.request = v.into();
1065 self
1066 }
1067
1068 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1070 self.0.options = v.into();
1071 self
1072 }
1073
1074 pub async fn send(self) -> Result<crate::model::Operation> {
1076 (*self.0.stub)
1077 .set_node_pool_autoscaling(self.0.request, self.0.options)
1078 .await
1079 .map(crate::Response::into_body)
1080 }
1081
1082 #[deprecated]
1084 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1085 self.0.request.project_id = v.into();
1086 self
1087 }
1088
1089 #[deprecated]
1091 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1092 self.0.request.zone = v.into();
1093 self
1094 }
1095
1096 #[deprecated]
1098 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1099 self.0.request.cluster_id = v.into();
1100 self
1101 }
1102
1103 #[deprecated]
1105 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1106 self.0.request.node_pool_id = v.into();
1107 self
1108 }
1109
1110 pub fn set_autoscaling<T>(mut self, v: T) -> Self
1114 where
1115 T: std::convert::Into<crate::model::NodePoolAutoscaling>,
1116 {
1117 self.0.request.autoscaling = std::option::Option::Some(v.into());
1118 self
1119 }
1120
1121 pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
1125 where
1126 T: std::convert::Into<crate::model::NodePoolAutoscaling>,
1127 {
1128 self.0.request.autoscaling = v.map(|x| x.into());
1129 self
1130 }
1131
1132 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1134 self.0.request.name = v.into();
1135 self
1136 }
1137 }
1138
1139 #[doc(hidden)]
1140 impl crate::RequestBuilder for SetNodePoolAutoscaling {
1141 fn request_options(&mut self) -> &mut crate::RequestOptions {
1142 &mut self.0.options
1143 }
1144 }
1145
1146 #[derive(Clone, Debug)]
1163 pub struct SetLoggingService(RequestBuilder<crate::model::SetLoggingServiceRequest>);
1164
1165 impl SetLoggingService {
1166 pub(crate) fn new(
1167 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1168 ) -> Self {
1169 Self(RequestBuilder::new(stub))
1170 }
1171
1172 pub fn with_request<V: Into<crate::model::SetLoggingServiceRequest>>(
1174 mut self,
1175 v: V,
1176 ) -> Self {
1177 self.0.request = v.into();
1178 self
1179 }
1180
1181 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1183 self.0.options = v.into();
1184 self
1185 }
1186
1187 pub async fn send(self) -> Result<crate::model::Operation> {
1189 (*self.0.stub)
1190 .set_logging_service(self.0.request, self.0.options)
1191 .await
1192 .map(crate::Response::into_body)
1193 }
1194
1195 #[deprecated]
1197 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1198 self.0.request.project_id = v.into();
1199 self
1200 }
1201
1202 #[deprecated]
1204 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1205 self.0.request.zone = v.into();
1206 self
1207 }
1208
1209 #[deprecated]
1211 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1212 self.0.request.cluster_id = v.into();
1213 self
1214 }
1215
1216 pub fn set_logging_service<T: Into<std::string::String>>(mut self, v: T) -> Self {
1220 self.0.request.logging_service = v.into();
1221 self
1222 }
1223
1224 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1226 self.0.request.name = v.into();
1227 self
1228 }
1229 }
1230
1231 #[doc(hidden)]
1232 impl crate::RequestBuilder for SetLoggingService {
1233 fn request_options(&mut self) -> &mut crate::RequestOptions {
1234 &mut self.0.options
1235 }
1236 }
1237
1238 #[derive(Clone, Debug)]
1255 pub struct SetMonitoringService(RequestBuilder<crate::model::SetMonitoringServiceRequest>);
1256
1257 impl SetMonitoringService {
1258 pub(crate) fn new(
1259 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1260 ) -> Self {
1261 Self(RequestBuilder::new(stub))
1262 }
1263
1264 pub fn with_request<V: Into<crate::model::SetMonitoringServiceRequest>>(
1266 mut self,
1267 v: V,
1268 ) -> Self {
1269 self.0.request = v.into();
1270 self
1271 }
1272
1273 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1275 self.0.options = v.into();
1276 self
1277 }
1278
1279 pub async fn send(self) -> Result<crate::model::Operation> {
1281 (*self.0.stub)
1282 .set_monitoring_service(self.0.request, self.0.options)
1283 .await
1284 .map(crate::Response::into_body)
1285 }
1286
1287 #[deprecated]
1289 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1290 self.0.request.project_id = v.into();
1291 self
1292 }
1293
1294 #[deprecated]
1296 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1297 self.0.request.zone = v.into();
1298 self
1299 }
1300
1301 #[deprecated]
1303 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1304 self.0.request.cluster_id = v.into();
1305 self
1306 }
1307
1308 pub fn set_monitoring_service<T: Into<std::string::String>>(mut self, v: T) -> Self {
1312 self.0.request.monitoring_service = v.into();
1313 self
1314 }
1315
1316 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1318 self.0.request.name = v.into();
1319 self
1320 }
1321 }
1322
1323 #[doc(hidden)]
1324 impl crate::RequestBuilder for SetMonitoringService {
1325 fn request_options(&mut self) -> &mut crate::RequestOptions {
1326 &mut self.0.options
1327 }
1328 }
1329
1330 #[derive(Clone, Debug)]
1347 pub struct SetAddonsConfig(RequestBuilder<crate::model::SetAddonsConfigRequest>);
1348
1349 impl SetAddonsConfig {
1350 pub(crate) fn new(
1351 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1352 ) -> Self {
1353 Self(RequestBuilder::new(stub))
1354 }
1355
1356 pub fn with_request<V: Into<crate::model::SetAddonsConfigRequest>>(mut self, v: V) -> Self {
1358 self.0.request = v.into();
1359 self
1360 }
1361
1362 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1364 self.0.options = v.into();
1365 self
1366 }
1367
1368 pub async fn send(self) -> Result<crate::model::Operation> {
1370 (*self.0.stub)
1371 .set_addons_config(self.0.request, self.0.options)
1372 .await
1373 .map(crate::Response::into_body)
1374 }
1375
1376 #[deprecated]
1378 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1379 self.0.request.project_id = v.into();
1380 self
1381 }
1382
1383 #[deprecated]
1385 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1386 self.0.request.zone = v.into();
1387 self
1388 }
1389
1390 #[deprecated]
1392 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1393 self.0.request.cluster_id = v.into();
1394 self
1395 }
1396
1397 pub fn set_addons_config<T>(mut self, v: T) -> Self
1401 where
1402 T: std::convert::Into<crate::model::AddonsConfig>,
1403 {
1404 self.0.request.addons_config = std::option::Option::Some(v.into());
1405 self
1406 }
1407
1408 pub fn set_or_clear_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
1412 where
1413 T: std::convert::Into<crate::model::AddonsConfig>,
1414 {
1415 self.0.request.addons_config = v.map(|x| x.into());
1416 self
1417 }
1418
1419 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1421 self.0.request.name = v.into();
1422 self
1423 }
1424 }
1425
1426 #[doc(hidden)]
1427 impl crate::RequestBuilder for SetAddonsConfig {
1428 fn request_options(&mut self) -> &mut crate::RequestOptions {
1429 &mut self.0.options
1430 }
1431 }
1432
1433 #[derive(Clone, Debug)]
1450 pub struct SetLocations(RequestBuilder<crate::model::SetLocationsRequest>);
1451
1452 impl SetLocations {
1453 pub(crate) fn new(
1454 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1455 ) -> Self {
1456 Self(RequestBuilder::new(stub))
1457 }
1458
1459 pub fn with_request<V: Into<crate::model::SetLocationsRequest>>(mut self, v: V) -> Self {
1461 self.0.request = v.into();
1462 self
1463 }
1464
1465 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1467 self.0.options = v.into();
1468 self
1469 }
1470
1471 pub async fn send(self) -> Result<crate::model::Operation> {
1473 (*self.0.stub)
1474 .set_locations(self.0.request, self.0.options)
1475 .await
1476 .map(crate::Response::into_body)
1477 }
1478
1479 #[deprecated]
1481 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1482 self.0.request.project_id = v.into();
1483 self
1484 }
1485
1486 #[deprecated]
1488 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1489 self.0.request.zone = v.into();
1490 self
1491 }
1492
1493 #[deprecated]
1495 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1496 self.0.request.cluster_id = v.into();
1497 self
1498 }
1499
1500 pub fn set_locations<T, V>(mut self, v: T) -> Self
1504 where
1505 T: std::iter::IntoIterator<Item = V>,
1506 V: std::convert::Into<std::string::String>,
1507 {
1508 use std::iter::Iterator;
1509 self.0.request.locations = v.into_iter().map(|i| i.into()).collect();
1510 self
1511 }
1512
1513 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1515 self.0.request.name = v.into();
1516 self
1517 }
1518 }
1519
1520 #[doc(hidden)]
1521 impl crate::RequestBuilder for SetLocations {
1522 fn request_options(&mut self) -> &mut crate::RequestOptions {
1523 &mut self.0.options
1524 }
1525 }
1526
1527 #[derive(Clone, Debug)]
1544 pub struct UpdateMaster(RequestBuilder<crate::model::UpdateMasterRequest>);
1545
1546 impl UpdateMaster {
1547 pub(crate) fn new(
1548 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1549 ) -> Self {
1550 Self(RequestBuilder::new(stub))
1551 }
1552
1553 pub fn with_request<V: Into<crate::model::UpdateMasterRequest>>(mut self, v: V) -> Self {
1555 self.0.request = v.into();
1556 self
1557 }
1558
1559 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1561 self.0.options = v.into();
1562 self
1563 }
1564
1565 pub async fn send(self) -> Result<crate::model::Operation> {
1567 (*self.0.stub)
1568 .update_master(self.0.request, self.0.options)
1569 .await
1570 .map(crate::Response::into_body)
1571 }
1572
1573 #[deprecated]
1575 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1576 self.0.request.project_id = v.into();
1577 self
1578 }
1579
1580 #[deprecated]
1582 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1583 self.0.request.zone = v.into();
1584 self
1585 }
1586
1587 #[deprecated]
1589 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1590 self.0.request.cluster_id = v.into();
1591 self
1592 }
1593
1594 pub fn set_master_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1598 self.0.request.master_version = v.into();
1599 self
1600 }
1601
1602 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1604 self.0.request.name = v.into();
1605 self
1606 }
1607 }
1608
1609 #[doc(hidden)]
1610 impl crate::RequestBuilder for UpdateMaster {
1611 fn request_options(&mut self) -> &mut crate::RequestOptions {
1612 &mut self.0.options
1613 }
1614 }
1615
1616 #[derive(Clone, Debug)]
1633 pub struct SetMasterAuth(RequestBuilder<crate::model::SetMasterAuthRequest>);
1634
1635 impl SetMasterAuth {
1636 pub(crate) fn new(
1637 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1638 ) -> Self {
1639 Self(RequestBuilder::new(stub))
1640 }
1641
1642 pub fn with_request<V: Into<crate::model::SetMasterAuthRequest>>(mut self, v: V) -> Self {
1644 self.0.request = v.into();
1645 self
1646 }
1647
1648 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1650 self.0.options = v.into();
1651 self
1652 }
1653
1654 pub async fn send(self) -> Result<crate::model::Operation> {
1656 (*self.0.stub)
1657 .set_master_auth(self.0.request, self.0.options)
1658 .await
1659 .map(crate::Response::into_body)
1660 }
1661
1662 #[deprecated]
1664 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1665 self.0.request.project_id = v.into();
1666 self
1667 }
1668
1669 #[deprecated]
1671 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1672 self.0.request.zone = v.into();
1673 self
1674 }
1675
1676 #[deprecated]
1678 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1679 self.0.request.cluster_id = v.into();
1680 self
1681 }
1682
1683 pub fn set_action<T: Into<crate::model::set_master_auth_request::Action>>(
1687 mut self,
1688 v: T,
1689 ) -> Self {
1690 self.0.request.action = v.into();
1691 self
1692 }
1693
1694 pub fn set_update<T>(mut self, v: T) -> Self
1698 where
1699 T: std::convert::Into<crate::model::MasterAuth>,
1700 {
1701 self.0.request.update = std::option::Option::Some(v.into());
1702 self
1703 }
1704
1705 pub fn set_or_clear_update<T>(mut self, v: std::option::Option<T>) -> Self
1709 where
1710 T: std::convert::Into<crate::model::MasterAuth>,
1711 {
1712 self.0.request.update = v.map(|x| x.into());
1713 self
1714 }
1715
1716 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1718 self.0.request.name = v.into();
1719 self
1720 }
1721 }
1722
1723 #[doc(hidden)]
1724 impl crate::RequestBuilder for SetMasterAuth {
1725 fn request_options(&mut self) -> &mut crate::RequestOptions {
1726 &mut self.0.options
1727 }
1728 }
1729
1730 #[derive(Clone, Debug)]
1747 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
1748
1749 impl DeleteCluster {
1750 pub(crate) fn new(
1751 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1752 ) -> Self {
1753 Self(RequestBuilder::new(stub))
1754 }
1755
1756 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
1758 self.0.request = v.into();
1759 self
1760 }
1761
1762 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1764 self.0.options = v.into();
1765 self
1766 }
1767
1768 pub async fn send(self) -> Result<crate::model::Operation> {
1770 (*self.0.stub)
1771 .delete_cluster(self.0.request, self.0.options)
1772 .await
1773 .map(crate::Response::into_body)
1774 }
1775
1776 #[deprecated]
1778 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1779 self.0.request.project_id = v.into();
1780 self
1781 }
1782
1783 #[deprecated]
1785 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1786 self.0.request.zone = v.into();
1787 self
1788 }
1789
1790 #[deprecated]
1792 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1793 self.0.request.cluster_id = v.into();
1794 self
1795 }
1796
1797 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1799 self.0.request.name = v.into();
1800 self
1801 }
1802 }
1803
1804 #[doc(hidden)]
1805 impl crate::RequestBuilder for DeleteCluster {
1806 fn request_options(&mut self) -> &mut crate::RequestOptions {
1807 &mut self.0.options
1808 }
1809 }
1810
1811 #[derive(Clone, Debug)]
1828 pub struct ListOperations(RequestBuilder<crate::model::ListOperationsRequest>);
1829
1830 impl ListOperations {
1831 pub(crate) fn new(
1832 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1833 ) -> Self {
1834 Self(RequestBuilder::new(stub))
1835 }
1836
1837 pub fn with_request<V: Into<crate::model::ListOperationsRequest>>(mut self, v: V) -> Self {
1839 self.0.request = v.into();
1840 self
1841 }
1842
1843 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1845 self.0.options = v.into();
1846 self
1847 }
1848
1849 pub async fn send(self) -> Result<crate::model::ListOperationsResponse> {
1851 (*self.0.stub)
1852 .list_operations(self.0.request, self.0.options)
1853 .await
1854 .map(crate::Response::into_body)
1855 }
1856
1857 #[deprecated]
1859 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1860 self.0.request.project_id = v.into();
1861 self
1862 }
1863
1864 #[deprecated]
1866 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1867 self.0.request.zone = v.into();
1868 self
1869 }
1870
1871 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1873 self.0.request.parent = v.into();
1874 self
1875 }
1876 }
1877
1878 #[doc(hidden)]
1879 impl crate::RequestBuilder for ListOperations {
1880 fn request_options(&mut self) -> &mut crate::RequestOptions {
1881 &mut self.0.options
1882 }
1883 }
1884
1885 #[derive(Clone, Debug)]
1902 pub struct GetOperation(RequestBuilder<crate::model::GetOperationRequest>);
1903
1904 impl GetOperation {
1905 pub(crate) fn new(
1906 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1907 ) -> Self {
1908 Self(RequestBuilder::new(stub))
1909 }
1910
1911 pub fn with_request<V: Into<crate::model::GetOperationRequest>>(mut self, v: V) -> Self {
1913 self.0.request = v.into();
1914 self
1915 }
1916
1917 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1919 self.0.options = v.into();
1920 self
1921 }
1922
1923 pub async fn send(self) -> Result<crate::model::Operation> {
1925 (*self.0.stub)
1926 .get_operation(self.0.request, self.0.options)
1927 .await
1928 .map(crate::Response::into_body)
1929 }
1930
1931 #[deprecated]
1933 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1934 self.0.request.project_id = v.into();
1935 self
1936 }
1937
1938 #[deprecated]
1940 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1941 self.0.request.zone = v.into();
1942 self
1943 }
1944
1945 #[deprecated]
1947 pub fn set_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1948 self.0.request.operation_id = v.into();
1949 self
1950 }
1951
1952 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1954 self.0.request.name = v.into();
1955 self
1956 }
1957 }
1958
1959 #[doc(hidden)]
1960 impl crate::RequestBuilder for GetOperation {
1961 fn request_options(&mut self) -> &mut crate::RequestOptions {
1962 &mut self.0.options
1963 }
1964 }
1965
1966 #[derive(Clone, Debug)]
1983 pub struct CancelOperation(RequestBuilder<crate::model::CancelOperationRequest>);
1984
1985 impl CancelOperation {
1986 pub(crate) fn new(
1987 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1988 ) -> Self {
1989 Self(RequestBuilder::new(stub))
1990 }
1991
1992 pub fn with_request<V: Into<crate::model::CancelOperationRequest>>(mut self, v: V) -> Self {
1994 self.0.request = v.into();
1995 self
1996 }
1997
1998 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2000 self.0.options = v.into();
2001 self
2002 }
2003
2004 pub async fn send(self) -> Result<()> {
2006 (*self.0.stub)
2007 .cancel_operation(self.0.request, self.0.options)
2008 .await
2009 .map(crate::Response::into_body)
2010 }
2011
2012 #[deprecated]
2014 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2015 self.0.request.project_id = v.into();
2016 self
2017 }
2018
2019 #[deprecated]
2021 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2022 self.0.request.zone = v.into();
2023 self
2024 }
2025
2026 #[deprecated]
2028 pub fn set_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2029 self.0.request.operation_id = v.into();
2030 self
2031 }
2032
2033 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2035 self.0.request.name = v.into();
2036 self
2037 }
2038 }
2039
2040 #[doc(hidden)]
2041 impl crate::RequestBuilder for CancelOperation {
2042 fn request_options(&mut self) -> &mut crate::RequestOptions {
2043 &mut self.0.options
2044 }
2045 }
2046
2047 #[derive(Clone, Debug)]
2064 pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
2065
2066 impl GetServerConfig {
2067 pub(crate) fn new(
2068 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2069 ) -> Self {
2070 Self(RequestBuilder::new(stub))
2071 }
2072
2073 pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
2075 self.0.request = v.into();
2076 self
2077 }
2078
2079 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2081 self.0.options = v.into();
2082 self
2083 }
2084
2085 pub async fn send(self) -> Result<crate::model::ServerConfig> {
2087 (*self.0.stub)
2088 .get_server_config(self.0.request, self.0.options)
2089 .await
2090 .map(crate::Response::into_body)
2091 }
2092
2093 #[deprecated]
2095 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2096 self.0.request.project_id = v.into();
2097 self
2098 }
2099
2100 #[deprecated]
2102 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2103 self.0.request.zone = v.into();
2104 self
2105 }
2106
2107 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2109 self.0.request.name = v.into();
2110 self
2111 }
2112 }
2113
2114 #[doc(hidden)]
2115 impl crate::RequestBuilder for GetServerConfig {
2116 fn request_options(&mut self) -> &mut crate::RequestOptions {
2117 &mut self.0.options
2118 }
2119 }
2120
2121 #[derive(Clone, Debug)]
2138 pub struct GetJSONWebKeys(RequestBuilder<crate::model::GetJSONWebKeysRequest>);
2139
2140 impl GetJSONWebKeys {
2141 pub(crate) fn new(
2142 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2143 ) -> Self {
2144 Self(RequestBuilder::new(stub))
2145 }
2146
2147 pub fn with_request<V: Into<crate::model::GetJSONWebKeysRequest>>(mut self, v: V) -> Self {
2149 self.0.request = v.into();
2150 self
2151 }
2152
2153 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2155 self.0.options = v.into();
2156 self
2157 }
2158
2159 pub async fn send(self) -> Result<crate::model::GetJSONWebKeysResponse> {
2161 (*self.0.stub)
2162 .get_json_web_keys(self.0.request, self.0.options)
2163 .await
2164 .map(crate::Response::into_body)
2165 }
2166
2167 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2169 self.0.request.parent = v.into();
2170 self
2171 }
2172 }
2173
2174 #[doc(hidden)]
2175 impl crate::RequestBuilder for GetJSONWebKeys {
2176 fn request_options(&mut self) -> &mut crate::RequestOptions {
2177 &mut self.0.options
2178 }
2179 }
2180
2181 #[derive(Clone, Debug)]
2198 pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
2199
2200 impl ListNodePools {
2201 pub(crate) fn new(
2202 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2203 ) -> Self {
2204 Self(RequestBuilder::new(stub))
2205 }
2206
2207 pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
2209 self.0.request = v.into();
2210 self
2211 }
2212
2213 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2215 self.0.options = v.into();
2216 self
2217 }
2218
2219 pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
2221 (*self.0.stub)
2222 .list_node_pools(self.0.request, self.0.options)
2223 .await
2224 .map(crate::Response::into_body)
2225 }
2226
2227 #[deprecated]
2229 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2230 self.0.request.project_id = v.into();
2231 self
2232 }
2233
2234 #[deprecated]
2236 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2237 self.0.request.zone = v.into();
2238 self
2239 }
2240
2241 #[deprecated]
2243 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2244 self.0.request.cluster_id = v.into();
2245 self
2246 }
2247
2248 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2250 self.0.request.parent = v.into();
2251 self
2252 }
2253 }
2254
2255 #[doc(hidden)]
2256 impl crate::RequestBuilder for ListNodePools {
2257 fn request_options(&mut self) -> &mut crate::RequestOptions {
2258 &mut self.0.options
2259 }
2260 }
2261
2262 #[derive(Clone, Debug)]
2279 pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
2280
2281 impl GetNodePool {
2282 pub(crate) fn new(
2283 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2284 ) -> Self {
2285 Self(RequestBuilder::new(stub))
2286 }
2287
2288 pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
2290 self.0.request = v.into();
2291 self
2292 }
2293
2294 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2296 self.0.options = v.into();
2297 self
2298 }
2299
2300 pub async fn send(self) -> Result<crate::model::NodePool> {
2302 (*self.0.stub)
2303 .get_node_pool(self.0.request, self.0.options)
2304 .await
2305 .map(crate::Response::into_body)
2306 }
2307
2308 #[deprecated]
2310 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2311 self.0.request.project_id = v.into();
2312 self
2313 }
2314
2315 #[deprecated]
2317 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2318 self.0.request.zone = v.into();
2319 self
2320 }
2321
2322 #[deprecated]
2324 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2325 self.0.request.cluster_id = v.into();
2326 self
2327 }
2328
2329 #[deprecated]
2331 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2332 self.0.request.node_pool_id = v.into();
2333 self
2334 }
2335
2336 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2338 self.0.request.name = v.into();
2339 self
2340 }
2341 }
2342
2343 #[doc(hidden)]
2344 impl crate::RequestBuilder for GetNodePool {
2345 fn request_options(&mut self) -> &mut crate::RequestOptions {
2346 &mut self.0.options
2347 }
2348 }
2349
2350 #[derive(Clone, Debug)]
2367 pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
2368
2369 impl CreateNodePool {
2370 pub(crate) fn new(
2371 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2372 ) -> Self {
2373 Self(RequestBuilder::new(stub))
2374 }
2375
2376 pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
2378 self.0.request = v.into();
2379 self
2380 }
2381
2382 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2384 self.0.options = v.into();
2385 self
2386 }
2387
2388 pub async fn send(self) -> Result<crate::model::Operation> {
2390 (*self.0.stub)
2391 .create_node_pool(self.0.request, self.0.options)
2392 .await
2393 .map(crate::Response::into_body)
2394 }
2395
2396 #[deprecated]
2398 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2399 self.0.request.project_id = v.into();
2400 self
2401 }
2402
2403 #[deprecated]
2405 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2406 self.0.request.zone = v.into();
2407 self
2408 }
2409
2410 #[deprecated]
2412 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2413 self.0.request.cluster_id = v.into();
2414 self
2415 }
2416
2417 pub fn set_node_pool<T>(mut self, v: T) -> Self
2421 where
2422 T: std::convert::Into<crate::model::NodePool>,
2423 {
2424 self.0.request.node_pool = std::option::Option::Some(v.into());
2425 self
2426 }
2427
2428 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
2432 where
2433 T: std::convert::Into<crate::model::NodePool>,
2434 {
2435 self.0.request.node_pool = v.map(|x| x.into());
2436 self
2437 }
2438
2439 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2441 self.0.request.parent = v.into();
2442 self
2443 }
2444 }
2445
2446 #[doc(hidden)]
2447 impl crate::RequestBuilder for CreateNodePool {
2448 fn request_options(&mut self) -> &mut crate::RequestOptions {
2449 &mut self.0.options
2450 }
2451 }
2452
2453 #[derive(Clone, Debug)]
2470 pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
2471
2472 impl DeleteNodePool {
2473 pub(crate) fn new(
2474 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2475 ) -> Self {
2476 Self(RequestBuilder::new(stub))
2477 }
2478
2479 pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
2481 self.0.request = v.into();
2482 self
2483 }
2484
2485 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2487 self.0.options = v.into();
2488 self
2489 }
2490
2491 pub async fn send(self) -> Result<crate::model::Operation> {
2493 (*self.0.stub)
2494 .delete_node_pool(self.0.request, self.0.options)
2495 .await
2496 .map(crate::Response::into_body)
2497 }
2498
2499 #[deprecated]
2501 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2502 self.0.request.project_id = v.into();
2503 self
2504 }
2505
2506 #[deprecated]
2508 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2509 self.0.request.zone = v.into();
2510 self
2511 }
2512
2513 #[deprecated]
2515 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2516 self.0.request.cluster_id = v.into();
2517 self
2518 }
2519
2520 #[deprecated]
2522 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2523 self.0.request.node_pool_id = v.into();
2524 self
2525 }
2526
2527 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2529 self.0.request.name = v.into();
2530 self
2531 }
2532 }
2533
2534 #[doc(hidden)]
2535 impl crate::RequestBuilder for DeleteNodePool {
2536 fn request_options(&mut self) -> &mut crate::RequestOptions {
2537 &mut self.0.options
2538 }
2539 }
2540
2541 #[derive(Clone, Debug)]
2558 pub struct CompleteNodePoolUpgrade(
2559 RequestBuilder<crate::model::CompleteNodePoolUpgradeRequest>,
2560 );
2561
2562 impl CompleteNodePoolUpgrade {
2563 pub(crate) fn new(
2564 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2565 ) -> Self {
2566 Self(RequestBuilder::new(stub))
2567 }
2568
2569 pub fn with_request<V: Into<crate::model::CompleteNodePoolUpgradeRequest>>(
2571 mut self,
2572 v: V,
2573 ) -> Self {
2574 self.0.request = v.into();
2575 self
2576 }
2577
2578 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2580 self.0.options = v.into();
2581 self
2582 }
2583
2584 pub async fn send(self) -> Result<()> {
2586 (*self.0.stub)
2587 .complete_node_pool_upgrade(self.0.request, self.0.options)
2588 .await
2589 .map(crate::Response::into_body)
2590 }
2591
2592 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2594 self.0.request.name = v.into();
2595 self
2596 }
2597 }
2598
2599 #[doc(hidden)]
2600 impl crate::RequestBuilder for CompleteNodePoolUpgrade {
2601 fn request_options(&mut self) -> &mut crate::RequestOptions {
2602 &mut self.0.options
2603 }
2604 }
2605
2606 #[derive(Clone, Debug)]
2623 pub struct RollbackNodePoolUpgrade(
2624 RequestBuilder<crate::model::RollbackNodePoolUpgradeRequest>,
2625 );
2626
2627 impl RollbackNodePoolUpgrade {
2628 pub(crate) fn new(
2629 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2630 ) -> Self {
2631 Self(RequestBuilder::new(stub))
2632 }
2633
2634 pub fn with_request<V: Into<crate::model::RollbackNodePoolUpgradeRequest>>(
2636 mut self,
2637 v: V,
2638 ) -> Self {
2639 self.0.request = v.into();
2640 self
2641 }
2642
2643 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2645 self.0.options = v.into();
2646 self
2647 }
2648
2649 pub async fn send(self) -> Result<crate::model::Operation> {
2651 (*self.0.stub)
2652 .rollback_node_pool_upgrade(self.0.request, self.0.options)
2653 .await
2654 .map(crate::Response::into_body)
2655 }
2656
2657 #[deprecated]
2659 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2660 self.0.request.project_id = v.into();
2661 self
2662 }
2663
2664 #[deprecated]
2666 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2667 self.0.request.zone = v.into();
2668 self
2669 }
2670
2671 #[deprecated]
2673 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2674 self.0.request.cluster_id = v.into();
2675 self
2676 }
2677
2678 #[deprecated]
2680 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2681 self.0.request.node_pool_id = v.into();
2682 self
2683 }
2684
2685 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2687 self.0.request.name = v.into();
2688 self
2689 }
2690
2691 pub fn set_respect_pdb<T: Into<bool>>(mut self, v: T) -> Self {
2693 self.0.request.respect_pdb = v.into();
2694 self
2695 }
2696 }
2697
2698 #[doc(hidden)]
2699 impl crate::RequestBuilder for RollbackNodePoolUpgrade {
2700 fn request_options(&mut self) -> &mut crate::RequestOptions {
2701 &mut self.0.options
2702 }
2703 }
2704
2705 #[derive(Clone, Debug)]
2722 pub struct SetNodePoolManagement(RequestBuilder<crate::model::SetNodePoolManagementRequest>);
2723
2724 impl SetNodePoolManagement {
2725 pub(crate) fn new(
2726 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2727 ) -> Self {
2728 Self(RequestBuilder::new(stub))
2729 }
2730
2731 pub fn with_request<V: Into<crate::model::SetNodePoolManagementRequest>>(
2733 mut self,
2734 v: V,
2735 ) -> Self {
2736 self.0.request = v.into();
2737 self
2738 }
2739
2740 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2742 self.0.options = v.into();
2743 self
2744 }
2745
2746 pub async fn send(self) -> Result<crate::model::Operation> {
2748 (*self.0.stub)
2749 .set_node_pool_management(self.0.request, self.0.options)
2750 .await
2751 .map(crate::Response::into_body)
2752 }
2753
2754 #[deprecated]
2756 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2757 self.0.request.project_id = v.into();
2758 self
2759 }
2760
2761 #[deprecated]
2763 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2764 self.0.request.zone = v.into();
2765 self
2766 }
2767
2768 #[deprecated]
2770 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2771 self.0.request.cluster_id = v.into();
2772 self
2773 }
2774
2775 #[deprecated]
2777 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2778 self.0.request.node_pool_id = v.into();
2779 self
2780 }
2781
2782 pub fn set_management<T>(mut self, v: T) -> Self
2786 where
2787 T: std::convert::Into<crate::model::NodeManagement>,
2788 {
2789 self.0.request.management = std::option::Option::Some(v.into());
2790 self
2791 }
2792
2793 pub fn set_or_clear_management<T>(mut self, v: std::option::Option<T>) -> Self
2797 where
2798 T: std::convert::Into<crate::model::NodeManagement>,
2799 {
2800 self.0.request.management = v.map(|x| x.into());
2801 self
2802 }
2803
2804 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2806 self.0.request.name = v.into();
2807 self
2808 }
2809 }
2810
2811 #[doc(hidden)]
2812 impl crate::RequestBuilder for SetNodePoolManagement {
2813 fn request_options(&mut self) -> &mut crate::RequestOptions {
2814 &mut self.0.options
2815 }
2816 }
2817
2818 #[derive(Clone, Debug)]
2835 pub struct SetLabels(RequestBuilder<crate::model::SetLabelsRequest>);
2836
2837 impl SetLabels {
2838 pub(crate) fn new(
2839 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2840 ) -> Self {
2841 Self(RequestBuilder::new(stub))
2842 }
2843
2844 pub fn with_request<V: Into<crate::model::SetLabelsRequest>>(mut self, v: V) -> Self {
2846 self.0.request = v.into();
2847 self
2848 }
2849
2850 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2852 self.0.options = v.into();
2853 self
2854 }
2855
2856 pub async fn send(self) -> Result<crate::model::Operation> {
2858 (*self.0.stub)
2859 .set_labels(self.0.request, self.0.options)
2860 .await
2861 .map(crate::Response::into_body)
2862 }
2863
2864 #[deprecated]
2866 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2867 self.0.request.project_id = v.into();
2868 self
2869 }
2870
2871 #[deprecated]
2873 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2874 self.0.request.zone = v.into();
2875 self
2876 }
2877
2878 #[deprecated]
2880 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2881 self.0.request.cluster_id = v.into();
2882 self
2883 }
2884
2885 pub fn set_resource_labels<T, K, V>(mut self, v: T) -> Self
2889 where
2890 T: std::iter::IntoIterator<Item = (K, V)>,
2891 K: std::convert::Into<std::string::String>,
2892 V: std::convert::Into<std::string::String>,
2893 {
2894 self.0.request.resource_labels =
2895 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2896 self
2897 }
2898
2899 pub fn set_label_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
2903 self.0.request.label_fingerprint = v.into();
2904 self
2905 }
2906
2907 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2909 self.0.request.name = v.into();
2910 self
2911 }
2912 }
2913
2914 #[doc(hidden)]
2915 impl crate::RequestBuilder for SetLabels {
2916 fn request_options(&mut self) -> &mut crate::RequestOptions {
2917 &mut self.0.options
2918 }
2919 }
2920
2921 #[derive(Clone, Debug)]
2938 pub struct SetLegacyAbac(RequestBuilder<crate::model::SetLegacyAbacRequest>);
2939
2940 impl SetLegacyAbac {
2941 pub(crate) fn new(
2942 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2943 ) -> Self {
2944 Self(RequestBuilder::new(stub))
2945 }
2946
2947 pub fn with_request<V: Into<crate::model::SetLegacyAbacRequest>>(mut self, v: V) -> Self {
2949 self.0.request = v.into();
2950 self
2951 }
2952
2953 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2955 self.0.options = v.into();
2956 self
2957 }
2958
2959 pub async fn send(self) -> Result<crate::model::Operation> {
2961 (*self.0.stub)
2962 .set_legacy_abac(self.0.request, self.0.options)
2963 .await
2964 .map(crate::Response::into_body)
2965 }
2966
2967 #[deprecated]
2969 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2970 self.0.request.project_id = v.into();
2971 self
2972 }
2973
2974 #[deprecated]
2976 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2977 self.0.request.zone = v.into();
2978 self
2979 }
2980
2981 #[deprecated]
2983 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2984 self.0.request.cluster_id = v.into();
2985 self
2986 }
2987
2988 pub fn set_enabled<T: Into<bool>>(mut self, v: T) -> Self {
2992 self.0.request.enabled = v.into();
2993 self
2994 }
2995
2996 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2998 self.0.request.name = v.into();
2999 self
3000 }
3001 }
3002
3003 #[doc(hidden)]
3004 impl crate::RequestBuilder for SetLegacyAbac {
3005 fn request_options(&mut self) -> &mut crate::RequestOptions {
3006 &mut self.0.options
3007 }
3008 }
3009
3010 #[derive(Clone, Debug)]
3027 pub struct StartIPRotation(RequestBuilder<crate::model::StartIPRotationRequest>);
3028
3029 impl StartIPRotation {
3030 pub(crate) fn new(
3031 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3032 ) -> Self {
3033 Self(RequestBuilder::new(stub))
3034 }
3035
3036 pub fn with_request<V: Into<crate::model::StartIPRotationRequest>>(mut self, v: V) -> Self {
3038 self.0.request = v.into();
3039 self
3040 }
3041
3042 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3044 self.0.options = v.into();
3045 self
3046 }
3047
3048 pub async fn send(self) -> Result<crate::model::Operation> {
3050 (*self.0.stub)
3051 .start_ip_rotation(self.0.request, self.0.options)
3052 .await
3053 .map(crate::Response::into_body)
3054 }
3055
3056 #[deprecated]
3058 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3059 self.0.request.project_id = v.into();
3060 self
3061 }
3062
3063 #[deprecated]
3065 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3066 self.0.request.zone = v.into();
3067 self
3068 }
3069
3070 #[deprecated]
3072 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3073 self.0.request.cluster_id = v.into();
3074 self
3075 }
3076
3077 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3079 self.0.request.name = v.into();
3080 self
3081 }
3082
3083 pub fn set_rotate_credentials<T: Into<bool>>(mut self, v: T) -> Self {
3085 self.0.request.rotate_credentials = v.into();
3086 self
3087 }
3088 }
3089
3090 #[doc(hidden)]
3091 impl crate::RequestBuilder for StartIPRotation {
3092 fn request_options(&mut self) -> &mut crate::RequestOptions {
3093 &mut self.0.options
3094 }
3095 }
3096
3097 #[derive(Clone, Debug)]
3114 pub struct CompleteIPRotation(RequestBuilder<crate::model::CompleteIPRotationRequest>);
3115
3116 impl CompleteIPRotation {
3117 pub(crate) fn new(
3118 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3119 ) -> Self {
3120 Self(RequestBuilder::new(stub))
3121 }
3122
3123 pub fn with_request<V: Into<crate::model::CompleteIPRotationRequest>>(
3125 mut self,
3126 v: V,
3127 ) -> Self {
3128 self.0.request = v.into();
3129 self
3130 }
3131
3132 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3134 self.0.options = v.into();
3135 self
3136 }
3137
3138 pub async fn send(self) -> Result<crate::model::Operation> {
3140 (*self.0.stub)
3141 .complete_ip_rotation(self.0.request, self.0.options)
3142 .await
3143 .map(crate::Response::into_body)
3144 }
3145
3146 #[deprecated]
3148 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3149 self.0.request.project_id = v.into();
3150 self
3151 }
3152
3153 #[deprecated]
3155 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3156 self.0.request.zone = v.into();
3157 self
3158 }
3159
3160 #[deprecated]
3162 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3163 self.0.request.cluster_id = v.into();
3164 self
3165 }
3166
3167 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3169 self.0.request.name = v.into();
3170 self
3171 }
3172 }
3173
3174 #[doc(hidden)]
3175 impl crate::RequestBuilder for CompleteIPRotation {
3176 fn request_options(&mut self) -> &mut crate::RequestOptions {
3177 &mut self.0.options
3178 }
3179 }
3180
3181 #[derive(Clone, Debug)]
3198 pub struct SetNodePoolSize(RequestBuilder<crate::model::SetNodePoolSizeRequest>);
3199
3200 impl SetNodePoolSize {
3201 pub(crate) fn new(
3202 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3203 ) -> Self {
3204 Self(RequestBuilder::new(stub))
3205 }
3206
3207 pub fn with_request<V: Into<crate::model::SetNodePoolSizeRequest>>(mut self, v: V) -> Self {
3209 self.0.request = v.into();
3210 self
3211 }
3212
3213 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3215 self.0.options = v.into();
3216 self
3217 }
3218
3219 pub async fn send(self) -> Result<crate::model::Operation> {
3221 (*self.0.stub)
3222 .set_node_pool_size(self.0.request, self.0.options)
3223 .await
3224 .map(crate::Response::into_body)
3225 }
3226
3227 #[deprecated]
3229 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3230 self.0.request.project_id = v.into();
3231 self
3232 }
3233
3234 #[deprecated]
3236 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3237 self.0.request.zone = v.into();
3238 self
3239 }
3240
3241 #[deprecated]
3243 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3244 self.0.request.cluster_id = v.into();
3245 self
3246 }
3247
3248 #[deprecated]
3250 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3251 self.0.request.node_pool_id = v.into();
3252 self
3253 }
3254
3255 pub fn set_node_count<T: Into<i32>>(mut self, v: T) -> Self {
3259 self.0.request.node_count = v.into();
3260 self
3261 }
3262
3263 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3265 self.0.request.name = v.into();
3266 self
3267 }
3268 }
3269
3270 #[doc(hidden)]
3271 impl crate::RequestBuilder for SetNodePoolSize {
3272 fn request_options(&mut self) -> &mut crate::RequestOptions {
3273 &mut self.0.options
3274 }
3275 }
3276
3277 #[derive(Clone, Debug)]
3294 pub struct SetNetworkPolicy(RequestBuilder<crate::model::SetNetworkPolicyRequest>);
3295
3296 impl SetNetworkPolicy {
3297 pub(crate) fn new(
3298 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3299 ) -> Self {
3300 Self(RequestBuilder::new(stub))
3301 }
3302
3303 pub fn with_request<V: Into<crate::model::SetNetworkPolicyRequest>>(
3305 mut self,
3306 v: V,
3307 ) -> Self {
3308 self.0.request = v.into();
3309 self
3310 }
3311
3312 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3314 self.0.options = v.into();
3315 self
3316 }
3317
3318 pub async fn send(self) -> Result<crate::model::Operation> {
3320 (*self.0.stub)
3321 .set_network_policy(self.0.request, self.0.options)
3322 .await
3323 .map(crate::Response::into_body)
3324 }
3325
3326 #[deprecated]
3328 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3329 self.0.request.project_id = v.into();
3330 self
3331 }
3332
3333 #[deprecated]
3335 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3336 self.0.request.zone = v.into();
3337 self
3338 }
3339
3340 #[deprecated]
3342 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3343 self.0.request.cluster_id = v.into();
3344 self
3345 }
3346
3347 pub fn set_network_policy<T>(mut self, v: T) -> Self
3351 where
3352 T: std::convert::Into<crate::model::NetworkPolicy>,
3353 {
3354 self.0.request.network_policy = std::option::Option::Some(v.into());
3355 self
3356 }
3357
3358 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
3362 where
3363 T: std::convert::Into<crate::model::NetworkPolicy>,
3364 {
3365 self.0.request.network_policy = v.map(|x| x.into());
3366 self
3367 }
3368
3369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3371 self.0.request.name = v.into();
3372 self
3373 }
3374 }
3375
3376 #[doc(hidden)]
3377 impl crate::RequestBuilder for SetNetworkPolicy {
3378 fn request_options(&mut self) -> &mut crate::RequestOptions {
3379 &mut self.0.options
3380 }
3381 }
3382
3383 #[derive(Clone, Debug)]
3400 pub struct SetMaintenancePolicy(RequestBuilder<crate::model::SetMaintenancePolicyRequest>);
3401
3402 impl SetMaintenancePolicy {
3403 pub(crate) fn new(
3404 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3405 ) -> Self {
3406 Self(RequestBuilder::new(stub))
3407 }
3408
3409 pub fn with_request<V: Into<crate::model::SetMaintenancePolicyRequest>>(
3411 mut self,
3412 v: V,
3413 ) -> Self {
3414 self.0.request = v.into();
3415 self
3416 }
3417
3418 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3420 self.0.options = v.into();
3421 self
3422 }
3423
3424 pub async fn send(self) -> Result<crate::model::Operation> {
3426 (*self.0.stub)
3427 .set_maintenance_policy(self.0.request, self.0.options)
3428 .await
3429 .map(crate::Response::into_body)
3430 }
3431
3432 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3436 self.0.request.project_id = v.into();
3437 self
3438 }
3439
3440 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3444 self.0.request.zone = v.into();
3445 self
3446 }
3447
3448 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3452 self.0.request.cluster_id = v.into();
3453 self
3454 }
3455
3456 pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
3460 where
3461 T: std::convert::Into<crate::model::MaintenancePolicy>,
3462 {
3463 self.0.request.maintenance_policy = std::option::Option::Some(v.into());
3464 self
3465 }
3466
3467 pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
3471 where
3472 T: std::convert::Into<crate::model::MaintenancePolicy>,
3473 {
3474 self.0.request.maintenance_policy = v.map(|x| x.into());
3475 self
3476 }
3477
3478 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3480 self.0.request.name = v.into();
3481 self
3482 }
3483 }
3484
3485 #[doc(hidden)]
3486 impl crate::RequestBuilder for SetMaintenancePolicy {
3487 fn request_options(&mut self) -> &mut crate::RequestOptions {
3488 &mut self.0.options
3489 }
3490 }
3491
3492 #[derive(Clone, Debug)]
3513 pub struct ListUsableSubnetworks(RequestBuilder<crate::model::ListUsableSubnetworksRequest>);
3514
3515 impl ListUsableSubnetworks {
3516 pub(crate) fn new(
3517 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3518 ) -> Self {
3519 Self(RequestBuilder::new(stub))
3520 }
3521
3522 pub fn with_request<V: Into<crate::model::ListUsableSubnetworksRequest>>(
3524 mut self,
3525 v: V,
3526 ) -> Self {
3527 self.0.request = v.into();
3528 self
3529 }
3530
3531 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3533 self.0.options = v.into();
3534 self
3535 }
3536
3537 pub async fn send(self) -> Result<crate::model::ListUsableSubnetworksResponse> {
3539 (*self.0.stub)
3540 .list_usable_subnetworks(self.0.request, self.0.options)
3541 .await
3542 .map(crate::Response::into_body)
3543 }
3544
3545 pub fn by_page(
3547 self,
3548 ) -> impl google_cloud_gax::paginator::Paginator<
3549 crate::model::ListUsableSubnetworksResponse,
3550 crate::Error,
3551 > {
3552 use std::clone::Clone;
3553 let token = self.0.request.page_token.clone();
3554 let execute = move |token: String| {
3555 let mut builder = self.clone();
3556 builder.0.request = builder.0.request.set_page_token(token);
3557 builder.send()
3558 };
3559 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3560 }
3561
3562 pub fn by_item(
3564 self,
3565 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3566 crate::model::ListUsableSubnetworksResponse,
3567 crate::Error,
3568 > {
3569 use google_cloud_gax::paginator::Paginator;
3570 self.by_page().items()
3571 }
3572
3573 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3575 self.0.request.parent = v.into();
3576 self
3577 }
3578
3579 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3581 self.0.request.filter = v.into();
3582 self
3583 }
3584
3585 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3587 self.0.request.page_size = v.into();
3588 self
3589 }
3590
3591 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3593 self.0.request.page_token = v.into();
3594 self
3595 }
3596 }
3597
3598 #[doc(hidden)]
3599 impl crate::RequestBuilder for ListUsableSubnetworks {
3600 fn request_options(&mut self) -> &mut crate::RequestOptions {
3601 &mut self.0.options
3602 }
3603 }
3604
3605 #[derive(Clone, Debug)]
3622 pub struct CheckAutopilotCompatibility(
3623 RequestBuilder<crate::model::CheckAutopilotCompatibilityRequest>,
3624 );
3625
3626 impl CheckAutopilotCompatibility {
3627 pub(crate) fn new(
3628 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3629 ) -> Self {
3630 Self(RequestBuilder::new(stub))
3631 }
3632
3633 pub fn with_request<V: Into<crate::model::CheckAutopilotCompatibilityRequest>>(
3635 mut self,
3636 v: V,
3637 ) -> Self {
3638 self.0.request = v.into();
3639 self
3640 }
3641
3642 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3644 self.0.options = v.into();
3645 self
3646 }
3647
3648 pub async fn send(self) -> Result<crate::model::CheckAutopilotCompatibilityResponse> {
3650 (*self.0.stub)
3651 .check_autopilot_compatibility(self.0.request, self.0.options)
3652 .await
3653 .map(crate::Response::into_body)
3654 }
3655
3656 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3658 self.0.request.name = v.into();
3659 self
3660 }
3661 }
3662
3663 #[doc(hidden)]
3664 impl crate::RequestBuilder for CheckAutopilotCompatibility {
3665 fn request_options(&mut self) -> &mut crate::RequestOptions {
3666 &mut self.0.options
3667 }
3668 }
3669
3670 #[derive(Clone, Debug)]
3687 pub struct FetchClusterUpgradeInfo(
3688 RequestBuilder<crate::model::FetchClusterUpgradeInfoRequest>,
3689 );
3690
3691 impl FetchClusterUpgradeInfo {
3692 pub(crate) fn new(
3693 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3694 ) -> Self {
3695 Self(RequestBuilder::new(stub))
3696 }
3697
3698 pub fn with_request<V: Into<crate::model::FetchClusterUpgradeInfoRequest>>(
3700 mut self,
3701 v: V,
3702 ) -> Self {
3703 self.0.request = v.into();
3704 self
3705 }
3706
3707 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3709 self.0.options = v.into();
3710 self
3711 }
3712
3713 pub async fn send(self) -> Result<crate::model::ClusterUpgradeInfo> {
3715 (*self.0.stub)
3716 .fetch_cluster_upgrade_info(self.0.request, self.0.options)
3717 .await
3718 .map(crate::Response::into_body)
3719 }
3720
3721 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3725 self.0.request.name = v.into();
3726 self
3727 }
3728
3729 pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
3731 self.0.request.version = v.into();
3732 self
3733 }
3734 }
3735
3736 #[doc(hidden)]
3737 impl crate::RequestBuilder for FetchClusterUpgradeInfo {
3738 fn request_options(&mut self) -> &mut crate::RequestOptions {
3739 &mut self.0.options
3740 }
3741 }
3742
3743 #[derive(Clone, Debug)]
3760 pub struct FetchNodePoolUpgradeInfo(
3761 RequestBuilder<crate::model::FetchNodePoolUpgradeInfoRequest>,
3762 );
3763
3764 impl FetchNodePoolUpgradeInfo {
3765 pub(crate) fn new(
3766 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3767 ) -> Self {
3768 Self(RequestBuilder::new(stub))
3769 }
3770
3771 pub fn with_request<V: Into<crate::model::FetchNodePoolUpgradeInfoRequest>>(
3773 mut self,
3774 v: V,
3775 ) -> Self {
3776 self.0.request = v.into();
3777 self
3778 }
3779
3780 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3782 self.0.options = v.into();
3783 self
3784 }
3785
3786 pub async fn send(self) -> Result<crate::model::NodePoolUpgradeInfo> {
3788 (*self.0.stub)
3789 .fetch_node_pool_upgrade_info(self.0.request, self.0.options)
3790 .await
3791 .map(crate::Response::into_body)
3792 }
3793
3794 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3798 self.0.request.name = v.into();
3799 self
3800 }
3801
3802 pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
3804 self.0.request.version = v.into();
3805 self
3806 }
3807 }
3808
3809 #[doc(hidden)]
3810 impl crate::RequestBuilder for FetchNodePoolUpgradeInfo {
3811 fn request_options(&mut self) -> &mut crate::RequestOptions {
3812 &mut self.0.options
3813 }
3814 }
3815}