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 pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
1027 where
1028 T: std::convert::Into<crate::model::node_pool::NodePoolMaintenancePolicy>,
1029 {
1030 self.0.request.maintenance_policy = std::option::Option::Some(v.into());
1031 self
1032 }
1033
1034 pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
1036 where
1037 T: std::convert::Into<crate::model::node_pool::NodePoolMaintenancePolicy>,
1038 {
1039 self.0.request.maintenance_policy = v.map(|x| x.into());
1040 self
1041 }
1042 }
1043
1044 #[doc(hidden)]
1045 impl crate::RequestBuilder for UpdateNodePool {
1046 fn request_options(&mut self) -> &mut crate::RequestOptions {
1047 &mut self.0.options
1048 }
1049 }
1050
1051 #[derive(Clone, Debug)]
1068 pub struct SetNodePoolAutoscaling(RequestBuilder<crate::model::SetNodePoolAutoscalingRequest>);
1069
1070 impl SetNodePoolAutoscaling {
1071 pub(crate) fn new(
1072 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1073 ) -> Self {
1074 Self(RequestBuilder::new(stub))
1075 }
1076
1077 pub fn with_request<V: Into<crate::model::SetNodePoolAutoscalingRequest>>(
1079 mut self,
1080 v: V,
1081 ) -> Self {
1082 self.0.request = v.into();
1083 self
1084 }
1085
1086 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1088 self.0.options = v.into();
1089 self
1090 }
1091
1092 pub async fn send(self) -> Result<crate::model::Operation> {
1094 (*self.0.stub)
1095 .set_node_pool_autoscaling(self.0.request, self.0.options)
1096 .await
1097 .map(crate::Response::into_body)
1098 }
1099
1100 #[deprecated]
1102 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1103 self.0.request.project_id = v.into();
1104 self
1105 }
1106
1107 #[deprecated]
1109 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1110 self.0.request.zone = v.into();
1111 self
1112 }
1113
1114 #[deprecated]
1116 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1117 self.0.request.cluster_id = v.into();
1118 self
1119 }
1120
1121 #[deprecated]
1123 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1124 self.0.request.node_pool_id = v.into();
1125 self
1126 }
1127
1128 pub fn set_autoscaling<T>(mut self, v: T) -> Self
1132 where
1133 T: std::convert::Into<crate::model::NodePoolAutoscaling>,
1134 {
1135 self.0.request.autoscaling = std::option::Option::Some(v.into());
1136 self
1137 }
1138
1139 pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
1143 where
1144 T: std::convert::Into<crate::model::NodePoolAutoscaling>,
1145 {
1146 self.0.request.autoscaling = v.map(|x| x.into());
1147 self
1148 }
1149
1150 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1152 self.0.request.name = v.into();
1153 self
1154 }
1155 }
1156
1157 #[doc(hidden)]
1158 impl crate::RequestBuilder for SetNodePoolAutoscaling {
1159 fn request_options(&mut self) -> &mut crate::RequestOptions {
1160 &mut self.0.options
1161 }
1162 }
1163
1164 #[derive(Clone, Debug)]
1181 pub struct SetLoggingService(RequestBuilder<crate::model::SetLoggingServiceRequest>);
1182
1183 impl SetLoggingService {
1184 pub(crate) fn new(
1185 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1186 ) -> Self {
1187 Self(RequestBuilder::new(stub))
1188 }
1189
1190 pub fn with_request<V: Into<crate::model::SetLoggingServiceRequest>>(
1192 mut self,
1193 v: V,
1194 ) -> Self {
1195 self.0.request = v.into();
1196 self
1197 }
1198
1199 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1201 self.0.options = v.into();
1202 self
1203 }
1204
1205 pub async fn send(self) -> Result<crate::model::Operation> {
1207 (*self.0.stub)
1208 .set_logging_service(self.0.request, self.0.options)
1209 .await
1210 .map(crate::Response::into_body)
1211 }
1212
1213 #[deprecated]
1215 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1216 self.0.request.project_id = v.into();
1217 self
1218 }
1219
1220 #[deprecated]
1222 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1223 self.0.request.zone = v.into();
1224 self
1225 }
1226
1227 #[deprecated]
1229 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1230 self.0.request.cluster_id = v.into();
1231 self
1232 }
1233
1234 pub fn set_logging_service<T: Into<std::string::String>>(mut self, v: T) -> Self {
1238 self.0.request.logging_service = v.into();
1239 self
1240 }
1241
1242 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1244 self.0.request.name = v.into();
1245 self
1246 }
1247 }
1248
1249 #[doc(hidden)]
1250 impl crate::RequestBuilder for SetLoggingService {
1251 fn request_options(&mut self) -> &mut crate::RequestOptions {
1252 &mut self.0.options
1253 }
1254 }
1255
1256 #[derive(Clone, Debug)]
1273 pub struct SetMonitoringService(RequestBuilder<crate::model::SetMonitoringServiceRequest>);
1274
1275 impl SetMonitoringService {
1276 pub(crate) fn new(
1277 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1278 ) -> Self {
1279 Self(RequestBuilder::new(stub))
1280 }
1281
1282 pub fn with_request<V: Into<crate::model::SetMonitoringServiceRequest>>(
1284 mut self,
1285 v: V,
1286 ) -> Self {
1287 self.0.request = v.into();
1288 self
1289 }
1290
1291 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1293 self.0.options = v.into();
1294 self
1295 }
1296
1297 pub async fn send(self) -> Result<crate::model::Operation> {
1299 (*self.0.stub)
1300 .set_monitoring_service(self.0.request, self.0.options)
1301 .await
1302 .map(crate::Response::into_body)
1303 }
1304
1305 #[deprecated]
1307 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1308 self.0.request.project_id = v.into();
1309 self
1310 }
1311
1312 #[deprecated]
1314 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1315 self.0.request.zone = v.into();
1316 self
1317 }
1318
1319 #[deprecated]
1321 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1322 self.0.request.cluster_id = v.into();
1323 self
1324 }
1325
1326 pub fn set_monitoring_service<T: Into<std::string::String>>(mut self, v: T) -> Self {
1330 self.0.request.monitoring_service = v.into();
1331 self
1332 }
1333
1334 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.0.request.name = v.into();
1337 self
1338 }
1339 }
1340
1341 #[doc(hidden)]
1342 impl crate::RequestBuilder for SetMonitoringService {
1343 fn request_options(&mut self) -> &mut crate::RequestOptions {
1344 &mut self.0.options
1345 }
1346 }
1347
1348 #[derive(Clone, Debug)]
1365 pub struct SetAddonsConfig(RequestBuilder<crate::model::SetAddonsConfigRequest>);
1366
1367 impl SetAddonsConfig {
1368 pub(crate) fn new(
1369 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1370 ) -> Self {
1371 Self(RequestBuilder::new(stub))
1372 }
1373
1374 pub fn with_request<V: Into<crate::model::SetAddonsConfigRequest>>(mut self, v: V) -> Self {
1376 self.0.request = v.into();
1377 self
1378 }
1379
1380 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1382 self.0.options = v.into();
1383 self
1384 }
1385
1386 pub async fn send(self) -> Result<crate::model::Operation> {
1388 (*self.0.stub)
1389 .set_addons_config(self.0.request, self.0.options)
1390 .await
1391 .map(crate::Response::into_body)
1392 }
1393
1394 #[deprecated]
1396 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1397 self.0.request.project_id = v.into();
1398 self
1399 }
1400
1401 #[deprecated]
1403 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1404 self.0.request.zone = v.into();
1405 self
1406 }
1407
1408 #[deprecated]
1410 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1411 self.0.request.cluster_id = v.into();
1412 self
1413 }
1414
1415 pub fn set_addons_config<T>(mut self, v: T) -> Self
1419 where
1420 T: std::convert::Into<crate::model::AddonsConfig>,
1421 {
1422 self.0.request.addons_config = std::option::Option::Some(v.into());
1423 self
1424 }
1425
1426 pub fn set_or_clear_addons_config<T>(mut self, v: std::option::Option<T>) -> Self
1430 where
1431 T: std::convert::Into<crate::model::AddonsConfig>,
1432 {
1433 self.0.request.addons_config = v.map(|x| x.into());
1434 self
1435 }
1436
1437 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1439 self.0.request.name = v.into();
1440 self
1441 }
1442 }
1443
1444 #[doc(hidden)]
1445 impl crate::RequestBuilder for SetAddonsConfig {
1446 fn request_options(&mut self) -> &mut crate::RequestOptions {
1447 &mut self.0.options
1448 }
1449 }
1450
1451 #[derive(Clone, Debug)]
1468 pub struct SetLocations(RequestBuilder<crate::model::SetLocationsRequest>);
1469
1470 impl SetLocations {
1471 pub(crate) fn new(
1472 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1473 ) -> Self {
1474 Self(RequestBuilder::new(stub))
1475 }
1476
1477 pub fn with_request<V: Into<crate::model::SetLocationsRequest>>(mut self, v: V) -> Self {
1479 self.0.request = v.into();
1480 self
1481 }
1482
1483 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1485 self.0.options = v.into();
1486 self
1487 }
1488
1489 pub async fn send(self) -> Result<crate::model::Operation> {
1491 (*self.0.stub)
1492 .set_locations(self.0.request, self.0.options)
1493 .await
1494 .map(crate::Response::into_body)
1495 }
1496
1497 #[deprecated]
1499 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1500 self.0.request.project_id = v.into();
1501 self
1502 }
1503
1504 #[deprecated]
1506 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1507 self.0.request.zone = v.into();
1508 self
1509 }
1510
1511 #[deprecated]
1513 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1514 self.0.request.cluster_id = v.into();
1515 self
1516 }
1517
1518 pub fn set_locations<T, V>(mut self, v: T) -> Self
1522 where
1523 T: std::iter::IntoIterator<Item = V>,
1524 V: std::convert::Into<std::string::String>,
1525 {
1526 use std::iter::Iterator;
1527 self.0.request.locations = v.into_iter().map(|i| i.into()).collect();
1528 self
1529 }
1530
1531 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1533 self.0.request.name = v.into();
1534 self
1535 }
1536 }
1537
1538 #[doc(hidden)]
1539 impl crate::RequestBuilder for SetLocations {
1540 fn request_options(&mut self) -> &mut crate::RequestOptions {
1541 &mut self.0.options
1542 }
1543 }
1544
1545 #[derive(Clone, Debug)]
1562 pub struct UpdateMaster(RequestBuilder<crate::model::UpdateMasterRequest>);
1563
1564 impl UpdateMaster {
1565 pub(crate) fn new(
1566 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1567 ) -> Self {
1568 Self(RequestBuilder::new(stub))
1569 }
1570
1571 pub fn with_request<V: Into<crate::model::UpdateMasterRequest>>(mut self, v: V) -> Self {
1573 self.0.request = v.into();
1574 self
1575 }
1576
1577 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1579 self.0.options = v.into();
1580 self
1581 }
1582
1583 pub async fn send(self) -> Result<crate::model::Operation> {
1585 (*self.0.stub)
1586 .update_master(self.0.request, self.0.options)
1587 .await
1588 .map(crate::Response::into_body)
1589 }
1590
1591 #[deprecated]
1593 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1594 self.0.request.project_id = v.into();
1595 self
1596 }
1597
1598 #[deprecated]
1600 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1601 self.0.request.zone = v.into();
1602 self
1603 }
1604
1605 #[deprecated]
1607 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1608 self.0.request.cluster_id = v.into();
1609 self
1610 }
1611
1612 pub fn set_master_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1616 self.0.request.master_version = v.into();
1617 self
1618 }
1619
1620 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1622 self.0.request.name = v.into();
1623 self
1624 }
1625 }
1626
1627 #[doc(hidden)]
1628 impl crate::RequestBuilder for UpdateMaster {
1629 fn request_options(&mut self) -> &mut crate::RequestOptions {
1630 &mut self.0.options
1631 }
1632 }
1633
1634 #[derive(Clone, Debug)]
1651 pub struct SetMasterAuth(RequestBuilder<crate::model::SetMasterAuthRequest>);
1652
1653 impl SetMasterAuth {
1654 pub(crate) fn new(
1655 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1656 ) -> Self {
1657 Self(RequestBuilder::new(stub))
1658 }
1659
1660 pub fn with_request<V: Into<crate::model::SetMasterAuthRequest>>(mut self, v: V) -> Self {
1662 self.0.request = v.into();
1663 self
1664 }
1665
1666 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1668 self.0.options = v.into();
1669 self
1670 }
1671
1672 pub async fn send(self) -> Result<crate::model::Operation> {
1674 (*self.0.stub)
1675 .set_master_auth(self.0.request, self.0.options)
1676 .await
1677 .map(crate::Response::into_body)
1678 }
1679
1680 #[deprecated]
1682 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1683 self.0.request.project_id = v.into();
1684 self
1685 }
1686
1687 #[deprecated]
1689 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1690 self.0.request.zone = v.into();
1691 self
1692 }
1693
1694 #[deprecated]
1696 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1697 self.0.request.cluster_id = v.into();
1698 self
1699 }
1700
1701 pub fn set_action<T: Into<crate::model::set_master_auth_request::Action>>(
1705 mut self,
1706 v: T,
1707 ) -> Self {
1708 self.0.request.action = v.into();
1709 self
1710 }
1711
1712 pub fn set_update<T>(mut self, v: T) -> Self
1716 where
1717 T: std::convert::Into<crate::model::MasterAuth>,
1718 {
1719 self.0.request.update = std::option::Option::Some(v.into());
1720 self
1721 }
1722
1723 pub fn set_or_clear_update<T>(mut self, v: std::option::Option<T>) -> Self
1727 where
1728 T: std::convert::Into<crate::model::MasterAuth>,
1729 {
1730 self.0.request.update = v.map(|x| x.into());
1731 self
1732 }
1733
1734 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1736 self.0.request.name = v.into();
1737 self
1738 }
1739 }
1740
1741 #[doc(hidden)]
1742 impl crate::RequestBuilder for SetMasterAuth {
1743 fn request_options(&mut self) -> &mut crate::RequestOptions {
1744 &mut self.0.options
1745 }
1746 }
1747
1748 #[derive(Clone, Debug)]
1765 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
1766
1767 impl DeleteCluster {
1768 pub(crate) fn new(
1769 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1770 ) -> Self {
1771 Self(RequestBuilder::new(stub))
1772 }
1773
1774 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
1776 self.0.request = v.into();
1777 self
1778 }
1779
1780 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1782 self.0.options = v.into();
1783 self
1784 }
1785
1786 pub async fn send(self) -> Result<crate::model::Operation> {
1788 (*self.0.stub)
1789 .delete_cluster(self.0.request, self.0.options)
1790 .await
1791 .map(crate::Response::into_body)
1792 }
1793
1794 #[deprecated]
1796 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1797 self.0.request.project_id = v.into();
1798 self
1799 }
1800
1801 #[deprecated]
1803 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1804 self.0.request.zone = v.into();
1805 self
1806 }
1807
1808 #[deprecated]
1810 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1811 self.0.request.cluster_id = v.into();
1812 self
1813 }
1814
1815 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1817 self.0.request.name = v.into();
1818 self
1819 }
1820 }
1821
1822 #[doc(hidden)]
1823 impl crate::RequestBuilder for DeleteCluster {
1824 fn request_options(&mut self) -> &mut crate::RequestOptions {
1825 &mut self.0.options
1826 }
1827 }
1828
1829 #[derive(Clone, Debug)]
1846 pub struct ListOperations(RequestBuilder<crate::model::ListOperationsRequest>);
1847
1848 impl ListOperations {
1849 pub(crate) fn new(
1850 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1851 ) -> Self {
1852 Self(RequestBuilder::new(stub))
1853 }
1854
1855 pub fn with_request<V: Into<crate::model::ListOperationsRequest>>(mut self, v: V) -> Self {
1857 self.0.request = v.into();
1858 self
1859 }
1860
1861 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1863 self.0.options = v.into();
1864 self
1865 }
1866
1867 pub async fn send(self) -> Result<crate::model::ListOperationsResponse> {
1869 (*self.0.stub)
1870 .list_operations(self.0.request, self.0.options)
1871 .await
1872 .map(crate::Response::into_body)
1873 }
1874
1875 #[deprecated]
1877 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1878 self.0.request.project_id = v.into();
1879 self
1880 }
1881
1882 #[deprecated]
1884 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1885 self.0.request.zone = v.into();
1886 self
1887 }
1888
1889 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1891 self.0.request.parent = v.into();
1892 self
1893 }
1894 }
1895
1896 #[doc(hidden)]
1897 impl crate::RequestBuilder for ListOperations {
1898 fn request_options(&mut self) -> &mut crate::RequestOptions {
1899 &mut self.0.options
1900 }
1901 }
1902
1903 #[derive(Clone, Debug)]
1920 pub struct GetOperation(RequestBuilder<crate::model::GetOperationRequest>);
1921
1922 impl GetOperation {
1923 pub(crate) fn new(
1924 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
1925 ) -> Self {
1926 Self(RequestBuilder::new(stub))
1927 }
1928
1929 pub fn with_request<V: Into<crate::model::GetOperationRequest>>(mut self, v: V) -> Self {
1931 self.0.request = v.into();
1932 self
1933 }
1934
1935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1937 self.0.options = v.into();
1938 self
1939 }
1940
1941 pub async fn send(self) -> Result<crate::model::Operation> {
1943 (*self.0.stub)
1944 .get_operation(self.0.request, self.0.options)
1945 .await
1946 .map(crate::Response::into_body)
1947 }
1948
1949 #[deprecated]
1951 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1952 self.0.request.project_id = v.into();
1953 self
1954 }
1955
1956 #[deprecated]
1958 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1959 self.0.request.zone = v.into();
1960 self
1961 }
1962
1963 #[deprecated]
1965 pub fn set_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1966 self.0.request.operation_id = v.into();
1967 self
1968 }
1969
1970 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1972 self.0.request.name = v.into();
1973 self
1974 }
1975 }
1976
1977 #[doc(hidden)]
1978 impl crate::RequestBuilder for GetOperation {
1979 fn request_options(&mut self) -> &mut crate::RequestOptions {
1980 &mut self.0.options
1981 }
1982 }
1983
1984 #[derive(Clone, Debug)]
2001 pub struct CancelOperation(RequestBuilder<crate::model::CancelOperationRequest>);
2002
2003 impl CancelOperation {
2004 pub(crate) fn new(
2005 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2006 ) -> Self {
2007 Self(RequestBuilder::new(stub))
2008 }
2009
2010 pub fn with_request<V: Into<crate::model::CancelOperationRequest>>(mut self, v: V) -> Self {
2012 self.0.request = v.into();
2013 self
2014 }
2015
2016 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2018 self.0.options = v.into();
2019 self
2020 }
2021
2022 pub async fn send(self) -> Result<()> {
2024 (*self.0.stub)
2025 .cancel_operation(self.0.request, self.0.options)
2026 .await
2027 .map(crate::Response::into_body)
2028 }
2029
2030 #[deprecated]
2032 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2033 self.0.request.project_id = v.into();
2034 self
2035 }
2036
2037 #[deprecated]
2039 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2040 self.0.request.zone = v.into();
2041 self
2042 }
2043
2044 #[deprecated]
2046 pub fn set_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2047 self.0.request.operation_id = v.into();
2048 self
2049 }
2050
2051 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2053 self.0.request.name = v.into();
2054 self
2055 }
2056 }
2057
2058 #[doc(hidden)]
2059 impl crate::RequestBuilder for CancelOperation {
2060 fn request_options(&mut self) -> &mut crate::RequestOptions {
2061 &mut self.0.options
2062 }
2063 }
2064
2065 #[derive(Clone, Debug)]
2082 pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
2083
2084 impl GetServerConfig {
2085 pub(crate) fn new(
2086 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2087 ) -> Self {
2088 Self(RequestBuilder::new(stub))
2089 }
2090
2091 pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
2093 self.0.request = v.into();
2094 self
2095 }
2096
2097 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2099 self.0.options = v.into();
2100 self
2101 }
2102
2103 pub async fn send(self) -> Result<crate::model::ServerConfig> {
2105 (*self.0.stub)
2106 .get_server_config(self.0.request, self.0.options)
2107 .await
2108 .map(crate::Response::into_body)
2109 }
2110
2111 #[deprecated]
2113 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2114 self.0.request.project_id = v.into();
2115 self
2116 }
2117
2118 #[deprecated]
2120 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2121 self.0.request.zone = v.into();
2122 self
2123 }
2124
2125 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2127 self.0.request.name = v.into();
2128 self
2129 }
2130 }
2131
2132 #[doc(hidden)]
2133 impl crate::RequestBuilder for GetServerConfig {
2134 fn request_options(&mut self) -> &mut crate::RequestOptions {
2135 &mut self.0.options
2136 }
2137 }
2138
2139 #[derive(Clone, Debug)]
2156 pub struct GetJSONWebKeys(RequestBuilder<crate::model::GetJSONWebKeysRequest>);
2157
2158 impl GetJSONWebKeys {
2159 pub(crate) fn new(
2160 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2161 ) -> Self {
2162 Self(RequestBuilder::new(stub))
2163 }
2164
2165 pub fn with_request<V: Into<crate::model::GetJSONWebKeysRequest>>(mut self, v: V) -> Self {
2167 self.0.request = v.into();
2168 self
2169 }
2170
2171 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2173 self.0.options = v.into();
2174 self
2175 }
2176
2177 pub async fn send(self) -> Result<crate::model::GetJSONWebKeysResponse> {
2179 (*self.0.stub)
2180 .get_json_web_keys(self.0.request, self.0.options)
2181 .await
2182 .map(crate::Response::into_body)
2183 }
2184
2185 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2187 self.0.request.parent = v.into();
2188 self
2189 }
2190 }
2191
2192 #[doc(hidden)]
2193 impl crate::RequestBuilder for GetJSONWebKeys {
2194 fn request_options(&mut self) -> &mut crate::RequestOptions {
2195 &mut self.0.options
2196 }
2197 }
2198
2199 #[derive(Clone, Debug)]
2216 pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
2217
2218 impl ListNodePools {
2219 pub(crate) fn new(
2220 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2221 ) -> Self {
2222 Self(RequestBuilder::new(stub))
2223 }
2224
2225 pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
2227 self.0.request = v.into();
2228 self
2229 }
2230
2231 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2233 self.0.options = v.into();
2234 self
2235 }
2236
2237 pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
2239 (*self.0.stub)
2240 .list_node_pools(self.0.request, self.0.options)
2241 .await
2242 .map(crate::Response::into_body)
2243 }
2244
2245 #[deprecated]
2247 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2248 self.0.request.project_id = v.into();
2249 self
2250 }
2251
2252 #[deprecated]
2254 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2255 self.0.request.zone = v.into();
2256 self
2257 }
2258
2259 #[deprecated]
2261 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2262 self.0.request.cluster_id = v.into();
2263 self
2264 }
2265
2266 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2268 self.0.request.parent = v.into();
2269 self
2270 }
2271 }
2272
2273 #[doc(hidden)]
2274 impl crate::RequestBuilder for ListNodePools {
2275 fn request_options(&mut self) -> &mut crate::RequestOptions {
2276 &mut self.0.options
2277 }
2278 }
2279
2280 #[derive(Clone, Debug)]
2297 pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
2298
2299 impl GetNodePool {
2300 pub(crate) fn new(
2301 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2302 ) -> Self {
2303 Self(RequestBuilder::new(stub))
2304 }
2305
2306 pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
2308 self.0.request = v.into();
2309 self
2310 }
2311
2312 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2314 self.0.options = v.into();
2315 self
2316 }
2317
2318 pub async fn send(self) -> Result<crate::model::NodePool> {
2320 (*self.0.stub)
2321 .get_node_pool(self.0.request, self.0.options)
2322 .await
2323 .map(crate::Response::into_body)
2324 }
2325
2326 #[deprecated]
2328 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2329 self.0.request.project_id = v.into();
2330 self
2331 }
2332
2333 #[deprecated]
2335 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2336 self.0.request.zone = v.into();
2337 self
2338 }
2339
2340 #[deprecated]
2342 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2343 self.0.request.cluster_id = v.into();
2344 self
2345 }
2346
2347 #[deprecated]
2349 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2350 self.0.request.node_pool_id = v.into();
2351 self
2352 }
2353
2354 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2356 self.0.request.name = v.into();
2357 self
2358 }
2359 }
2360
2361 #[doc(hidden)]
2362 impl crate::RequestBuilder for GetNodePool {
2363 fn request_options(&mut self) -> &mut crate::RequestOptions {
2364 &mut self.0.options
2365 }
2366 }
2367
2368 #[derive(Clone, Debug)]
2385 pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
2386
2387 impl CreateNodePool {
2388 pub(crate) fn new(
2389 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2390 ) -> Self {
2391 Self(RequestBuilder::new(stub))
2392 }
2393
2394 pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
2396 self.0.request = v.into();
2397 self
2398 }
2399
2400 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2402 self.0.options = v.into();
2403 self
2404 }
2405
2406 pub async fn send(self) -> Result<crate::model::Operation> {
2408 (*self.0.stub)
2409 .create_node_pool(self.0.request, self.0.options)
2410 .await
2411 .map(crate::Response::into_body)
2412 }
2413
2414 #[deprecated]
2416 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2417 self.0.request.project_id = v.into();
2418 self
2419 }
2420
2421 #[deprecated]
2423 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2424 self.0.request.zone = v.into();
2425 self
2426 }
2427
2428 #[deprecated]
2430 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2431 self.0.request.cluster_id = v.into();
2432 self
2433 }
2434
2435 pub fn set_node_pool<T>(mut self, v: T) -> Self
2439 where
2440 T: std::convert::Into<crate::model::NodePool>,
2441 {
2442 self.0.request.node_pool = std::option::Option::Some(v.into());
2443 self
2444 }
2445
2446 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
2450 where
2451 T: std::convert::Into<crate::model::NodePool>,
2452 {
2453 self.0.request.node_pool = v.map(|x| x.into());
2454 self
2455 }
2456
2457 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2459 self.0.request.parent = v.into();
2460 self
2461 }
2462 }
2463
2464 #[doc(hidden)]
2465 impl crate::RequestBuilder for CreateNodePool {
2466 fn request_options(&mut self) -> &mut crate::RequestOptions {
2467 &mut self.0.options
2468 }
2469 }
2470
2471 #[derive(Clone, Debug)]
2488 pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
2489
2490 impl DeleteNodePool {
2491 pub(crate) fn new(
2492 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2493 ) -> Self {
2494 Self(RequestBuilder::new(stub))
2495 }
2496
2497 pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
2499 self.0.request = v.into();
2500 self
2501 }
2502
2503 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2505 self.0.options = v.into();
2506 self
2507 }
2508
2509 pub async fn send(self) -> Result<crate::model::Operation> {
2511 (*self.0.stub)
2512 .delete_node_pool(self.0.request, self.0.options)
2513 .await
2514 .map(crate::Response::into_body)
2515 }
2516
2517 #[deprecated]
2519 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2520 self.0.request.project_id = v.into();
2521 self
2522 }
2523
2524 #[deprecated]
2526 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2527 self.0.request.zone = v.into();
2528 self
2529 }
2530
2531 #[deprecated]
2533 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2534 self.0.request.cluster_id = v.into();
2535 self
2536 }
2537
2538 #[deprecated]
2540 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2541 self.0.request.node_pool_id = v.into();
2542 self
2543 }
2544
2545 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2547 self.0.request.name = v.into();
2548 self
2549 }
2550 }
2551
2552 #[doc(hidden)]
2553 impl crate::RequestBuilder for DeleteNodePool {
2554 fn request_options(&mut self) -> &mut crate::RequestOptions {
2555 &mut self.0.options
2556 }
2557 }
2558
2559 #[derive(Clone, Debug)]
2576 pub struct CompleteNodePoolUpgrade(
2577 RequestBuilder<crate::model::CompleteNodePoolUpgradeRequest>,
2578 );
2579
2580 impl CompleteNodePoolUpgrade {
2581 pub(crate) fn new(
2582 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2583 ) -> Self {
2584 Self(RequestBuilder::new(stub))
2585 }
2586
2587 pub fn with_request<V: Into<crate::model::CompleteNodePoolUpgradeRequest>>(
2589 mut self,
2590 v: V,
2591 ) -> Self {
2592 self.0.request = v.into();
2593 self
2594 }
2595
2596 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2598 self.0.options = v.into();
2599 self
2600 }
2601
2602 pub async fn send(self) -> Result<()> {
2604 (*self.0.stub)
2605 .complete_node_pool_upgrade(self.0.request, self.0.options)
2606 .await
2607 .map(crate::Response::into_body)
2608 }
2609
2610 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2612 self.0.request.name = v.into();
2613 self
2614 }
2615 }
2616
2617 #[doc(hidden)]
2618 impl crate::RequestBuilder for CompleteNodePoolUpgrade {
2619 fn request_options(&mut self) -> &mut crate::RequestOptions {
2620 &mut self.0.options
2621 }
2622 }
2623
2624 #[derive(Clone, Debug)]
2641 pub struct RollbackNodePoolUpgrade(
2642 RequestBuilder<crate::model::RollbackNodePoolUpgradeRequest>,
2643 );
2644
2645 impl RollbackNodePoolUpgrade {
2646 pub(crate) fn new(
2647 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2648 ) -> Self {
2649 Self(RequestBuilder::new(stub))
2650 }
2651
2652 pub fn with_request<V: Into<crate::model::RollbackNodePoolUpgradeRequest>>(
2654 mut self,
2655 v: V,
2656 ) -> Self {
2657 self.0.request = v.into();
2658 self
2659 }
2660
2661 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2663 self.0.options = v.into();
2664 self
2665 }
2666
2667 pub async fn send(self) -> Result<crate::model::Operation> {
2669 (*self.0.stub)
2670 .rollback_node_pool_upgrade(self.0.request, self.0.options)
2671 .await
2672 .map(crate::Response::into_body)
2673 }
2674
2675 #[deprecated]
2677 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2678 self.0.request.project_id = v.into();
2679 self
2680 }
2681
2682 #[deprecated]
2684 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2685 self.0.request.zone = v.into();
2686 self
2687 }
2688
2689 #[deprecated]
2691 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2692 self.0.request.cluster_id = v.into();
2693 self
2694 }
2695
2696 #[deprecated]
2698 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2699 self.0.request.node_pool_id = v.into();
2700 self
2701 }
2702
2703 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2705 self.0.request.name = v.into();
2706 self
2707 }
2708
2709 pub fn set_respect_pdb<T: Into<bool>>(mut self, v: T) -> Self {
2711 self.0.request.respect_pdb = v.into();
2712 self
2713 }
2714 }
2715
2716 #[doc(hidden)]
2717 impl crate::RequestBuilder for RollbackNodePoolUpgrade {
2718 fn request_options(&mut self) -> &mut crate::RequestOptions {
2719 &mut self.0.options
2720 }
2721 }
2722
2723 #[derive(Clone, Debug)]
2740 pub struct SetNodePoolManagement(RequestBuilder<crate::model::SetNodePoolManagementRequest>);
2741
2742 impl SetNodePoolManagement {
2743 pub(crate) fn new(
2744 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2745 ) -> Self {
2746 Self(RequestBuilder::new(stub))
2747 }
2748
2749 pub fn with_request<V: Into<crate::model::SetNodePoolManagementRequest>>(
2751 mut self,
2752 v: V,
2753 ) -> Self {
2754 self.0.request = v.into();
2755 self
2756 }
2757
2758 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2760 self.0.options = v.into();
2761 self
2762 }
2763
2764 pub async fn send(self) -> Result<crate::model::Operation> {
2766 (*self.0.stub)
2767 .set_node_pool_management(self.0.request, self.0.options)
2768 .await
2769 .map(crate::Response::into_body)
2770 }
2771
2772 #[deprecated]
2774 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2775 self.0.request.project_id = v.into();
2776 self
2777 }
2778
2779 #[deprecated]
2781 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2782 self.0.request.zone = v.into();
2783 self
2784 }
2785
2786 #[deprecated]
2788 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2789 self.0.request.cluster_id = v.into();
2790 self
2791 }
2792
2793 #[deprecated]
2795 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2796 self.0.request.node_pool_id = v.into();
2797 self
2798 }
2799
2800 pub fn set_management<T>(mut self, v: T) -> Self
2804 where
2805 T: std::convert::Into<crate::model::NodeManagement>,
2806 {
2807 self.0.request.management = std::option::Option::Some(v.into());
2808 self
2809 }
2810
2811 pub fn set_or_clear_management<T>(mut self, v: std::option::Option<T>) -> Self
2815 where
2816 T: std::convert::Into<crate::model::NodeManagement>,
2817 {
2818 self.0.request.management = v.map(|x| x.into());
2819 self
2820 }
2821
2822 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2824 self.0.request.name = v.into();
2825 self
2826 }
2827 }
2828
2829 #[doc(hidden)]
2830 impl crate::RequestBuilder for SetNodePoolManagement {
2831 fn request_options(&mut self) -> &mut crate::RequestOptions {
2832 &mut self.0.options
2833 }
2834 }
2835
2836 #[derive(Clone, Debug)]
2853 pub struct SetLabels(RequestBuilder<crate::model::SetLabelsRequest>);
2854
2855 impl SetLabels {
2856 pub(crate) fn new(
2857 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2858 ) -> Self {
2859 Self(RequestBuilder::new(stub))
2860 }
2861
2862 pub fn with_request<V: Into<crate::model::SetLabelsRequest>>(mut self, v: V) -> Self {
2864 self.0.request = v.into();
2865 self
2866 }
2867
2868 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2870 self.0.options = v.into();
2871 self
2872 }
2873
2874 pub async fn send(self) -> Result<crate::model::Operation> {
2876 (*self.0.stub)
2877 .set_labels(self.0.request, self.0.options)
2878 .await
2879 .map(crate::Response::into_body)
2880 }
2881
2882 #[deprecated]
2884 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2885 self.0.request.project_id = v.into();
2886 self
2887 }
2888
2889 #[deprecated]
2891 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2892 self.0.request.zone = v.into();
2893 self
2894 }
2895
2896 #[deprecated]
2898 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2899 self.0.request.cluster_id = v.into();
2900 self
2901 }
2902
2903 pub fn set_resource_labels<T, K, V>(mut self, v: T) -> Self
2907 where
2908 T: std::iter::IntoIterator<Item = (K, V)>,
2909 K: std::convert::Into<std::string::String>,
2910 V: std::convert::Into<std::string::String>,
2911 {
2912 self.0.request.resource_labels =
2913 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2914 self
2915 }
2916
2917 pub fn set_label_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
2921 self.0.request.label_fingerprint = v.into();
2922 self
2923 }
2924
2925 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2927 self.0.request.name = v.into();
2928 self
2929 }
2930 }
2931
2932 #[doc(hidden)]
2933 impl crate::RequestBuilder for SetLabels {
2934 fn request_options(&mut self) -> &mut crate::RequestOptions {
2935 &mut self.0.options
2936 }
2937 }
2938
2939 #[derive(Clone, Debug)]
2956 pub struct SetLegacyAbac(RequestBuilder<crate::model::SetLegacyAbacRequest>);
2957
2958 impl SetLegacyAbac {
2959 pub(crate) fn new(
2960 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
2961 ) -> Self {
2962 Self(RequestBuilder::new(stub))
2963 }
2964
2965 pub fn with_request<V: Into<crate::model::SetLegacyAbacRequest>>(mut self, v: V) -> Self {
2967 self.0.request = v.into();
2968 self
2969 }
2970
2971 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2973 self.0.options = v.into();
2974 self
2975 }
2976
2977 pub async fn send(self) -> Result<crate::model::Operation> {
2979 (*self.0.stub)
2980 .set_legacy_abac(self.0.request, self.0.options)
2981 .await
2982 .map(crate::Response::into_body)
2983 }
2984
2985 #[deprecated]
2987 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2988 self.0.request.project_id = v.into();
2989 self
2990 }
2991
2992 #[deprecated]
2994 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2995 self.0.request.zone = v.into();
2996 self
2997 }
2998
2999 #[deprecated]
3001 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3002 self.0.request.cluster_id = v.into();
3003 self
3004 }
3005
3006 pub fn set_enabled<T: Into<bool>>(mut self, v: T) -> Self {
3010 self.0.request.enabled = v.into();
3011 self
3012 }
3013
3014 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3016 self.0.request.name = v.into();
3017 self
3018 }
3019 }
3020
3021 #[doc(hidden)]
3022 impl crate::RequestBuilder for SetLegacyAbac {
3023 fn request_options(&mut self) -> &mut crate::RequestOptions {
3024 &mut self.0.options
3025 }
3026 }
3027
3028 #[derive(Clone, Debug)]
3045 pub struct StartIPRotation(RequestBuilder<crate::model::StartIPRotationRequest>);
3046
3047 impl StartIPRotation {
3048 pub(crate) fn new(
3049 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3050 ) -> Self {
3051 Self(RequestBuilder::new(stub))
3052 }
3053
3054 pub fn with_request<V: Into<crate::model::StartIPRotationRequest>>(mut self, v: V) -> Self {
3056 self.0.request = v.into();
3057 self
3058 }
3059
3060 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3062 self.0.options = v.into();
3063 self
3064 }
3065
3066 pub async fn send(self) -> Result<crate::model::Operation> {
3068 (*self.0.stub)
3069 .start_ip_rotation(self.0.request, self.0.options)
3070 .await
3071 .map(crate::Response::into_body)
3072 }
3073
3074 #[deprecated]
3076 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3077 self.0.request.project_id = v.into();
3078 self
3079 }
3080
3081 #[deprecated]
3083 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3084 self.0.request.zone = v.into();
3085 self
3086 }
3087
3088 #[deprecated]
3090 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3091 self.0.request.cluster_id = v.into();
3092 self
3093 }
3094
3095 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3097 self.0.request.name = v.into();
3098 self
3099 }
3100
3101 pub fn set_rotate_credentials<T: Into<bool>>(mut self, v: T) -> Self {
3103 self.0.request.rotate_credentials = v.into();
3104 self
3105 }
3106 }
3107
3108 #[doc(hidden)]
3109 impl crate::RequestBuilder for StartIPRotation {
3110 fn request_options(&mut self) -> &mut crate::RequestOptions {
3111 &mut self.0.options
3112 }
3113 }
3114
3115 #[derive(Clone, Debug)]
3132 pub struct CompleteIPRotation(RequestBuilder<crate::model::CompleteIPRotationRequest>);
3133
3134 impl CompleteIPRotation {
3135 pub(crate) fn new(
3136 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3137 ) -> Self {
3138 Self(RequestBuilder::new(stub))
3139 }
3140
3141 pub fn with_request<V: Into<crate::model::CompleteIPRotationRequest>>(
3143 mut self,
3144 v: V,
3145 ) -> Self {
3146 self.0.request = v.into();
3147 self
3148 }
3149
3150 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3152 self.0.options = v.into();
3153 self
3154 }
3155
3156 pub async fn send(self) -> Result<crate::model::Operation> {
3158 (*self.0.stub)
3159 .complete_ip_rotation(self.0.request, self.0.options)
3160 .await
3161 .map(crate::Response::into_body)
3162 }
3163
3164 #[deprecated]
3166 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3167 self.0.request.project_id = v.into();
3168 self
3169 }
3170
3171 #[deprecated]
3173 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3174 self.0.request.zone = v.into();
3175 self
3176 }
3177
3178 #[deprecated]
3180 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3181 self.0.request.cluster_id = v.into();
3182 self
3183 }
3184
3185 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3187 self.0.request.name = v.into();
3188 self
3189 }
3190 }
3191
3192 #[doc(hidden)]
3193 impl crate::RequestBuilder for CompleteIPRotation {
3194 fn request_options(&mut self) -> &mut crate::RequestOptions {
3195 &mut self.0.options
3196 }
3197 }
3198
3199 #[derive(Clone, Debug)]
3216 pub struct SetNodePoolSize(RequestBuilder<crate::model::SetNodePoolSizeRequest>);
3217
3218 impl SetNodePoolSize {
3219 pub(crate) fn new(
3220 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3221 ) -> Self {
3222 Self(RequestBuilder::new(stub))
3223 }
3224
3225 pub fn with_request<V: Into<crate::model::SetNodePoolSizeRequest>>(mut self, v: V) -> Self {
3227 self.0.request = v.into();
3228 self
3229 }
3230
3231 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3233 self.0.options = v.into();
3234 self
3235 }
3236
3237 pub async fn send(self) -> Result<crate::model::Operation> {
3239 (*self.0.stub)
3240 .set_node_pool_size(self.0.request, self.0.options)
3241 .await
3242 .map(crate::Response::into_body)
3243 }
3244
3245 #[deprecated]
3247 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3248 self.0.request.project_id = v.into();
3249 self
3250 }
3251
3252 #[deprecated]
3254 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3255 self.0.request.zone = v.into();
3256 self
3257 }
3258
3259 #[deprecated]
3261 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3262 self.0.request.cluster_id = v.into();
3263 self
3264 }
3265
3266 #[deprecated]
3268 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3269 self.0.request.node_pool_id = v.into();
3270 self
3271 }
3272
3273 pub fn set_node_count<T: Into<i32>>(mut self, v: T) -> Self {
3277 self.0.request.node_count = v.into();
3278 self
3279 }
3280
3281 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3283 self.0.request.name = v.into();
3284 self
3285 }
3286 }
3287
3288 #[doc(hidden)]
3289 impl crate::RequestBuilder for SetNodePoolSize {
3290 fn request_options(&mut self) -> &mut crate::RequestOptions {
3291 &mut self.0.options
3292 }
3293 }
3294
3295 #[derive(Clone, Debug)]
3312 pub struct SetNetworkPolicy(RequestBuilder<crate::model::SetNetworkPolicyRequest>);
3313
3314 impl SetNetworkPolicy {
3315 pub(crate) fn new(
3316 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3317 ) -> Self {
3318 Self(RequestBuilder::new(stub))
3319 }
3320
3321 pub fn with_request<V: Into<crate::model::SetNetworkPolicyRequest>>(
3323 mut self,
3324 v: V,
3325 ) -> Self {
3326 self.0.request = v.into();
3327 self
3328 }
3329
3330 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3332 self.0.options = v.into();
3333 self
3334 }
3335
3336 pub async fn send(self) -> Result<crate::model::Operation> {
3338 (*self.0.stub)
3339 .set_network_policy(self.0.request, self.0.options)
3340 .await
3341 .map(crate::Response::into_body)
3342 }
3343
3344 #[deprecated]
3346 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3347 self.0.request.project_id = v.into();
3348 self
3349 }
3350
3351 #[deprecated]
3353 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3354 self.0.request.zone = v.into();
3355 self
3356 }
3357
3358 #[deprecated]
3360 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3361 self.0.request.cluster_id = v.into();
3362 self
3363 }
3364
3365 pub fn set_network_policy<T>(mut self, v: T) -> Self
3369 where
3370 T: std::convert::Into<crate::model::NetworkPolicy>,
3371 {
3372 self.0.request.network_policy = std::option::Option::Some(v.into());
3373 self
3374 }
3375
3376 pub fn set_or_clear_network_policy<T>(mut self, v: std::option::Option<T>) -> Self
3380 where
3381 T: std::convert::Into<crate::model::NetworkPolicy>,
3382 {
3383 self.0.request.network_policy = v.map(|x| x.into());
3384 self
3385 }
3386
3387 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3389 self.0.request.name = v.into();
3390 self
3391 }
3392 }
3393
3394 #[doc(hidden)]
3395 impl crate::RequestBuilder for SetNetworkPolicy {
3396 fn request_options(&mut self) -> &mut crate::RequestOptions {
3397 &mut self.0.options
3398 }
3399 }
3400
3401 #[derive(Clone, Debug)]
3418 pub struct SetMaintenancePolicy(RequestBuilder<crate::model::SetMaintenancePolicyRequest>);
3419
3420 impl SetMaintenancePolicy {
3421 pub(crate) fn new(
3422 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3423 ) -> Self {
3424 Self(RequestBuilder::new(stub))
3425 }
3426
3427 pub fn with_request<V: Into<crate::model::SetMaintenancePolicyRequest>>(
3429 mut self,
3430 v: V,
3431 ) -> Self {
3432 self.0.request = v.into();
3433 self
3434 }
3435
3436 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3438 self.0.options = v.into();
3439 self
3440 }
3441
3442 pub async fn send(self) -> Result<crate::model::Operation> {
3444 (*self.0.stub)
3445 .set_maintenance_policy(self.0.request, self.0.options)
3446 .await
3447 .map(crate::Response::into_body)
3448 }
3449
3450 pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3454 self.0.request.project_id = v.into();
3455 self
3456 }
3457
3458 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3462 self.0.request.zone = v.into();
3463 self
3464 }
3465
3466 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3470 self.0.request.cluster_id = v.into();
3471 self
3472 }
3473
3474 pub fn set_maintenance_policy<T>(mut self, v: T) -> Self
3478 where
3479 T: std::convert::Into<crate::model::MaintenancePolicy>,
3480 {
3481 self.0.request.maintenance_policy = std::option::Option::Some(v.into());
3482 self
3483 }
3484
3485 pub fn set_or_clear_maintenance_policy<T>(mut self, v: std::option::Option<T>) -> Self
3489 where
3490 T: std::convert::Into<crate::model::MaintenancePolicy>,
3491 {
3492 self.0.request.maintenance_policy = v.map(|x| x.into());
3493 self
3494 }
3495
3496 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3498 self.0.request.name = v.into();
3499 self
3500 }
3501 }
3502
3503 #[doc(hidden)]
3504 impl crate::RequestBuilder for SetMaintenancePolicy {
3505 fn request_options(&mut self) -> &mut crate::RequestOptions {
3506 &mut self.0.options
3507 }
3508 }
3509
3510 #[derive(Clone, Debug)]
3531 pub struct ListUsableSubnetworks(RequestBuilder<crate::model::ListUsableSubnetworksRequest>);
3532
3533 impl ListUsableSubnetworks {
3534 pub(crate) fn new(
3535 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3536 ) -> Self {
3537 Self(RequestBuilder::new(stub))
3538 }
3539
3540 pub fn with_request<V: Into<crate::model::ListUsableSubnetworksRequest>>(
3542 mut self,
3543 v: V,
3544 ) -> Self {
3545 self.0.request = v.into();
3546 self
3547 }
3548
3549 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3551 self.0.options = v.into();
3552 self
3553 }
3554
3555 pub async fn send(self) -> Result<crate::model::ListUsableSubnetworksResponse> {
3557 (*self.0.stub)
3558 .list_usable_subnetworks(self.0.request, self.0.options)
3559 .await
3560 .map(crate::Response::into_body)
3561 }
3562
3563 pub fn by_page(
3565 self,
3566 ) -> impl google_cloud_gax::paginator::Paginator<
3567 crate::model::ListUsableSubnetworksResponse,
3568 crate::Error,
3569 > {
3570 use std::clone::Clone;
3571 let token = self.0.request.page_token.clone();
3572 let execute = move |token: String| {
3573 let mut builder = self.clone();
3574 builder.0.request = builder.0.request.set_page_token(token);
3575 builder.send()
3576 };
3577 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3578 }
3579
3580 pub fn by_item(
3582 self,
3583 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3584 crate::model::ListUsableSubnetworksResponse,
3585 crate::Error,
3586 > {
3587 use google_cloud_gax::paginator::Paginator;
3588 self.by_page().items()
3589 }
3590
3591 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3593 self.0.request.parent = v.into();
3594 self
3595 }
3596
3597 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3599 self.0.request.filter = v.into();
3600 self
3601 }
3602
3603 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3605 self.0.request.page_size = v.into();
3606 self
3607 }
3608
3609 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3611 self.0.request.page_token = v.into();
3612 self
3613 }
3614 }
3615
3616 #[doc(hidden)]
3617 impl crate::RequestBuilder for ListUsableSubnetworks {
3618 fn request_options(&mut self) -> &mut crate::RequestOptions {
3619 &mut self.0.options
3620 }
3621 }
3622
3623 #[derive(Clone, Debug)]
3640 pub struct CheckAutopilotCompatibility(
3641 RequestBuilder<crate::model::CheckAutopilotCompatibilityRequest>,
3642 );
3643
3644 impl CheckAutopilotCompatibility {
3645 pub(crate) fn new(
3646 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3647 ) -> Self {
3648 Self(RequestBuilder::new(stub))
3649 }
3650
3651 pub fn with_request<V: Into<crate::model::CheckAutopilotCompatibilityRequest>>(
3653 mut self,
3654 v: V,
3655 ) -> Self {
3656 self.0.request = v.into();
3657 self
3658 }
3659
3660 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3662 self.0.options = v.into();
3663 self
3664 }
3665
3666 pub async fn send(self) -> Result<crate::model::CheckAutopilotCompatibilityResponse> {
3668 (*self.0.stub)
3669 .check_autopilot_compatibility(self.0.request, self.0.options)
3670 .await
3671 .map(crate::Response::into_body)
3672 }
3673
3674 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3676 self.0.request.name = v.into();
3677 self
3678 }
3679 }
3680
3681 #[doc(hidden)]
3682 impl crate::RequestBuilder for CheckAutopilotCompatibility {
3683 fn request_options(&mut self) -> &mut crate::RequestOptions {
3684 &mut self.0.options
3685 }
3686 }
3687
3688 #[derive(Clone, Debug)]
3705 pub struct FetchClusterUpgradeInfo(
3706 RequestBuilder<crate::model::FetchClusterUpgradeInfoRequest>,
3707 );
3708
3709 impl FetchClusterUpgradeInfo {
3710 pub(crate) fn new(
3711 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3712 ) -> Self {
3713 Self(RequestBuilder::new(stub))
3714 }
3715
3716 pub fn with_request<V: Into<crate::model::FetchClusterUpgradeInfoRequest>>(
3718 mut self,
3719 v: V,
3720 ) -> Self {
3721 self.0.request = v.into();
3722 self
3723 }
3724
3725 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3727 self.0.options = v.into();
3728 self
3729 }
3730
3731 pub async fn send(self) -> Result<crate::model::ClusterUpgradeInfo> {
3733 (*self.0.stub)
3734 .fetch_cluster_upgrade_info(self.0.request, self.0.options)
3735 .await
3736 .map(crate::Response::into_body)
3737 }
3738
3739 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3743 self.0.request.name = v.into();
3744 self
3745 }
3746
3747 pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
3749 self.0.request.version = v.into();
3750 self
3751 }
3752 }
3753
3754 #[doc(hidden)]
3755 impl crate::RequestBuilder for FetchClusterUpgradeInfo {
3756 fn request_options(&mut self) -> &mut crate::RequestOptions {
3757 &mut self.0.options
3758 }
3759 }
3760
3761 #[derive(Clone, Debug)]
3778 pub struct FetchNodePoolUpgradeInfo(
3779 RequestBuilder<crate::model::FetchNodePoolUpgradeInfoRequest>,
3780 );
3781
3782 impl FetchNodePoolUpgradeInfo {
3783 pub(crate) fn new(
3784 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3785 ) -> Self {
3786 Self(RequestBuilder::new(stub))
3787 }
3788
3789 pub fn with_request<V: Into<crate::model::FetchNodePoolUpgradeInfoRequest>>(
3791 mut self,
3792 v: V,
3793 ) -> Self {
3794 self.0.request = v.into();
3795 self
3796 }
3797
3798 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3800 self.0.options = v.into();
3801 self
3802 }
3803
3804 pub async fn send(self) -> Result<crate::model::NodePoolUpgradeInfo> {
3806 (*self.0.stub)
3807 .fetch_node_pool_upgrade_info(self.0.request, self.0.options)
3808 .await
3809 .map(crate::Response::into_body)
3810 }
3811
3812 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3816 self.0.request.name = v.into();
3817 self
3818 }
3819
3820 pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
3822 self.0.request.version = v.into();
3823 self
3824 }
3825 }
3826
3827 #[doc(hidden)]
3828 impl crate::RequestBuilder for FetchNodePoolUpgradeInfo {
3829 fn request_options(&mut self) -> &mut crate::RequestOptions {
3830 &mut self.0.options
3831 }
3832 }
3833
3834 #[derive(Clone, Debug)]
3851 pub struct CompleteControlPlaneUpgrade(
3852 RequestBuilder<crate::model::CompleteControlPlaneUpgradeRequest>,
3853 );
3854
3855 impl CompleteControlPlaneUpgrade {
3856 pub(crate) fn new(
3857 stub: std::sync::Arc<dyn super::super::stub::dynamic::ClusterManager>,
3858 ) -> Self {
3859 Self(RequestBuilder::new(stub))
3860 }
3861
3862 pub fn with_request<V: Into<crate::model::CompleteControlPlaneUpgradeRequest>>(
3864 mut self,
3865 v: V,
3866 ) -> Self {
3867 self.0.request = v.into();
3868 self
3869 }
3870
3871 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3873 self.0.options = v.into();
3874 self
3875 }
3876
3877 pub async fn send(self) -> Result<crate::model::Operation> {
3879 (*self.0.stub)
3880 .complete_control_plane_upgrade(self.0.request, self.0.options)
3881 .await
3882 .map(crate::Response::into_body)
3883 }
3884
3885 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3889 self.0.request.name = v.into();
3890 self
3891 }
3892
3893 pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
3895 self.0.request.version = v.into();
3896 self
3897 }
3898 }
3899
3900 #[doc(hidden)]
3901 impl crate::RequestBuilder for CompleteControlPlaneUpgrade {
3902 fn request_options(&mut self) -> &mut crate::RequestOptions {
3903 &mut self.0.options
3904 }
3905 }
3906}