1#[cfg(feature = "images")]
18#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
19pub mod images {
20 use crate::Result;
21
22 pub type ClientBuilder =
36 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
37
38 pub(crate) mod client {
39 use super::super::super::client::Images;
40 pub struct Factory;
41 impl gax::client_builder::internal::ClientFactory for Factory {
42 type Client = Images;
43 type Credentials = gaxi::options::Credentials;
44 async fn build(
45 self,
46 config: gaxi::options::ClientConfig,
47 ) -> gax::client_builder::Result<Self::Client> {
48 Self::Client::new(config).await
49 }
50 }
51 }
52
53 #[derive(Clone, Debug)]
55 pub(crate) struct RequestBuilder<R: std::default::Default> {
56 stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>,
57 request: R,
58 options: gax::options::RequestOptions,
59 }
60
61 impl<R> RequestBuilder<R>
62 where
63 R: std::default::Default,
64 {
65 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
92 pub struct Delete(RequestBuilder<crate::model::images::DeleteRequest>);
93
94 impl Delete {
95 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
96 Self(RequestBuilder::new(stub))
97 }
98
99 pub fn with_request<V: Into<crate::model::images::DeleteRequest>>(mut self, v: V) -> Self {
101 self.0.request = v.into();
102 self
103 }
104
105 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
107 self.0.options = v.into();
108 self
109 }
110
111 pub async fn send(self) -> Result<crate::model::Operation> {
113 (*self.0.stub)
114 .delete(self.0.request, self.0.options)
115 .await
116 .map(gax::response::Response::into_body)
117 }
118
119 pub fn set_image<T: Into<std::string::String>>(mut self, v: T) -> Self {
121 self.0.request.image = v.into();
122 self
123 }
124
125 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
127 self.0.request.project = v.into();
128 self
129 }
130
131 pub fn set_request_id<T>(mut self, v: T) -> Self
133 where
134 T: std::convert::Into<std::string::String>,
135 {
136 self.0.request.request_id = std::option::Option::Some(v.into());
137 self
138 }
139
140 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
142 where
143 T: std::convert::Into<std::string::String>,
144 {
145 self.0.request.request_id = v.map(|x| x.into());
146 self
147 }
148 }
149
150 #[doc(hidden)]
151 impl gax::options::internal::RequestBuilder for Delete {
152 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
153 &mut self.0.options
154 }
155 }
156
157 #[derive(Clone, Debug)]
175 pub struct Deprecate(RequestBuilder<crate::model::images::DeprecateRequest>);
176
177 impl Deprecate {
178 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
179 Self(RequestBuilder::new(stub))
180 }
181
182 pub fn with_request<V: Into<crate::model::images::DeprecateRequest>>(
184 mut self,
185 v: V,
186 ) -> Self {
187 self.0.request = v.into();
188 self
189 }
190
191 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
193 self.0.options = v.into();
194 self
195 }
196
197 pub async fn send(self) -> Result<crate::model::Operation> {
199 (*self.0.stub)
200 .deprecate(self.0.request, self.0.options)
201 .await
202 .map(gax::response::Response::into_body)
203 }
204
205 pub fn set_image<T: Into<std::string::String>>(mut self, v: T) -> Self {
207 self.0.request.image = v.into();
208 self
209 }
210
211 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
213 self.0.request.project = v.into();
214 self
215 }
216
217 pub fn set_request_id<T>(mut self, v: T) -> Self
219 where
220 T: std::convert::Into<std::string::String>,
221 {
222 self.0.request.request_id = std::option::Option::Some(v.into());
223 self
224 }
225
226 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
228 where
229 T: std::convert::Into<std::string::String>,
230 {
231 self.0.request.request_id = v.map(|x| x.into());
232 self
233 }
234
235 pub fn set_body<T>(mut self, v: T) -> Self
237 where
238 T: std::convert::Into<crate::model::DeprecationStatus>,
239 {
240 self.0.request.body = std::option::Option::Some(v.into());
241 self
242 }
243
244 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
246 where
247 T: std::convert::Into<crate::model::DeprecationStatus>,
248 {
249 self.0.request.body = v.map(|x| x.into());
250 self
251 }
252 }
253
254 #[doc(hidden)]
255 impl gax::options::internal::RequestBuilder for Deprecate {
256 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
257 &mut self.0.options
258 }
259 }
260
261 #[derive(Clone, Debug)]
279 pub struct Get(RequestBuilder<crate::model::images::GetRequest>);
280
281 impl Get {
282 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
283 Self(RequestBuilder::new(stub))
284 }
285
286 pub fn with_request<V: Into<crate::model::images::GetRequest>>(mut self, v: V) -> Self {
288 self.0.request = v.into();
289 self
290 }
291
292 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
294 self.0.options = v.into();
295 self
296 }
297
298 pub async fn send(self) -> Result<crate::model::Image> {
300 (*self.0.stub)
301 .get(self.0.request, self.0.options)
302 .await
303 .map(gax::response::Response::into_body)
304 }
305
306 pub fn set_image<T: Into<std::string::String>>(mut self, v: T) -> Self {
308 self.0.request.image = v.into();
309 self
310 }
311
312 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
314 self.0.request.project = v.into();
315 self
316 }
317 }
318
319 #[doc(hidden)]
320 impl gax::options::internal::RequestBuilder for Get {
321 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
322 &mut self.0.options
323 }
324 }
325
326 #[derive(Clone, Debug)]
344 pub struct GetFromFamily(RequestBuilder<crate::model::images::GetFromFamilyRequest>);
345
346 impl GetFromFamily {
347 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
348 Self(RequestBuilder::new(stub))
349 }
350
351 pub fn with_request<V: Into<crate::model::images::GetFromFamilyRequest>>(
353 mut self,
354 v: V,
355 ) -> Self {
356 self.0.request = v.into();
357 self
358 }
359
360 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
362 self.0.options = v.into();
363 self
364 }
365
366 pub async fn send(self) -> Result<crate::model::Image> {
368 (*self.0.stub)
369 .get_from_family(self.0.request, self.0.options)
370 .await
371 .map(gax::response::Response::into_body)
372 }
373
374 pub fn set_family<T: Into<std::string::String>>(mut self, v: T) -> Self {
376 self.0.request.family = v.into();
377 self
378 }
379
380 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
382 self.0.request.project = v.into();
383 self
384 }
385 }
386
387 #[doc(hidden)]
388 impl gax::options::internal::RequestBuilder for GetFromFamily {
389 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
390 &mut self.0.options
391 }
392 }
393
394 #[derive(Clone, Debug)]
412 pub struct GetIamPolicy(RequestBuilder<crate::model::images::GetIamPolicyRequest>);
413
414 impl GetIamPolicy {
415 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
416 Self(RequestBuilder::new(stub))
417 }
418
419 pub fn with_request<V: Into<crate::model::images::GetIamPolicyRequest>>(
421 mut self,
422 v: V,
423 ) -> Self {
424 self.0.request = v.into();
425 self
426 }
427
428 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
430 self.0.options = v.into();
431 self
432 }
433
434 pub async fn send(self) -> Result<crate::model::Policy> {
436 (*self.0.stub)
437 .get_iam_policy(self.0.request, self.0.options)
438 .await
439 .map(gax::response::Response::into_body)
440 }
441
442 pub fn set_options_requested_policy_version<T>(mut self, v: T) -> Self
444 where
445 T: std::convert::Into<i32>,
446 {
447 self.0.request.options_requested_policy_version = std::option::Option::Some(v.into());
448 self
449 }
450
451 pub fn set_or_clear_options_requested_policy_version<T>(
453 mut self,
454 v: std::option::Option<T>,
455 ) -> Self
456 where
457 T: std::convert::Into<i32>,
458 {
459 self.0.request.options_requested_policy_version = v.map(|x| x.into());
460 self
461 }
462
463 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
465 self.0.request.project = v.into();
466 self
467 }
468
469 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
471 self.0.request.resource = v.into();
472 self
473 }
474 }
475
476 #[doc(hidden)]
477 impl gax::options::internal::RequestBuilder for GetIamPolicy {
478 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
479 &mut self.0.options
480 }
481 }
482
483 #[derive(Clone, Debug)]
501 pub struct Insert(RequestBuilder<crate::model::images::InsertRequest>);
502
503 impl Insert {
504 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
505 Self(RequestBuilder::new(stub))
506 }
507
508 pub fn with_request<V: Into<crate::model::images::InsertRequest>>(mut self, v: V) -> Self {
510 self.0.request = v.into();
511 self
512 }
513
514 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
516 self.0.options = v.into();
517 self
518 }
519
520 pub async fn send(self) -> Result<crate::model::Operation> {
522 (*self.0.stub)
523 .insert(self.0.request, self.0.options)
524 .await
525 .map(gax::response::Response::into_body)
526 }
527
528 pub fn set_force_create<T>(mut self, v: T) -> Self
530 where
531 T: std::convert::Into<bool>,
532 {
533 self.0.request.force_create = std::option::Option::Some(v.into());
534 self
535 }
536
537 pub fn set_or_clear_force_create<T>(mut self, v: std::option::Option<T>) -> Self
539 where
540 T: std::convert::Into<bool>,
541 {
542 self.0.request.force_create = v.map(|x| x.into());
543 self
544 }
545
546 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
548 self.0.request.project = v.into();
549 self
550 }
551
552 pub fn set_request_id<T>(mut self, v: T) -> Self
554 where
555 T: std::convert::Into<std::string::String>,
556 {
557 self.0.request.request_id = std::option::Option::Some(v.into());
558 self
559 }
560
561 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
563 where
564 T: std::convert::Into<std::string::String>,
565 {
566 self.0.request.request_id = v.map(|x| x.into());
567 self
568 }
569
570 pub fn set_body<T>(mut self, v: T) -> Self
572 where
573 T: std::convert::Into<crate::model::Image>,
574 {
575 self.0.request.body = std::option::Option::Some(v.into());
576 self
577 }
578
579 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
581 where
582 T: std::convert::Into<crate::model::Image>,
583 {
584 self.0.request.body = v.map(|x| x.into());
585 self
586 }
587 }
588
589 #[doc(hidden)]
590 impl gax::options::internal::RequestBuilder for Insert {
591 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
592 &mut self.0.options
593 }
594 }
595
596 #[derive(Clone, Debug)]
618 pub struct List(RequestBuilder<crate::model::images::ListRequest>);
619
620 impl List {
621 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
622 Self(RequestBuilder::new(stub))
623 }
624
625 pub fn with_request<V: Into<crate::model::images::ListRequest>>(mut self, v: V) -> Self {
627 self.0.request = v.into();
628 self
629 }
630
631 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
633 self.0.options = v.into();
634 self
635 }
636
637 pub async fn send(self) -> Result<crate::model::ImageList> {
639 (*self.0.stub)
640 .list(self.0.request, self.0.options)
641 .await
642 .map(gax::response::Response::into_body)
643 }
644
645 pub fn by_page(
647 self,
648 ) -> impl gax::paginator::Paginator<crate::model::ImageList, gax::error::Error> {
649 use std::clone::Clone;
650 let token = self.0.request.page_token.clone().unwrap_or_default();
651 let execute = move |token: String| {
652 let mut builder = self.clone();
653 builder.0.request = builder.0.request.set_page_token(token);
654 builder.send()
655 };
656 gax::paginator::internal::new_paginator(token, execute)
657 }
658
659 pub fn by_item(
661 self,
662 ) -> impl gax::paginator::ItemPaginator<crate::model::ImageList, gax::error::Error>
663 {
664 use gax::paginator::Paginator;
665 self.by_page().items()
666 }
667
668 pub fn set_filter<T>(mut self, v: T) -> Self
670 where
671 T: std::convert::Into<std::string::String>,
672 {
673 self.0.request.filter = std::option::Option::Some(v.into());
674 self
675 }
676
677 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
679 where
680 T: std::convert::Into<std::string::String>,
681 {
682 self.0.request.filter = v.map(|x| x.into());
683 self
684 }
685
686 pub fn set_max_results<T>(mut self, v: T) -> Self
688 where
689 T: std::convert::Into<u32>,
690 {
691 self.0.request.max_results = std::option::Option::Some(v.into());
692 self
693 }
694
695 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
697 where
698 T: std::convert::Into<u32>,
699 {
700 self.0.request.max_results = v.map(|x| x.into());
701 self
702 }
703
704 pub fn set_order_by<T>(mut self, v: T) -> Self
706 where
707 T: std::convert::Into<std::string::String>,
708 {
709 self.0.request.order_by = std::option::Option::Some(v.into());
710 self
711 }
712
713 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
715 where
716 T: std::convert::Into<std::string::String>,
717 {
718 self.0.request.order_by = v.map(|x| x.into());
719 self
720 }
721
722 pub fn set_page_token<T>(mut self, v: T) -> Self
724 where
725 T: std::convert::Into<std::string::String>,
726 {
727 self.0.request.page_token = std::option::Option::Some(v.into());
728 self
729 }
730
731 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
733 where
734 T: std::convert::Into<std::string::String>,
735 {
736 self.0.request.page_token = v.map(|x| x.into());
737 self
738 }
739
740 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
742 self.0.request.project = v.into();
743 self
744 }
745
746 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
748 where
749 T: std::convert::Into<bool>,
750 {
751 self.0.request.return_partial_success = std::option::Option::Some(v.into());
752 self
753 }
754
755 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
757 where
758 T: std::convert::Into<bool>,
759 {
760 self.0.request.return_partial_success = v.map(|x| x.into());
761 self
762 }
763 }
764
765 #[doc(hidden)]
766 impl gax::options::internal::RequestBuilder for List {
767 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
768 &mut self.0.options
769 }
770 }
771
772 #[derive(Clone, Debug)]
790 pub struct Patch(RequestBuilder<crate::model::images::PatchRequest>);
791
792 impl Patch {
793 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
794 Self(RequestBuilder::new(stub))
795 }
796
797 pub fn with_request<V: Into<crate::model::images::PatchRequest>>(mut self, v: V) -> Self {
799 self.0.request = v.into();
800 self
801 }
802
803 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
805 self.0.options = v.into();
806 self
807 }
808
809 pub async fn send(self) -> Result<crate::model::Operation> {
811 (*self.0.stub)
812 .patch(self.0.request, self.0.options)
813 .await
814 .map(gax::response::Response::into_body)
815 }
816
817 pub fn set_image<T: Into<std::string::String>>(mut self, v: T) -> Self {
819 self.0.request.image = v.into();
820 self
821 }
822
823 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
825 self.0.request.project = v.into();
826 self
827 }
828
829 pub fn set_request_id<T>(mut self, v: T) -> Self
831 where
832 T: std::convert::Into<std::string::String>,
833 {
834 self.0.request.request_id = std::option::Option::Some(v.into());
835 self
836 }
837
838 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
840 where
841 T: std::convert::Into<std::string::String>,
842 {
843 self.0.request.request_id = v.map(|x| x.into());
844 self
845 }
846
847 pub fn set_body<T>(mut self, v: T) -> Self
849 where
850 T: std::convert::Into<crate::model::Image>,
851 {
852 self.0.request.body = std::option::Option::Some(v.into());
853 self
854 }
855
856 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
858 where
859 T: std::convert::Into<crate::model::Image>,
860 {
861 self.0.request.body = v.map(|x| x.into());
862 self
863 }
864 }
865
866 #[doc(hidden)]
867 impl gax::options::internal::RequestBuilder for Patch {
868 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
869 &mut self.0.options
870 }
871 }
872
873 #[derive(Clone, Debug)]
891 pub struct SetIamPolicy(RequestBuilder<crate::model::images::SetIamPolicyRequest>);
892
893 impl SetIamPolicy {
894 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
895 Self(RequestBuilder::new(stub))
896 }
897
898 pub fn with_request<V: Into<crate::model::images::SetIamPolicyRequest>>(
900 mut self,
901 v: V,
902 ) -> Self {
903 self.0.request = v.into();
904 self
905 }
906
907 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
909 self.0.options = v.into();
910 self
911 }
912
913 pub async fn send(self) -> Result<crate::model::Policy> {
915 (*self.0.stub)
916 .set_iam_policy(self.0.request, self.0.options)
917 .await
918 .map(gax::response::Response::into_body)
919 }
920
921 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
923 self.0.request.project = v.into();
924 self
925 }
926
927 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
929 self.0.request.resource = v.into();
930 self
931 }
932
933 pub fn set_body<T>(mut self, v: T) -> Self
935 where
936 T: std::convert::Into<crate::model::GlobalSetPolicyRequest>,
937 {
938 self.0.request.body = std::option::Option::Some(v.into());
939 self
940 }
941
942 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
944 where
945 T: std::convert::Into<crate::model::GlobalSetPolicyRequest>,
946 {
947 self.0.request.body = v.map(|x| x.into());
948 self
949 }
950 }
951
952 #[doc(hidden)]
953 impl gax::options::internal::RequestBuilder for SetIamPolicy {
954 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
955 &mut self.0.options
956 }
957 }
958
959 #[derive(Clone, Debug)]
977 pub struct SetLabels(RequestBuilder<crate::model::images::SetLabelsRequest>);
978
979 impl SetLabels {
980 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
981 Self(RequestBuilder::new(stub))
982 }
983
984 pub fn with_request<V: Into<crate::model::images::SetLabelsRequest>>(
986 mut self,
987 v: V,
988 ) -> Self {
989 self.0.request = v.into();
990 self
991 }
992
993 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
995 self.0.options = v.into();
996 self
997 }
998
999 pub async fn send(self) -> Result<crate::model::Operation> {
1001 (*self.0.stub)
1002 .set_labels(self.0.request, self.0.options)
1003 .await
1004 .map(gax::response::Response::into_body)
1005 }
1006
1007 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1009 self.0.request.project = v.into();
1010 self
1011 }
1012
1013 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1015 self.0.request.resource = v.into();
1016 self
1017 }
1018
1019 pub fn set_body<T>(mut self, v: T) -> Self
1021 where
1022 T: std::convert::Into<crate::model::GlobalSetLabelsRequest>,
1023 {
1024 self.0.request.body = std::option::Option::Some(v.into());
1025 self
1026 }
1027
1028 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1030 where
1031 T: std::convert::Into<crate::model::GlobalSetLabelsRequest>,
1032 {
1033 self.0.request.body = v.map(|x| x.into());
1034 self
1035 }
1036 }
1037
1038 #[doc(hidden)]
1039 impl gax::options::internal::RequestBuilder for SetLabels {
1040 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1041 &mut self.0.options
1042 }
1043 }
1044
1045 #[derive(Clone, Debug)]
1063 pub struct TestIamPermissions(RequestBuilder<crate::model::images::TestIamPermissionsRequest>);
1064
1065 impl TestIamPermissions {
1066 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Images>) -> Self {
1067 Self(RequestBuilder::new(stub))
1068 }
1069
1070 pub fn with_request<V: Into<crate::model::images::TestIamPermissionsRequest>>(
1072 mut self,
1073 v: V,
1074 ) -> Self {
1075 self.0.request = v.into();
1076 self
1077 }
1078
1079 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1081 self.0.options = v.into();
1082 self
1083 }
1084
1085 pub async fn send(self) -> Result<crate::model::TestPermissionsResponse> {
1087 (*self.0.stub)
1088 .test_iam_permissions(self.0.request, self.0.options)
1089 .await
1090 .map(gax::response::Response::into_body)
1091 }
1092
1093 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1095 self.0.request.project = v.into();
1096 self
1097 }
1098
1099 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1101 self.0.request.resource = v.into();
1102 self
1103 }
1104
1105 pub fn set_body<T>(mut self, v: T) -> Self
1107 where
1108 T: std::convert::Into<crate::model::TestPermissionsRequest>,
1109 {
1110 self.0.request.body = std::option::Option::Some(v.into());
1111 self
1112 }
1113
1114 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1116 where
1117 T: std::convert::Into<crate::model::TestPermissionsRequest>,
1118 {
1119 self.0.request.body = v.map(|x| x.into());
1120 self
1121 }
1122 }
1123
1124 #[doc(hidden)]
1125 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1126 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1127 &mut self.0.options
1128 }
1129 }
1130}
1131
1132#[cfg(feature = "instance-group-manager-resize-requests")]
1133#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-manager-resize-requests")))]
1134pub mod instance_group_manager_resize_requests {
1135 use crate::Result;
1136
1137 pub type ClientBuilder =
1151 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1152
1153 pub(crate) mod client {
1154 use super::super::super::client::InstanceGroupManagerResizeRequests;
1155 pub struct Factory;
1156 impl gax::client_builder::internal::ClientFactory for Factory {
1157 type Client = InstanceGroupManagerResizeRequests;
1158 type Credentials = gaxi::options::Credentials;
1159 async fn build(
1160 self,
1161 config: gaxi::options::ClientConfig,
1162 ) -> gax::client_builder::Result<Self::Client> {
1163 Self::Client::new(config).await
1164 }
1165 }
1166 }
1167
1168 #[derive(Clone, Debug)]
1170 pub(crate) struct RequestBuilder<R: std::default::Default> {
1171 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests>,
1172 request: R,
1173 options: gax::options::RequestOptions,
1174 }
1175
1176 impl<R> RequestBuilder<R>
1177 where
1178 R: std::default::Default,
1179 {
1180 pub(crate) fn new(
1181 stub: std::sync::Arc<
1182 dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1183 >,
1184 ) -> Self {
1185 Self {
1186 stub,
1187 request: R::default(),
1188 options: gax::options::RequestOptions::default(),
1189 }
1190 }
1191 }
1192
1193 #[derive(Clone, Debug)]
1211 pub struct Cancel(
1212 RequestBuilder<crate::model::instance_group_manager_resize_requests::CancelRequest>,
1213 );
1214
1215 impl Cancel {
1216 pub(crate) fn new(
1217 stub: std::sync::Arc<
1218 dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1219 >,
1220 ) -> Self {
1221 Self(RequestBuilder::new(stub))
1222 }
1223
1224 pub fn with_request<
1226 V: Into<crate::model::instance_group_manager_resize_requests::CancelRequest>,
1227 >(
1228 mut self,
1229 v: V,
1230 ) -> Self {
1231 self.0.request = v.into();
1232 self
1233 }
1234
1235 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1237 self.0.options = v.into();
1238 self
1239 }
1240
1241 pub async fn send(self) -> Result<crate::model::Operation> {
1243 (*self.0.stub)
1244 .cancel(self.0.request, self.0.options)
1245 .await
1246 .map(gax::response::Response::into_body)
1247 }
1248
1249 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1251 self.0.request.instance_group_manager = v.into();
1252 self
1253 }
1254
1255 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1257 self.0.request.project = v.into();
1258 self
1259 }
1260
1261 pub fn set_request_id<T>(mut self, v: T) -> Self
1263 where
1264 T: std::convert::Into<std::string::String>,
1265 {
1266 self.0.request.request_id = std::option::Option::Some(v.into());
1267 self
1268 }
1269
1270 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
1272 where
1273 T: std::convert::Into<std::string::String>,
1274 {
1275 self.0.request.request_id = v.map(|x| x.into());
1276 self
1277 }
1278
1279 pub fn set_resize_request<T: Into<std::string::String>>(mut self, v: T) -> Self {
1281 self.0.request.resize_request = v.into();
1282 self
1283 }
1284
1285 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1287 self.0.request.zone = v.into();
1288 self
1289 }
1290 }
1291
1292 #[doc(hidden)]
1293 impl gax::options::internal::RequestBuilder for Cancel {
1294 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1295 &mut self.0.options
1296 }
1297 }
1298
1299 #[derive(Clone, Debug)]
1317 pub struct Delete(
1318 RequestBuilder<crate::model::instance_group_manager_resize_requests::DeleteRequest>,
1319 );
1320
1321 impl Delete {
1322 pub(crate) fn new(
1323 stub: std::sync::Arc<
1324 dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1325 >,
1326 ) -> Self {
1327 Self(RequestBuilder::new(stub))
1328 }
1329
1330 pub fn with_request<
1332 V: Into<crate::model::instance_group_manager_resize_requests::DeleteRequest>,
1333 >(
1334 mut self,
1335 v: V,
1336 ) -> Self {
1337 self.0.request = v.into();
1338 self
1339 }
1340
1341 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1343 self.0.options = v.into();
1344 self
1345 }
1346
1347 pub async fn send(self) -> Result<crate::model::Operation> {
1349 (*self.0.stub)
1350 .delete(self.0.request, self.0.options)
1351 .await
1352 .map(gax::response::Response::into_body)
1353 }
1354
1355 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1357 self.0.request.instance_group_manager = v.into();
1358 self
1359 }
1360
1361 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1363 self.0.request.project = v.into();
1364 self
1365 }
1366
1367 pub fn set_request_id<T>(mut self, v: T) -> Self
1369 where
1370 T: std::convert::Into<std::string::String>,
1371 {
1372 self.0.request.request_id = std::option::Option::Some(v.into());
1373 self
1374 }
1375
1376 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
1378 where
1379 T: std::convert::Into<std::string::String>,
1380 {
1381 self.0.request.request_id = v.map(|x| x.into());
1382 self
1383 }
1384
1385 pub fn set_resize_request<T: Into<std::string::String>>(mut self, v: T) -> Self {
1387 self.0.request.resize_request = v.into();
1388 self
1389 }
1390
1391 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1393 self.0.request.zone = v.into();
1394 self
1395 }
1396 }
1397
1398 #[doc(hidden)]
1399 impl gax::options::internal::RequestBuilder for Delete {
1400 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1401 &mut self.0.options
1402 }
1403 }
1404
1405 #[derive(Clone, Debug)]
1423 pub struct Get(
1424 RequestBuilder<crate::model::instance_group_manager_resize_requests::GetRequest>,
1425 );
1426
1427 impl Get {
1428 pub(crate) fn new(
1429 stub: std::sync::Arc<
1430 dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1431 >,
1432 ) -> Self {
1433 Self(RequestBuilder::new(stub))
1434 }
1435
1436 pub fn with_request<
1438 V: Into<crate::model::instance_group_manager_resize_requests::GetRequest>,
1439 >(
1440 mut self,
1441 v: V,
1442 ) -> Self {
1443 self.0.request = v.into();
1444 self
1445 }
1446
1447 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1449 self.0.options = v.into();
1450 self
1451 }
1452
1453 pub async fn send(self) -> Result<crate::model::InstanceGroupManagerResizeRequest> {
1455 (*self.0.stub)
1456 .get(self.0.request, self.0.options)
1457 .await
1458 .map(gax::response::Response::into_body)
1459 }
1460
1461 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1463 self.0.request.instance_group_manager = v.into();
1464 self
1465 }
1466
1467 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1469 self.0.request.project = v.into();
1470 self
1471 }
1472
1473 pub fn set_resize_request<T: Into<std::string::String>>(mut self, v: T) -> Self {
1475 self.0.request.resize_request = v.into();
1476 self
1477 }
1478
1479 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1481 self.0.request.zone = v.into();
1482 self
1483 }
1484 }
1485
1486 #[doc(hidden)]
1487 impl gax::options::internal::RequestBuilder for Get {
1488 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1489 &mut self.0.options
1490 }
1491 }
1492
1493 #[derive(Clone, Debug)]
1511 pub struct Insert(
1512 RequestBuilder<crate::model::instance_group_manager_resize_requests::InsertRequest>,
1513 );
1514
1515 impl Insert {
1516 pub(crate) fn new(
1517 stub: std::sync::Arc<
1518 dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1519 >,
1520 ) -> Self {
1521 Self(RequestBuilder::new(stub))
1522 }
1523
1524 pub fn with_request<
1526 V: Into<crate::model::instance_group_manager_resize_requests::InsertRequest>,
1527 >(
1528 mut self,
1529 v: V,
1530 ) -> Self {
1531 self.0.request = v.into();
1532 self
1533 }
1534
1535 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1537 self.0.options = v.into();
1538 self
1539 }
1540
1541 pub async fn send(self) -> Result<crate::model::Operation> {
1543 (*self.0.stub)
1544 .insert(self.0.request, self.0.options)
1545 .await
1546 .map(gax::response::Response::into_body)
1547 }
1548
1549 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1551 self.0.request.instance_group_manager = v.into();
1552 self
1553 }
1554
1555 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1557 self.0.request.project = v.into();
1558 self
1559 }
1560
1561 pub fn set_request_id<T>(mut self, v: T) -> Self
1563 where
1564 T: std::convert::Into<std::string::String>,
1565 {
1566 self.0.request.request_id = std::option::Option::Some(v.into());
1567 self
1568 }
1569
1570 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
1572 where
1573 T: std::convert::Into<std::string::String>,
1574 {
1575 self.0.request.request_id = v.map(|x| x.into());
1576 self
1577 }
1578
1579 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1581 self.0.request.zone = v.into();
1582 self
1583 }
1584
1585 pub fn set_body<T>(mut self, v: T) -> Self
1587 where
1588 T: std::convert::Into<crate::model::InstanceGroupManagerResizeRequest>,
1589 {
1590 self.0.request.body = std::option::Option::Some(v.into());
1591 self
1592 }
1593
1594 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1596 where
1597 T: std::convert::Into<crate::model::InstanceGroupManagerResizeRequest>,
1598 {
1599 self.0.request.body = v.map(|x| x.into());
1600 self
1601 }
1602 }
1603
1604 #[doc(hidden)]
1605 impl gax::options::internal::RequestBuilder for Insert {
1606 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1607 &mut self.0.options
1608 }
1609 }
1610
1611 #[derive(Clone, Debug)]
1633 pub struct List(
1634 RequestBuilder<crate::model::instance_group_manager_resize_requests::ListRequest>,
1635 );
1636
1637 impl List {
1638 pub(crate) fn new(
1639 stub: std::sync::Arc<
1640 dyn super::super::stub::dynamic::InstanceGroupManagerResizeRequests,
1641 >,
1642 ) -> Self {
1643 Self(RequestBuilder::new(stub))
1644 }
1645
1646 pub fn with_request<
1648 V: Into<crate::model::instance_group_manager_resize_requests::ListRequest>,
1649 >(
1650 mut self,
1651 v: V,
1652 ) -> Self {
1653 self.0.request = v.into();
1654 self
1655 }
1656
1657 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1659 self.0.options = v.into();
1660 self
1661 }
1662
1663 pub async fn send(
1665 self,
1666 ) -> Result<crate::model::InstanceGroupManagerResizeRequestsListResponse> {
1667 (*self.0.stub)
1668 .list(self.0.request, self.0.options)
1669 .await
1670 .map(gax::response::Response::into_body)
1671 }
1672
1673 pub fn by_page(
1675 self,
1676 ) -> impl gax::paginator::Paginator<
1677 crate::model::InstanceGroupManagerResizeRequestsListResponse,
1678 gax::error::Error,
1679 > {
1680 use std::clone::Clone;
1681 let token = self.0.request.page_token.clone().unwrap_or_default();
1682 let execute = move |token: String| {
1683 let mut builder = self.clone();
1684 builder.0.request = builder.0.request.set_page_token(token);
1685 builder.send()
1686 };
1687 gax::paginator::internal::new_paginator(token, execute)
1688 }
1689
1690 pub fn by_item(
1692 self,
1693 ) -> impl gax::paginator::ItemPaginator<
1694 crate::model::InstanceGroupManagerResizeRequestsListResponse,
1695 gax::error::Error,
1696 > {
1697 use gax::paginator::Paginator;
1698 self.by_page().items()
1699 }
1700
1701 pub fn set_filter<T>(mut self, v: T) -> Self
1703 where
1704 T: std::convert::Into<std::string::String>,
1705 {
1706 self.0.request.filter = std::option::Option::Some(v.into());
1707 self
1708 }
1709
1710 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
1712 where
1713 T: std::convert::Into<std::string::String>,
1714 {
1715 self.0.request.filter = v.map(|x| x.into());
1716 self
1717 }
1718
1719 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1721 self.0.request.instance_group_manager = v.into();
1722 self
1723 }
1724
1725 pub fn set_max_results<T>(mut self, v: T) -> Self
1727 where
1728 T: std::convert::Into<u32>,
1729 {
1730 self.0.request.max_results = std::option::Option::Some(v.into());
1731 self
1732 }
1733
1734 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
1736 where
1737 T: std::convert::Into<u32>,
1738 {
1739 self.0.request.max_results = v.map(|x| x.into());
1740 self
1741 }
1742
1743 pub fn set_order_by<T>(mut self, v: T) -> Self
1745 where
1746 T: std::convert::Into<std::string::String>,
1747 {
1748 self.0.request.order_by = std::option::Option::Some(v.into());
1749 self
1750 }
1751
1752 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
1754 where
1755 T: std::convert::Into<std::string::String>,
1756 {
1757 self.0.request.order_by = v.map(|x| x.into());
1758 self
1759 }
1760
1761 pub fn set_page_token<T>(mut self, v: T) -> Self
1763 where
1764 T: std::convert::Into<std::string::String>,
1765 {
1766 self.0.request.page_token = std::option::Option::Some(v.into());
1767 self
1768 }
1769
1770 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
1772 where
1773 T: std::convert::Into<std::string::String>,
1774 {
1775 self.0.request.page_token = v.map(|x| x.into());
1776 self
1777 }
1778
1779 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1781 self.0.request.project = v.into();
1782 self
1783 }
1784
1785 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
1787 where
1788 T: std::convert::Into<bool>,
1789 {
1790 self.0.request.return_partial_success = std::option::Option::Some(v.into());
1791 self
1792 }
1793
1794 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
1796 where
1797 T: std::convert::Into<bool>,
1798 {
1799 self.0.request.return_partial_success = v.map(|x| x.into());
1800 self
1801 }
1802
1803 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1805 self.0.request.zone = v.into();
1806 self
1807 }
1808 }
1809
1810 #[doc(hidden)]
1811 impl gax::options::internal::RequestBuilder for List {
1812 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1813 &mut self.0.options
1814 }
1815 }
1816}
1817
1818#[cfg(feature = "instance-group-managers")]
1819#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-managers")))]
1820pub mod instance_group_managers {
1821 use crate::Result;
1822
1823 pub type ClientBuilder =
1837 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1838
1839 pub(crate) mod client {
1840 use super::super::super::client::InstanceGroupManagers;
1841 pub struct Factory;
1842 impl gax::client_builder::internal::ClientFactory for Factory {
1843 type Client = InstanceGroupManagers;
1844 type Credentials = gaxi::options::Credentials;
1845 async fn build(
1846 self,
1847 config: gaxi::options::ClientConfig,
1848 ) -> gax::client_builder::Result<Self::Client> {
1849 Self::Client::new(config).await
1850 }
1851 }
1852 }
1853
1854 #[derive(Clone, Debug)]
1856 pub(crate) struct RequestBuilder<R: std::default::Default> {
1857 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
1858 request: R,
1859 options: gax::options::RequestOptions,
1860 }
1861
1862 impl<R> RequestBuilder<R>
1863 where
1864 R: std::default::Default,
1865 {
1866 pub(crate) fn new(
1867 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
1868 ) -> Self {
1869 Self {
1870 stub,
1871 request: R::default(),
1872 options: gax::options::RequestOptions::default(),
1873 }
1874 }
1875 }
1876
1877 #[derive(Clone, Debug)]
1895 pub struct AbandonInstances(
1896 RequestBuilder<crate::model::instance_group_managers::AbandonInstancesRequest>,
1897 );
1898
1899 impl AbandonInstances {
1900 pub(crate) fn new(
1901 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
1902 ) -> Self {
1903 Self(RequestBuilder::new(stub))
1904 }
1905
1906 pub fn with_request<
1908 V: Into<crate::model::instance_group_managers::AbandonInstancesRequest>,
1909 >(
1910 mut self,
1911 v: V,
1912 ) -> Self {
1913 self.0.request = v.into();
1914 self
1915 }
1916
1917 pub fn with_options<V: Into<gax::options::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 .abandon_instances(self.0.request, self.0.options)
1927 .await
1928 .map(gax::response::Response::into_body)
1929 }
1930
1931 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
1933 self.0.request.instance_group_manager = v.into();
1934 self
1935 }
1936
1937 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1939 self.0.request.project = v.into();
1940 self
1941 }
1942
1943 pub fn set_request_id<T>(mut self, v: T) -> Self
1945 where
1946 T: std::convert::Into<std::string::String>,
1947 {
1948 self.0.request.request_id = std::option::Option::Some(v.into());
1949 self
1950 }
1951
1952 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
1954 where
1955 T: std::convert::Into<std::string::String>,
1956 {
1957 self.0.request.request_id = v.map(|x| x.into());
1958 self
1959 }
1960
1961 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
1963 self.0.request.zone = v.into();
1964 self
1965 }
1966
1967 pub fn set_body<T>(mut self, v: T) -> Self
1969 where
1970 T: std::convert::Into<crate::model::InstanceGroupManagersAbandonInstancesRequest>,
1971 {
1972 self.0.request.body = std::option::Option::Some(v.into());
1973 self
1974 }
1975
1976 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1978 where
1979 T: std::convert::Into<crate::model::InstanceGroupManagersAbandonInstancesRequest>,
1980 {
1981 self.0.request.body = v.map(|x| x.into());
1982 self
1983 }
1984 }
1985
1986 #[doc(hidden)]
1987 impl gax::options::internal::RequestBuilder for AbandonInstances {
1988 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1989 &mut self.0.options
1990 }
1991 }
1992
1993 #[derive(Clone, Debug)]
2015 pub struct AggregatedList(
2016 RequestBuilder<crate::model::instance_group_managers::AggregatedListRequest>,
2017 );
2018
2019 impl AggregatedList {
2020 pub(crate) fn new(
2021 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2022 ) -> Self {
2023 Self(RequestBuilder::new(stub))
2024 }
2025
2026 pub fn with_request<
2028 V: Into<crate::model::instance_group_managers::AggregatedListRequest>,
2029 >(
2030 mut self,
2031 v: V,
2032 ) -> Self {
2033 self.0.request = v.into();
2034 self
2035 }
2036
2037 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2039 self.0.options = v.into();
2040 self
2041 }
2042
2043 pub async fn send(self) -> Result<crate::model::InstanceGroupManagerAggregatedList> {
2045 (*self.0.stub)
2046 .aggregated_list(self.0.request, self.0.options)
2047 .await
2048 .map(gax::response::Response::into_body)
2049 }
2050
2051 pub fn by_page(
2053 self,
2054 ) -> impl gax::paginator::Paginator<
2055 crate::model::InstanceGroupManagerAggregatedList,
2056 gax::error::Error,
2057 > {
2058 use std::clone::Clone;
2059 let token = self.0.request.page_token.clone().unwrap_or_default();
2060 let execute = move |token: String| {
2061 let mut builder = self.clone();
2062 builder.0.request = builder.0.request.set_page_token(token);
2063 builder.send()
2064 };
2065 gax::paginator::internal::new_paginator(token, execute)
2066 }
2067
2068 pub fn by_item(
2070 self,
2071 ) -> impl gax::paginator::ItemPaginator<
2072 crate::model::InstanceGroupManagerAggregatedList,
2073 gax::error::Error,
2074 > {
2075 use gax::paginator::Paginator;
2076 self.by_page().items()
2077 }
2078
2079 pub fn set_filter<T>(mut self, v: T) -> Self
2081 where
2082 T: std::convert::Into<std::string::String>,
2083 {
2084 self.0.request.filter = std::option::Option::Some(v.into());
2085 self
2086 }
2087
2088 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
2090 where
2091 T: std::convert::Into<std::string::String>,
2092 {
2093 self.0.request.filter = v.map(|x| x.into());
2094 self
2095 }
2096
2097 pub fn set_include_all_scopes<T>(mut self, v: T) -> Self
2099 where
2100 T: std::convert::Into<bool>,
2101 {
2102 self.0.request.include_all_scopes = std::option::Option::Some(v.into());
2103 self
2104 }
2105
2106 pub fn set_or_clear_include_all_scopes<T>(mut self, v: std::option::Option<T>) -> Self
2108 where
2109 T: std::convert::Into<bool>,
2110 {
2111 self.0.request.include_all_scopes = v.map(|x| x.into());
2112 self
2113 }
2114
2115 pub fn set_max_results<T>(mut self, v: T) -> Self
2117 where
2118 T: std::convert::Into<u32>,
2119 {
2120 self.0.request.max_results = std::option::Option::Some(v.into());
2121 self
2122 }
2123
2124 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
2126 where
2127 T: std::convert::Into<u32>,
2128 {
2129 self.0.request.max_results = v.map(|x| x.into());
2130 self
2131 }
2132
2133 pub fn set_order_by<T>(mut self, v: T) -> Self
2135 where
2136 T: std::convert::Into<std::string::String>,
2137 {
2138 self.0.request.order_by = std::option::Option::Some(v.into());
2139 self
2140 }
2141
2142 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
2144 where
2145 T: std::convert::Into<std::string::String>,
2146 {
2147 self.0.request.order_by = v.map(|x| x.into());
2148 self
2149 }
2150
2151 pub fn set_page_token<T>(mut self, v: T) -> Self
2153 where
2154 T: std::convert::Into<std::string::String>,
2155 {
2156 self.0.request.page_token = std::option::Option::Some(v.into());
2157 self
2158 }
2159
2160 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
2162 where
2163 T: std::convert::Into<std::string::String>,
2164 {
2165 self.0.request.page_token = v.map(|x| x.into());
2166 self
2167 }
2168
2169 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2171 self.0.request.project = v.into();
2172 self
2173 }
2174
2175 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
2177 where
2178 T: std::convert::Into<bool>,
2179 {
2180 self.0.request.return_partial_success = std::option::Option::Some(v.into());
2181 self
2182 }
2183
2184 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
2186 where
2187 T: std::convert::Into<bool>,
2188 {
2189 self.0.request.return_partial_success = v.map(|x| x.into());
2190 self
2191 }
2192
2193 pub fn set_service_project_number<T>(mut self, v: T) -> Self
2195 where
2196 T: std::convert::Into<i64>,
2197 {
2198 self.0.request.service_project_number = std::option::Option::Some(v.into());
2199 self
2200 }
2201
2202 pub fn set_or_clear_service_project_number<T>(mut self, v: std::option::Option<T>) -> Self
2204 where
2205 T: std::convert::Into<i64>,
2206 {
2207 self.0.request.service_project_number = v.map(|x| x.into());
2208 self
2209 }
2210 }
2211
2212 #[doc(hidden)]
2213 impl gax::options::internal::RequestBuilder for AggregatedList {
2214 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2215 &mut self.0.options
2216 }
2217 }
2218
2219 #[derive(Clone, Debug)]
2237 pub struct ApplyUpdatesToInstances(
2238 RequestBuilder<crate::model::instance_group_managers::ApplyUpdatesToInstancesRequest>,
2239 );
2240
2241 impl ApplyUpdatesToInstances {
2242 pub(crate) fn new(
2243 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2244 ) -> Self {
2245 Self(RequestBuilder::new(stub))
2246 }
2247
2248 pub fn with_request<
2250 V: Into<crate::model::instance_group_managers::ApplyUpdatesToInstancesRequest>,
2251 >(
2252 mut self,
2253 v: V,
2254 ) -> Self {
2255 self.0.request = v.into();
2256 self
2257 }
2258
2259 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2261 self.0.options = v.into();
2262 self
2263 }
2264
2265 pub async fn send(self) -> Result<crate::model::Operation> {
2267 (*self.0.stub)
2268 .apply_updates_to_instances(self.0.request, self.0.options)
2269 .await
2270 .map(gax::response::Response::into_body)
2271 }
2272
2273 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2275 self.0.request.instance_group_manager = v.into();
2276 self
2277 }
2278
2279 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2281 self.0.request.project = v.into();
2282 self
2283 }
2284
2285 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2287 self.0.request.zone = v.into();
2288 self
2289 }
2290
2291 pub fn set_body<T>(mut self, v: T) -> Self
2293 where
2294 T: std::convert::Into<crate::model::InstanceGroupManagersApplyUpdatesRequest>,
2295 {
2296 self.0.request.body = std::option::Option::Some(v.into());
2297 self
2298 }
2299
2300 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2302 where
2303 T: std::convert::Into<crate::model::InstanceGroupManagersApplyUpdatesRequest>,
2304 {
2305 self.0.request.body = v.map(|x| x.into());
2306 self
2307 }
2308 }
2309
2310 #[doc(hidden)]
2311 impl gax::options::internal::RequestBuilder for ApplyUpdatesToInstances {
2312 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2313 &mut self.0.options
2314 }
2315 }
2316
2317 #[derive(Clone, Debug)]
2335 pub struct CreateInstances(
2336 RequestBuilder<crate::model::instance_group_managers::CreateInstancesRequest>,
2337 );
2338
2339 impl CreateInstances {
2340 pub(crate) fn new(
2341 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2342 ) -> Self {
2343 Self(RequestBuilder::new(stub))
2344 }
2345
2346 pub fn with_request<
2348 V: Into<crate::model::instance_group_managers::CreateInstancesRequest>,
2349 >(
2350 mut self,
2351 v: V,
2352 ) -> Self {
2353 self.0.request = v.into();
2354 self
2355 }
2356
2357 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2359 self.0.options = v.into();
2360 self
2361 }
2362
2363 pub async fn send(self) -> Result<crate::model::Operation> {
2365 (*self.0.stub)
2366 .create_instances(self.0.request, self.0.options)
2367 .await
2368 .map(gax::response::Response::into_body)
2369 }
2370
2371 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2373 self.0.request.instance_group_manager = v.into();
2374 self
2375 }
2376
2377 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2379 self.0.request.project = v.into();
2380 self
2381 }
2382
2383 pub fn set_request_id<T>(mut self, v: T) -> Self
2385 where
2386 T: std::convert::Into<std::string::String>,
2387 {
2388 self.0.request.request_id = std::option::Option::Some(v.into());
2389 self
2390 }
2391
2392 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
2394 where
2395 T: std::convert::Into<std::string::String>,
2396 {
2397 self.0.request.request_id = v.map(|x| x.into());
2398 self
2399 }
2400
2401 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2403 self.0.request.zone = v.into();
2404 self
2405 }
2406
2407 pub fn set_body<T>(mut self, v: T) -> Self
2409 where
2410 T: std::convert::Into<crate::model::InstanceGroupManagersCreateInstancesRequest>,
2411 {
2412 self.0.request.body = std::option::Option::Some(v.into());
2413 self
2414 }
2415
2416 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2418 where
2419 T: std::convert::Into<crate::model::InstanceGroupManagersCreateInstancesRequest>,
2420 {
2421 self.0.request.body = v.map(|x| x.into());
2422 self
2423 }
2424 }
2425
2426 #[doc(hidden)]
2427 impl gax::options::internal::RequestBuilder for CreateInstances {
2428 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2429 &mut self.0.options
2430 }
2431 }
2432
2433 #[derive(Clone, Debug)]
2451 pub struct Delete(RequestBuilder<crate::model::instance_group_managers::DeleteRequest>);
2452
2453 impl Delete {
2454 pub(crate) fn new(
2455 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2456 ) -> Self {
2457 Self(RequestBuilder::new(stub))
2458 }
2459
2460 pub fn with_request<V: Into<crate::model::instance_group_managers::DeleteRequest>>(
2462 mut self,
2463 v: V,
2464 ) -> Self {
2465 self.0.request = v.into();
2466 self
2467 }
2468
2469 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2471 self.0.options = v.into();
2472 self
2473 }
2474
2475 pub async fn send(self) -> Result<crate::model::Operation> {
2477 (*self.0.stub)
2478 .delete(self.0.request, self.0.options)
2479 .await
2480 .map(gax::response::Response::into_body)
2481 }
2482
2483 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2485 self.0.request.instance_group_manager = v.into();
2486 self
2487 }
2488
2489 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2491 self.0.request.project = v.into();
2492 self
2493 }
2494
2495 pub fn set_request_id<T>(mut self, v: T) -> Self
2497 where
2498 T: std::convert::Into<std::string::String>,
2499 {
2500 self.0.request.request_id = std::option::Option::Some(v.into());
2501 self
2502 }
2503
2504 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
2506 where
2507 T: std::convert::Into<std::string::String>,
2508 {
2509 self.0.request.request_id = v.map(|x| x.into());
2510 self
2511 }
2512
2513 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2515 self.0.request.zone = v.into();
2516 self
2517 }
2518 }
2519
2520 #[doc(hidden)]
2521 impl gax::options::internal::RequestBuilder for Delete {
2522 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2523 &mut self.0.options
2524 }
2525 }
2526
2527 #[derive(Clone, Debug)]
2545 pub struct DeleteInstances(
2546 RequestBuilder<crate::model::instance_group_managers::DeleteInstancesRequest>,
2547 );
2548
2549 impl DeleteInstances {
2550 pub(crate) fn new(
2551 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2552 ) -> Self {
2553 Self(RequestBuilder::new(stub))
2554 }
2555
2556 pub fn with_request<
2558 V: Into<crate::model::instance_group_managers::DeleteInstancesRequest>,
2559 >(
2560 mut self,
2561 v: V,
2562 ) -> Self {
2563 self.0.request = v.into();
2564 self
2565 }
2566
2567 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2569 self.0.options = v.into();
2570 self
2571 }
2572
2573 pub async fn send(self) -> Result<crate::model::Operation> {
2575 (*self.0.stub)
2576 .delete_instances(self.0.request, self.0.options)
2577 .await
2578 .map(gax::response::Response::into_body)
2579 }
2580
2581 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2583 self.0.request.instance_group_manager = v.into();
2584 self
2585 }
2586
2587 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2589 self.0.request.project = v.into();
2590 self
2591 }
2592
2593 pub fn set_request_id<T>(mut self, v: T) -> Self
2595 where
2596 T: std::convert::Into<std::string::String>,
2597 {
2598 self.0.request.request_id = std::option::Option::Some(v.into());
2599 self
2600 }
2601
2602 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
2604 where
2605 T: std::convert::Into<std::string::String>,
2606 {
2607 self.0.request.request_id = v.map(|x| x.into());
2608 self
2609 }
2610
2611 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2613 self.0.request.zone = v.into();
2614 self
2615 }
2616
2617 pub fn set_body<T>(mut self, v: T) -> Self
2619 where
2620 T: std::convert::Into<crate::model::InstanceGroupManagersDeleteInstancesRequest>,
2621 {
2622 self.0.request.body = std::option::Option::Some(v.into());
2623 self
2624 }
2625
2626 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2628 where
2629 T: std::convert::Into<crate::model::InstanceGroupManagersDeleteInstancesRequest>,
2630 {
2631 self.0.request.body = v.map(|x| x.into());
2632 self
2633 }
2634 }
2635
2636 #[doc(hidden)]
2637 impl gax::options::internal::RequestBuilder for DeleteInstances {
2638 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2639 &mut self.0.options
2640 }
2641 }
2642
2643 #[derive(Clone, Debug)]
2661 pub struct DeletePerInstanceConfigs(
2662 RequestBuilder<crate::model::instance_group_managers::DeletePerInstanceConfigsRequest>,
2663 );
2664
2665 impl DeletePerInstanceConfigs {
2666 pub(crate) fn new(
2667 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2668 ) -> Self {
2669 Self(RequestBuilder::new(stub))
2670 }
2671
2672 pub fn with_request<
2674 V: Into<crate::model::instance_group_managers::DeletePerInstanceConfigsRequest>,
2675 >(
2676 mut self,
2677 v: V,
2678 ) -> Self {
2679 self.0.request = v.into();
2680 self
2681 }
2682
2683 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2685 self.0.options = v.into();
2686 self
2687 }
2688
2689 pub async fn send(self) -> Result<crate::model::Operation> {
2691 (*self.0.stub)
2692 .delete_per_instance_configs(self.0.request, self.0.options)
2693 .await
2694 .map(gax::response::Response::into_body)
2695 }
2696
2697 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2699 self.0.request.instance_group_manager = v.into();
2700 self
2701 }
2702
2703 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2705 self.0.request.project = v.into();
2706 self
2707 }
2708
2709 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2711 self.0.request.zone = v.into();
2712 self
2713 }
2714
2715 pub fn set_body<T>(mut self, v: T) -> Self
2717 where
2718 T: std::convert::Into<crate::model::InstanceGroupManagersDeletePerInstanceConfigsReq>,
2719 {
2720 self.0.request.body = std::option::Option::Some(v.into());
2721 self
2722 }
2723
2724 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2726 where
2727 T: std::convert::Into<crate::model::InstanceGroupManagersDeletePerInstanceConfigsReq>,
2728 {
2729 self.0.request.body = v.map(|x| x.into());
2730 self
2731 }
2732 }
2733
2734 #[doc(hidden)]
2735 impl gax::options::internal::RequestBuilder for DeletePerInstanceConfigs {
2736 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2737 &mut self.0.options
2738 }
2739 }
2740
2741 #[derive(Clone, Debug)]
2759 pub struct Get(RequestBuilder<crate::model::instance_group_managers::GetRequest>);
2760
2761 impl Get {
2762 pub(crate) fn new(
2763 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2764 ) -> Self {
2765 Self(RequestBuilder::new(stub))
2766 }
2767
2768 pub fn with_request<V: Into<crate::model::instance_group_managers::GetRequest>>(
2770 mut self,
2771 v: V,
2772 ) -> Self {
2773 self.0.request = v.into();
2774 self
2775 }
2776
2777 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2779 self.0.options = v.into();
2780 self
2781 }
2782
2783 pub async fn send(self) -> Result<crate::model::InstanceGroupManager> {
2785 (*self.0.stub)
2786 .get(self.0.request, self.0.options)
2787 .await
2788 .map(gax::response::Response::into_body)
2789 }
2790
2791 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
2793 self.0.request.instance_group_manager = v.into();
2794 self
2795 }
2796
2797 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2799 self.0.request.project = v.into();
2800 self
2801 }
2802
2803 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2805 self.0.request.zone = v.into();
2806 self
2807 }
2808 }
2809
2810 #[doc(hidden)]
2811 impl gax::options::internal::RequestBuilder for Get {
2812 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2813 &mut self.0.options
2814 }
2815 }
2816
2817 #[derive(Clone, Debug)]
2835 pub struct Insert(RequestBuilder<crate::model::instance_group_managers::InsertRequest>);
2836
2837 impl Insert {
2838 pub(crate) fn new(
2839 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2840 ) -> Self {
2841 Self(RequestBuilder::new(stub))
2842 }
2843
2844 pub fn with_request<V: Into<crate::model::instance_group_managers::InsertRequest>>(
2846 mut self,
2847 v: V,
2848 ) -> Self {
2849 self.0.request = v.into();
2850 self
2851 }
2852
2853 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2855 self.0.options = v.into();
2856 self
2857 }
2858
2859 pub async fn send(self) -> Result<crate::model::Operation> {
2861 (*self.0.stub)
2862 .insert(self.0.request, self.0.options)
2863 .await
2864 .map(gax::response::Response::into_body)
2865 }
2866
2867 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2869 self.0.request.project = v.into();
2870 self
2871 }
2872
2873 pub fn set_request_id<T>(mut self, v: T) -> Self
2875 where
2876 T: std::convert::Into<std::string::String>,
2877 {
2878 self.0.request.request_id = std::option::Option::Some(v.into());
2879 self
2880 }
2881
2882 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
2884 where
2885 T: std::convert::Into<std::string::String>,
2886 {
2887 self.0.request.request_id = v.map(|x| x.into());
2888 self
2889 }
2890
2891 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
2893 self.0.request.zone = v.into();
2894 self
2895 }
2896
2897 pub fn set_body<T>(mut self, v: T) -> Self
2899 where
2900 T: std::convert::Into<crate::model::InstanceGroupManager>,
2901 {
2902 self.0.request.body = std::option::Option::Some(v.into());
2903 self
2904 }
2905
2906 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2908 where
2909 T: std::convert::Into<crate::model::InstanceGroupManager>,
2910 {
2911 self.0.request.body = v.map(|x| x.into());
2912 self
2913 }
2914 }
2915
2916 #[doc(hidden)]
2917 impl gax::options::internal::RequestBuilder for Insert {
2918 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2919 &mut self.0.options
2920 }
2921 }
2922
2923 #[derive(Clone, Debug)]
2945 pub struct List(RequestBuilder<crate::model::instance_group_managers::ListRequest>);
2946
2947 impl List {
2948 pub(crate) fn new(
2949 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
2950 ) -> Self {
2951 Self(RequestBuilder::new(stub))
2952 }
2953
2954 pub fn with_request<V: Into<crate::model::instance_group_managers::ListRequest>>(
2956 mut self,
2957 v: V,
2958 ) -> Self {
2959 self.0.request = v.into();
2960 self
2961 }
2962
2963 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2965 self.0.options = v.into();
2966 self
2967 }
2968
2969 pub async fn send(self) -> Result<crate::model::InstanceGroupManagerList> {
2971 (*self.0.stub)
2972 .list(self.0.request, self.0.options)
2973 .await
2974 .map(gax::response::Response::into_body)
2975 }
2976
2977 pub fn by_page(
2979 self,
2980 ) -> impl gax::paginator::Paginator<crate::model::InstanceGroupManagerList, gax::error::Error>
2981 {
2982 use std::clone::Clone;
2983 let token = self.0.request.page_token.clone().unwrap_or_default();
2984 let execute = move |token: String| {
2985 let mut builder = self.clone();
2986 builder.0.request = builder.0.request.set_page_token(token);
2987 builder.send()
2988 };
2989 gax::paginator::internal::new_paginator(token, execute)
2990 }
2991
2992 pub fn by_item(
2994 self,
2995 ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceGroupManagerList, gax::error::Error>
2996 {
2997 use gax::paginator::Paginator;
2998 self.by_page().items()
2999 }
3000
3001 pub fn set_filter<T>(mut self, v: T) -> Self
3003 where
3004 T: std::convert::Into<std::string::String>,
3005 {
3006 self.0.request.filter = std::option::Option::Some(v.into());
3007 self
3008 }
3009
3010 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3012 where
3013 T: std::convert::Into<std::string::String>,
3014 {
3015 self.0.request.filter = v.map(|x| x.into());
3016 self
3017 }
3018
3019 pub fn set_max_results<T>(mut self, v: T) -> Self
3021 where
3022 T: std::convert::Into<u32>,
3023 {
3024 self.0.request.max_results = std::option::Option::Some(v.into());
3025 self
3026 }
3027
3028 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
3030 where
3031 T: std::convert::Into<u32>,
3032 {
3033 self.0.request.max_results = v.map(|x| x.into());
3034 self
3035 }
3036
3037 pub fn set_order_by<T>(mut self, v: T) -> Self
3039 where
3040 T: std::convert::Into<std::string::String>,
3041 {
3042 self.0.request.order_by = std::option::Option::Some(v.into());
3043 self
3044 }
3045
3046 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
3048 where
3049 T: std::convert::Into<std::string::String>,
3050 {
3051 self.0.request.order_by = v.map(|x| x.into());
3052 self
3053 }
3054
3055 pub fn set_page_token<T>(mut self, v: T) -> Self
3057 where
3058 T: std::convert::Into<std::string::String>,
3059 {
3060 self.0.request.page_token = std::option::Option::Some(v.into());
3061 self
3062 }
3063
3064 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
3066 where
3067 T: std::convert::Into<std::string::String>,
3068 {
3069 self.0.request.page_token = v.map(|x| x.into());
3070 self
3071 }
3072
3073 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3075 self.0.request.project = v.into();
3076 self
3077 }
3078
3079 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
3081 where
3082 T: std::convert::Into<bool>,
3083 {
3084 self.0.request.return_partial_success = std::option::Option::Some(v.into());
3085 self
3086 }
3087
3088 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
3090 where
3091 T: std::convert::Into<bool>,
3092 {
3093 self.0.request.return_partial_success = v.map(|x| x.into());
3094 self
3095 }
3096
3097 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3099 self.0.request.zone = v.into();
3100 self
3101 }
3102 }
3103
3104 #[doc(hidden)]
3105 impl gax::options::internal::RequestBuilder for List {
3106 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3107 &mut self.0.options
3108 }
3109 }
3110
3111 #[derive(Clone, Debug)]
3133 pub struct ListErrors(RequestBuilder<crate::model::instance_group_managers::ListErrorsRequest>);
3134
3135 impl ListErrors {
3136 pub(crate) fn new(
3137 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3138 ) -> Self {
3139 Self(RequestBuilder::new(stub))
3140 }
3141
3142 pub fn with_request<V: Into<crate::model::instance_group_managers::ListErrorsRequest>>(
3144 mut self,
3145 v: V,
3146 ) -> Self {
3147 self.0.request = v.into();
3148 self
3149 }
3150
3151 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3153 self.0.options = v.into();
3154 self
3155 }
3156
3157 pub async fn send(self) -> Result<crate::model::InstanceGroupManagersListErrorsResponse> {
3159 (*self.0.stub)
3160 .list_errors(self.0.request, self.0.options)
3161 .await
3162 .map(gax::response::Response::into_body)
3163 }
3164
3165 pub fn by_page(
3167 self,
3168 ) -> impl gax::paginator::Paginator<
3169 crate::model::InstanceGroupManagersListErrorsResponse,
3170 gax::error::Error,
3171 > {
3172 use std::clone::Clone;
3173 let token = self.0.request.page_token.clone().unwrap_or_default();
3174 let execute = move |token: String| {
3175 let mut builder = self.clone();
3176 builder.0.request = builder.0.request.set_page_token(token);
3177 builder.send()
3178 };
3179 gax::paginator::internal::new_paginator(token, execute)
3180 }
3181
3182 pub fn by_item(
3184 self,
3185 ) -> impl gax::paginator::ItemPaginator<
3186 crate::model::InstanceGroupManagersListErrorsResponse,
3187 gax::error::Error,
3188 > {
3189 use gax::paginator::Paginator;
3190 self.by_page().items()
3191 }
3192
3193 pub fn set_filter<T>(mut self, v: T) -> Self
3195 where
3196 T: std::convert::Into<std::string::String>,
3197 {
3198 self.0.request.filter = std::option::Option::Some(v.into());
3199 self
3200 }
3201
3202 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3204 where
3205 T: std::convert::Into<std::string::String>,
3206 {
3207 self.0.request.filter = v.map(|x| x.into());
3208 self
3209 }
3210
3211 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
3213 self.0.request.instance_group_manager = v.into();
3214 self
3215 }
3216
3217 pub fn set_max_results<T>(mut self, v: T) -> Self
3219 where
3220 T: std::convert::Into<u32>,
3221 {
3222 self.0.request.max_results = std::option::Option::Some(v.into());
3223 self
3224 }
3225
3226 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
3228 where
3229 T: std::convert::Into<u32>,
3230 {
3231 self.0.request.max_results = v.map(|x| x.into());
3232 self
3233 }
3234
3235 pub fn set_order_by<T>(mut self, v: T) -> Self
3237 where
3238 T: std::convert::Into<std::string::String>,
3239 {
3240 self.0.request.order_by = std::option::Option::Some(v.into());
3241 self
3242 }
3243
3244 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
3246 where
3247 T: std::convert::Into<std::string::String>,
3248 {
3249 self.0.request.order_by = v.map(|x| x.into());
3250 self
3251 }
3252
3253 pub fn set_page_token<T>(mut self, v: T) -> Self
3255 where
3256 T: std::convert::Into<std::string::String>,
3257 {
3258 self.0.request.page_token = std::option::Option::Some(v.into());
3259 self
3260 }
3261
3262 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
3264 where
3265 T: std::convert::Into<std::string::String>,
3266 {
3267 self.0.request.page_token = v.map(|x| x.into());
3268 self
3269 }
3270
3271 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3273 self.0.request.project = v.into();
3274 self
3275 }
3276
3277 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
3279 where
3280 T: std::convert::Into<bool>,
3281 {
3282 self.0.request.return_partial_success = std::option::Option::Some(v.into());
3283 self
3284 }
3285
3286 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
3288 where
3289 T: std::convert::Into<bool>,
3290 {
3291 self.0.request.return_partial_success = v.map(|x| x.into());
3292 self
3293 }
3294
3295 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3297 self.0.request.zone = v.into();
3298 self
3299 }
3300 }
3301
3302 #[doc(hidden)]
3303 impl gax::options::internal::RequestBuilder for ListErrors {
3304 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3305 &mut self.0.options
3306 }
3307 }
3308
3309 #[derive(Clone, Debug)]
3331 pub struct ListManagedInstances(
3332 RequestBuilder<crate::model::instance_group_managers::ListManagedInstancesRequest>,
3333 );
3334
3335 impl ListManagedInstances {
3336 pub(crate) fn new(
3337 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3338 ) -> Self {
3339 Self(RequestBuilder::new(stub))
3340 }
3341
3342 pub fn with_request<
3344 V: Into<crate::model::instance_group_managers::ListManagedInstancesRequest>,
3345 >(
3346 mut self,
3347 v: V,
3348 ) -> Self {
3349 self.0.request = v.into();
3350 self
3351 }
3352
3353 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3355 self.0.options = v.into();
3356 self
3357 }
3358
3359 pub async fn send(
3361 self,
3362 ) -> Result<crate::model::InstanceGroupManagersListManagedInstancesResponse> {
3363 (*self.0.stub)
3364 .list_managed_instances(self.0.request, self.0.options)
3365 .await
3366 .map(gax::response::Response::into_body)
3367 }
3368
3369 pub fn by_page(
3371 self,
3372 ) -> impl gax::paginator::Paginator<
3373 crate::model::InstanceGroupManagersListManagedInstancesResponse,
3374 gax::error::Error,
3375 > {
3376 use std::clone::Clone;
3377 let token = self.0.request.page_token.clone().unwrap_or_default();
3378 let execute = move |token: String| {
3379 let mut builder = self.clone();
3380 builder.0.request = builder.0.request.set_page_token(token);
3381 builder.send()
3382 };
3383 gax::paginator::internal::new_paginator(token, execute)
3384 }
3385
3386 pub fn by_item(
3388 self,
3389 ) -> impl gax::paginator::ItemPaginator<
3390 crate::model::InstanceGroupManagersListManagedInstancesResponse,
3391 gax::error::Error,
3392 > {
3393 use gax::paginator::Paginator;
3394 self.by_page().items()
3395 }
3396
3397 pub fn set_filter<T>(mut self, v: T) -> Self
3399 where
3400 T: std::convert::Into<std::string::String>,
3401 {
3402 self.0.request.filter = std::option::Option::Some(v.into());
3403 self
3404 }
3405
3406 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3408 where
3409 T: std::convert::Into<std::string::String>,
3410 {
3411 self.0.request.filter = v.map(|x| x.into());
3412 self
3413 }
3414
3415 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
3417 self.0.request.instance_group_manager = v.into();
3418 self
3419 }
3420
3421 pub fn set_max_results<T>(mut self, v: T) -> Self
3423 where
3424 T: std::convert::Into<u32>,
3425 {
3426 self.0.request.max_results = std::option::Option::Some(v.into());
3427 self
3428 }
3429
3430 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
3432 where
3433 T: std::convert::Into<u32>,
3434 {
3435 self.0.request.max_results = v.map(|x| x.into());
3436 self
3437 }
3438
3439 pub fn set_order_by<T>(mut self, v: T) -> Self
3441 where
3442 T: std::convert::Into<std::string::String>,
3443 {
3444 self.0.request.order_by = std::option::Option::Some(v.into());
3445 self
3446 }
3447
3448 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
3450 where
3451 T: std::convert::Into<std::string::String>,
3452 {
3453 self.0.request.order_by = v.map(|x| x.into());
3454 self
3455 }
3456
3457 pub fn set_page_token<T>(mut self, v: T) -> Self
3459 where
3460 T: std::convert::Into<std::string::String>,
3461 {
3462 self.0.request.page_token = std::option::Option::Some(v.into());
3463 self
3464 }
3465
3466 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
3468 where
3469 T: std::convert::Into<std::string::String>,
3470 {
3471 self.0.request.page_token = v.map(|x| x.into());
3472 self
3473 }
3474
3475 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3477 self.0.request.project = v.into();
3478 self
3479 }
3480
3481 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
3483 where
3484 T: std::convert::Into<bool>,
3485 {
3486 self.0.request.return_partial_success = std::option::Option::Some(v.into());
3487 self
3488 }
3489
3490 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
3492 where
3493 T: std::convert::Into<bool>,
3494 {
3495 self.0.request.return_partial_success = v.map(|x| x.into());
3496 self
3497 }
3498
3499 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3501 self.0.request.zone = v.into();
3502 self
3503 }
3504 }
3505
3506 #[doc(hidden)]
3507 impl gax::options::internal::RequestBuilder for ListManagedInstances {
3508 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3509 &mut self.0.options
3510 }
3511 }
3512
3513 #[derive(Clone, Debug)]
3535 pub struct ListPerInstanceConfigs(
3536 RequestBuilder<crate::model::instance_group_managers::ListPerInstanceConfigsRequest>,
3537 );
3538
3539 impl ListPerInstanceConfigs {
3540 pub(crate) fn new(
3541 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3542 ) -> Self {
3543 Self(RequestBuilder::new(stub))
3544 }
3545
3546 pub fn with_request<
3548 V: Into<crate::model::instance_group_managers::ListPerInstanceConfigsRequest>,
3549 >(
3550 mut self,
3551 v: V,
3552 ) -> Self {
3553 self.0.request = v.into();
3554 self
3555 }
3556
3557 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3559 self.0.options = v.into();
3560 self
3561 }
3562
3563 pub async fn send(
3565 self,
3566 ) -> Result<crate::model::InstanceGroupManagersListPerInstanceConfigsResp> {
3567 (*self.0.stub)
3568 .list_per_instance_configs(self.0.request, self.0.options)
3569 .await
3570 .map(gax::response::Response::into_body)
3571 }
3572
3573 pub fn by_page(
3575 self,
3576 ) -> impl gax::paginator::Paginator<
3577 crate::model::InstanceGroupManagersListPerInstanceConfigsResp,
3578 gax::error::Error,
3579 > {
3580 use std::clone::Clone;
3581 let token = self.0.request.page_token.clone().unwrap_or_default();
3582 let execute = move |token: String| {
3583 let mut builder = self.clone();
3584 builder.0.request = builder.0.request.set_page_token(token);
3585 builder.send()
3586 };
3587 gax::paginator::internal::new_paginator(token, execute)
3588 }
3589
3590 pub fn by_item(
3592 self,
3593 ) -> impl gax::paginator::ItemPaginator<
3594 crate::model::InstanceGroupManagersListPerInstanceConfigsResp,
3595 gax::error::Error,
3596 > {
3597 use gax::paginator::Paginator;
3598 self.by_page().items()
3599 }
3600
3601 pub fn set_filter<T>(mut self, v: T) -> Self
3603 where
3604 T: std::convert::Into<std::string::String>,
3605 {
3606 self.0.request.filter = std::option::Option::Some(v.into());
3607 self
3608 }
3609
3610 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3612 where
3613 T: std::convert::Into<std::string::String>,
3614 {
3615 self.0.request.filter = v.map(|x| x.into());
3616 self
3617 }
3618
3619 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
3621 self.0.request.instance_group_manager = v.into();
3622 self
3623 }
3624
3625 pub fn set_max_results<T>(mut self, v: T) -> Self
3627 where
3628 T: std::convert::Into<u32>,
3629 {
3630 self.0.request.max_results = std::option::Option::Some(v.into());
3631 self
3632 }
3633
3634 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
3636 where
3637 T: std::convert::Into<u32>,
3638 {
3639 self.0.request.max_results = v.map(|x| x.into());
3640 self
3641 }
3642
3643 pub fn set_order_by<T>(mut self, v: T) -> Self
3645 where
3646 T: std::convert::Into<std::string::String>,
3647 {
3648 self.0.request.order_by = std::option::Option::Some(v.into());
3649 self
3650 }
3651
3652 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
3654 where
3655 T: std::convert::Into<std::string::String>,
3656 {
3657 self.0.request.order_by = v.map(|x| x.into());
3658 self
3659 }
3660
3661 pub fn set_page_token<T>(mut self, v: T) -> Self
3663 where
3664 T: std::convert::Into<std::string::String>,
3665 {
3666 self.0.request.page_token = std::option::Option::Some(v.into());
3667 self
3668 }
3669
3670 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
3672 where
3673 T: std::convert::Into<std::string::String>,
3674 {
3675 self.0.request.page_token = v.map(|x| x.into());
3676 self
3677 }
3678
3679 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3681 self.0.request.project = v.into();
3682 self
3683 }
3684
3685 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
3687 where
3688 T: std::convert::Into<bool>,
3689 {
3690 self.0.request.return_partial_success = std::option::Option::Some(v.into());
3691 self
3692 }
3693
3694 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
3696 where
3697 T: std::convert::Into<bool>,
3698 {
3699 self.0.request.return_partial_success = v.map(|x| x.into());
3700 self
3701 }
3702
3703 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3705 self.0.request.zone = v.into();
3706 self
3707 }
3708 }
3709
3710 #[doc(hidden)]
3711 impl gax::options::internal::RequestBuilder for ListPerInstanceConfigs {
3712 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3713 &mut self.0.options
3714 }
3715 }
3716
3717 #[derive(Clone, Debug)]
3735 pub struct Patch(RequestBuilder<crate::model::instance_group_managers::PatchRequest>);
3736
3737 impl Patch {
3738 pub(crate) fn new(
3739 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3740 ) -> Self {
3741 Self(RequestBuilder::new(stub))
3742 }
3743
3744 pub fn with_request<V: Into<crate::model::instance_group_managers::PatchRequest>>(
3746 mut self,
3747 v: V,
3748 ) -> Self {
3749 self.0.request = v.into();
3750 self
3751 }
3752
3753 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3755 self.0.options = v.into();
3756 self
3757 }
3758
3759 pub async fn send(self) -> Result<crate::model::Operation> {
3761 (*self.0.stub)
3762 .patch(self.0.request, self.0.options)
3763 .await
3764 .map(gax::response::Response::into_body)
3765 }
3766
3767 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
3769 self.0.request.instance_group_manager = v.into();
3770 self
3771 }
3772
3773 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3775 self.0.request.project = v.into();
3776 self
3777 }
3778
3779 pub fn set_request_id<T>(mut self, v: T) -> Self
3781 where
3782 T: std::convert::Into<std::string::String>,
3783 {
3784 self.0.request.request_id = std::option::Option::Some(v.into());
3785 self
3786 }
3787
3788 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
3790 where
3791 T: std::convert::Into<std::string::String>,
3792 {
3793 self.0.request.request_id = v.map(|x| x.into());
3794 self
3795 }
3796
3797 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3799 self.0.request.zone = v.into();
3800 self
3801 }
3802
3803 pub fn set_body<T>(mut self, v: T) -> Self
3805 where
3806 T: std::convert::Into<crate::model::InstanceGroupManager>,
3807 {
3808 self.0.request.body = std::option::Option::Some(v.into());
3809 self
3810 }
3811
3812 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3814 where
3815 T: std::convert::Into<crate::model::InstanceGroupManager>,
3816 {
3817 self.0.request.body = v.map(|x| x.into());
3818 self
3819 }
3820 }
3821
3822 #[doc(hidden)]
3823 impl gax::options::internal::RequestBuilder for Patch {
3824 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3825 &mut self.0.options
3826 }
3827 }
3828
3829 #[derive(Clone, Debug)]
3847 pub struct PatchPerInstanceConfigs(
3848 RequestBuilder<crate::model::instance_group_managers::PatchPerInstanceConfigsRequest>,
3849 );
3850
3851 impl PatchPerInstanceConfigs {
3852 pub(crate) fn new(
3853 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3854 ) -> Self {
3855 Self(RequestBuilder::new(stub))
3856 }
3857
3858 pub fn with_request<
3860 V: Into<crate::model::instance_group_managers::PatchPerInstanceConfigsRequest>,
3861 >(
3862 mut self,
3863 v: V,
3864 ) -> Self {
3865 self.0.request = v.into();
3866 self
3867 }
3868
3869 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3871 self.0.options = v.into();
3872 self
3873 }
3874
3875 pub async fn send(self) -> Result<crate::model::Operation> {
3877 (*self.0.stub)
3878 .patch_per_instance_configs(self.0.request, self.0.options)
3879 .await
3880 .map(gax::response::Response::into_body)
3881 }
3882
3883 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
3885 self.0.request.instance_group_manager = v.into();
3886 self
3887 }
3888
3889 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3891 self.0.request.project = v.into();
3892 self
3893 }
3894
3895 pub fn set_request_id<T>(mut self, v: T) -> Self
3897 where
3898 T: std::convert::Into<std::string::String>,
3899 {
3900 self.0.request.request_id = std::option::Option::Some(v.into());
3901 self
3902 }
3903
3904 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
3906 where
3907 T: std::convert::Into<std::string::String>,
3908 {
3909 self.0.request.request_id = v.map(|x| x.into());
3910 self
3911 }
3912
3913 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
3915 self.0.request.zone = v.into();
3916 self
3917 }
3918
3919 pub fn set_body<T>(mut self, v: T) -> Self
3921 where
3922 T: std::convert::Into<crate::model::InstanceGroupManagersPatchPerInstanceConfigsReq>,
3923 {
3924 self.0.request.body = std::option::Option::Some(v.into());
3925 self
3926 }
3927
3928 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3930 where
3931 T: std::convert::Into<crate::model::InstanceGroupManagersPatchPerInstanceConfigsReq>,
3932 {
3933 self.0.request.body = v.map(|x| x.into());
3934 self
3935 }
3936 }
3937
3938 #[doc(hidden)]
3939 impl gax::options::internal::RequestBuilder for PatchPerInstanceConfigs {
3940 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3941 &mut self.0.options
3942 }
3943 }
3944
3945 #[derive(Clone, Debug)]
3963 pub struct RecreateInstances(
3964 RequestBuilder<crate::model::instance_group_managers::RecreateInstancesRequest>,
3965 );
3966
3967 impl RecreateInstances {
3968 pub(crate) fn new(
3969 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
3970 ) -> Self {
3971 Self(RequestBuilder::new(stub))
3972 }
3973
3974 pub fn with_request<
3976 V: Into<crate::model::instance_group_managers::RecreateInstancesRequest>,
3977 >(
3978 mut self,
3979 v: V,
3980 ) -> Self {
3981 self.0.request = v.into();
3982 self
3983 }
3984
3985 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3987 self.0.options = v.into();
3988 self
3989 }
3990
3991 pub async fn send(self) -> Result<crate::model::Operation> {
3993 (*self.0.stub)
3994 .recreate_instances(self.0.request, self.0.options)
3995 .await
3996 .map(gax::response::Response::into_body)
3997 }
3998
3999 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4001 self.0.request.instance_group_manager = v.into();
4002 self
4003 }
4004
4005 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4007 self.0.request.project = v.into();
4008 self
4009 }
4010
4011 pub fn set_request_id<T>(mut self, v: T) -> Self
4013 where
4014 T: std::convert::Into<std::string::String>,
4015 {
4016 self.0.request.request_id = std::option::Option::Some(v.into());
4017 self
4018 }
4019
4020 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4022 where
4023 T: std::convert::Into<std::string::String>,
4024 {
4025 self.0.request.request_id = v.map(|x| x.into());
4026 self
4027 }
4028
4029 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4031 self.0.request.zone = v.into();
4032 self
4033 }
4034
4035 pub fn set_body<T>(mut self, v: T) -> Self
4037 where
4038 T: std::convert::Into<crate::model::InstanceGroupManagersRecreateInstancesRequest>,
4039 {
4040 self.0.request.body = std::option::Option::Some(v.into());
4041 self
4042 }
4043
4044 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4046 where
4047 T: std::convert::Into<crate::model::InstanceGroupManagersRecreateInstancesRequest>,
4048 {
4049 self.0.request.body = v.map(|x| x.into());
4050 self
4051 }
4052 }
4053
4054 #[doc(hidden)]
4055 impl gax::options::internal::RequestBuilder for RecreateInstances {
4056 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4057 &mut self.0.options
4058 }
4059 }
4060
4061 #[derive(Clone, Debug)]
4079 pub struct Resize(RequestBuilder<crate::model::instance_group_managers::ResizeRequest>);
4080
4081 impl Resize {
4082 pub(crate) fn new(
4083 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4084 ) -> Self {
4085 Self(RequestBuilder::new(stub))
4086 }
4087
4088 pub fn with_request<V: Into<crate::model::instance_group_managers::ResizeRequest>>(
4090 mut self,
4091 v: V,
4092 ) -> Self {
4093 self.0.request = v.into();
4094 self
4095 }
4096
4097 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4099 self.0.options = v.into();
4100 self
4101 }
4102
4103 pub async fn send(self) -> Result<crate::model::Operation> {
4105 (*self.0.stub)
4106 .resize(self.0.request, self.0.options)
4107 .await
4108 .map(gax::response::Response::into_body)
4109 }
4110
4111 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4113 self.0.request.instance_group_manager = v.into();
4114 self
4115 }
4116
4117 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4119 self.0.request.project = v.into();
4120 self
4121 }
4122
4123 pub fn set_request_id<T>(mut self, v: T) -> Self
4125 where
4126 T: std::convert::Into<std::string::String>,
4127 {
4128 self.0.request.request_id = std::option::Option::Some(v.into());
4129 self
4130 }
4131
4132 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4134 where
4135 T: std::convert::Into<std::string::String>,
4136 {
4137 self.0.request.request_id = v.map(|x| x.into());
4138 self
4139 }
4140
4141 pub fn set_size<T: Into<i32>>(mut self, v: T) -> Self {
4143 self.0.request.size = v.into();
4144 self
4145 }
4146
4147 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4149 self.0.request.zone = v.into();
4150 self
4151 }
4152 }
4153
4154 #[doc(hidden)]
4155 impl gax::options::internal::RequestBuilder for Resize {
4156 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4157 &mut self.0.options
4158 }
4159 }
4160
4161 #[derive(Clone, Debug)]
4179 pub struct ResumeInstances(
4180 RequestBuilder<crate::model::instance_group_managers::ResumeInstancesRequest>,
4181 );
4182
4183 impl ResumeInstances {
4184 pub(crate) fn new(
4185 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4186 ) -> Self {
4187 Self(RequestBuilder::new(stub))
4188 }
4189
4190 pub fn with_request<
4192 V: Into<crate::model::instance_group_managers::ResumeInstancesRequest>,
4193 >(
4194 mut self,
4195 v: V,
4196 ) -> Self {
4197 self.0.request = v.into();
4198 self
4199 }
4200
4201 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4203 self.0.options = v.into();
4204 self
4205 }
4206
4207 pub async fn send(self) -> Result<crate::model::Operation> {
4209 (*self.0.stub)
4210 .resume_instances(self.0.request, self.0.options)
4211 .await
4212 .map(gax::response::Response::into_body)
4213 }
4214
4215 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4217 self.0.request.instance_group_manager = v.into();
4218 self
4219 }
4220
4221 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4223 self.0.request.project = v.into();
4224 self
4225 }
4226
4227 pub fn set_request_id<T>(mut self, v: T) -> Self
4229 where
4230 T: std::convert::Into<std::string::String>,
4231 {
4232 self.0.request.request_id = std::option::Option::Some(v.into());
4233 self
4234 }
4235
4236 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4238 where
4239 T: std::convert::Into<std::string::String>,
4240 {
4241 self.0.request.request_id = v.map(|x| x.into());
4242 self
4243 }
4244
4245 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4247 self.0.request.zone = v.into();
4248 self
4249 }
4250
4251 pub fn set_body<T>(mut self, v: T) -> Self
4253 where
4254 T: std::convert::Into<crate::model::InstanceGroupManagersResumeInstancesRequest>,
4255 {
4256 self.0.request.body = std::option::Option::Some(v.into());
4257 self
4258 }
4259
4260 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4262 where
4263 T: std::convert::Into<crate::model::InstanceGroupManagersResumeInstancesRequest>,
4264 {
4265 self.0.request.body = v.map(|x| x.into());
4266 self
4267 }
4268 }
4269
4270 #[doc(hidden)]
4271 impl gax::options::internal::RequestBuilder for ResumeInstances {
4272 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4273 &mut self.0.options
4274 }
4275 }
4276
4277 #[derive(Clone, Debug)]
4295 pub struct SetInstanceTemplate(
4296 RequestBuilder<crate::model::instance_group_managers::SetInstanceTemplateRequest>,
4297 );
4298
4299 impl SetInstanceTemplate {
4300 pub(crate) fn new(
4301 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4302 ) -> Self {
4303 Self(RequestBuilder::new(stub))
4304 }
4305
4306 pub fn with_request<
4308 V: Into<crate::model::instance_group_managers::SetInstanceTemplateRequest>,
4309 >(
4310 mut self,
4311 v: V,
4312 ) -> Self {
4313 self.0.request = v.into();
4314 self
4315 }
4316
4317 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4319 self.0.options = v.into();
4320 self
4321 }
4322
4323 pub async fn send(self) -> Result<crate::model::Operation> {
4325 (*self.0.stub)
4326 .set_instance_template(self.0.request, self.0.options)
4327 .await
4328 .map(gax::response::Response::into_body)
4329 }
4330
4331 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4333 self.0.request.instance_group_manager = v.into();
4334 self
4335 }
4336
4337 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4339 self.0.request.project = v.into();
4340 self
4341 }
4342
4343 pub fn set_request_id<T>(mut self, v: T) -> Self
4345 where
4346 T: std::convert::Into<std::string::String>,
4347 {
4348 self.0.request.request_id = std::option::Option::Some(v.into());
4349 self
4350 }
4351
4352 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4354 where
4355 T: std::convert::Into<std::string::String>,
4356 {
4357 self.0.request.request_id = v.map(|x| x.into());
4358 self
4359 }
4360
4361 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4363 self.0.request.zone = v.into();
4364 self
4365 }
4366
4367 pub fn set_body<T>(mut self, v: T) -> Self
4369 where
4370 T: std::convert::Into<crate::model::InstanceGroupManagersSetInstanceTemplateRequest>,
4371 {
4372 self.0.request.body = std::option::Option::Some(v.into());
4373 self
4374 }
4375
4376 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4378 where
4379 T: std::convert::Into<crate::model::InstanceGroupManagersSetInstanceTemplateRequest>,
4380 {
4381 self.0.request.body = v.map(|x| x.into());
4382 self
4383 }
4384 }
4385
4386 #[doc(hidden)]
4387 impl gax::options::internal::RequestBuilder for SetInstanceTemplate {
4388 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4389 &mut self.0.options
4390 }
4391 }
4392
4393 #[derive(Clone, Debug)]
4411 pub struct SetTargetPools(
4412 RequestBuilder<crate::model::instance_group_managers::SetTargetPoolsRequest>,
4413 );
4414
4415 impl SetTargetPools {
4416 pub(crate) fn new(
4417 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4418 ) -> Self {
4419 Self(RequestBuilder::new(stub))
4420 }
4421
4422 pub fn with_request<
4424 V: Into<crate::model::instance_group_managers::SetTargetPoolsRequest>,
4425 >(
4426 mut self,
4427 v: V,
4428 ) -> Self {
4429 self.0.request = v.into();
4430 self
4431 }
4432
4433 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4435 self.0.options = v.into();
4436 self
4437 }
4438
4439 pub async fn send(self) -> Result<crate::model::Operation> {
4441 (*self.0.stub)
4442 .set_target_pools(self.0.request, self.0.options)
4443 .await
4444 .map(gax::response::Response::into_body)
4445 }
4446
4447 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4449 self.0.request.instance_group_manager = v.into();
4450 self
4451 }
4452
4453 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4455 self.0.request.project = v.into();
4456 self
4457 }
4458
4459 pub fn set_request_id<T>(mut self, v: T) -> Self
4461 where
4462 T: std::convert::Into<std::string::String>,
4463 {
4464 self.0.request.request_id = std::option::Option::Some(v.into());
4465 self
4466 }
4467
4468 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4470 where
4471 T: std::convert::Into<std::string::String>,
4472 {
4473 self.0.request.request_id = v.map(|x| x.into());
4474 self
4475 }
4476
4477 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4479 self.0.request.zone = v.into();
4480 self
4481 }
4482
4483 pub fn set_body<T>(mut self, v: T) -> Self
4485 where
4486 T: std::convert::Into<crate::model::InstanceGroupManagersSetTargetPoolsRequest>,
4487 {
4488 self.0.request.body = std::option::Option::Some(v.into());
4489 self
4490 }
4491
4492 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4494 where
4495 T: std::convert::Into<crate::model::InstanceGroupManagersSetTargetPoolsRequest>,
4496 {
4497 self.0.request.body = v.map(|x| x.into());
4498 self
4499 }
4500 }
4501
4502 #[doc(hidden)]
4503 impl gax::options::internal::RequestBuilder for SetTargetPools {
4504 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4505 &mut self.0.options
4506 }
4507 }
4508
4509 #[derive(Clone, Debug)]
4527 pub struct StartInstances(
4528 RequestBuilder<crate::model::instance_group_managers::StartInstancesRequest>,
4529 );
4530
4531 impl StartInstances {
4532 pub(crate) fn new(
4533 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4534 ) -> Self {
4535 Self(RequestBuilder::new(stub))
4536 }
4537
4538 pub fn with_request<
4540 V: Into<crate::model::instance_group_managers::StartInstancesRequest>,
4541 >(
4542 mut self,
4543 v: V,
4544 ) -> Self {
4545 self.0.request = v.into();
4546 self
4547 }
4548
4549 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4551 self.0.options = v.into();
4552 self
4553 }
4554
4555 pub async fn send(self) -> Result<crate::model::Operation> {
4557 (*self.0.stub)
4558 .start_instances(self.0.request, self.0.options)
4559 .await
4560 .map(gax::response::Response::into_body)
4561 }
4562
4563 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4565 self.0.request.instance_group_manager = v.into();
4566 self
4567 }
4568
4569 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4571 self.0.request.project = v.into();
4572 self
4573 }
4574
4575 pub fn set_request_id<T>(mut self, v: T) -> Self
4577 where
4578 T: std::convert::Into<std::string::String>,
4579 {
4580 self.0.request.request_id = std::option::Option::Some(v.into());
4581 self
4582 }
4583
4584 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4586 where
4587 T: std::convert::Into<std::string::String>,
4588 {
4589 self.0.request.request_id = v.map(|x| x.into());
4590 self
4591 }
4592
4593 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4595 self.0.request.zone = v.into();
4596 self
4597 }
4598
4599 pub fn set_body<T>(mut self, v: T) -> Self
4601 where
4602 T: std::convert::Into<crate::model::InstanceGroupManagersStartInstancesRequest>,
4603 {
4604 self.0.request.body = std::option::Option::Some(v.into());
4605 self
4606 }
4607
4608 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4610 where
4611 T: std::convert::Into<crate::model::InstanceGroupManagersStartInstancesRequest>,
4612 {
4613 self.0.request.body = v.map(|x| x.into());
4614 self
4615 }
4616 }
4617
4618 #[doc(hidden)]
4619 impl gax::options::internal::RequestBuilder for StartInstances {
4620 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4621 &mut self.0.options
4622 }
4623 }
4624
4625 #[derive(Clone, Debug)]
4643 pub struct StopInstances(
4644 RequestBuilder<crate::model::instance_group_managers::StopInstancesRequest>,
4645 );
4646
4647 impl StopInstances {
4648 pub(crate) fn new(
4649 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4650 ) -> Self {
4651 Self(RequestBuilder::new(stub))
4652 }
4653
4654 pub fn with_request<
4656 V: Into<crate::model::instance_group_managers::StopInstancesRequest>,
4657 >(
4658 mut self,
4659 v: V,
4660 ) -> Self {
4661 self.0.request = v.into();
4662 self
4663 }
4664
4665 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4667 self.0.options = v.into();
4668 self
4669 }
4670
4671 pub async fn send(self) -> Result<crate::model::Operation> {
4673 (*self.0.stub)
4674 .stop_instances(self.0.request, self.0.options)
4675 .await
4676 .map(gax::response::Response::into_body)
4677 }
4678
4679 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4681 self.0.request.instance_group_manager = v.into();
4682 self
4683 }
4684
4685 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4687 self.0.request.project = v.into();
4688 self
4689 }
4690
4691 pub fn set_request_id<T>(mut self, v: T) -> Self
4693 where
4694 T: std::convert::Into<std::string::String>,
4695 {
4696 self.0.request.request_id = std::option::Option::Some(v.into());
4697 self
4698 }
4699
4700 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4702 where
4703 T: std::convert::Into<std::string::String>,
4704 {
4705 self.0.request.request_id = v.map(|x| x.into());
4706 self
4707 }
4708
4709 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4711 self.0.request.zone = v.into();
4712 self
4713 }
4714
4715 pub fn set_body<T>(mut self, v: T) -> Self
4717 where
4718 T: std::convert::Into<crate::model::InstanceGroupManagersStopInstancesRequest>,
4719 {
4720 self.0.request.body = std::option::Option::Some(v.into());
4721 self
4722 }
4723
4724 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4726 where
4727 T: std::convert::Into<crate::model::InstanceGroupManagersStopInstancesRequest>,
4728 {
4729 self.0.request.body = v.map(|x| x.into());
4730 self
4731 }
4732 }
4733
4734 #[doc(hidden)]
4735 impl gax::options::internal::RequestBuilder for StopInstances {
4736 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4737 &mut self.0.options
4738 }
4739 }
4740
4741 #[derive(Clone, Debug)]
4759 pub struct SuspendInstances(
4760 RequestBuilder<crate::model::instance_group_managers::SuspendInstancesRequest>,
4761 );
4762
4763 impl SuspendInstances {
4764 pub(crate) fn new(
4765 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4766 ) -> Self {
4767 Self(RequestBuilder::new(stub))
4768 }
4769
4770 pub fn with_request<
4772 V: Into<crate::model::instance_group_managers::SuspendInstancesRequest>,
4773 >(
4774 mut self,
4775 v: V,
4776 ) -> Self {
4777 self.0.request = v.into();
4778 self
4779 }
4780
4781 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4783 self.0.options = v.into();
4784 self
4785 }
4786
4787 pub async fn send(self) -> Result<crate::model::Operation> {
4789 (*self.0.stub)
4790 .suspend_instances(self.0.request, self.0.options)
4791 .await
4792 .map(gax::response::Response::into_body)
4793 }
4794
4795 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4797 self.0.request.instance_group_manager = v.into();
4798 self
4799 }
4800
4801 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4803 self.0.request.project = v.into();
4804 self
4805 }
4806
4807 pub fn set_request_id<T>(mut self, v: T) -> Self
4809 where
4810 T: std::convert::Into<std::string::String>,
4811 {
4812 self.0.request.request_id = std::option::Option::Some(v.into());
4813 self
4814 }
4815
4816 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4818 where
4819 T: std::convert::Into<std::string::String>,
4820 {
4821 self.0.request.request_id = v.map(|x| x.into());
4822 self
4823 }
4824
4825 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4827 self.0.request.zone = v.into();
4828 self
4829 }
4830
4831 pub fn set_body<T>(mut self, v: T) -> Self
4833 where
4834 T: std::convert::Into<crate::model::InstanceGroupManagersSuspendInstancesRequest>,
4835 {
4836 self.0.request.body = std::option::Option::Some(v.into());
4837 self
4838 }
4839
4840 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4842 where
4843 T: std::convert::Into<crate::model::InstanceGroupManagersSuspendInstancesRequest>,
4844 {
4845 self.0.request.body = v.map(|x| x.into());
4846 self
4847 }
4848 }
4849
4850 #[doc(hidden)]
4851 impl gax::options::internal::RequestBuilder for SuspendInstances {
4852 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4853 &mut self.0.options
4854 }
4855 }
4856
4857 #[derive(Clone, Debug)]
4875 pub struct UpdatePerInstanceConfigs(
4876 RequestBuilder<crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest>,
4877 );
4878
4879 impl UpdatePerInstanceConfigs {
4880 pub(crate) fn new(
4881 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroupManagers>,
4882 ) -> Self {
4883 Self(RequestBuilder::new(stub))
4884 }
4885
4886 pub fn with_request<
4888 V: Into<crate::model::instance_group_managers::UpdatePerInstanceConfigsRequest>,
4889 >(
4890 mut self,
4891 v: V,
4892 ) -> Self {
4893 self.0.request = v.into();
4894 self
4895 }
4896
4897 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4899 self.0.options = v.into();
4900 self
4901 }
4902
4903 pub async fn send(self) -> Result<crate::model::Operation> {
4905 (*self.0.stub)
4906 .update_per_instance_configs(self.0.request, self.0.options)
4907 .await
4908 .map(gax::response::Response::into_body)
4909 }
4910
4911 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
4913 self.0.request.instance_group_manager = v.into();
4914 self
4915 }
4916
4917 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4919 self.0.request.project = v.into();
4920 self
4921 }
4922
4923 pub fn set_request_id<T>(mut self, v: T) -> Self
4925 where
4926 T: std::convert::Into<std::string::String>,
4927 {
4928 self.0.request.request_id = std::option::Option::Some(v.into());
4929 self
4930 }
4931
4932 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
4934 where
4935 T: std::convert::Into<std::string::String>,
4936 {
4937 self.0.request.request_id = v.map(|x| x.into());
4938 self
4939 }
4940
4941 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
4943 self.0.request.zone = v.into();
4944 self
4945 }
4946
4947 pub fn set_body<T>(mut self, v: T) -> Self
4949 where
4950 T: std::convert::Into<crate::model::InstanceGroupManagersUpdatePerInstanceConfigsReq>,
4951 {
4952 self.0.request.body = std::option::Option::Some(v.into());
4953 self
4954 }
4955
4956 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4958 where
4959 T: std::convert::Into<crate::model::InstanceGroupManagersUpdatePerInstanceConfigsReq>,
4960 {
4961 self.0.request.body = v.map(|x| x.into());
4962 self
4963 }
4964 }
4965
4966 #[doc(hidden)]
4967 impl gax::options::internal::RequestBuilder for UpdatePerInstanceConfigs {
4968 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4969 &mut self.0.options
4970 }
4971 }
4972}
4973
4974#[cfg(feature = "instance-groups")]
4975#[cfg_attr(docsrs, doc(cfg(feature = "instance-groups")))]
4976pub mod instance_groups {
4977 use crate::Result;
4978
4979 pub type ClientBuilder =
4993 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4994
4995 pub(crate) mod client {
4996 use super::super::super::client::InstanceGroups;
4997 pub struct Factory;
4998 impl gax::client_builder::internal::ClientFactory for Factory {
4999 type Client = InstanceGroups;
5000 type Credentials = gaxi::options::Credentials;
5001 async fn build(
5002 self,
5003 config: gaxi::options::ClientConfig,
5004 ) -> gax::client_builder::Result<Self::Client> {
5005 Self::Client::new(config).await
5006 }
5007 }
5008 }
5009
5010 #[derive(Clone, Debug)]
5012 pub(crate) struct RequestBuilder<R: std::default::Default> {
5013 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5014 request: R,
5015 options: gax::options::RequestOptions,
5016 }
5017
5018 impl<R> RequestBuilder<R>
5019 where
5020 R: std::default::Default,
5021 {
5022 pub(crate) fn new(
5023 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5024 ) -> Self {
5025 Self {
5026 stub,
5027 request: R::default(),
5028 options: gax::options::RequestOptions::default(),
5029 }
5030 }
5031 }
5032
5033 #[derive(Clone, Debug)]
5051 pub struct AddInstances(RequestBuilder<crate::model::instance_groups::AddInstancesRequest>);
5052
5053 impl AddInstances {
5054 pub(crate) fn new(
5055 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5056 ) -> Self {
5057 Self(RequestBuilder::new(stub))
5058 }
5059
5060 pub fn with_request<V: Into<crate::model::instance_groups::AddInstancesRequest>>(
5062 mut self,
5063 v: V,
5064 ) -> Self {
5065 self.0.request = v.into();
5066 self
5067 }
5068
5069 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5071 self.0.options = v.into();
5072 self
5073 }
5074
5075 pub async fn send(self) -> Result<crate::model::Operation> {
5077 (*self.0.stub)
5078 .add_instances(self.0.request, self.0.options)
5079 .await
5080 .map(gax::response::Response::into_body)
5081 }
5082
5083 pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
5085 self.0.request.instance_group = v.into();
5086 self
5087 }
5088
5089 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5091 self.0.request.project = v.into();
5092 self
5093 }
5094
5095 pub fn set_request_id<T>(mut self, v: T) -> Self
5097 where
5098 T: std::convert::Into<std::string::String>,
5099 {
5100 self.0.request.request_id = std::option::Option::Some(v.into());
5101 self
5102 }
5103
5104 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
5106 where
5107 T: std::convert::Into<std::string::String>,
5108 {
5109 self.0.request.request_id = v.map(|x| x.into());
5110 self
5111 }
5112
5113 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
5115 self.0.request.zone = v.into();
5116 self
5117 }
5118
5119 pub fn set_body<T>(mut self, v: T) -> Self
5121 where
5122 T: std::convert::Into<crate::model::InstanceGroupsAddInstancesRequest>,
5123 {
5124 self.0.request.body = std::option::Option::Some(v.into());
5125 self
5126 }
5127
5128 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5130 where
5131 T: std::convert::Into<crate::model::InstanceGroupsAddInstancesRequest>,
5132 {
5133 self.0.request.body = v.map(|x| x.into());
5134 self
5135 }
5136 }
5137
5138 #[doc(hidden)]
5139 impl gax::options::internal::RequestBuilder for AddInstances {
5140 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5141 &mut self.0.options
5142 }
5143 }
5144
5145 #[derive(Clone, Debug)]
5167 pub struct AggregatedList(RequestBuilder<crate::model::instance_groups::AggregatedListRequest>);
5168
5169 impl AggregatedList {
5170 pub(crate) fn new(
5171 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5172 ) -> Self {
5173 Self(RequestBuilder::new(stub))
5174 }
5175
5176 pub fn with_request<V: Into<crate::model::instance_groups::AggregatedListRequest>>(
5178 mut self,
5179 v: V,
5180 ) -> Self {
5181 self.0.request = v.into();
5182 self
5183 }
5184
5185 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5187 self.0.options = v.into();
5188 self
5189 }
5190
5191 pub async fn send(self) -> Result<crate::model::InstanceGroupAggregatedList> {
5193 (*self.0.stub)
5194 .aggregated_list(self.0.request, self.0.options)
5195 .await
5196 .map(gax::response::Response::into_body)
5197 }
5198
5199 pub fn by_page(
5201 self,
5202 ) -> impl gax::paginator::Paginator<crate::model::InstanceGroupAggregatedList, gax::error::Error>
5203 {
5204 use std::clone::Clone;
5205 let token = self.0.request.page_token.clone().unwrap_or_default();
5206 let execute = move |token: String| {
5207 let mut builder = self.clone();
5208 builder.0.request = builder.0.request.set_page_token(token);
5209 builder.send()
5210 };
5211 gax::paginator::internal::new_paginator(token, execute)
5212 }
5213
5214 pub fn by_item(
5216 self,
5217 ) -> impl gax::paginator::ItemPaginator<
5218 crate::model::InstanceGroupAggregatedList,
5219 gax::error::Error,
5220 > {
5221 use gax::paginator::Paginator;
5222 self.by_page().items()
5223 }
5224
5225 pub fn set_filter<T>(mut self, v: T) -> Self
5227 where
5228 T: std::convert::Into<std::string::String>,
5229 {
5230 self.0.request.filter = std::option::Option::Some(v.into());
5231 self
5232 }
5233
5234 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
5236 where
5237 T: std::convert::Into<std::string::String>,
5238 {
5239 self.0.request.filter = v.map(|x| x.into());
5240 self
5241 }
5242
5243 pub fn set_include_all_scopes<T>(mut self, v: T) -> Self
5245 where
5246 T: std::convert::Into<bool>,
5247 {
5248 self.0.request.include_all_scopes = std::option::Option::Some(v.into());
5249 self
5250 }
5251
5252 pub fn set_or_clear_include_all_scopes<T>(mut self, v: std::option::Option<T>) -> Self
5254 where
5255 T: std::convert::Into<bool>,
5256 {
5257 self.0.request.include_all_scopes = v.map(|x| x.into());
5258 self
5259 }
5260
5261 pub fn set_max_results<T>(mut self, v: T) -> Self
5263 where
5264 T: std::convert::Into<u32>,
5265 {
5266 self.0.request.max_results = std::option::Option::Some(v.into());
5267 self
5268 }
5269
5270 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
5272 where
5273 T: std::convert::Into<u32>,
5274 {
5275 self.0.request.max_results = v.map(|x| x.into());
5276 self
5277 }
5278
5279 pub fn set_order_by<T>(mut self, v: T) -> Self
5281 where
5282 T: std::convert::Into<std::string::String>,
5283 {
5284 self.0.request.order_by = std::option::Option::Some(v.into());
5285 self
5286 }
5287
5288 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
5290 where
5291 T: std::convert::Into<std::string::String>,
5292 {
5293 self.0.request.order_by = v.map(|x| x.into());
5294 self
5295 }
5296
5297 pub fn set_page_token<T>(mut self, v: T) -> Self
5299 where
5300 T: std::convert::Into<std::string::String>,
5301 {
5302 self.0.request.page_token = std::option::Option::Some(v.into());
5303 self
5304 }
5305
5306 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
5308 where
5309 T: std::convert::Into<std::string::String>,
5310 {
5311 self.0.request.page_token = v.map(|x| x.into());
5312 self
5313 }
5314
5315 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5317 self.0.request.project = v.into();
5318 self
5319 }
5320
5321 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
5323 where
5324 T: std::convert::Into<bool>,
5325 {
5326 self.0.request.return_partial_success = std::option::Option::Some(v.into());
5327 self
5328 }
5329
5330 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
5332 where
5333 T: std::convert::Into<bool>,
5334 {
5335 self.0.request.return_partial_success = v.map(|x| x.into());
5336 self
5337 }
5338
5339 pub fn set_service_project_number<T>(mut self, v: T) -> Self
5341 where
5342 T: std::convert::Into<i64>,
5343 {
5344 self.0.request.service_project_number = std::option::Option::Some(v.into());
5345 self
5346 }
5347
5348 pub fn set_or_clear_service_project_number<T>(mut self, v: std::option::Option<T>) -> Self
5350 where
5351 T: std::convert::Into<i64>,
5352 {
5353 self.0.request.service_project_number = v.map(|x| x.into());
5354 self
5355 }
5356 }
5357
5358 #[doc(hidden)]
5359 impl gax::options::internal::RequestBuilder for AggregatedList {
5360 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5361 &mut self.0.options
5362 }
5363 }
5364
5365 #[derive(Clone, Debug)]
5383 pub struct Delete(RequestBuilder<crate::model::instance_groups::DeleteRequest>);
5384
5385 impl Delete {
5386 pub(crate) fn new(
5387 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5388 ) -> Self {
5389 Self(RequestBuilder::new(stub))
5390 }
5391
5392 pub fn with_request<V: Into<crate::model::instance_groups::DeleteRequest>>(
5394 mut self,
5395 v: V,
5396 ) -> Self {
5397 self.0.request = v.into();
5398 self
5399 }
5400
5401 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5403 self.0.options = v.into();
5404 self
5405 }
5406
5407 pub async fn send(self) -> Result<crate::model::Operation> {
5409 (*self.0.stub)
5410 .delete(self.0.request, self.0.options)
5411 .await
5412 .map(gax::response::Response::into_body)
5413 }
5414
5415 pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
5417 self.0.request.instance_group = v.into();
5418 self
5419 }
5420
5421 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5423 self.0.request.project = v.into();
5424 self
5425 }
5426
5427 pub fn set_request_id<T>(mut self, v: T) -> Self
5429 where
5430 T: std::convert::Into<std::string::String>,
5431 {
5432 self.0.request.request_id = std::option::Option::Some(v.into());
5433 self
5434 }
5435
5436 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
5438 where
5439 T: std::convert::Into<std::string::String>,
5440 {
5441 self.0.request.request_id = v.map(|x| x.into());
5442 self
5443 }
5444
5445 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
5447 self.0.request.zone = v.into();
5448 self
5449 }
5450 }
5451
5452 #[doc(hidden)]
5453 impl gax::options::internal::RequestBuilder for Delete {
5454 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5455 &mut self.0.options
5456 }
5457 }
5458
5459 #[derive(Clone, Debug)]
5477 pub struct Get(RequestBuilder<crate::model::instance_groups::GetRequest>);
5478
5479 impl Get {
5480 pub(crate) fn new(
5481 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5482 ) -> Self {
5483 Self(RequestBuilder::new(stub))
5484 }
5485
5486 pub fn with_request<V: Into<crate::model::instance_groups::GetRequest>>(
5488 mut self,
5489 v: V,
5490 ) -> Self {
5491 self.0.request = v.into();
5492 self
5493 }
5494
5495 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5497 self.0.options = v.into();
5498 self
5499 }
5500
5501 pub async fn send(self) -> Result<crate::model::InstanceGroup> {
5503 (*self.0.stub)
5504 .get(self.0.request, self.0.options)
5505 .await
5506 .map(gax::response::Response::into_body)
5507 }
5508
5509 pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
5511 self.0.request.instance_group = v.into();
5512 self
5513 }
5514
5515 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5517 self.0.request.project = v.into();
5518 self
5519 }
5520
5521 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
5523 self.0.request.zone = v.into();
5524 self
5525 }
5526 }
5527
5528 #[doc(hidden)]
5529 impl gax::options::internal::RequestBuilder for Get {
5530 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5531 &mut self.0.options
5532 }
5533 }
5534
5535 #[derive(Clone, Debug)]
5553 pub struct Insert(RequestBuilder<crate::model::instance_groups::InsertRequest>);
5554
5555 impl Insert {
5556 pub(crate) fn new(
5557 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5558 ) -> Self {
5559 Self(RequestBuilder::new(stub))
5560 }
5561
5562 pub fn with_request<V: Into<crate::model::instance_groups::InsertRequest>>(
5564 mut self,
5565 v: V,
5566 ) -> Self {
5567 self.0.request = v.into();
5568 self
5569 }
5570
5571 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5573 self.0.options = v.into();
5574 self
5575 }
5576
5577 pub async fn send(self) -> Result<crate::model::Operation> {
5579 (*self.0.stub)
5580 .insert(self.0.request, self.0.options)
5581 .await
5582 .map(gax::response::Response::into_body)
5583 }
5584
5585 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5587 self.0.request.project = v.into();
5588 self
5589 }
5590
5591 pub fn set_request_id<T>(mut self, v: T) -> Self
5593 where
5594 T: std::convert::Into<std::string::String>,
5595 {
5596 self.0.request.request_id = std::option::Option::Some(v.into());
5597 self
5598 }
5599
5600 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
5602 where
5603 T: std::convert::Into<std::string::String>,
5604 {
5605 self.0.request.request_id = v.map(|x| x.into());
5606 self
5607 }
5608
5609 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
5611 self.0.request.zone = v.into();
5612 self
5613 }
5614
5615 pub fn set_body<T>(mut self, v: T) -> Self
5617 where
5618 T: std::convert::Into<crate::model::InstanceGroup>,
5619 {
5620 self.0.request.body = std::option::Option::Some(v.into());
5621 self
5622 }
5623
5624 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5626 where
5627 T: std::convert::Into<crate::model::InstanceGroup>,
5628 {
5629 self.0.request.body = v.map(|x| x.into());
5630 self
5631 }
5632 }
5633
5634 #[doc(hidden)]
5635 impl gax::options::internal::RequestBuilder for Insert {
5636 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5637 &mut self.0.options
5638 }
5639 }
5640
5641 #[derive(Clone, Debug)]
5663 pub struct List(RequestBuilder<crate::model::instance_groups::ListRequest>);
5664
5665 impl List {
5666 pub(crate) fn new(
5667 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5668 ) -> Self {
5669 Self(RequestBuilder::new(stub))
5670 }
5671
5672 pub fn with_request<V: Into<crate::model::instance_groups::ListRequest>>(
5674 mut self,
5675 v: V,
5676 ) -> Self {
5677 self.0.request = v.into();
5678 self
5679 }
5680
5681 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5683 self.0.options = v.into();
5684 self
5685 }
5686
5687 pub async fn send(self) -> Result<crate::model::InstanceGroupList> {
5689 (*self.0.stub)
5690 .list(self.0.request, self.0.options)
5691 .await
5692 .map(gax::response::Response::into_body)
5693 }
5694
5695 pub fn by_page(
5697 self,
5698 ) -> impl gax::paginator::Paginator<crate::model::InstanceGroupList, gax::error::Error>
5699 {
5700 use std::clone::Clone;
5701 let token = self.0.request.page_token.clone().unwrap_or_default();
5702 let execute = move |token: String| {
5703 let mut builder = self.clone();
5704 builder.0.request = builder.0.request.set_page_token(token);
5705 builder.send()
5706 };
5707 gax::paginator::internal::new_paginator(token, execute)
5708 }
5709
5710 pub fn by_item(
5712 self,
5713 ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceGroupList, gax::error::Error>
5714 {
5715 use gax::paginator::Paginator;
5716 self.by_page().items()
5717 }
5718
5719 pub fn set_filter<T>(mut self, v: T) -> Self
5721 where
5722 T: std::convert::Into<std::string::String>,
5723 {
5724 self.0.request.filter = std::option::Option::Some(v.into());
5725 self
5726 }
5727
5728 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
5730 where
5731 T: std::convert::Into<std::string::String>,
5732 {
5733 self.0.request.filter = v.map(|x| x.into());
5734 self
5735 }
5736
5737 pub fn set_max_results<T>(mut self, v: T) -> Self
5739 where
5740 T: std::convert::Into<u32>,
5741 {
5742 self.0.request.max_results = std::option::Option::Some(v.into());
5743 self
5744 }
5745
5746 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
5748 where
5749 T: std::convert::Into<u32>,
5750 {
5751 self.0.request.max_results = v.map(|x| x.into());
5752 self
5753 }
5754
5755 pub fn set_order_by<T>(mut self, v: T) -> Self
5757 where
5758 T: std::convert::Into<std::string::String>,
5759 {
5760 self.0.request.order_by = std::option::Option::Some(v.into());
5761 self
5762 }
5763
5764 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
5766 where
5767 T: std::convert::Into<std::string::String>,
5768 {
5769 self.0.request.order_by = v.map(|x| x.into());
5770 self
5771 }
5772
5773 pub fn set_page_token<T>(mut self, v: T) -> Self
5775 where
5776 T: std::convert::Into<std::string::String>,
5777 {
5778 self.0.request.page_token = std::option::Option::Some(v.into());
5779 self
5780 }
5781
5782 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
5784 where
5785 T: std::convert::Into<std::string::String>,
5786 {
5787 self.0.request.page_token = v.map(|x| x.into());
5788 self
5789 }
5790
5791 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5793 self.0.request.project = v.into();
5794 self
5795 }
5796
5797 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
5799 where
5800 T: std::convert::Into<bool>,
5801 {
5802 self.0.request.return_partial_success = std::option::Option::Some(v.into());
5803 self
5804 }
5805
5806 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
5808 where
5809 T: std::convert::Into<bool>,
5810 {
5811 self.0.request.return_partial_success = v.map(|x| x.into());
5812 self
5813 }
5814
5815 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
5817 self.0.request.zone = v.into();
5818 self
5819 }
5820 }
5821
5822 #[doc(hidden)]
5823 impl gax::options::internal::RequestBuilder for List {
5824 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5825 &mut self.0.options
5826 }
5827 }
5828
5829 #[derive(Clone, Debug)]
5851 pub struct ListInstances(RequestBuilder<crate::model::instance_groups::ListInstancesRequest>);
5852
5853 impl ListInstances {
5854 pub(crate) fn new(
5855 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
5856 ) -> Self {
5857 Self(RequestBuilder::new(stub))
5858 }
5859
5860 pub fn with_request<V: Into<crate::model::instance_groups::ListInstancesRequest>>(
5862 mut self,
5863 v: V,
5864 ) -> Self {
5865 self.0.request = v.into();
5866 self
5867 }
5868
5869 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5871 self.0.options = v.into();
5872 self
5873 }
5874
5875 pub async fn send(self) -> Result<crate::model::InstanceGroupsListInstances> {
5877 (*self.0.stub)
5878 .list_instances(self.0.request, self.0.options)
5879 .await
5880 .map(gax::response::Response::into_body)
5881 }
5882
5883 pub fn by_page(
5885 self,
5886 ) -> impl gax::paginator::Paginator<crate::model::InstanceGroupsListInstances, gax::error::Error>
5887 {
5888 use std::clone::Clone;
5889 let token = self.0.request.page_token.clone().unwrap_or_default();
5890 let execute = move |token: String| {
5891 let mut builder = self.clone();
5892 builder.0.request = builder.0.request.set_page_token(token);
5893 builder.send()
5894 };
5895 gax::paginator::internal::new_paginator(token, execute)
5896 }
5897
5898 pub fn by_item(
5900 self,
5901 ) -> impl gax::paginator::ItemPaginator<
5902 crate::model::InstanceGroupsListInstances,
5903 gax::error::Error,
5904 > {
5905 use gax::paginator::Paginator;
5906 self.by_page().items()
5907 }
5908
5909 pub fn set_filter<T>(mut self, v: T) -> Self
5911 where
5912 T: std::convert::Into<std::string::String>,
5913 {
5914 self.0.request.filter = std::option::Option::Some(v.into());
5915 self
5916 }
5917
5918 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
5920 where
5921 T: std::convert::Into<std::string::String>,
5922 {
5923 self.0.request.filter = v.map(|x| x.into());
5924 self
5925 }
5926
5927 pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
5929 self.0.request.instance_group = v.into();
5930 self
5931 }
5932
5933 pub fn set_max_results<T>(mut self, v: T) -> Self
5935 where
5936 T: std::convert::Into<u32>,
5937 {
5938 self.0.request.max_results = std::option::Option::Some(v.into());
5939 self
5940 }
5941
5942 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
5944 where
5945 T: std::convert::Into<u32>,
5946 {
5947 self.0.request.max_results = v.map(|x| x.into());
5948 self
5949 }
5950
5951 pub fn set_order_by<T>(mut self, v: T) -> Self
5953 where
5954 T: std::convert::Into<std::string::String>,
5955 {
5956 self.0.request.order_by = std::option::Option::Some(v.into());
5957 self
5958 }
5959
5960 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
5962 where
5963 T: std::convert::Into<std::string::String>,
5964 {
5965 self.0.request.order_by = v.map(|x| x.into());
5966 self
5967 }
5968
5969 pub fn set_page_token<T>(mut self, v: T) -> Self
5971 where
5972 T: std::convert::Into<std::string::String>,
5973 {
5974 self.0.request.page_token = std::option::Option::Some(v.into());
5975 self
5976 }
5977
5978 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
5980 where
5981 T: std::convert::Into<std::string::String>,
5982 {
5983 self.0.request.page_token = v.map(|x| x.into());
5984 self
5985 }
5986
5987 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5989 self.0.request.project = v.into();
5990 self
5991 }
5992
5993 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
5995 where
5996 T: std::convert::Into<bool>,
5997 {
5998 self.0.request.return_partial_success = std::option::Option::Some(v.into());
5999 self
6000 }
6001
6002 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
6004 where
6005 T: std::convert::Into<bool>,
6006 {
6007 self.0.request.return_partial_success = v.map(|x| x.into());
6008 self
6009 }
6010
6011 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6013 self.0.request.zone = v.into();
6014 self
6015 }
6016
6017 pub fn set_body<T>(mut self, v: T) -> Self
6019 where
6020 T: std::convert::Into<crate::model::InstanceGroupsListInstancesRequest>,
6021 {
6022 self.0.request.body = std::option::Option::Some(v.into());
6023 self
6024 }
6025
6026 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6028 where
6029 T: std::convert::Into<crate::model::InstanceGroupsListInstancesRequest>,
6030 {
6031 self.0.request.body = v.map(|x| x.into());
6032 self
6033 }
6034 }
6035
6036 #[doc(hidden)]
6037 impl gax::options::internal::RequestBuilder for ListInstances {
6038 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6039 &mut self.0.options
6040 }
6041 }
6042
6043 #[derive(Clone, Debug)]
6061 pub struct RemoveInstances(
6062 RequestBuilder<crate::model::instance_groups::RemoveInstancesRequest>,
6063 );
6064
6065 impl RemoveInstances {
6066 pub(crate) fn new(
6067 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
6068 ) -> Self {
6069 Self(RequestBuilder::new(stub))
6070 }
6071
6072 pub fn with_request<V: Into<crate::model::instance_groups::RemoveInstancesRequest>>(
6074 mut self,
6075 v: V,
6076 ) -> Self {
6077 self.0.request = v.into();
6078 self
6079 }
6080
6081 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6083 self.0.options = v.into();
6084 self
6085 }
6086
6087 pub async fn send(self) -> Result<crate::model::Operation> {
6089 (*self.0.stub)
6090 .remove_instances(self.0.request, self.0.options)
6091 .await
6092 .map(gax::response::Response::into_body)
6093 }
6094
6095 pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
6097 self.0.request.instance_group = v.into();
6098 self
6099 }
6100
6101 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6103 self.0.request.project = v.into();
6104 self
6105 }
6106
6107 pub fn set_request_id<T>(mut self, v: T) -> Self
6109 where
6110 T: std::convert::Into<std::string::String>,
6111 {
6112 self.0.request.request_id = std::option::Option::Some(v.into());
6113 self
6114 }
6115
6116 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
6118 where
6119 T: std::convert::Into<std::string::String>,
6120 {
6121 self.0.request.request_id = v.map(|x| x.into());
6122 self
6123 }
6124
6125 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6127 self.0.request.zone = v.into();
6128 self
6129 }
6130
6131 pub fn set_body<T>(mut self, v: T) -> Self
6133 where
6134 T: std::convert::Into<crate::model::InstanceGroupsRemoveInstancesRequest>,
6135 {
6136 self.0.request.body = std::option::Option::Some(v.into());
6137 self
6138 }
6139
6140 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6142 where
6143 T: std::convert::Into<crate::model::InstanceGroupsRemoveInstancesRequest>,
6144 {
6145 self.0.request.body = v.map(|x| x.into());
6146 self
6147 }
6148 }
6149
6150 #[doc(hidden)]
6151 impl gax::options::internal::RequestBuilder for RemoveInstances {
6152 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6153 &mut self.0.options
6154 }
6155 }
6156
6157 #[derive(Clone, Debug)]
6175 pub struct SetNamedPorts(RequestBuilder<crate::model::instance_groups::SetNamedPortsRequest>);
6176
6177 impl SetNamedPorts {
6178 pub(crate) fn new(
6179 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
6180 ) -> Self {
6181 Self(RequestBuilder::new(stub))
6182 }
6183
6184 pub fn with_request<V: Into<crate::model::instance_groups::SetNamedPortsRequest>>(
6186 mut self,
6187 v: V,
6188 ) -> Self {
6189 self.0.request = v.into();
6190 self
6191 }
6192
6193 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6195 self.0.options = v.into();
6196 self
6197 }
6198
6199 pub async fn send(self) -> Result<crate::model::Operation> {
6201 (*self.0.stub)
6202 .set_named_ports(self.0.request, self.0.options)
6203 .await
6204 .map(gax::response::Response::into_body)
6205 }
6206
6207 pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
6209 self.0.request.instance_group = v.into();
6210 self
6211 }
6212
6213 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6215 self.0.request.project = v.into();
6216 self
6217 }
6218
6219 pub fn set_request_id<T>(mut self, v: T) -> Self
6221 where
6222 T: std::convert::Into<std::string::String>,
6223 {
6224 self.0.request.request_id = std::option::Option::Some(v.into());
6225 self
6226 }
6227
6228 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
6230 where
6231 T: std::convert::Into<std::string::String>,
6232 {
6233 self.0.request.request_id = v.map(|x| x.into());
6234 self
6235 }
6236
6237 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6239 self.0.request.zone = v.into();
6240 self
6241 }
6242
6243 pub fn set_body<T>(mut self, v: T) -> Self
6245 where
6246 T: std::convert::Into<crate::model::InstanceGroupsSetNamedPortsRequest>,
6247 {
6248 self.0.request.body = std::option::Option::Some(v.into());
6249 self
6250 }
6251
6252 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6254 where
6255 T: std::convert::Into<crate::model::InstanceGroupsSetNamedPortsRequest>,
6256 {
6257 self.0.request.body = v.map(|x| x.into());
6258 self
6259 }
6260 }
6261
6262 #[doc(hidden)]
6263 impl gax::options::internal::RequestBuilder for SetNamedPorts {
6264 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6265 &mut self.0.options
6266 }
6267 }
6268
6269 #[derive(Clone, Debug)]
6287 pub struct TestIamPermissions(
6288 RequestBuilder<crate::model::instance_groups::TestIamPermissionsRequest>,
6289 );
6290
6291 impl TestIamPermissions {
6292 pub(crate) fn new(
6293 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceGroups>,
6294 ) -> Self {
6295 Self(RequestBuilder::new(stub))
6296 }
6297
6298 pub fn with_request<V: Into<crate::model::instance_groups::TestIamPermissionsRequest>>(
6300 mut self,
6301 v: V,
6302 ) -> Self {
6303 self.0.request = v.into();
6304 self
6305 }
6306
6307 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6309 self.0.options = v.into();
6310 self
6311 }
6312
6313 pub async fn send(self) -> Result<crate::model::TestPermissionsResponse> {
6315 (*self.0.stub)
6316 .test_iam_permissions(self.0.request, self.0.options)
6317 .await
6318 .map(gax::response::Response::into_body)
6319 }
6320
6321 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6323 self.0.request.project = v.into();
6324 self
6325 }
6326
6327 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6329 self.0.request.resource = v.into();
6330 self
6331 }
6332
6333 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6335 self.0.request.zone = v.into();
6336 self
6337 }
6338
6339 pub fn set_body<T>(mut self, v: T) -> Self
6341 where
6342 T: std::convert::Into<crate::model::TestPermissionsRequest>,
6343 {
6344 self.0.request.body = std::option::Option::Some(v.into());
6345 self
6346 }
6347
6348 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6350 where
6351 T: std::convert::Into<crate::model::TestPermissionsRequest>,
6352 {
6353 self.0.request.body = v.map(|x| x.into());
6354 self
6355 }
6356 }
6357
6358 #[doc(hidden)]
6359 impl gax::options::internal::RequestBuilder for TestIamPermissions {
6360 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6361 &mut self.0.options
6362 }
6363 }
6364}
6365
6366#[cfg(feature = "instances")]
6367#[cfg_attr(docsrs, doc(cfg(feature = "instances")))]
6368pub mod instances {
6369 use crate::Result;
6370
6371 pub type ClientBuilder =
6385 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6386
6387 pub(crate) mod client {
6388 use super::super::super::client::Instances;
6389 pub struct Factory;
6390 impl gax::client_builder::internal::ClientFactory for Factory {
6391 type Client = Instances;
6392 type Credentials = gaxi::options::Credentials;
6393 async fn build(
6394 self,
6395 config: gaxi::options::ClientConfig,
6396 ) -> gax::client_builder::Result<Self::Client> {
6397 Self::Client::new(config).await
6398 }
6399 }
6400 }
6401
6402 #[derive(Clone, Debug)]
6404 pub(crate) struct RequestBuilder<R: std::default::Default> {
6405 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6406 request: R,
6407 options: gax::options::RequestOptions,
6408 }
6409
6410 impl<R> RequestBuilder<R>
6411 where
6412 R: std::default::Default,
6413 {
6414 pub(crate) fn new(
6415 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6416 ) -> Self {
6417 Self {
6418 stub,
6419 request: R::default(),
6420 options: gax::options::RequestOptions::default(),
6421 }
6422 }
6423 }
6424
6425 #[derive(Clone, Debug)]
6443 pub struct AddAccessConfig(RequestBuilder<crate::model::instances::AddAccessConfigRequest>);
6444
6445 impl AddAccessConfig {
6446 pub(crate) fn new(
6447 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6448 ) -> Self {
6449 Self(RequestBuilder::new(stub))
6450 }
6451
6452 pub fn with_request<V: Into<crate::model::instances::AddAccessConfigRequest>>(
6454 mut self,
6455 v: V,
6456 ) -> Self {
6457 self.0.request = v.into();
6458 self
6459 }
6460
6461 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6463 self.0.options = v.into();
6464 self
6465 }
6466
6467 pub async fn send(self) -> Result<crate::model::Operation> {
6469 (*self.0.stub)
6470 .add_access_config(self.0.request, self.0.options)
6471 .await
6472 .map(gax::response::Response::into_body)
6473 }
6474
6475 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6477 self.0.request.instance = v.into();
6478 self
6479 }
6480
6481 pub fn set_network_interface<T: Into<std::string::String>>(mut self, v: T) -> Self {
6483 self.0.request.network_interface = v.into();
6484 self
6485 }
6486
6487 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6489 self.0.request.project = v.into();
6490 self
6491 }
6492
6493 pub fn set_request_id<T>(mut self, v: T) -> Self
6495 where
6496 T: std::convert::Into<std::string::String>,
6497 {
6498 self.0.request.request_id = std::option::Option::Some(v.into());
6499 self
6500 }
6501
6502 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
6504 where
6505 T: std::convert::Into<std::string::String>,
6506 {
6507 self.0.request.request_id = v.map(|x| x.into());
6508 self
6509 }
6510
6511 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6513 self.0.request.zone = v.into();
6514 self
6515 }
6516
6517 pub fn set_body<T>(mut self, v: T) -> Self
6519 where
6520 T: std::convert::Into<crate::model::AccessConfig>,
6521 {
6522 self.0.request.body = std::option::Option::Some(v.into());
6523 self
6524 }
6525
6526 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6528 where
6529 T: std::convert::Into<crate::model::AccessConfig>,
6530 {
6531 self.0.request.body = v.map(|x| x.into());
6532 self
6533 }
6534 }
6535
6536 #[doc(hidden)]
6537 impl gax::options::internal::RequestBuilder for AddAccessConfig {
6538 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6539 &mut self.0.options
6540 }
6541 }
6542
6543 #[derive(Clone, Debug)]
6561 pub struct AddNetworkInterface(
6562 RequestBuilder<crate::model::instances::AddNetworkInterfaceRequest>,
6563 );
6564
6565 impl AddNetworkInterface {
6566 pub(crate) fn new(
6567 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6568 ) -> Self {
6569 Self(RequestBuilder::new(stub))
6570 }
6571
6572 pub fn with_request<V: Into<crate::model::instances::AddNetworkInterfaceRequest>>(
6574 mut self,
6575 v: V,
6576 ) -> Self {
6577 self.0.request = v.into();
6578 self
6579 }
6580
6581 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6583 self.0.options = v.into();
6584 self
6585 }
6586
6587 pub async fn send(self) -> Result<crate::model::Operation> {
6589 (*self.0.stub)
6590 .add_network_interface(self.0.request, self.0.options)
6591 .await
6592 .map(gax::response::Response::into_body)
6593 }
6594
6595 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6597 self.0.request.instance = v.into();
6598 self
6599 }
6600
6601 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6603 self.0.request.project = v.into();
6604 self
6605 }
6606
6607 pub fn set_request_id<T>(mut self, v: T) -> Self
6609 where
6610 T: std::convert::Into<std::string::String>,
6611 {
6612 self.0.request.request_id = std::option::Option::Some(v.into());
6613 self
6614 }
6615
6616 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
6618 where
6619 T: std::convert::Into<std::string::String>,
6620 {
6621 self.0.request.request_id = v.map(|x| x.into());
6622 self
6623 }
6624
6625 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6627 self.0.request.zone = v.into();
6628 self
6629 }
6630
6631 pub fn set_body<T>(mut self, v: T) -> Self
6633 where
6634 T: std::convert::Into<crate::model::NetworkInterface>,
6635 {
6636 self.0.request.body = std::option::Option::Some(v.into());
6637 self
6638 }
6639
6640 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6642 where
6643 T: std::convert::Into<crate::model::NetworkInterface>,
6644 {
6645 self.0.request.body = v.map(|x| x.into());
6646 self
6647 }
6648 }
6649
6650 #[doc(hidden)]
6651 impl gax::options::internal::RequestBuilder for AddNetworkInterface {
6652 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6653 &mut self.0.options
6654 }
6655 }
6656
6657 #[derive(Clone, Debug)]
6675 pub struct AddResourcePolicies(
6676 RequestBuilder<crate::model::instances::AddResourcePoliciesRequest>,
6677 );
6678
6679 impl AddResourcePolicies {
6680 pub(crate) fn new(
6681 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6682 ) -> Self {
6683 Self(RequestBuilder::new(stub))
6684 }
6685
6686 pub fn with_request<V: Into<crate::model::instances::AddResourcePoliciesRequest>>(
6688 mut self,
6689 v: V,
6690 ) -> Self {
6691 self.0.request = v.into();
6692 self
6693 }
6694
6695 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6697 self.0.options = v.into();
6698 self
6699 }
6700
6701 pub async fn send(self) -> Result<crate::model::Operation> {
6703 (*self.0.stub)
6704 .add_resource_policies(self.0.request, self.0.options)
6705 .await
6706 .map(gax::response::Response::into_body)
6707 }
6708
6709 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6711 self.0.request.instance = v.into();
6712 self
6713 }
6714
6715 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6717 self.0.request.project = v.into();
6718 self
6719 }
6720
6721 pub fn set_request_id<T>(mut self, v: T) -> Self
6723 where
6724 T: std::convert::Into<std::string::String>,
6725 {
6726 self.0.request.request_id = std::option::Option::Some(v.into());
6727 self
6728 }
6729
6730 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
6732 where
6733 T: std::convert::Into<std::string::String>,
6734 {
6735 self.0.request.request_id = v.map(|x| x.into());
6736 self
6737 }
6738
6739 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
6741 self.0.request.zone = v.into();
6742 self
6743 }
6744
6745 pub fn set_body<T>(mut self, v: T) -> Self
6747 where
6748 T: std::convert::Into<crate::model::InstancesAddResourcePoliciesRequest>,
6749 {
6750 self.0.request.body = std::option::Option::Some(v.into());
6751 self
6752 }
6753
6754 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6756 where
6757 T: std::convert::Into<crate::model::InstancesAddResourcePoliciesRequest>,
6758 {
6759 self.0.request.body = v.map(|x| x.into());
6760 self
6761 }
6762 }
6763
6764 #[doc(hidden)]
6765 impl gax::options::internal::RequestBuilder for AddResourcePolicies {
6766 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6767 &mut self.0.options
6768 }
6769 }
6770
6771 #[derive(Clone, Debug)]
6793 pub struct AggregatedList(RequestBuilder<crate::model::instances::AggregatedListRequest>);
6794
6795 impl AggregatedList {
6796 pub(crate) fn new(
6797 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
6798 ) -> Self {
6799 Self(RequestBuilder::new(stub))
6800 }
6801
6802 pub fn with_request<V: Into<crate::model::instances::AggregatedListRequest>>(
6804 mut self,
6805 v: V,
6806 ) -> Self {
6807 self.0.request = v.into();
6808 self
6809 }
6810
6811 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6813 self.0.options = v.into();
6814 self
6815 }
6816
6817 pub async fn send(self) -> Result<crate::model::InstanceAggregatedList> {
6819 (*self.0.stub)
6820 .aggregated_list(self.0.request, self.0.options)
6821 .await
6822 .map(gax::response::Response::into_body)
6823 }
6824
6825 pub fn by_page(
6827 self,
6828 ) -> impl gax::paginator::Paginator<crate::model::InstanceAggregatedList, gax::error::Error>
6829 {
6830 use std::clone::Clone;
6831 let token = self.0.request.page_token.clone().unwrap_or_default();
6832 let execute = move |token: String| {
6833 let mut builder = self.clone();
6834 builder.0.request = builder.0.request.set_page_token(token);
6835 builder.send()
6836 };
6837 gax::paginator::internal::new_paginator(token, execute)
6838 }
6839
6840 pub fn by_item(
6842 self,
6843 ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceAggregatedList, gax::error::Error>
6844 {
6845 use gax::paginator::Paginator;
6846 self.by_page().items()
6847 }
6848
6849 pub fn set_filter<T>(mut self, v: T) -> Self
6851 where
6852 T: std::convert::Into<std::string::String>,
6853 {
6854 self.0.request.filter = std::option::Option::Some(v.into());
6855 self
6856 }
6857
6858 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
6860 where
6861 T: std::convert::Into<std::string::String>,
6862 {
6863 self.0.request.filter = v.map(|x| x.into());
6864 self
6865 }
6866
6867 pub fn set_include_all_scopes<T>(mut self, v: T) -> Self
6869 where
6870 T: std::convert::Into<bool>,
6871 {
6872 self.0.request.include_all_scopes = std::option::Option::Some(v.into());
6873 self
6874 }
6875
6876 pub fn set_or_clear_include_all_scopes<T>(mut self, v: std::option::Option<T>) -> Self
6878 where
6879 T: std::convert::Into<bool>,
6880 {
6881 self.0.request.include_all_scopes = v.map(|x| x.into());
6882 self
6883 }
6884
6885 pub fn set_max_results<T>(mut self, v: T) -> Self
6887 where
6888 T: std::convert::Into<u32>,
6889 {
6890 self.0.request.max_results = std::option::Option::Some(v.into());
6891 self
6892 }
6893
6894 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
6896 where
6897 T: std::convert::Into<u32>,
6898 {
6899 self.0.request.max_results = v.map(|x| x.into());
6900 self
6901 }
6902
6903 pub fn set_order_by<T>(mut self, v: T) -> Self
6905 where
6906 T: std::convert::Into<std::string::String>,
6907 {
6908 self.0.request.order_by = std::option::Option::Some(v.into());
6909 self
6910 }
6911
6912 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
6914 where
6915 T: std::convert::Into<std::string::String>,
6916 {
6917 self.0.request.order_by = v.map(|x| x.into());
6918 self
6919 }
6920
6921 pub fn set_page_token<T>(mut self, v: T) -> Self
6923 where
6924 T: std::convert::Into<std::string::String>,
6925 {
6926 self.0.request.page_token = std::option::Option::Some(v.into());
6927 self
6928 }
6929
6930 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
6932 where
6933 T: std::convert::Into<std::string::String>,
6934 {
6935 self.0.request.page_token = v.map(|x| x.into());
6936 self
6937 }
6938
6939 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6941 self.0.request.project = v.into();
6942 self
6943 }
6944
6945 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
6947 where
6948 T: std::convert::Into<bool>,
6949 {
6950 self.0.request.return_partial_success = std::option::Option::Some(v.into());
6951 self
6952 }
6953
6954 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
6956 where
6957 T: std::convert::Into<bool>,
6958 {
6959 self.0.request.return_partial_success = v.map(|x| x.into());
6960 self
6961 }
6962
6963 pub fn set_service_project_number<T>(mut self, v: T) -> Self
6965 where
6966 T: std::convert::Into<i64>,
6967 {
6968 self.0.request.service_project_number = std::option::Option::Some(v.into());
6969 self
6970 }
6971
6972 pub fn set_or_clear_service_project_number<T>(mut self, v: std::option::Option<T>) -> Self
6974 where
6975 T: std::convert::Into<i64>,
6976 {
6977 self.0.request.service_project_number = v.map(|x| x.into());
6978 self
6979 }
6980 }
6981
6982 #[doc(hidden)]
6983 impl gax::options::internal::RequestBuilder for AggregatedList {
6984 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6985 &mut self.0.options
6986 }
6987 }
6988
6989 #[derive(Clone, Debug)]
7007 pub struct AttachDisk(RequestBuilder<crate::model::instances::AttachDiskRequest>);
7008
7009 impl AttachDisk {
7010 pub(crate) fn new(
7011 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7012 ) -> Self {
7013 Self(RequestBuilder::new(stub))
7014 }
7015
7016 pub fn with_request<V: Into<crate::model::instances::AttachDiskRequest>>(
7018 mut self,
7019 v: V,
7020 ) -> Self {
7021 self.0.request = v.into();
7022 self
7023 }
7024
7025 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7027 self.0.options = v.into();
7028 self
7029 }
7030
7031 pub async fn send(self) -> Result<crate::model::Operation> {
7033 (*self.0.stub)
7034 .attach_disk(self.0.request, self.0.options)
7035 .await
7036 .map(gax::response::Response::into_body)
7037 }
7038
7039 pub fn set_force_attach<T>(mut self, v: T) -> Self
7041 where
7042 T: std::convert::Into<bool>,
7043 {
7044 self.0.request.force_attach = std::option::Option::Some(v.into());
7045 self
7046 }
7047
7048 pub fn set_or_clear_force_attach<T>(mut self, v: std::option::Option<T>) -> Self
7050 where
7051 T: std::convert::Into<bool>,
7052 {
7053 self.0.request.force_attach = v.map(|x| x.into());
7054 self
7055 }
7056
7057 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7059 self.0.request.instance = v.into();
7060 self
7061 }
7062
7063 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7065 self.0.request.project = v.into();
7066 self
7067 }
7068
7069 pub fn set_request_id<T>(mut self, v: T) -> Self
7071 where
7072 T: std::convert::Into<std::string::String>,
7073 {
7074 self.0.request.request_id = std::option::Option::Some(v.into());
7075 self
7076 }
7077
7078 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7080 where
7081 T: std::convert::Into<std::string::String>,
7082 {
7083 self.0.request.request_id = v.map(|x| x.into());
7084 self
7085 }
7086
7087 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7089 self.0.request.zone = v.into();
7090 self
7091 }
7092
7093 pub fn set_body<T>(mut self, v: T) -> Self
7095 where
7096 T: std::convert::Into<crate::model::AttachedDisk>,
7097 {
7098 self.0.request.body = std::option::Option::Some(v.into());
7099 self
7100 }
7101
7102 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7104 where
7105 T: std::convert::Into<crate::model::AttachedDisk>,
7106 {
7107 self.0.request.body = v.map(|x| x.into());
7108 self
7109 }
7110 }
7111
7112 #[doc(hidden)]
7113 impl gax::options::internal::RequestBuilder for AttachDisk {
7114 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7115 &mut self.0.options
7116 }
7117 }
7118
7119 #[derive(Clone, Debug)]
7137 pub struct BulkInsert(RequestBuilder<crate::model::instances::BulkInsertRequest>);
7138
7139 impl BulkInsert {
7140 pub(crate) fn new(
7141 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7142 ) -> Self {
7143 Self(RequestBuilder::new(stub))
7144 }
7145
7146 pub fn with_request<V: Into<crate::model::instances::BulkInsertRequest>>(
7148 mut self,
7149 v: V,
7150 ) -> Self {
7151 self.0.request = v.into();
7152 self
7153 }
7154
7155 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7157 self.0.options = v.into();
7158 self
7159 }
7160
7161 pub async fn send(self) -> Result<crate::model::Operation> {
7163 (*self.0.stub)
7164 .bulk_insert(self.0.request, self.0.options)
7165 .await
7166 .map(gax::response::Response::into_body)
7167 }
7168
7169 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7171 self.0.request.project = v.into();
7172 self
7173 }
7174
7175 pub fn set_request_id<T>(mut self, v: T) -> Self
7177 where
7178 T: std::convert::Into<std::string::String>,
7179 {
7180 self.0.request.request_id = std::option::Option::Some(v.into());
7181 self
7182 }
7183
7184 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7186 where
7187 T: std::convert::Into<std::string::String>,
7188 {
7189 self.0.request.request_id = v.map(|x| x.into());
7190 self
7191 }
7192
7193 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7195 self.0.request.zone = v.into();
7196 self
7197 }
7198
7199 pub fn set_body<T>(mut self, v: T) -> Self
7201 where
7202 T: std::convert::Into<crate::model::BulkInsertInstanceResource>,
7203 {
7204 self.0.request.body = std::option::Option::Some(v.into());
7205 self
7206 }
7207
7208 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7210 where
7211 T: std::convert::Into<crate::model::BulkInsertInstanceResource>,
7212 {
7213 self.0.request.body = v.map(|x| x.into());
7214 self
7215 }
7216 }
7217
7218 #[doc(hidden)]
7219 impl gax::options::internal::RequestBuilder for BulkInsert {
7220 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7221 &mut self.0.options
7222 }
7223 }
7224
7225 #[derive(Clone, Debug)]
7243 pub struct Delete(RequestBuilder<crate::model::instances::DeleteRequest>);
7244
7245 impl Delete {
7246 pub(crate) fn new(
7247 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7248 ) -> Self {
7249 Self(RequestBuilder::new(stub))
7250 }
7251
7252 pub fn with_request<V: Into<crate::model::instances::DeleteRequest>>(
7254 mut self,
7255 v: V,
7256 ) -> Self {
7257 self.0.request = v.into();
7258 self
7259 }
7260
7261 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7263 self.0.options = v.into();
7264 self
7265 }
7266
7267 pub async fn send(self) -> Result<crate::model::Operation> {
7269 (*self.0.stub)
7270 .delete(self.0.request, self.0.options)
7271 .await
7272 .map(gax::response::Response::into_body)
7273 }
7274
7275 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7277 self.0.request.instance = v.into();
7278 self
7279 }
7280
7281 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7283 self.0.request.project = v.into();
7284 self
7285 }
7286
7287 pub fn set_request_id<T>(mut self, v: T) -> Self
7289 where
7290 T: std::convert::Into<std::string::String>,
7291 {
7292 self.0.request.request_id = std::option::Option::Some(v.into());
7293 self
7294 }
7295
7296 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7298 where
7299 T: std::convert::Into<std::string::String>,
7300 {
7301 self.0.request.request_id = v.map(|x| x.into());
7302 self
7303 }
7304
7305 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7307 self.0.request.zone = v.into();
7308 self
7309 }
7310 }
7311
7312 #[doc(hidden)]
7313 impl gax::options::internal::RequestBuilder for Delete {
7314 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7315 &mut self.0.options
7316 }
7317 }
7318
7319 #[derive(Clone, Debug)]
7337 pub struct DeleteAccessConfig(
7338 RequestBuilder<crate::model::instances::DeleteAccessConfigRequest>,
7339 );
7340
7341 impl DeleteAccessConfig {
7342 pub(crate) fn new(
7343 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7344 ) -> Self {
7345 Self(RequestBuilder::new(stub))
7346 }
7347
7348 pub fn with_request<V: Into<crate::model::instances::DeleteAccessConfigRequest>>(
7350 mut self,
7351 v: V,
7352 ) -> Self {
7353 self.0.request = v.into();
7354 self
7355 }
7356
7357 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7359 self.0.options = v.into();
7360 self
7361 }
7362
7363 pub async fn send(self) -> Result<crate::model::Operation> {
7365 (*self.0.stub)
7366 .delete_access_config(self.0.request, self.0.options)
7367 .await
7368 .map(gax::response::Response::into_body)
7369 }
7370
7371 pub fn set_access_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
7373 self.0.request.access_config = v.into();
7374 self
7375 }
7376
7377 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7379 self.0.request.instance = v.into();
7380 self
7381 }
7382
7383 pub fn set_network_interface<T: Into<std::string::String>>(mut self, v: T) -> Self {
7385 self.0.request.network_interface = v.into();
7386 self
7387 }
7388
7389 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7391 self.0.request.project = v.into();
7392 self
7393 }
7394
7395 pub fn set_request_id<T>(mut self, v: T) -> Self
7397 where
7398 T: std::convert::Into<std::string::String>,
7399 {
7400 self.0.request.request_id = std::option::Option::Some(v.into());
7401 self
7402 }
7403
7404 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7406 where
7407 T: std::convert::Into<std::string::String>,
7408 {
7409 self.0.request.request_id = v.map(|x| x.into());
7410 self
7411 }
7412
7413 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7415 self.0.request.zone = v.into();
7416 self
7417 }
7418 }
7419
7420 #[doc(hidden)]
7421 impl gax::options::internal::RequestBuilder for DeleteAccessConfig {
7422 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7423 &mut self.0.options
7424 }
7425 }
7426
7427 #[derive(Clone, Debug)]
7445 pub struct DeleteNetworkInterface(
7446 RequestBuilder<crate::model::instances::DeleteNetworkInterfaceRequest>,
7447 );
7448
7449 impl DeleteNetworkInterface {
7450 pub(crate) fn new(
7451 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7452 ) -> Self {
7453 Self(RequestBuilder::new(stub))
7454 }
7455
7456 pub fn with_request<V: Into<crate::model::instances::DeleteNetworkInterfaceRequest>>(
7458 mut self,
7459 v: V,
7460 ) -> Self {
7461 self.0.request = v.into();
7462 self
7463 }
7464
7465 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7467 self.0.options = v.into();
7468 self
7469 }
7470
7471 pub async fn send(self) -> Result<crate::model::Operation> {
7473 (*self.0.stub)
7474 .delete_network_interface(self.0.request, self.0.options)
7475 .await
7476 .map(gax::response::Response::into_body)
7477 }
7478
7479 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7481 self.0.request.instance = v.into();
7482 self
7483 }
7484
7485 pub fn set_network_interface_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7487 self.0.request.network_interface_name = v.into();
7488 self
7489 }
7490
7491 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7493 self.0.request.project = v.into();
7494 self
7495 }
7496
7497 pub fn set_request_id<T>(mut self, v: T) -> Self
7499 where
7500 T: std::convert::Into<std::string::String>,
7501 {
7502 self.0.request.request_id = std::option::Option::Some(v.into());
7503 self
7504 }
7505
7506 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7508 where
7509 T: std::convert::Into<std::string::String>,
7510 {
7511 self.0.request.request_id = v.map(|x| x.into());
7512 self
7513 }
7514
7515 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7517 self.0.request.zone = v.into();
7518 self
7519 }
7520 }
7521
7522 #[doc(hidden)]
7523 impl gax::options::internal::RequestBuilder for DeleteNetworkInterface {
7524 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7525 &mut self.0.options
7526 }
7527 }
7528
7529 #[derive(Clone, Debug)]
7547 pub struct DetachDisk(RequestBuilder<crate::model::instances::DetachDiskRequest>);
7548
7549 impl DetachDisk {
7550 pub(crate) fn new(
7551 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7552 ) -> Self {
7553 Self(RequestBuilder::new(stub))
7554 }
7555
7556 pub fn with_request<V: Into<crate::model::instances::DetachDiskRequest>>(
7558 mut self,
7559 v: V,
7560 ) -> Self {
7561 self.0.request = v.into();
7562 self
7563 }
7564
7565 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7567 self.0.options = v.into();
7568 self
7569 }
7570
7571 pub async fn send(self) -> Result<crate::model::Operation> {
7573 (*self.0.stub)
7574 .detach_disk(self.0.request, self.0.options)
7575 .await
7576 .map(gax::response::Response::into_body)
7577 }
7578
7579 pub fn set_device_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7581 self.0.request.device_name = v.into();
7582 self
7583 }
7584
7585 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7587 self.0.request.instance = v.into();
7588 self
7589 }
7590
7591 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7593 self.0.request.project = v.into();
7594 self
7595 }
7596
7597 pub fn set_request_id<T>(mut self, v: T) -> Self
7599 where
7600 T: std::convert::Into<std::string::String>,
7601 {
7602 self.0.request.request_id = std::option::Option::Some(v.into());
7603 self
7604 }
7605
7606 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
7608 where
7609 T: std::convert::Into<std::string::String>,
7610 {
7611 self.0.request.request_id = v.map(|x| x.into());
7612 self
7613 }
7614
7615 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7617 self.0.request.zone = v.into();
7618 self
7619 }
7620 }
7621
7622 #[doc(hidden)]
7623 impl gax::options::internal::RequestBuilder for DetachDisk {
7624 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7625 &mut self.0.options
7626 }
7627 }
7628
7629 #[derive(Clone, Debug)]
7647 pub struct Get(RequestBuilder<crate::model::instances::GetRequest>);
7648
7649 impl Get {
7650 pub(crate) fn new(
7651 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7652 ) -> Self {
7653 Self(RequestBuilder::new(stub))
7654 }
7655
7656 pub fn with_request<V: Into<crate::model::instances::GetRequest>>(mut self, v: V) -> Self {
7658 self.0.request = v.into();
7659 self
7660 }
7661
7662 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7664 self.0.options = v.into();
7665 self
7666 }
7667
7668 pub async fn send(self) -> Result<crate::model::Instance> {
7670 (*self.0.stub)
7671 .get(self.0.request, self.0.options)
7672 .await
7673 .map(gax::response::Response::into_body)
7674 }
7675
7676 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7678 self.0.request.instance = v.into();
7679 self
7680 }
7681
7682 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7684 self.0.request.project = v.into();
7685 self
7686 }
7687
7688 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7690 self.0.request.zone = v.into();
7691 self
7692 }
7693 }
7694
7695 #[doc(hidden)]
7696 impl gax::options::internal::RequestBuilder for Get {
7697 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7698 &mut self.0.options
7699 }
7700 }
7701
7702 #[derive(Clone, Debug)]
7720 pub struct GetEffectiveFirewalls(
7721 RequestBuilder<crate::model::instances::GetEffectiveFirewallsRequest>,
7722 );
7723
7724 impl GetEffectiveFirewalls {
7725 pub(crate) fn new(
7726 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7727 ) -> Self {
7728 Self(RequestBuilder::new(stub))
7729 }
7730
7731 pub fn with_request<V: Into<crate::model::instances::GetEffectiveFirewallsRequest>>(
7733 mut self,
7734 v: V,
7735 ) -> Self {
7736 self.0.request = v.into();
7737 self
7738 }
7739
7740 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7742 self.0.options = v.into();
7743 self
7744 }
7745
7746 pub async fn send(self) -> Result<crate::model::InstancesGetEffectiveFirewallsResponse> {
7748 (*self.0.stub)
7749 .get_effective_firewalls(self.0.request, self.0.options)
7750 .await
7751 .map(gax::response::Response::into_body)
7752 }
7753
7754 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7756 self.0.request.instance = v.into();
7757 self
7758 }
7759
7760 pub fn set_network_interface<T: Into<std::string::String>>(mut self, v: T) -> Self {
7762 self.0.request.network_interface = v.into();
7763 self
7764 }
7765
7766 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7768 self.0.request.project = v.into();
7769 self
7770 }
7771
7772 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7774 self.0.request.zone = v.into();
7775 self
7776 }
7777 }
7778
7779 #[doc(hidden)]
7780 impl gax::options::internal::RequestBuilder for GetEffectiveFirewalls {
7781 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7782 &mut self.0.options
7783 }
7784 }
7785
7786 #[derive(Clone, Debug)]
7804 pub struct GetGuestAttributes(
7805 RequestBuilder<crate::model::instances::GetGuestAttributesRequest>,
7806 );
7807
7808 impl GetGuestAttributes {
7809 pub(crate) fn new(
7810 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7811 ) -> Self {
7812 Self(RequestBuilder::new(stub))
7813 }
7814
7815 pub fn with_request<V: Into<crate::model::instances::GetGuestAttributesRequest>>(
7817 mut self,
7818 v: V,
7819 ) -> Self {
7820 self.0.request = v.into();
7821 self
7822 }
7823
7824 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7826 self.0.options = v.into();
7827 self
7828 }
7829
7830 pub async fn send(self) -> Result<crate::model::GuestAttributes> {
7832 (*self.0.stub)
7833 .get_guest_attributes(self.0.request, self.0.options)
7834 .await
7835 .map(gax::response::Response::into_body)
7836 }
7837
7838 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7840 self.0.request.instance = v.into();
7841 self
7842 }
7843
7844 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7846 self.0.request.project = v.into();
7847 self
7848 }
7849
7850 pub fn set_query_path<T>(mut self, v: T) -> Self
7852 where
7853 T: std::convert::Into<std::string::String>,
7854 {
7855 self.0.request.query_path = std::option::Option::Some(v.into());
7856 self
7857 }
7858
7859 pub fn set_or_clear_query_path<T>(mut self, v: std::option::Option<T>) -> Self
7861 where
7862 T: std::convert::Into<std::string::String>,
7863 {
7864 self.0.request.query_path = v.map(|x| x.into());
7865 self
7866 }
7867
7868 pub fn set_variable_key<T>(mut self, v: T) -> Self
7870 where
7871 T: std::convert::Into<std::string::String>,
7872 {
7873 self.0.request.variable_key = std::option::Option::Some(v.into());
7874 self
7875 }
7876
7877 pub fn set_or_clear_variable_key<T>(mut self, v: std::option::Option<T>) -> Self
7879 where
7880 T: std::convert::Into<std::string::String>,
7881 {
7882 self.0.request.variable_key = v.map(|x| x.into());
7883 self
7884 }
7885
7886 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7888 self.0.request.zone = v.into();
7889 self
7890 }
7891 }
7892
7893 #[doc(hidden)]
7894 impl gax::options::internal::RequestBuilder for GetGuestAttributes {
7895 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7896 &mut self.0.options
7897 }
7898 }
7899
7900 #[derive(Clone, Debug)]
7918 pub struct GetIamPolicy(RequestBuilder<crate::model::instances::GetIamPolicyRequest>);
7919
7920 impl GetIamPolicy {
7921 pub(crate) fn new(
7922 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
7923 ) -> Self {
7924 Self(RequestBuilder::new(stub))
7925 }
7926
7927 pub fn with_request<V: Into<crate::model::instances::GetIamPolicyRequest>>(
7929 mut self,
7930 v: V,
7931 ) -> Self {
7932 self.0.request = v.into();
7933 self
7934 }
7935
7936 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7938 self.0.options = v.into();
7939 self
7940 }
7941
7942 pub async fn send(self) -> Result<crate::model::Policy> {
7944 (*self.0.stub)
7945 .get_iam_policy(self.0.request, self.0.options)
7946 .await
7947 .map(gax::response::Response::into_body)
7948 }
7949
7950 pub fn set_options_requested_policy_version<T>(mut self, v: T) -> Self
7952 where
7953 T: std::convert::Into<i32>,
7954 {
7955 self.0.request.options_requested_policy_version = std::option::Option::Some(v.into());
7956 self
7957 }
7958
7959 pub fn set_or_clear_options_requested_policy_version<T>(
7961 mut self,
7962 v: std::option::Option<T>,
7963 ) -> Self
7964 where
7965 T: std::convert::Into<i32>,
7966 {
7967 self.0.request.options_requested_policy_version = v.map(|x| x.into());
7968 self
7969 }
7970
7971 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7973 self.0.request.project = v.into();
7974 self
7975 }
7976
7977 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7979 self.0.request.resource = v.into();
7980 self
7981 }
7982
7983 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
7985 self.0.request.zone = v.into();
7986 self
7987 }
7988 }
7989
7990 #[doc(hidden)]
7991 impl gax::options::internal::RequestBuilder for GetIamPolicy {
7992 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7993 &mut self.0.options
7994 }
7995 }
7996
7997 #[derive(Clone, Debug)]
8015 pub struct GetScreenshot(RequestBuilder<crate::model::instances::GetScreenshotRequest>);
8016
8017 impl GetScreenshot {
8018 pub(crate) fn new(
8019 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8020 ) -> Self {
8021 Self(RequestBuilder::new(stub))
8022 }
8023
8024 pub fn with_request<V: Into<crate::model::instances::GetScreenshotRequest>>(
8026 mut self,
8027 v: V,
8028 ) -> Self {
8029 self.0.request = v.into();
8030 self
8031 }
8032
8033 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8035 self.0.options = v.into();
8036 self
8037 }
8038
8039 pub async fn send(self) -> Result<crate::model::Screenshot> {
8041 (*self.0.stub)
8042 .get_screenshot(self.0.request, self.0.options)
8043 .await
8044 .map(gax::response::Response::into_body)
8045 }
8046
8047 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8049 self.0.request.instance = v.into();
8050 self
8051 }
8052
8053 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8055 self.0.request.project = v.into();
8056 self
8057 }
8058
8059 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8061 self.0.request.zone = v.into();
8062 self
8063 }
8064 }
8065
8066 #[doc(hidden)]
8067 impl gax::options::internal::RequestBuilder for GetScreenshot {
8068 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8069 &mut self.0.options
8070 }
8071 }
8072
8073 #[derive(Clone, Debug)]
8091 pub struct GetSerialPortOutput(
8092 RequestBuilder<crate::model::instances::GetSerialPortOutputRequest>,
8093 );
8094
8095 impl GetSerialPortOutput {
8096 pub(crate) fn new(
8097 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8098 ) -> Self {
8099 Self(RequestBuilder::new(stub))
8100 }
8101
8102 pub fn with_request<V: Into<crate::model::instances::GetSerialPortOutputRequest>>(
8104 mut self,
8105 v: V,
8106 ) -> Self {
8107 self.0.request = v.into();
8108 self
8109 }
8110
8111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8113 self.0.options = v.into();
8114 self
8115 }
8116
8117 pub async fn send(self) -> Result<crate::model::SerialPortOutput> {
8119 (*self.0.stub)
8120 .get_serial_port_output(self.0.request, self.0.options)
8121 .await
8122 .map(gax::response::Response::into_body)
8123 }
8124
8125 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8127 self.0.request.instance = v.into();
8128 self
8129 }
8130
8131 pub fn set_port<T>(mut self, v: T) -> Self
8133 where
8134 T: std::convert::Into<i32>,
8135 {
8136 self.0.request.port = std::option::Option::Some(v.into());
8137 self
8138 }
8139
8140 pub fn set_or_clear_port<T>(mut self, v: std::option::Option<T>) -> Self
8142 where
8143 T: std::convert::Into<i32>,
8144 {
8145 self.0.request.port = v.map(|x| x.into());
8146 self
8147 }
8148
8149 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8151 self.0.request.project = v.into();
8152 self
8153 }
8154
8155 pub fn set_start<T>(mut self, v: T) -> Self
8157 where
8158 T: std::convert::Into<i64>,
8159 {
8160 self.0.request.start = std::option::Option::Some(v.into());
8161 self
8162 }
8163
8164 pub fn set_or_clear_start<T>(mut self, v: std::option::Option<T>) -> Self
8166 where
8167 T: std::convert::Into<i64>,
8168 {
8169 self.0.request.start = v.map(|x| x.into());
8170 self
8171 }
8172
8173 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8175 self.0.request.zone = v.into();
8176 self
8177 }
8178 }
8179
8180 #[doc(hidden)]
8181 impl gax::options::internal::RequestBuilder for GetSerialPortOutput {
8182 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8183 &mut self.0.options
8184 }
8185 }
8186
8187 #[derive(Clone, Debug)]
8205 pub struct GetShieldedInstanceIdentity(
8206 RequestBuilder<crate::model::instances::GetShieldedInstanceIdentityRequest>,
8207 );
8208
8209 impl GetShieldedInstanceIdentity {
8210 pub(crate) fn new(
8211 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8212 ) -> Self {
8213 Self(RequestBuilder::new(stub))
8214 }
8215
8216 pub fn with_request<
8218 V: Into<crate::model::instances::GetShieldedInstanceIdentityRequest>,
8219 >(
8220 mut self,
8221 v: V,
8222 ) -> Self {
8223 self.0.request = v.into();
8224 self
8225 }
8226
8227 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8229 self.0.options = v.into();
8230 self
8231 }
8232
8233 pub async fn send(self) -> Result<crate::model::ShieldedInstanceIdentity> {
8235 (*self.0.stub)
8236 .get_shielded_instance_identity(self.0.request, self.0.options)
8237 .await
8238 .map(gax::response::Response::into_body)
8239 }
8240
8241 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8243 self.0.request.instance = v.into();
8244 self
8245 }
8246
8247 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8249 self.0.request.project = v.into();
8250 self
8251 }
8252
8253 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8255 self.0.request.zone = v.into();
8256 self
8257 }
8258 }
8259
8260 #[doc(hidden)]
8261 impl gax::options::internal::RequestBuilder for GetShieldedInstanceIdentity {
8262 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8263 &mut self.0.options
8264 }
8265 }
8266
8267 #[derive(Clone, Debug)]
8285 pub struct Insert(RequestBuilder<crate::model::instances::InsertRequest>);
8286
8287 impl Insert {
8288 pub(crate) fn new(
8289 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8290 ) -> Self {
8291 Self(RequestBuilder::new(stub))
8292 }
8293
8294 pub fn with_request<V: Into<crate::model::instances::InsertRequest>>(
8296 mut self,
8297 v: V,
8298 ) -> Self {
8299 self.0.request = v.into();
8300 self
8301 }
8302
8303 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8305 self.0.options = v.into();
8306 self
8307 }
8308
8309 pub async fn send(self) -> Result<crate::model::Operation> {
8311 (*self.0.stub)
8312 .insert(self.0.request, self.0.options)
8313 .await
8314 .map(gax::response::Response::into_body)
8315 }
8316
8317 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8319 self.0.request.project = v.into();
8320 self
8321 }
8322
8323 pub fn set_request_id<T>(mut self, v: T) -> Self
8325 where
8326 T: std::convert::Into<std::string::String>,
8327 {
8328 self.0.request.request_id = std::option::Option::Some(v.into());
8329 self
8330 }
8331
8332 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
8334 where
8335 T: std::convert::Into<std::string::String>,
8336 {
8337 self.0.request.request_id = v.map(|x| x.into());
8338 self
8339 }
8340
8341 pub fn set_source_instance_template<T>(mut self, v: T) -> Self
8343 where
8344 T: std::convert::Into<std::string::String>,
8345 {
8346 self.0.request.source_instance_template = std::option::Option::Some(v.into());
8347 self
8348 }
8349
8350 pub fn set_or_clear_source_instance_template<T>(mut self, v: std::option::Option<T>) -> Self
8352 where
8353 T: std::convert::Into<std::string::String>,
8354 {
8355 self.0.request.source_instance_template = v.map(|x| x.into());
8356 self
8357 }
8358
8359 pub fn set_source_machine_image<T>(mut self, v: T) -> Self
8361 where
8362 T: std::convert::Into<std::string::String>,
8363 {
8364 self.0.request.source_machine_image = std::option::Option::Some(v.into());
8365 self
8366 }
8367
8368 pub fn set_or_clear_source_machine_image<T>(mut self, v: std::option::Option<T>) -> Self
8370 where
8371 T: std::convert::Into<std::string::String>,
8372 {
8373 self.0.request.source_machine_image = v.map(|x| x.into());
8374 self
8375 }
8376
8377 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8379 self.0.request.zone = v.into();
8380 self
8381 }
8382
8383 pub fn set_body<T>(mut self, v: T) -> Self
8385 where
8386 T: std::convert::Into<crate::model::Instance>,
8387 {
8388 self.0.request.body = std::option::Option::Some(v.into());
8389 self
8390 }
8391
8392 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8394 where
8395 T: std::convert::Into<crate::model::Instance>,
8396 {
8397 self.0.request.body = v.map(|x| x.into());
8398 self
8399 }
8400 }
8401
8402 #[doc(hidden)]
8403 impl gax::options::internal::RequestBuilder for Insert {
8404 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8405 &mut self.0.options
8406 }
8407 }
8408
8409 #[derive(Clone, Debug)]
8431 pub struct List(RequestBuilder<crate::model::instances::ListRequest>);
8432
8433 impl List {
8434 pub(crate) fn new(
8435 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8436 ) -> Self {
8437 Self(RequestBuilder::new(stub))
8438 }
8439
8440 pub fn with_request<V: Into<crate::model::instances::ListRequest>>(mut self, v: V) -> Self {
8442 self.0.request = v.into();
8443 self
8444 }
8445
8446 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8448 self.0.options = v.into();
8449 self
8450 }
8451
8452 pub async fn send(self) -> Result<crate::model::InstanceList> {
8454 (*self.0.stub)
8455 .list(self.0.request, self.0.options)
8456 .await
8457 .map(gax::response::Response::into_body)
8458 }
8459
8460 pub fn by_page(
8462 self,
8463 ) -> impl gax::paginator::Paginator<crate::model::InstanceList, gax::error::Error> {
8464 use std::clone::Clone;
8465 let token = self.0.request.page_token.clone().unwrap_or_default();
8466 let execute = move |token: String| {
8467 let mut builder = self.clone();
8468 builder.0.request = builder.0.request.set_page_token(token);
8469 builder.send()
8470 };
8471 gax::paginator::internal::new_paginator(token, execute)
8472 }
8473
8474 pub fn by_item(
8476 self,
8477 ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceList, gax::error::Error>
8478 {
8479 use gax::paginator::Paginator;
8480 self.by_page().items()
8481 }
8482
8483 pub fn set_filter<T>(mut self, v: T) -> Self
8485 where
8486 T: std::convert::Into<std::string::String>,
8487 {
8488 self.0.request.filter = std::option::Option::Some(v.into());
8489 self
8490 }
8491
8492 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
8494 where
8495 T: std::convert::Into<std::string::String>,
8496 {
8497 self.0.request.filter = v.map(|x| x.into());
8498 self
8499 }
8500
8501 pub fn set_max_results<T>(mut self, v: T) -> Self
8503 where
8504 T: std::convert::Into<u32>,
8505 {
8506 self.0.request.max_results = std::option::Option::Some(v.into());
8507 self
8508 }
8509
8510 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
8512 where
8513 T: std::convert::Into<u32>,
8514 {
8515 self.0.request.max_results = v.map(|x| x.into());
8516 self
8517 }
8518
8519 pub fn set_order_by<T>(mut self, v: T) -> Self
8521 where
8522 T: std::convert::Into<std::string::String>,
8523 {
8524 self.0.request.order_by = std::option::Option::Some(v.into());
8525 self
8526 }
8527
8528 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
8530 where
8531 T: std::convert::Into<std::string::String>,
8532 {
8533 self.0.request.order_by = v.map(|x| x.into());
8534 self
8535 }
8536
8537 pub fn set_page_token<T>(mut self, v: T) -> Self
8539 where
8540 T: std::convert::Into<std::string::String>,
8541 {
8542 self.0.request.page_token = std::option::Option::Some(v.into());
8543 self
8544 }
8545
8546 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
8548 where
8549 T: std::convert::Into<std::string::String>,
8550 {
8551 self.0.request.page_token = v.map(|x| x.into());
8552 self
8553 }
8554
8555 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8557 self.0.request.project = v.into();
8558 self
8559 }
8560
8561 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
8563 where
8564 T: std::convert::Into<bool>,
8565 {
8566 self.0.request.return_partial_success = std::option::Option::Some(v.into());
8567 self
8568 }
8569
8570 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
8572 where
8573 T: std::convert::Into<bool>,
8574 {
8575 self.0.request.return_partial_success = v.map(|x| x.into());
8576 self
8577 }
8578
8579 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8581 self.0.request.zone = v.into();
8582 self
8583 }
8584 }
8585
8586 #[doc(hidden)]
8587 impl gax::options::internal::RequestBuilder for List {
8588 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8589 &mut self.0.options
8590 }
8591 }
8592
8593 #[derive(Clone, Debug)]
8615 pub struct ListReferrers(RequestBuilder<crate::model::instances::ListReferrersRequest>);
8616
8617 impl ListReferrers {
8618 pub(crate) fn new(
8619 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8620 ) -> Self {
8621 Self(RequestBuilder::new(stub))
8622 }
8623
8624 pub fn with_request<V: Into<crate::model::instances::ListReferrersRequest>>(
8626 mut self,
8627 v: V,
8628 ) -> Self {
8629 self.0.request = v.into();
8630 self
8631 }
8632
8633 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8635 self.0.options = v.into();
8636 self
8637 }
8638
8639 pub async fn send(self) -> Result<crate::model::InstanceListReferrers> {
8641 (*self.0.stub)
8642 .list_referrers(self.0.request, self.0.options)
8643 .await
8644 .map(gax::response::Response::into_body)
8645 }
8646
8647 pub fn by_page(
8649 self,
8650 ) -> impl gax::paginator::Paginator<crate::model::InstanceListReferrers, gax::error::Error>
8651 {
8652 use std::clone::Clone;
8653 let token = self.0.request.page_token.clone().unwrap_or_default();
8654 let execute = move |token: String| {
8655 let mut builder = self.clone();
8656 builder.0.request = builder.0.request.set_page_token(token);
8657 builder.send()
8658 };
8659 gax::paginator::internal::new_paginator(token, execute)
8660 }
8661
8662 pub fn by_item(
8664 self,
8665 ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceListReferrers, gax::error::Error>
8666 {
8667 use gax::paginator::Paginator;
8668 self.by_page().items()
8669 }
8670
8671 pub fn set_filter<T>(mut self, v: T) -> Self
8673 where
8674 T: std::convert::Into<std::string::String>,
8675 {
8676 self.0.request.filter = std::option::Option::Some(v.into());
8677 self
8678 }
8679
8680 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
8682 where
8683 T: std::convert::Into<std::string::String>,
8684 {
8685 self.0.request.filter = v.map(|x| x.into());
8686 self
8687 }
8688
8689 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8691 self.0.request.instance = v.into();
8692 self
8693 }
8694
8695 pub fn set_max_results<T>(mut self, v: T) -> Self
8697 where
8698 T: std::convert::Into<u32>,
8699 {
8700 self.0.request.max_results = std::option::Option::Some(v.into());
8701 self
8702 }
8703
8704 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
8706 where
8707 T: std::convert::Into<u32>,
8708 {
8709 self.0.request.max_results = v.map(|x| x.into());
8710 self
8711 }
8712
8713 pub fn set_order_by<T>(mut self, v: T) -> Self
8715 where
8716 T: std::convert::Into<std::string::String>,
8717 {
8718 self.0.request.order_by = std::option::Option::Some(v.into());
8719 self
8720 }
8721
8722 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
8724 where
8725 T: std::convert::Into<std::string::String>,
8726 {
8727 self.0.request.order_by = v.map(|x| x.into());
8728 self
8729 }
8730
8731 pub fn set_page_token<T>(mut self, v: T) -> Self
8733 where
8734 T: std::convert::Into<std::string::String>,
8735 {
8736 self.0.request.page_token = std::option::Option::Some(v.into());
8737 self
8738 }
8739
8740 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
8742 where
8743 T: std::convert::Into<std::string::String>,
8744 {
8745 self.0.request.page_token = v.map(|x| x.into());
8746 self
8747 }
8748
8749 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8751 self.0.request.project = v.into();
8752 self
8753 }
8754
8755 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
8757 where
8758 T: std::convert::Into<bool>,
8759 {
8760 self.0.request.return_partial_success = std::option::Option::Some(v.into());
8761 self
8762 }
8763
8764 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
8766 where
8767 T: std::convert::Into<bool>,
8768 {
8769 self.0.request.return_partial_success = v.map(|x| x.into());
8770 self
8771 }
8772
8773 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8775 self.0.request.zone = v.into();
8776 self
8777 }
8778 }
8779
8780 #[doc(hidden)]
8781 impl gax::options::internal::RequestBuilder for ListReferrers {
8782 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8783 &mut self.0.options
8784 }
8785 }
8786
8787 #[derive(Clone, Debug)]
8805 pub struct PerformMaintenance(
8806 RequestBuilder<crate::model::instances::PerformMaintenanceRequest>,
8807 );
8808
8809 impl PerformMaintenance {
8810 pub(crate) fn new(
8811 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8812 ) -> Self {
8813 Self(RequestBuilder::new(stub))
8814 }
8815
8816 pub fn with_request<V: Into<crate::model::instances::PerformMaintenanceRequest>>(
8818 mut self,
8819 v: V,
8820 ) -> Self {
8821 self.0.request = v.into();
8822 self
8823 }
8824
8825 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8827 self.0.options = v.into();
8828 self
8829 }
8830
8831 pub async fn send(self) -> Result<crate::model::Operation> {
8833 (*self.0.stub)
8834 .perform_maintenance(self.0.request, self.0.options)
8835 .await
8836 .map(gax::response::Response::into_body)
8837 }
8838
8839 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8841 self.0.request.instance = v.into();
8842 self
8843 }
8844
8845 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8847 self.0.request.project = v.into();
8848 self
8849 }
8850
8851 pub fn set_request_id<T>(mut self, v: T) -> Self
8853 where
8854 T: std::convert::Into<std::string::String>,
8855 {
8856 self.0.request.request_id = std::option::Option::Some(v.into());
8857 self
8858 }
8859
8860 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
8862 where
8863 T: std::convert::Into<std::string::String>,
8864 {
8865 self.0.request.request_id = v.map(|x| x.into());
8866 self
8867 }
8868
8869 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8871 self.0.request.zone = v.into();
8872 self
8873 }
8874 }
8875
8876 #[doc(hidden)]
8877 impl gax::options::internal::RequestBuilder for PerformMaintenance {
8878 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8879 &mut self.0.options
8880 }
8881 }
8882
8883 #[derive(Clone, Debug)]
8901 pub struct RemoveResourcePolicies(
8902 RequestBuilder<crate::model::instances::RemoveResourcePoliciesRequest>,
8903 );
8904
8905 impl RemoveResourcePolicies {
8906 pub(crate) fn new(
8907 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
8908 ) -> Self {
8909 Self(RequestBuilder::new(stub))
8910 }
8911
8912 pub fn with_request<V: Into<crate::model::instances::RemoveResourcePoliciesRequest>>(
8914 mut self,
8915 v: V,
8916 ) -> Self {
8917 self.0.request = v.into();
8918 self
8919 }
8920
8921 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8923 self.0.options = v.into();
8924 self
8925 }
8926
8927 pub async fn send(self) -> Result<crate::model::Operation> {
8929 (*self.0.stub)
8930 .remove_resource_policies(self.0.request, self.0.options)
8931 .await
8932 .map(gax::response::Response::into_body)
8933 }
8934
8935 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
8937 self.0.request.instance = v.into();
8938 self
8939 }
8940
8941 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
8943 self.0.request.project = v.into();
8944 self
8945 }
8946
8947 pub fn set_request_id<T>(mut self, v: T) -> Self
8949 where
8950 T: std::convert::Into<std::string::String>,
8951 {
8952 self.0.request.request_id = std::option::Option::Some(v.into());
8953 self
8954 }
8955
8956 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
8958 where
8959 T: std::convert::Into<std::string::String>,
8960 {
8961 self.0.request.request_id = v.map(|x| x.into());
8962 self
8963 }
8964
8965 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
8967 self.0.request.zone = v.into();
8968 self
8969 }
8970
8971 pub fn set_body<T>(mut self, v: T) -> Self
8973 where
8974 T: std::convert::Into<crate::model::InstancesRemoveResourcePoliciesRequest>,
8975 {
8976 self.0.request.body = std::option::Option::Some(v.into());
8977 self
8978 }
8979
8980 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8982 where
8983 T: std::convert::Into<crate::model::InstancesRemoveResourcePoliciesRequest>,
8984 {
8985 self.0.request.body = v.map(|x| x.into());
8986 self
8987 }
8988 }
8989
8990 #[doc(hidden)]
8991 impl gax::options::internal::RequestBuilder for RemoveResourcePolicies {
8992 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8993 &mut self.0.options
8994 }
8995 }
8996
8997 #[derive(Clone, Debug)]
9015 pub struct ReportHostAsFaulty(
9016 RequestBuilder<crate::model::instances::ReportHostAsFaultyRequest>,
9017 );
9018
9019 impl ReportHostAsFaulty {
9020 pub(crate) fn new(
9021 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9022 ) -> Self {
9023 Self(RequestBuilder::new(stub))
9024 }
9025
9026 pub fn with_request<V: Into<crate::model::instances::ReportHostAsFaultyRequest>>(
9028 mut self,
9029 v: V,
9030 ) -> Self {
9031 self.0.request = v.into();
9032 self
9033 }
9034
9035 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9037 self.0.options = v.into();
9038 self
9039 }
9040
9041 pub async fn send(self) -> Result<crate::model::Operation> {
9043 (*self.0.stub)
9044 .report_host_as_faulty(self.0.request, self.0.options)
9045 .await
9046 .map(gax::response::Response::into_body)
9047 }
9048
9049 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9051 self.0.request.instance = v.into();
9052 self
9053 }
9054
9055 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9057 self.0.request.project = v.into();
9058 self
9059 }
9060
9061 pub fn set_request_id<T>(mut self, v: T) -> Self
9063 where
9064 T: std::convert::Into<std::string::String>,
9065 {
9066 self.0.request.request_id = std::option::Option::Some(v.into());
9067 self
9068 }
9069
9070 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9072 where
9073 T: std::convert::Into<std::string::String>,
9074 {
9075 self.0.request.request_id = v.map(|x| x.into());
9076 self
9077 }
9078
9079 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9081 self.0.request.zone = v.into();
9082 self
9083 }
9084
9085 pub fn set_body<T>(mut self, v: T) -> Self
9087 where
9088 T: std::convert::Into<crate::model::InstancesReportHostAsFaultyRequest>,
9089 {
9090 self.0.request.body = std::option::Option::Some(v.into());
9091 self
9092 }
9093
9094 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9096 where
9097 T: std::convert::Into<crate::model::InstancesReportHostAsFaultyRequest>,
9098 {
9099 self.0.request.body = v.map(|x| x.into());
9100 self
9101 }
9102 }
9103
9104 #[doc(hidden)]
9105 impl gax::options::internal::RequestBuilder for ReportHostAsFaulty {
9106 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9107 &mut self.0.options
9108 }
9109 }
9110
9111 #[derive(Clone, Debug)]
9129 pub struct Reset(RequestBuilder<crate::model::instances::ResetRequest>);
9130
9131 impl Reset {
9132 pub(crate) fn new(
9133 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9134 ) -> Self {
9135 Self(RequestBuilder::new(stub))
9136 }
9137
9138 pub fn with_request<V: Into<crate::model::instances::ResetRequest>>(
9140 mut self,
9141 v: V,
9142 ) -> Self {
9143 self.0.request = v.into();
9144 self
9145 }
9146
9147 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9149 self.0.options = v.into();
9150 self
9151 }
9152
9153 pub async fn send(self) -> Result<crate::model::Operation> {
9155 (*self.0.stub)
9156 .reset(self.0.request, self.0.options)
9157 .await
9158 .map(gax::response::Response::into_body)
9159 }
9160
9161 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9163 self.0.request.instance = v.into();
9164 self
9165 }
9166
9167 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9169 self.0.request.project = v.into();
9170 self
9171 }
9172
9173 pub fn set_request_id<T>(mut self, v: T) -> Self
9175 where
9176 T: std::convert::Into<std::string::String>,
9177 {
9178 self.0.request.request_id = std::option::Option::Some(v.into());
9179 self
9180 }
9181
9182 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9184 where
9185 T: std::convert::Into<std::string::String>,
9186 {
9187 self.0.request.request_id = v.map(|x| x.into());
9188 self
9189 }
9190
9191 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9193 self.0.request.zone = v.into();
9194 self
9195 }
9196 }
9197
9198 #[doc(hidden)]
9199 impl gax::options::internal::RequestBuilder for Reset {
9200 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9201 &mut self.0.options
9202 }
9203 }
9204
9205 #[derive(Clone, Debug)]
9223 pub struct Resume(RequestBuilder<crate::model::instances::ResumeRequest>);
9224
9225 impl Resume {
9226 pub(crate) fn new(
9227 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9228 ) -> Self {
9229 Self(RequestBuilder::new(stub))
9230 }
9231
9232 pub fn with_request<V: Into<crate::model::instances::ResumeRequest>>(
9234 mut self,
9235 v: V,
9236 ) -> Self {
9237 self.0.request = v.into();
9238 self
9239 }
9240
9241 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9243 self.0.options = v.into();
9244 self
9245 }
9246
9247 pub async fn send(self) -> Result<crate::model::Operation> {
9249 (*self.0.stub)
9250 .resume(self.0.request, self.0.options)
9251 .await
9252 .map(gax::response::Response::into_body)
9253 }
9254
9255 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9257 self.0.request.instance = v.into();
9258 self
9259 }
9260
9261 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9263 self.0.request.project = v.into();
9264 self
9265 }
9266
9267 pub fn set_request_id<T>(mut self, v: T) -> Self
9269 where
9270 T: std::convert::Into<std::string::String>,
9271 {
9272 self.0.request.request_id = std::option::Option::Some(v.into());
9273 self
9274 }
9275
9276 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9278 where
9279 T: std::convert::Into<std::string::String>,
9280 {
9281 self.0.request.request_id = v.map(|x| x.into());
9282 self
9283 }
9284
9285 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9287 self.0.request.zone = v.into();
9288 self
9289 }
9290 }
9291
9292 #[doc(hidden)]
9293 impl gax::options::internal::RequestBuilder for Resume {
9294 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9295 &mut self.0.options
9296 }
9297 }
9298
9299 #[derive(Clone, Debug)]
9317 pub struct SendDiagnosticInterrupt(
9318 RequestBuilder<crate::model::instances::SendDiagnosticInterruptRequest>,
9319 );
9320
9321 impl SendDiagnosticInterrupt {
9322 pub(crate) fn new(
9323 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9324 ) -> Self {
9325 Self(RequestBuilder::new(stub))
9326 }
9327
9328 pub fn with_request<V: Into<crate::model::instances::SendDiagnosticInterruptRequest>>(
9330 mut self,
9331 v: V,
9332 ) -> Self {
9333 self.0.request = v.into();
9334 self
9335 }
9336
9337 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9339 self.0.options = v.into();
9340 self
9341 }
9342
9343 pub async fn send(self) -> Result<wkt::Empty> {
9345 (*self.0.stub)
9346 .send_diagnostic_interrupt(self.0.request, self.0.options)
9347 .await
9348 .map(gax::response::Response::into_body)
9349 }
9350
9351 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9353 self.0.request.instance = v.into();
9354 self
9355 }
9356
9357 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9359 self.0.request.project = v.into();
9360 self
9361 }
9362
9363 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9365 self.0.request.zone = v.into();
9366 self
9367 }
9368 }
9369
9370 #[doc(hidden)]
9371 impl gax::options::internal::RequestBuilder for SendDiagnosticInterrupt {
9372 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9373 &mut self.0.options
9374 }
9375 }
9376
9377 #[derive(Clone, Debug)]
9395 pub struct SetDeletionProtection(
9396 RequestBuilder<crate::model::instances::SetDeletionProtectionRequest>,
9397 );
9398
9399 impl SetDeletionProtection {
9400 pub(crate) fn new(
9401 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9402 ) -> Self {
9403 Self(RequestBuilder::new(stub))
9404 }
9405
9406 pub fn with_request<V: Into<crate::model::instances::SetDeletionProtectionRequest>>(
9408 mut self,
9409 v: V,
9410 ) -> Self {
9411 self.0.request = v.into();
9412 self
9413 }
9414
9415 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9417 self.0.options = v.into();
9418 self
9419 }
9420
9421 pub async fn send(self) -> Result<crate::model::Operation> {
9423 (*self.0.stub)
9424 .set_deletion_protection(self.0.request, self.0.options)
9425 .await
9426 .map(gax::response::Response::into_body)
9427 }
9428
9429 pub fn set_deletion_protection<T>(mut self, v: T) -> Self
9431 where
9432 T: std::convert::Into<bool>,
9433 {
9434 self.0.request.deletion_protection = std::option::Option::Some(v.into());
9435 self
9436 }
9437
9438 pub fn set_or_clear_deletion_protection<T>(mut self, v: std::option::Option<T>) -> Self
9440 where
9441 T: std::convert::Into<bool>,
9442 {
9443 self.0.request.deletion_protection = v.map(|x| x.into());
9444 self
9445 }
9446
9447 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9449 self.0.request.project = v.into();
9450 self
9451 }
9452
9453 pub fn set_request_id<T>(mut self, v: T) -> Self
9455 where
9456 T: std::convert::Into<std::string::String>,
9457 {
9458 self.0.request.request_id = std::option::Option::Some(v.into());
9459 self
9460 }
9461
9462 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9464 where
9465 T: std::convert::Into<std::string::String>,
9466 {
9467 self.0.request.request_id = v.map(|x| x.into());
9468 self
9469 }
9470
9471 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9473 self.0.request.resource = v.into();
9474 self
9475 }
9476
9477 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9479 self.0.request.zone = v.into();
9480 self
9481 }
9482 }
9483
9484 #[doc(hidden)]
9485 impl gax::options::internal::RequestBuilder for SetDeletionProtection {
9486 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9487 &mut self.0.options
9488 }
9489 }
9490
9491 #[derive(Clone, Debug)]
9509 pub struct SetDiskAutoDelete(RequestBuilder<crate::model::instances::SetDiskAutoDeleteRequest>);
9510
9511 impl SetDiskAutoDelete {
9512 pub(crate) fn new(
9513 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9514 ) -> Self {
9515 Self(RequestBuilder::new(stub))
9516 }
9517
9518 pub fn with_request<V: Into<crate::model::instances::SetDiskAutoDeleteRequest>>(
9520 mut self,
9521 v: V,
9522 ) -> Self {
9523 self.0.request = v.into();
9524 self
9525 }
9526
9527 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9529 self.0.options = v.into();
9530 self
9531 }
9532
9533 pub async fn send(self) -> Result<crate::model::Operation> {
9535 (*self.0.stub)
9536 .set_disk_auto_delete(self.0.request, self.0.options)
9537 .await
9538 .map(gax::response::Response::into_body)
9539 }
9540
9541 pub fn set_auto_delete<T: Into<bool>>(mut self, v: T) -> Self {
9543 self.0.request.auto_delete = v.into();
9544 self
9545 }
9546
9547 pub fn set_device_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9549 self.0.request.device_name = v.into();
9550 self
9551 }
9552
9553 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9555 self.0.request.instance = v.into();
9556 self
9557 }
9558
9559 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9561 self.0.request.project = v.into();
9562 self
9563 }
9564
9565 pub fn set_request_id<T>(mut self, v: T) -> Self
9567 where
9568 T: std::convert::Into<std::string::String>,
9569 {
9570 self.0.request.request_id = std::option::Option::Some(v.into());
9571 self
9572 }
9573
9574 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9576 where
9577 T: std::convert::Into<std::string::String>,
9578 {
9579 self.0.request.request_id = v.map(|x| x.into());
9580 self
9581 }
9582
9583 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9585 self.0.request.zone = v.into();
9586 self
9587 }
9588 }
9589
9590 #[doc(hidden)]
9591 impl gax::options::internal::RequestBuilder for SetDiskAutoDelete {
9592 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9593 &mut self.0.options
9594 }
9595 }
9596
9597 #[derive(Clone, Debug)]
9615 pub struct SetIamPolicy(RequestBuilder<crate::model::instances::SetIamPolicyRequest>);
9616
9617 impl SetIamPolicy {
9618 pub(crate) fn new(
9619 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9620 ) -> Self {
9621 Self(RequestBuilder::new(stub))
9622 }
9623
9624 pub fn with_request<V: Into<crate::model::instances::SetIamPolicyRequest>>(
9626 mut self,
9627 v: V,
9628 ) -> Self {
9629 self.0.request = v.into();
9630 self
9631 }
9632
9633 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9635 self.0.options = v.into();
9636 self
9637 }
9638
9639 pub async fn send(self) -> Result<crate::model::Policy> {
9641 (*self.0.stub)
9642 .set_iam_policy(self.0.request, self.0.options)
9643 .await
9644 .map(gax::response::Response::into_body)
9645 }
9646
9647 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9649 self.0.request.project = v.into();
9650 self
9651 }
9652
9653 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9655 self.0.request.resource = v.into();
9656 self
9657 }
9658
9659 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9661 self.0.request.zone = v.into();
9662 self
9663 }
9664
9665 pub fn set_body<T>(mut self, v: T) -> Self
9667 where
9668 T: std::convert::Into<crate::model::ZoneSetPolicyRequest>,
9669 {
9670 self.0.request.body = std::option::Option::Some(v.into());
9671 self
9672 }
9673
9674 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9676 where
9677 T: std::convert::Into<crate::model::ZoneSetPolicyRequest>,
9678 {
9679 self.0.request.body = v.map(|x| x.into());
9680 self
9681 }
9682 }
9683
9684 #[doc(hidden)]
9685 impl gax::options::internal::RequestBuilder for SetIamPolicy {
9686 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9687 &mut self.0.options
9688 }
9689 }
9690
9691 #[derive(Clone, Debug)]
9709 pub struct SetLabels(RequestBuilder<crate::model::instances::SetLabelsRequest>);
9710
9711 impl SetLabels {
9712 pub(crate) fn new(
9713 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9714 ) -> Self {
9715 Self(RequestBuilder::new(stub))
9716 }
9717
9718 pub fn with_request<V: Into<crate::model::instances::SetLabelsRequest>>(
9720 mut self,
9721 v: V,
9722 ) -> Self {
9723 self.0.request = v.into();
9724 self
9725 }
9726
9727 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9729 self.0.options = v.into();
9730 self
9731 }
9732
9733 pub async fn send(self) -> Result<crate::model::Operation> {
9735 (*self.0.stub)
9736 .set_labels(self.0.request, self.0.options)
9737 .await
9738 .map(gax::response::Response::into_body)
9739 }
9740
9741 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9743 self.0.request.instance = v.into();
9744 self
9745 }
9746
9747 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9749 self.0.request.project = v.into();
9750 self
9751 }
9752
9753 pub fn set_request_id<T>(mut self, v: T) -> Self
9755 where
9756 T: std::convert::Into<std::string::String>,
9757 {
9758 self.0.request.request_id = std::option::Option::Some(v.into());
9759 self
9760 }
9761
9762 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9764 where
9765 T: std::convert::Into<std::string::String>,
9766 {
9767 self.0.request.request_id = v.map(|x| x.into());
9768 self
9769 }
9770
9771 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9773 self.0.request.zone = v.into();
9774 self
9775 }
9776
9777 pub fn set_body<T>(mut self, v: T) -> Self
9779 where
9780 T: std::convert::Into<crate::model::InstancesSetLabelsRequest>,
9781 {
9782 self.0.request.body = std::option::Option::Some(v.into());
9783 self
9784 }
9785
9786 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9788 where
9789 T: std::convert::Into<crate::model::InstancesSetLabelsRequest>,
9790 {
9791 self.0.request.body = v.map(|x| x.into());
9792 self
9793 }
9794 }
9795
9796 #[doc(hidden)]
9797 impl gax::options::internal::RequestBuilder for SetLabels {
9798 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9799 &mut self.0.options
9800 }
9801 }
9802
9803 #[derive(Clone, Debug)]
9821 pub struct SetMachineResources(
9822 RequestBuilder<crate::model::instances::SetMachineResourcesRequest>,
9823 );
9824
9825 impl SetMachineResources {
9826 pub(crate) fn new(
9827 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9828 ) -> Self {
9829 Self(RequestBuilder::new(stub))
9830 }
9831
9832 pub fn with_request<V: Into<crate::model::instances::SetMachineResourcesRequest>>(
9834 mut self,
9835 v: V,
9836 ) -> Self {
9837 self.0.request = v.into();
9838 self
9839 }
9840
9841 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9843 self.0.options = v.into();
9844 self
9845 }
9846
9847 pub async fn send(self) -> Result<crate::model::Operation> {
9849 (*self.0.stub)
9850 .set_machine_resources(self.0.request, self.0.options)
9851 .await
9852 .map(gax::response::Response::into_body)
9853 }
9854
9855 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9857 self.0.request.instance = v.into();
9858 self
9859 }
9860
9861 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9863 self.0.request.project = v.into();
9864 self
9865 }
9866
9867 pub fn set_request_id<T>(mut self, v: T) -> Self
9869 where
9870 T: std::convert::Into<std::string::String>,
9871 {
9872 self.0.request.request_id = std::option::Option::Some(v.into());
9873 self
9874 }
9875
9876 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9878 where
9879 T: std::convert::Into<std::string::String>,
9880 {
9881 self.0.request.request_id = v.map(|x| x.into());
9882 self
9883 }
9884
9885 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9887 self.0.request.zone = v.into();
9888 self
9889 }
9890
9891 pub fn set_body<T>(mut self, v: T) -> Self
9893 where
9894 T: std::convert::Into<crate::model::InstancesSetMachineResourcesRequest>,
9895 {
9896 self.0.request.body = std::option::Option::Some(v.into());
9897 self
9898 }
9899
9900 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9902 where
9903 T: std::convert::Into<crate::model::InstancesSetMachineResourcesRequest>,
9904 {
9905 self.0.request.body = v.map(|x| x.into());
9906 self
9907 }
9908 }
9909
9910 #[doc(hidden)]
9911 impl gax::options::internal::RequestBuilder for SetMachineResources {
9912 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9913 &mut self.0.options
9914 }
9915 }
9916
9917 #[derive(Clone, Debug)]
9935 pub struct SetMachineType(RequestBuilder<crate::model::instances::SetMachineTypeRequest>);
9936
9937 impl SetMachineType {
9938 pub(crate) fn new(
9939 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
9940 ) -> Self {
9941 Self(RequestBuilder::new(stub))
9942 }
9943
9944 pub fn with_request<V: Into<crate::model::instances::SetMachineTypeRequest>>(
9946 mut self,
9947 v: V,
9948 ) -> Self {
9949 self.0.request = v.into();
9950 self
9951 }
9952
9953 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9955 self.0.options = v.into();
9956 self
9957 }
9958
9959 pub async fn send(self) -> Result<crate::model::Operation> {
9961 (*self.0.stub)
9962 .set_machine_type(self.0.request, self.0.options)
9963 .await
9964 .map(gax::response::Response::into_body)
9965 }
9966
9967 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
9969 self.0.request.instance = v.into();
9970 self
9971 }
9972
9973 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
9975 self.0.request.project = v.into();
9976 self
9977 }
9978
9979 pub fn set_request_id<T>(mut self, v: T) -> Self
9981 where
9982 T: std::convert::Into<std::string::String>,
9983 {
9984 self.0.request.request_id = std::option::Option::Some(v.into());
9985 self
9986 }
9987
9988 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
9990 where
9991 T: std::convert::Into<std::string::String>,
9992 {
9993 self.0.request.request_id = v.map(|x| x.into());
9994 self
9995 }
9996
9997 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
9999 self.0.request.zone = v.into();
10000 self
10001 }
10002
10003 pub fn set_body<T>(mut self, v: T) -> Self
10005 where
10006 T: std::convert::Into<crate::model::InstancesSetMachineTypeRequest>,
10007 {
10008 self.0.request.body = std::option::Option::Some(v.into());
10009 self
10010 }
10011
10012 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10014 where
10015 T: std::convert::Into<crate::model::InstancesSetMachineTypeRequest>,
10016 {
10017 self.0.request.body = v.map(|x| x.into());
10018 self
10019 }
10020 }
10021
10022 #[doc(hidden)]
10023 impl gax::options::internal::RequestBuilder for SetMachineType {
10024 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10025 &mut self.0.options
10026 }
10027 }
10028
10029 #[derive(Clone, Debug)]
10047 pub struct SetMetadata(RequestBuilder<crate::model::instances::SetMetadataRequest>);
10048
10049 impl SetMetadata {
10050 pub(crate) fn new(
10051 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10052 ) -> Self {
10053 Self(RequestBuilder::new(stub))
10054 }
10055
10056 pub fn with_request<V: Into<crate::model::instances::SetMetadataRequest>>(
10058 mut self,
10059 v: V,
10060 ) -> Self {
10061 self.0.request = v.into();
10062 self
10063 }
10064
10065 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10067 self.0.options = v.into();
10068 self
10069 }
10070
10071 pub async fn send(self) -> Result<crate::model::Operation> {
10073 (*self.0.stub)
10074 .set_metadata(self.0.request, self.0.options)
10075 .await
10076 .map(gax::response::Response::into_body)
10077 }
10078
10079 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10081 self.0.request.instance = v.into();
10082 self
10083 }
10084
10085 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10087 self.0.request.project = v.into();
10088 self
10089 }
10090
10091 pub fn set_request_id<T>(mut self, v: T) -> Self
10093 where
10094 T: std::convert::Into<std::string::String>,
10095 {
10096 self.0.request.request_id = std::option::Option::Some(v.into());
10097 self
10098 }
10099
10100 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10102 where
10103 T: std::convert::Into<std::string::String>,
10104 {
10105 self.0.request.request_id = v.map(|x| x.into());
10106 self
10107 }
10108
10109 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10111 self.0.request.zone = v.into();
10112 self
10113 }
10114
10115 pub fn set_body<T>(mut self, v: T) -> Self
10117 where
10118 T: std::convert::Into<crate::model::Metadata>,
10119 {
10120 self.0.request.body = std::option::Option::Some(v.into());
10121 self
10122 }
10123
10124 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10126 where
10127 T: std::convert::Into<crate::model::Metadata>,
10128 {
10129 self.0.request.body = v.map(|x| x.into());
10130 self
10131 }
10132 }
10133
10134 #[doc(hidden)]
10135 impl gax::options::internal::RequestBuilder for SetMetadata {
10136 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10137 &mut self.0.options
10138 }
10139 }
10140
10141 #[derive(Clone, Debug)]
10159 pub struct SetMinCpuPlatform(RequestBuilder<crate::model::instances::SetMinCpuPlatformRequest>);
10160
10161 impl SetMinCpuPlatform {
10162 pub(crate) fn new(
10163 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10164 ) -> Self {
10165 Self(RequestBuilder::new(stub))
10166 }
10167
10168 pub fn with_request<V: Into<crate::model::instances::SetMinCpuPlatformRequest>>(
10170 mut self,
10171 v: V,
10172 ) -> Self {
10173 self.0.request = v.into();
10174 self
10175 }
10176
10177 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10179 self.0.options = v.into();
10180 self
10181 }
10182
10183 pub async fn send(self) -> Result<crate::model::Operation> {
10185 (*self.0.stub)
10186 .set_min_cpu_platform(self.0.request, self.0.options)
10187 .await
10188 .map(gax::response::Response::into_body)
10189 }
10190
10191 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10193 self.0.request.instance = v.into();
10194 self
10195 }
10196
10197 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10199 self.0.request.project = v.into();
10200 self
10201 }
10202
10203 pub fn set_request_id<T>(mut self, v: T) -> Self
10205 where
10206 T: std::convert::Into<std::string::String>,
10207 {
10208 self.0.request.request_id = std::option::Option::Some(v.into());
10209 self
10210 }
10211
10212 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10214 where
10215 T: std::convert::Into<std::string::String>,
10216 {
10217 self.0.request.request_id = v.map(|x| x.into());
10218 self
10219 }
10220
10221 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10223 self.0.request.zone = v.into();
10224 self
10225 }
10226
10227 pub fn set_body<T>(mut self, v: T) -> Self
10229 where
10230 T: std::convert::Into<crate::model::InstancesSetMinCpuPlatformRequest>,
10231 {
10232 self.0.request.body = std::option::Option::Some(v.into());
10233 self
10234 }
10235
10236 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10238 where
10239 T: std::convert::Into<crate::model::InstancesSetMinCpuPlatformRequest>,
10240 {
10241 self.0.request.body = v.map(|x| x.into());
10242 self
10243 }
10244 }
10245
10246 #[doc(hidden)]
10247 impl gax::options::internal::RequestBuilder for SetMinCpuPlatform {
10248 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10249 &mut self.0.options
10250 }
10251 }
10252
10253 #[derive(Clone, Debug)]
10271 pub struct SetName(RequestBuilder<crate::model::instances::SetNameRequest>);
10272
10273 impl SetName {
10274 pub(crate) fn new(
10275 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10276 ) -> Self {
10277 Self(RequestBuilder::new(stub))
10278 }
10279
10280 pub fn with_request<V: Into<crate::model::instances::SetNameRequest>>(
10282 mut self,
10283 v: V,
10284 ) -> Self {
10285 self.0.request = v.into();
10286 self
10287 }
10288
10289 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10291 self.0.options = v.into();
10292 self
10293 }
10294
10295 pub async fn send(self) -> Result<crate::model::Operation> {
10297 (*self.0.stub)
10298 .set_name(self.0.request, self.0.options)
10299 .await
10300 .map(gax::response::Response::into_body)
10301 }
10302
10303 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10305 self.0.request.instance = v.into();
10306 self
10307 }
10308
10309 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10311 self.0.request.project = v.into();
10312 self
10313 }
10314
10315 pub fn set_request_id<T>(mut self, v: T) -> Self
10317 where
10318 T: std::convert::Into<std::string::String>,
10319 {
10320 self.0.request.request_id = std::option::Option::Some(v.into());
10321 self
10322 }
10323
10324 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10326 where
10327 T: std::convert::Into<std::string::String>,
10328 {
10329 self.0.request.request_id = v.map(|x| x.into());
10330 self
10331 }
10332
10333 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10335 self.0.request.zone = v.into();
10336 self
10337 }
10338
10339 pub fn set_body<T>(mut self, v: T) -> Self
10341 where
10342 T: std::convert::Into<crate::model::InstancesSetNameRequest>,
10343 {
10344 self.0.request.body = std::option::Option::Some(v.into());
10345 self
10346 }
10347
10348 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10350 where
10351 T: std::convert::Into<crate::model::InstancesSetNameRequest>,
10352 {
10353 self.0.request.body = v.map(|x| x.into());
10354 self
10355 }
10356 }
10357
10358 #[doc(hidden)]
10359 impl gax::options::internal::RequestBuilder for SetName {
10360 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10361 &mut self.0.options
10362 }
10363 }
10364
10365 #[derive(Clone, Debug)]
10383 pub struct SetScheduling(RequestBuilder<crate::model::instances::SetSchedulingRequest>);
10384
10385 impl SetScheduling {
10386 pub(crate) fn new(
10387 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10388 ) -> Self {
10389 Self(RequestBuilder::new(stub))
10390 }
10391
10392 pub fn with_request<V: Into<crate::model::instances::SetSchedulingRequest>>(
10394 mut self,
10395 v: V,
10396 ) -> Self {
10397 self.0.request = v.into();
10398 self
10399 }
10400
10401 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10403 self.0.options = v.into();
10404 self
10405 }
10406
10407 pub async fn send(self) -> Result<crate::model::Operation> {
10409 (*self.0.stub)
10410 .set_scheduling(self.0.request, self.0.options)
10411 .await
10412 .map(gax::response::Response::into_body)
10413 }
10414
10415 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10417 self.0.request.instance = v.into();
10418 self
10419 }
10420
10421 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10423 self.0.request.project = v.into();
10424 self
10425 }
10426
10427 pub fn set_request_id<T>(mut self, v: T) -> Self
10429 where
10430 T: std::convert::Into<std::string::String>,
10431 {
10432 self.0.request.request_id = std::option::Option::Some(v.into());
10433 self
10434 }
10435
10436 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10438 where
10439 T: std::convert::Into<std::string::String>,
10440 {
10441 self.0.request.request_id = v.map(|x| x.into());
10442 self
10443 }
10444
10445 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10447 self.0.request.zone = v.into();
10448 self
10449 }
10450
10451 pub fn set_body<T>(mut self, v: T) -> Self
10453 where
10454 T: std::convert::Into<crate::model::Scheduling>,
10455 {
10456 self.0.request.body = std::option::Option::Some(v.into());
10457 self
10458 }
10459
10460 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10462 where
10463 T: std::convert::Into<crate::model::Scheduling>,
10464 {
10465 self.0.request.body = v.map(|x| x.into());
10466 self
10467 }
10468 }
10469
10470 #[doc(hidden)]
10471 impl gax::options::internal::RequestBuilder for SetScheduling {
10472 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10473 &mut self.0.options
10474 }
10475 }
10476
10477 #[derive(Clone, Debug)]
10495 pub struct SetSecurityPolicy(RequestBuilder<crate::model::instances::SetSecurityPolicyRequest>);
10496
10497 impl SetSecurityPolicy {
10498 pub(crate) fn new(
10499 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10500 ) -> Self {
10501 Self(RequestBuilder::new(stub))
10502 }
10503
10504 pub fn with_request<V: Into<crate::model::instances::SetSecurityPolicyRequest>>(
10506 mut self,
10507 v: V,
10508 ) -> Self {
10509 self.0.request = v.into();
10510 self
10511 }
10512
10513 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10515 self.0.options = v.into();
10516 self
10517 }
10518
10519 pub async fn send(self) -> Result<crate::model::Operation> {
10521 (*self.0.stub)
10522 .set_security_policy(self.0.request, self.0.options)
10523 .await
10524 .map(gax::response::Response::into_body)
10525 }
10526
10527 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10529 self.0.request.instance = v.into();
10530 self
10531 }
10532
10533 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10535 self.0.request.project = v.into();
10536 self
10537 }
10538
10539 pub fn set_request_id<T>(mut self, v: T) -> Self
10541 where
10542 T: std::convert::Into<std::string::String>,
10543 {
10544 self.0.request.request_id = std::option::Option::Some(v.into());
10545 self
10546 }
10547
10548 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10550 where
10551 T: std::convert::Into<std::string::String>,
10552 {
10553 self.0.request.request_id = v.map(|x| x.into());
10554 self
10555 }
10556
10557 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10559 self.0.request.zone = v.into();
10560 self
10561 }
10562
10563 pub fn set_body<T>(mut self, v: T) -> Self
10565 where
10566 T: std::convert::Into<crate::model::InstancesSetSecurityPolicyRequest>,
10567 {
10568 self.0.request.body = std::option::Option::Some(v.into());
10569 self
10570 }
10571
10572 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10574 where
10575 T: std::convert::Into<crate::model::InstancesSetSecurityPolicyRequest>,
10576 {
10577 self.0.request.body = v.map(|x| x.into());
10578 self
10579 }
10580 }
10581
10582 #[doc(hidden)]
10583 impl gax::options::internal::RequestBuilder for SetSecurityPolicy {
10584 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10585 &mut self.0.options
10586 }
10587 }
10588
10589 #[derive(Clone, Debug)]
10607 pub struct SetServiceAccount(RequestBuilder<crate::model::instances::SetServiceAccountRequest>);
10608
10609 impl SetServiceAccount {
10610 pub(crate) fn new(
10611 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10612 ) -> Self {
10613 Self(RequestBuilder::new(stub))
10614 }
10615
10616 pub fn with_request<V: Into<crate::model::instances::SetServiceAccountRequest>>(
10618 mut self,
10619 v: V,
10620 ) -> Self {
10621 self.0.request = v.into();
10622 self
10623 }
10624
10625 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10627 self.0.options = v.into();
10628 self
10629 }
10630
10631 pub async fn send(self) -> Result<crate::model::Operation> {
10633 (*self.0.stub)
10634 .set_service_account(self.0.request, self.0.options)
10635 .await
10636 .map(gax::response::Response::into_body)
10637 }
10638
10639 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10641 self.0.request.instance = v.into();
10642 self
10643 }
10644
10645 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10647 self.0.request.project = v.into();
10648 self
10649 }
10650
10651 pub fn set_request_id<T>(mut self, v: T) -> Self
10653 where
10654 T: std::convert::Into<std::string::String>,
10655 {
10656 self.0.request.request_id = std::option::Option::Some(v.into());
10657 self
10658 }
10659
10660 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10662 where
10663 T: std::convert::Into<std::string::String>,
10664 {
10665 self.0.request.request_id = v.map(|x| x.into());
10666 self
10667 }
10668
10669 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10671 self.0.request.zone = v.into();
10672 self
10673 }
10674
10675 pub fn set_body<T>(mut self, v: T) -> Self
10677 where
10678 T: std::convert::Into<crate::model::InstancesSetServiceAccountRequest>,
10679 {
10680 self.0.request.body = std::option::Option::Some(v.into());
10681 self
10682 }
10683
10684 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10686 where
10687 T: std::convert::Into<crate::model::InstancesSetServiceAccountRequest>,
10688 {
10689 self.0.request.body = v.map(|x| x.into());
10690 self
10691 }
10692 }
10693
10694 #[doc(hidden)]
10695 impl gax::options::internal::RequestBuilder for SetServiceAccount {
10696 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10697 &mut self.0.options
10698 }
10699 }
10700
10701 #[derive(Clone, Debug)]
10719 pub struct SetShieldedInstanceIntegrityPolicy(
10720 RequestBuilder<crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest>,
10721 );
10722
10723 impl SetShieldedInstanceIntegrityPolicy {
10724 pub(crate) fn new(
10725 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10726 ) -> Self {
10727 Self(RequestBuilder::new(stub))
10728 }
10729
10730 pub fn with_request<
10732 V: Into<crate::model::instances::SetShieldedInstanceIntegrityPolicyRequest>,
10733 >(
10734 mut self,
10735 v: V,
10736 ) -> Self {
10737 self.0.request = v.into();
10738 self
10739 }
10740
10741 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10743 self.0.options = v.into();
10744 self
10745 }
10746
10747 pub async fn send(self) -> Result<crate::model::Operation> {
10749 (*self.0.stub)
10750 .set_shielded_instance_integrity_policy(self.0.request, self.0.options)
10751 .await
10752 .map(gax::response::Response::into_body)
10753 }
10754
10755 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10757 self.0.request.instance = v.into();
10758 self
10759 }
10760
10761 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10763 self.0.request.project = v.into();
10764 self
10765 }
10766
10767 pub fn set_request_id<T>(mut self, v: T) -> Self
10769 where
10770 T: std::convert::Into<std::string::String>,
10771 {
10772 self.0.request.request_id = std::option::Option::Some(v.into());
10773 self
10774 }
10775
10776 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10778 where
10779 T: std::convert::Into<std::string::String>,
10780 {
10781 self.0.request.request_id = v.map(|x| x.into());
10782 self
10783 }
10784
10785 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10787 self.0.request.zone = v.into();
10788 self
10789 }
10790
10791 pub fn set_body<T>(mut self, v: T) -> Self
10793 where
10794 T: std::convert::Into<crate::model::ShieldedInstanceIntegrityPolicy>,
10795 {
10796 self.0.request.body = std::option::Option::Some(v.into());
10797 self
10798 }
10799
10800 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10802 where
10803 T: std::convert::Into<crate::model::ShieldedInstanceIntegrityPolicy>,
10804 {
10805 self.0.request.body = v.map(|x| x.into());
10806 self
10807 }
10808 }
10809
10810 #[doc(hidden)]
10811 impl gax::options::internal::RequestBuilder for SetShieldedInstanceIntegrityPolicy {
10812 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10813 &mut self.0.options
10814 }
10815 }
10816
10817 #[derive(Clone, Debug)]
10835 pub struct SetTags(RequestBuilder<crate::model::instances::SetTagsRequest>);
10836
10837 impl SetTags {
10838 pub(crate) fn new(
10839 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10840 ) -> Self {
10841 Self(RequestBuilder::new(stub))
10842 }
10843
10844 pub fn with_request<V: Into<crate::model::instances::SetTagsRequest>>(
10846 mut self,
10847 v: V,
10848 ) -> Self {
10849 self.0.request = v.into();
10850 self
10851 }
10852
10853 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10855 self.0.options = v.into();
10856 self
10857 }
10858
10859 pub async fn send(self) -> Result<crate::model::Operation> {
10861 (*self.0.stub)
10862 .set_tags(self.0.request, self.0.options)
10863 .await
10864 .map(gax::response::Response::into_body)
10865 }
10866
10867 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10869 self.0.request.instance = v.into();
10870 self
10871 }
10872
10873 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10875 self.0.request.project = v.into();
10876 self
10877 }
10878
10879 pub fn set_request_id<T>(mut self, v: T) -> Self
10881 where
10882 T: std::convert::Into<std::string::String>,
10883 {
10884 self.0.request.request_id = std::option::Option::Some(v.into());
10885 self
10886 }
10887
10888 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
10890 where
10891 T: std::convert::Into<std::string::String>,
10892 {
10893 self.0.request.request_id = v.map(|x| x.into());
10894 self
10895 }
10896
10897 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
10899 self.0.request.zone = v.into();
10900 self
10901 }
10902
10903 pub fn set_body<T>(mut self, v: T) -> Self
10905 where
10906 T: std::convert::Into<crate::model::Tags>,
10907 {
10908 self.0.request.body = std::option::Option::Some(v.into());
10909 self
10910 }
10911
10912 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10914 where
10915 T: std::convert::Into<crate::model::Tags>,
10916 {
10917 self.0.request.body = v.map(|x| x.into());
10918 self
10919 }
10920 }
10921
10922 #[doc(hidden)]
10923 impl gax::options::internal::RequestBuilder for SetTags {
10924 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10925 &mut self.0.options
10926 }
10927 }
10928
10929 #[derive(Clone, Debug)]
10947 pub struct SimulateMaintenanceEvent(
10948 RequestBuilder<crate::model::instances::SimulateMaintenanceEventRequest>,
10949 );
10950
10951 impl SimulateMaintenanceEvent {
10952 pub(crate) fn new(
10953 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
10954 ) -> Self {
10955 Self(RequestBuilder::new(stub))
10956 }
10957
10958 pub fn with_request<V: Into<crate::model::instances::SimulateMaintenanceEventRequest>>(
10960 mut self,
10961 v: V,
10962 ) -> Self {
10963 self.0.request = v.into();
10964 self
10965 }
10966
10967 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10969 self.0.options = v.into();
10970 self
10971 }
10972
10973 pub async fn send(self) -> Result<crate::model::Operation> {
10975 (*self.0.stub)
10976 .simulate_maintenance_event(self.0.request, self.0.options)
10977 .await
10978 .map(gax::response::Response::into_body)
10979 }
10980
10981 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
10983 self.0.request.instance = v.into();
10984 self
10985 }
10986
10987 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
10989 self.0.request.project = v.into();
10990 self
10991 }
10992
10993 pub fn set_request_id<T>(mut self, v: T) -> Self
10995 where
10996 T: std::convert::Into<std::string::String>,
10997 {
10998 self.0.request.request_id = std::option::Option::Some(v.into());
10999 self
11000 }
11001
11002 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11004 where
11005 T: std::convert::Into<std::string::String>,
11006 {
11007 self.0.request.request_id = v.map(|x| x.into());
11008 self
11009 }
11010
11011 pub fn set_with_extended_notifications<T>(mut self, v: T) -> Self
11013 where
11014 T: std::convert::Into<bool>,
11015 {
11016 self.0.request.with_extended_notifications = std::option::Option::Some(v.into());
11017 self
11018 }
11019
11020 pub fn set_or_clear_with_extended_notifications<T>(
11022 mut self,
11023 v: std::option::Option<T>,
11024 ) -> Self
11025 where
11026 T: std::convert::Into<bool>,
11027 {
11028 self.0.request.with_extended_notifications = v.map(|x| x.into());
11029 self
11030 }
11031
11032 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11034 self.0.request.zone = v.into();
11035 self
11036 }
11037 }
11038
11039 #[doc(hidden)]
11040 impl gax::options::internal::RequestBuilder for SimulateMaintenanceEvent {
11041 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11042 &mut self.0.options
11043 }
11044 }
11045
11046 #[derive(Clone, Debug)]
11064 pub struct Start(RequestBuilder<crate::model::instances::StartRequest>);
11065
11066 impl Start {
11067 pub(crate) fn new(
11068 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11069 ) -> Self {
11070 Self(RequestBuilder::new(stub))
11071 }
11072
11073 pub fn with_request<V: Into<crate::model::instances::StartRequest>>(
11075 mut self,
11076 v: V,
11077 ) -> Self {
11078 self.0.request = v.into();
11079 self
11080 }
11081
11082 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11084 self.0.options = v.into();
11085 self
11086 }
11087
11088 pub async fn send(self) -> Result<crate::model::Operation> {
11090 (*self.0.stub)
11091 .start(self.0.request, self.0.options)
11092 .await
11093 .map(gax::response::Response::into_body)
11094 }
11095
11096 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11098 self.0.request.instance = v.into();
11099 self
11100 }
11101
11102 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11104 self.0.request.project = v.into();
11105 self
11106 }
11107
11108 pub fn set_request_id<T>(mut self, v: T) -> Self
11110 where
11111 T: std::convert::Into<std::string::String>,
11112 {
11113 self.0.request.request_id = std::option::Option::Some(v.into());
11114 self
11115 }
11116
11117 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11119 where
11120 T: std::convert::Into<std::string::String>,
11121 {
11122 self.0.request.request_id = v.map(|x| x.into());
11123 self
11124 }
11125
11126 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11128 self.0.request.zone = v.into();
11129 self
11130 }
11131 }
11132
11133 #[doc(hidden)]
11134 impl gax::options::internal::RequestBuilder for Start {
11135 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11136 &mut self.0.options
11137 }
11138 }
11139
11140 #[derive(Clone, Debug)]
11158 pub struct StartWithEncryptionKey(
11159 RequestBuilder<crate::model::instances::StartWithEncryptionKeyRequest>,
11160 );
11161
11162 impl StartWithEncryptionKey {
11163 pub(crate) fn new(
11164 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11165 ) -> Self {
11166 Self(RequestBuilder::new(stub))
11167 }
11168
11169 pub fn with_request<V: Into<crate::model::instances::StartWithEncryptionKeyRequest>>(
11171 mut self,
11172 v: V,
11173 ) -> Self {
11174 self.0.request = v.into();
11175 self
11176 }
11177
11178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11180 self.0.options = v.into();
11181 self
11182 }
11183
11184 pub async fn send(self) -> Result<crate::model::Operation> {
11186 (*self.0.stub)
11187 .start_with_encryption_key(self.0.request, self.0.options)
11188 .await
11189 .map(gax::response::Response::into_body)
11190 }
11191
11192 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11194 self.0.request.instance = v.into();
11195 self
11196 }
11197
11198 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11200 self.0.request.project = v.into();
11201 self
11202 }
11203
11204 pub fn set_request_id<T>(mut self, v: T) -> Self
11206 where
11207 T: std::convert::Into<std::string::String>,
11208 {
11209 self.0.request.request_id = std::option::Option::Some(v.into());
11210 self
11211 }
11212
11213 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11215 where
11216 T: std::convert::Into<std::string::String>,
11217 {
11218 self.0.request.request_id = v.map(|x| x.into());
11219 self
11220 }
11221
11222 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11224 self.0.request.zone = v.into();
11225 self
11226 }
11227
11228 pub fn set_body<T>(mut self, v: T) -> Self
11230 where
11231 T: std::convert::Into<crate::model::InstancesStartWithEncryptionKeyRequest>,
11232 {
11233 self.0.request.body = std::option::Option::Some(v.into());
11234 self
11235 }
11236
11237 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11239 where
11240 T: std::convert::Into<crate::model::InstancesStartWithEncryptionKeyRequest>,
11241 {
11242 self.0.request.body = v.map(|x| x.into());
11243 self
11244 }
11245 }
11246
11247 #[doc(hidden)]
11248 impl gax::options::internal::RequestBuilder for StartWithEncryptionKey {
11249 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11250 &mut self.0.options
11251 }
11252 }
11253
11254 #[derive(Clone, Debug)]
11272 pub struct Stop(RequestBuilder<crate::model::instances::StopRequest>);
11273
11274 impl Stop {
11275 pub(crate) fn new(
11276 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11277 ) -> Self {
11278 Self(RequestBuilder::new(stub))
11279 }
11280
11281 pub fn with_request<V: Into<crate::model::instances::StopRequest>>(mut self, v: V) -> Self {
11283 self.0.request = v.into();
11284 self
11285 }
11286
11287 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11289 self.0.options = v.into();
11290 self
11291 }
11292
11293 pub async fn send(self) -> Result<crate::model::Operation> {
11295 (*self.0.stub)
11296 .stop(self.0.request, self.0.options)
11297 .await
11298 .map(gax::response::Response::into_body)
11299 }
11300
11301 pub fn set_discard_local_ssd<T>(mut self, v: T) -> Self
11303 where
11304 T: std::convert::Into<bool>,
11305 {
11306 self.0.request.discard_local_ssd = std::option::Option::Some(v.into());
11307 self
11308 }
11309
11310 pub fn set_or_clear_discard_local_ssd<T>(mut self, v: std::option::Option<T>) -> Self
11312 where
11313 T: std::convert::Into<bool>,
11314 {
11315 self.0.request.discard_local_ssd = v.map(|x| x.into());
11316 self
11317 }
11318
11319 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11321 self.0.request.instance = v.into();
11322 self
11323 }
11324
11325 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11327 self.0.request.project = v.into();
11328 self
11329 }
11330
11331 pub fn set_request_id<T>(mut self, v: T) -> Self
11333 where
11334 T: std::convert::Into<std::string::String>,
11335 {
11336 self.0.request.request_id = std::option::Option::Some(v.into());
11337 self
11338 }
11339
11340 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11342 where
11343 T: std::convert::Into<std::string::String>,
11344 {
11345 self.0.request.request_id = v.map(|x| x.into());
11346 self
11347 }
11348
11349 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11351 self.0.request.zone = v.into();
11352 self
11353 }
11354 }
11355
11356 #[doc(hidden)]
11357 impl gax::options::internal::RequestBuilder for Stop {
11358 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11359 &mut self.0.options
11360 }
11361 }
11362
11363 #[derive(Clone, Debug)]
11381 pub struct Suspend(RequestBuilder<crate::model::instances::SuspendRequest>);
11382
11383 impl Suspend {
11384 pub(crate) fn new(
11385 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11386 ) -> Self {
11387 Self(RequestBuilder::new(stub))
11388 }
11389
11390 pub fn with_request<V: Into<crate::model::instances::SuspendRequest>>(
11392 mut self,
11393 v: V,
11394 ) -> Self {
11395 self.0.request = v.into();
11396 self
11397 }
11398
11399 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11401 self.0.options = v.into();
11402 self
11403 }
11404
11405 pub async fn send(self) -> Result<crate::model::Operation> {
11407 (*self.0.stub)
11408 .suspend(self.0.request, self.0.options)
11409 .await
11410 .map(gax::response::Response::into_body)
11411 }
11412
11413 pub fn set_discard_local_ssd<T>(mut self, v: T) -> Self
11415 where
11416 T: std::convert::Into<bool>,
11417 {
11418 self.0.request.discard_local_ssd = std::option::Option::Some(v.into());
11419 self
11420 }
11421
11422 pub fn set_or_clear_discard_local_ssd<T>(mut self, v: std::option::Option<T>) -> Self
11424 where
11425 T: std::convert::Into<bool>,
11426 {
11427 self.0.request.discard_local_ssd = v.map(|x| x.into());
11428 self
11429 }
11430
11431 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11433 self.0.request.instance = v.into();
11434 self
11435 }
11436
11437 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11439 self.0.request.project = v.into();
11440 self
11441 }
11442
11443 pub fn set_request_id<T>(mut self, v: T) -> Self
11445 where
11446 T: std::convert::Into<std::string::String>,
11447 {
11448 self.0.request.request_id = std::option::Option::Some(v.into());
11449 self
11450 }
11451
11452 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11454 where
11455 T: std::convert::Into<std::string::String>,
11456 {
11457 self.0.request.request_id = v.map(|x| x.into());
11458 self
11459 }
11460
11461 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11463 self.0.request.zone = v.into();
11464 self
11465 }
11466 }
11467
11468 #[doc(hidden)]
11469 impl gax::options::internal::RequestBuilder for Suspend {
11470 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11471 &mut self.0.options
11472 }
11473 }
11474
11475 #[derive(Clone, Debug)]
11493 pub struct TestIamPermissions(
11494 RequestBuilder<crate::model::instances::TestIamPermissionsRequest>,
11495 );
11496
11497 impl TestIamPermissions {
11498 pub(crate) fn new(
11499 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11500 ) -> Self {
11501 Self(RequestBuilder::new(stub))
11502 }
11503
11504 pub fn with_request<V: Into<crate::model::instances::TestIamPermissionsRequest>>(
11506 mut self,
11507 v: V,
11508 ) -> Self {
11509 self.0.request = v.into();
11510 self
11511 }
11512
11513 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11515 self.0.options = v.into();
11516 self
11517 }
11518
11519 pub async fn send(self) -> Result<crate::model::TestPermissionsResponse> {
11521 (*self.0.stub)
11522 .test_iam_permissions(self.0.request, self.0.options)
11523 .await
11524 .map(gax::response::Response::into_body)
11525 }
11526
11527 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11529 self.0.request.project = v.into();
11530 self
11531 }
11532
11533 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11535 self.0.request.resource = v.into();
11536 self
11537 }
11538
11539 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11541 self.0.request.zone = v.into();
11542 self
11543 }
11544
11545 pub fn set_body<T>(mut self, v: T) -> Self
11547 where
11548 T: std::convert::Into<crate::model::TestPermissionsRequest>,
11549 {
11550 self.0.request.body = std::option::Option::Some(v.into());
11551 self
11552 }
11553
11554 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11556 where
11557 T: std::convert::Into<crate::model::TestPermissionsRequest>,
11558 {
11559 self.0.request.body = v.map(|x| x.into());
11560 self
11561 }
11562 }
11563
11564 #[doc(hidden)]
11565 impl gax::options::internal::RequestBuilder for TestIamPermissions {
11566 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11567 &mut self.0.options
11568 }
11569 }
11570
11571 #[derive(Clone, Debug)]
11589 pub struct Update(RequestBuilder<crate::model::instances::UpdateRequest>);
11590
11591 impl Update {
11592 pub(crate) fn new(
11593 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11594 ) -> Self {
11595 Self(RequestBuilder::new(stub))
11596 }
11597
11598 pub fn with_request<V: Into<crate::model::instances::UpdateRequest>>(
11600 mut self,
11601 v: V,
11602 ) -> Self {
11603 self.0.request = v.into();
11604 self
11605 }
11606
11607 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11609 self.0.options = v.into();
11610 self
11611 }
11612
11613 pub async fn send(self) -> Result<crate::model::Operation> {
11615 (*self.0.stub)
11616 .update(self.0.request, self.0.options)
11617 .await
11618 .map(gax::response::Response::into_body)
11619 }
11620
11621 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11623 self.0.request.instance = v.into();
11624 self
11625 }
11626
11627 pub fn set_minimal_action<T>(mut self, v: T) -> Self
11629 where
11630 T: std::convert::Into<crate::model::instances::update_request::MinimalAction>,
11631 {
11632 self.0.request.minimal_action = std::option::Option::Some(v.into());
11633 self
11634 }
11635
11636 pub fn set_or_clear_minimal_action<T>(mut self, v: std::option::Option<T>) -> Self
11638 where
11639 T: std::convert::Into<crate::model::instances::update_request::MinimalAction>,
11640 {
11641 self.0.request.minimal_action = v.map(|x| x.into());
11642 self
11643 }
11644
11645 pub fn set_most_disruptive_allowed_action<T>(mut self, v: T) -> Self
11647 where
11648 T: std::convert::Into<
11649 crate::model::instances::update_request::MostDisruptiveAllowedAction,
11650 >,
11651 {
11652 self.0.request.most_disruptive_allowed_action = std::option::Option::Some(v.into());
11653 self
11654 }
11655
11656 pub fn set_or_clear_most_disruptive_allowed_action<T>(
11658 mut self,
11659 v: std::option::Option<T>,
11660 ) -> Self
11661 where
11662 T: std::convert::Into<
11663 crate::model::instances::update_request::MostDisruptiveAllowedAction,
11664 >,
11665 {
11666 self.0.request.most_disruptive_allowed_action = v.map(|x| x.into());
11667 self
11668 }
11669
11670 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11672 self.0.request.project = v.into();
11673 self
11674 }
11675
11676 pub fn set_request_id<T>(mut self, v: T) -> Self
11678 where
11679 T: std::convert::Into<std::string::String>,
11680 {
11681 self.0.request.request_id = std::option::Option::Some(v.into());
11682 self
11683 }
11684
11685 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11687 where
11688 T: std::convert::Into<std::string::String>,
11689 {
11690 self.0.request.request_id = v.map(|x| x.into());
11691 self
11692 }
11693
11694 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11696 self.0.request.zone = v.into();
11697 self
11698 }
11699
11700 pub fn set_body<T>(mut self, v: T) -> Self
11702 where
11703 T: std::convert::Into<crate::model::Instance>,
11704 {
11705 self.0.request.body = std::option::Option::Some(v.into());
11706 self
11707 }
11708
11709 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11711 where
11712 T: std::convert::Into<crate::model::Instance>,
11713 {
11714 self.0.request.body = v.map(|x| x.into());
11715 self
11716 }
11717 }
11718
11719 #[doc(hidden)]
11720 impl gax::options::internal::RequestBuilder for Update {
11721 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11722 &mut self.0.options
11723 }
11724 }
11725
11726 #[derive(Clone, Debug)]
11744 pub struct UpdateAccessConfig(
11745 RequestBuilder<crate::model::instances::UpdateAccessConfigRequest>,
11746 );
11747
11748 impl UpdateAccessConfig {
11749 pub(crate) fn new(
11750 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11751 ) -> Self {
11752 Self(RequestBuilder::new(stub))
11753 }
11754
11755 pub fn with_request<V: Into<crate::model::instances::UpdateAccessConfigRequest>>(
11757 mut self,
11758 v: V,
11759 ) -> Self {
11760 self.0.request = v.into();
11761 self
11762 }
11763
11764 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11766 self.0.options = v.into();
11767 self
11768 }
11769
11770 pub async fn send(self) -> Result<crate::model::Operation> {
11772 (*self.0.stub)
11773 .update_access_config(self.0.request, self.0.options)
11774 .await
11775 .map(gax::response::Response::into_body)
11776 }
11777
11778 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11780 self.0.request.instance = v.into();
11781 self
11782 }
11783
11784 pub fn set_network_interface<T: Into<std::string::String>>(mut self, v: T) -> Self {
11786 self.0.request.network_interface = v.into();
11787 self
11788 }
11789
11790 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11792 self.0.request.project = v.into();
11793 self
11794 }
11795
11796 pub fn set_request_id<T>(mut self, v: T) -> Self
11798 where
11799 T: std::convert::Into<std::string::String>,
11800 {
11801 self.0.request.request_id = std::option::Option::Some(v.into());
11802 self
11803 }
11804
11805 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11807 where
11808 T: std::convert::Into<std::string::String>,
11809 {
11810 self.0.request.request_id = v.map(|x| x.into());
11811 self
11812 }
11813
11814 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11816 self.0.request.zone = v.into();
11817 self
11818 }
11819
11820 pub fn set_body<T>(mut self, v: T) -> Self
11822 where
11823 T: std::convert::Into<crate::model::AccessConfig>,
11824 {
11825 self.0.request.body = std::option::Option::Some(v.into());
11826 self
11827 }
11828
11829 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11831 where
11832 T: std::convert::Into<crate::model::AccessConfig>,
11833 {
11834 self.0.request.body = v.map(|x| x.into());
11835 self
11836 }
11837 }
11838
11839 #[doc(hidden)]
11840 impl gax::options::internal::RequestBuilder for UpdateAccessConfig {
11841 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11842 &mut self.0.options
11843 }
11844 }
11845
11846 #[derive(Clone, Debug)]
11864 pub struct UpdateDisplayDevice(
11865 RequestBuilder<crate::model::instances::UpdateDisplayDeviceRequest>,
11866 );
11867
11868 impl UpdateDisplayDevice {
11869 pub(crate) fn new(
11870 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11871 ) -> Self {
11872 Self(RequestBuilder::new(stub))
11873 }
11874
11875 pub fn with_request<V: Into<crate::model::instances::UpdateDisplayDeviceRequest>>(
11877 mut self,
11878 v: V,
11879 ) -> Self {
11880 self.0.request = v.into();
11881 self
11882 }
11883
11884 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11886 self.0.options = v.into();
11887 self
11888 }
11889
11890 pub async fn send(self) -> Result<crate::model::Operation> {
11892 (*self.0.stub)
11893 .update_display_device(self.0.request, self.0.options)
11894 .await
11895 .map(gax::response::Response::into_body)
11896 }
11897
11898 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
11900 self.0.request.instance = v.into();
11901 self
11902 }
11903
11904 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
11906 self.0.request.project = v.into();
11907 self
11908 }
11909
11910 pub fn set_request_id<T>(mut self, v: T) -> Self
11912 where
11913 T: std::convert::Into<std::string::String>,
11914 {
11915 self.0.request.request_id = std::option::Option::Some(v.into());
11916 self
11917 }
11918
11919 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
11921 where
11922 T: std::convert::Into<std::string::String>,
11923 {
11924 self.0.request.request_id = v.map(|x| x.into());
11925 self
11926 }
11927
11928 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
11930 self.0.request.zone = v.into();
11931 self
11932 }
11933
11934 pub fn set_body<T>(mut self, v: T) -> Self
11936 where
11937 T: std::convert::Into<crate::model::DisplayDevice>,
11938 {
11939 self.0.request.body = std::option::Option::Some(v.into());
11940 self
11941 }
11942
11943 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11945 where
11946 T: std::convert::Into<crate::model::DisplayDevice>,
11947 {
11948 self.0.request.body = v.map(|x| x.into());
11949 self
11950 }
11951 }
11952
11953 #[doc(hidden)]
11954 impl gax::options::internal::RequestBuilder for UpdateDisplayDevice {
11955 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11956 &mut self.0.options
11957 }
11958 }
11959
11960 #[derive(Clone, Debug)]
11978 pub struct UpdateNetworkInterface(
11979 RequestBuilder<crate::model::instances::UpdateNetworkInterfaceRequest>,
11980 );
11981
11982 impl UpdateNetworkInterface {
11983 pub(crate) fn new(
11984 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
11985 ) -> Self {
11986 Self(RequestBuilder::new(stub))
11987 }
11988
11989 pub fn with_request<V: Into<crate::model::instances::UpdateNetworkInterfaceRequest>>(
11991 mut self,
11992 v: V,
11993 ) -> Self {
11994 self.0.request = v.into();
11995 self
11996 }
11997
11998 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12000 self.0.options = v.into();
12001 self
12002 }
12003
12004 pub async fn send(self) -> Result<crate::model::Operation> {
12006 (*self.0.stub)
12007 .update_network_interface(self.0.request, self.0.options)
12008 .await
12009 .map(gax::response::Response::into_body)
12010 }
12011
12012 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
12014 self.0.request.instance = v.into();
12015 self
12016 }
12017
12018 pub fn set_network_interface<T: Into<std::string::String>>(mut self, v: T) -> Self {
12020 self.0.request.network_interface = v.into();
12021 self
12022 }
12023
12024 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12026 self.0.request.project = v.into();
12027 self
12028 }
12029
12030 pub fn set_request_id<T>(mut self, v: T) -> Self
12032 where
12033 T: std::convert::Into<std::string::String>,
12034 {
12035 self.0.request.request_id = std::option::Option::Some(v.into());
12036 self
12037 }
12038
12039 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
12041 where
12042 T: std::convert::Into<std::string::String>,
12043 {
12044 self.0.request.request_id = v.map(|x| x.into());
12045 self
12046 }
12047
12048 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
12050 self.0.request.zone = v.into();
12051 self
12052 }
12053
12054 pub fn set_body<T>(mut self, v: T) -> Self
12056 where
12057 T: std::convert::Into<crate::model::NetworkInterface>,
12058 {
12059 self.0.request.body = std::option::Option::Some(v.into());
12060 self
12061 }
12062
12063 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
12065 where
12066 T: std::convert::Into<crate::model::NetworkInterface>,
12067 {
12068 self.0.request.body = v.map(|x| x.into());
12069 self
12070 }
12071 }
12072
12073 #[doc(hidden)]
12074 impl gax::options::internal::RequestBuilder for UpdateNetworkInterface {
12075 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12076 &mut self.0.options
12077 }
12078 }
12079
12080 #[derive(Clone, Debug)]
12098 pub struct UpdateShieldedInstanceConfig(
12099 RequestBuilder<crate::model::instances::UpdateShieldedInstanceConfigRequest>,
12100 );
12101
12102 impl UpdateShieldedInstanceConfig {
12103 pub(crate) fn new(
12104 stub: std::sync::Arc<dyn super::super::stub::dynamic::Instances>,
12105 ) -> Self {
12106 Self(RequestBuilder::new(stub))
12107 }
12108
12109 pub fn with_request<
12111 V: Into<crate::model::instances::UpdateShieldedInstanceConfigRequest>,
12112 >(
12113 mut self,
12114 v: V,
12115 ) -> Self {
12116 self.0.request = v.into();
12117 self
12118 }
12119
12120 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12122 self.0.options = v.into();
12123 self
12124 }
12125
12126 pub async fn send(self) -> Result<crate::model::Operation> {
12128 (*self.0.stub)
12129 .update_shielded_instance_config(self.0.request, self.0.options)
12130 .await
12131 .map(gax::response::Response::into_body)
12132 }
12133
12134 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
12136 self.0.request.instance = v.into();
12137 self
12138 }
12139
12140 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12142 self.0.request.project = v.into();
12143 self
12144 }
12145
12146 pub fn set_request_id<T>(mut self, v: T) -> Self
12148 where
12149 T: std::convert::Into<std::string::String>,
12150 {
12151 self.0.request.request_id = std::option::Option::Some(v.into());
12152 self
12153 }
12154
12155 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
12157 where
12158 T: std::convert::Into<std::string::String>,
12159 {
12160 self.0.request.request_id = v.map(|x| x.into());
12161 self
12162 }
12163
12164 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
12166 self.0.request.zone = v.into();
12167 self
12168 }
12169
12170 pub fn set_body<T>(mut self, v: T) -> Self
12172 where
12173 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
12174 {
12175 self.0.request.body = std::option::Option::Some(v.into());
12176 self
12177 }
12178
12179 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
12181 where
12182 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
12183 {
12184 self.0.request.body = v.map(|x| x.into());
12185 self
12186 }
12187 }
12188
12189 #[doc(hidden)]
12190 impl gax::options::internal::RequestBuilder for UpdateShieldedInstanceConfig {
12191 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12192 &mut self.0.options
12193 }
12194 }
12195}
12196
12197#[cfg(feature = "machine-types")]
12198#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
12199pub mod machine_types {
12200 use crate::Result;
12201
12202 pub type ClientBuilder =
12216 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12217
12218 pub(crate) mod client {
12219 use super::super::super::client::MachineTypes;
12220 pub struct Factory;
12221 impl gax::client_builder::internal::ClientFactory for Factory {
12222 type Client = MachineTypes;
12223 type Credentials = gaxi::options::Credentials;
12224 async fn build(
12225 self,
12226 config: gaxi::options::ClientConfig,
12227 ) -> gax::client_builder::Result<Self::Client> {
12228 Self::Client::new(config).await
12229 }
12230 }
12231 }
12232
12233 #[derive(Clone, Debug)]
12235 pub(crate) struct RequestBuilder<R: std::default::Default> {
12236 stub: std::sync::Arc<dyn super::super::stub::dynamic::MachineTypes>,
12237 request: R,
12238 options: gax::options::RequestOptions,
12239 }
12240
12241 impl<R> RequestBuilder<R>
12242 where
12243 R: std::default::Default,
12244 {
12245 pub(crate) fn new(
12246 stub: std::sync::Arc<dyn super::super::stub::dynamic::MachineTypes>,
12247 ) -> Self {
12248 Self {
12249 stub,
12250 request: R::default(),
12251 options: gax::options::RequestOptions::default(),
12252 }
12253 }
12254 }
12255
12256 #[derive(Clone, Debug)]
12278 pub struct AggregatedList(RequestBuilder<crate::model::machine_types::AggregatedListRequest>);
12279
12280 impl AggregatedList {
12281 pub(crate) fn new(
12282 stub: std::sync::Arc<dyn super::super::stub::dynamic::MachineTypes>,
12283 ) -> Self {
12284 Self(RequestBuilder::new(stub))
12285 }
12286
12287 pub fn with_request<V: Into<crate::model::machine_types::AggregatedListRequest>>(
12289 mut self,
12290 v: V,
12291 ) -> Self {
12292 self.0.request = v.into();
12293 self
12294 }
12295
12296 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12298 self.0.options = v.into();
12299 self
12300 }
12301
12302 pub async fn send(self) -> Result<crate::model::MachineTypeAggregatedList> {
12304 (*self.0.stub)
12305 .aggregated_list(self.0.request, self.0.options)
12306 .await
12307 .map(gax::response::Response::into_body)
12308 }
12309
12310 pub fn by_page(
12312 self,
12313 ) -> impl gax::paginator::Paginator<crate::model::MachineTypeAggregatedList, gax::error::Error>
12314 {
12315 use std::clone::Clone;
12316 let token = self.0.request.page_token.clone().unwrap_or_default();
12317 let execute = move |token: String| {
12318 let mut builder = self.clone();
12319 builder.0.request = builder.0.request.set_page_token(token);
12320 builder.send()
12321 };
12322 gax::paginator::internal::new_paginator(token, execute)
12323 }
12324
12325 pub fn by_item(
12327 self,
12328 ) -> impl gax::paginator::ItemPaginator<crate::model::MachineTypeAggregatedList, gax::error::Error>
12329 {
12330 use gax::paginator::Paginator;
12331 self.by_page().items()
12332 }
12333
12334 pub fn set_filter<T>(mut self, v: T) -> Self
12336 where
12337 T: std::convert::Into<std::string::String>,
12338 {
12339 self.0.request.filter = std::option::Option::Some(v.into());
12340 self
12341 }
12342
12343 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
12345 where
12346 T: std::convert::Into<std::string::String>,
12347 {
12348 self.0.request.filter = v.map(|x| x.into());
12349 self
12350 }
12351
12352 pub fn set_include_all_scopes<T>(mut self, v: T) -> Self
12354 where
12355 T: std::convert::Into<bool>,
12356 {
12357 self.0.request.include_all_scopes = std::option::Option::Some(v.into());
12358 self
12359 }
12360
12361 pub fn set_or_clear_include_all_scopes<T>(mut self, v: std::option::Option<T>) -> Self
12363 where
12364 T: std::convert::Into<bool>,
12365 {
12366 self.0.request.include_all_scopes = v.map(|x| x.into());
12367 self
12368 }
12369
12370 pub fn set_max_results<T>(mut self, v: T) -> Self
12372 where
12373 T: std::convert::Into<u32>,
12374 {
12375 self.0.request.max_results = std::option::Option::Some(v.into());
12376 self
12377 }
12378
12379 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
12381 where
12382 T: std::convert::Into<u32>,
12383 {
12384 self.0.request.max_results = v.map(|x| x.into());
12385 self
12386 }
12387
12388 pub fn set_order_by<T>(mut self, v: T) -> Self
12390 where
12391 T: std::convert::Into<std::string::String>,
12392 {
12393 self.0.request.order_by = std::option::Option::Some(v.into());
12394 self
12395 }
12396
12397 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
12399 where
12400 T: std::convert::Into<std::string::String>,
12401 {
12402 self.0.request.order_by = v.map(|x| x.into());
12403 self
12404 }
12405
12406 pub fn set_page_token<T>(mut self, v: T) -> Self
12408 where
12409 T: std::convert::Into<std::string::String>,
12410 {
12411 self.0.request.page_token = std::option::Option::Some(v.into());
12412 self
12413 }
12414
12415 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
12417 where
12418 T: std::convert::Into<std::string::String>,
12419 {
12420 self.0.request.page_token = v.map(|x| x.into());
12421 self
12422 }
12423
12424 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12426 self.0.request.project = v.into();
12427 self
12428 }
12429
12430 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
12432 where
12433 T: std::convert::Into<bool>,
12434 {
12435 self.0.request.return_partial_success = std::option::Option::Some(v.into());
12436 self
12437 }
12438
12439 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
12441 where
12442 T: std::convert::Into<bool>,
12443 {
12444 self.0.request.return_partial_success = v.map(|x| x.into());
12445 self
12446 }
12447
12448 pub fn set_service_project_number<T>(mut self, v: T) -> Self
12450 where
12451 T: std::convert::Into<i64>,
12452 {
12453 self.0.request.service_project_number = std::option::Option::Some(v.into());
12454 self
12455 }
12456
12457 pub fn set_or_clear_service_project_number<T>(mut self, v: std::option::Option<T>) -> Self
12459 where
12460 T: std::convert::Into<i64>,
12461 {
12462 self.0.request.service_project_number = v.map(|x| x.into());
12463 self
12464 }
12465 }
12466
12467 #[doc(hidden)]
12468 impl gax::options::internal::RequestBuilder for AggregatedList {
12469 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12470 &mut self.0.options
12471 }
12472 }
12473
12474 #[derive(Clone, Debug)]
12492 pub struct Get(RequestBuilder<crate::model::machine_types::GetRequest>);
12493
12494 impl Get {
12495 pub(crate) fn new(
12496 stub: std::sync::Arc<dyn super::super::stub::dynamic::MachineTypes>,
12497 ) -> Self {
12498 Self(RequestBuilder::new(stub))
12499 }
12500
12501 pub fn with_request<V: Into<crate::model::machine_types::GetRequest>>(
12503 mut self,
12504 v: V,
12505 ) -> Self {
12506 self.0.request = v.into();
12507 self
12508 }
12509
12510 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12512 self.0.options = v.into();
12513 self
12514 }
12515
12516 pub async fn send(self) -> Result<crate::model::MachineType> {
12518 (*self.0.stub)
12519 .get(self.0.request, self.0.options)
12520 .await
12521 .map(gax::response::Response::into_body)
12522 }
12523
12524 pub fn set_machine_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
12526 self.0.request.machine_type = v.into();
12527 self
12528 }
12529
12530 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12532 self.0.request.project = v.into();
12533 self
12534 }
12535
12536 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
12538 self.0.request.zone = v.into();
12539 self
12540 }
12541 }
12542
12543 #[doc(hidden)]
12544 impl gax::options::internal::RequestBuilder for Get {
12545 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12546 &mut self.0.options
12547 }
12548 }
12549
12550 #[derive(Clone, Debug)]
12572 pub struct List(RequestBuilder<crate::model::machine_types::ListRequest>);
12573
12574 impl List {
12575 pub(crate) fn new(
12576 stub: std::sync::Arc<dyn super::super::stub::dynamic::MachineTypes>,
12577 ) -> Self {
12578 Self(RequestBuilder::new(stub))
12579 }
12580
12581 pub fn with_request<V: Into<crate::model::machine_types::ListRequest>>(
12583 mut self,
12584 v: V,
12585 ) -> Self {
12586 self.0.request = v.into();
12587 self
12588 }
12589
12590 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12592 self.0.options = v.into();
12593 self
12594 }
12595
12596 pub async fn send(self) -> Result<crate::model::MachineTypeList> {
12598 (*self.0.stub)
12599 .list(self.0.request, self.0.options)
12600 .await
12601 .map(gax::response::Response::into_body)
12602 }
12603
12604 pub fn by_page(
12606 self,
12607 ) -> impl gax::paginator::Paginator<crate::model::MachineTypeList, gax::error::Error>
12608 {
12609 use std::clone::Clone;
12610 let token = self.0.request.page_token.clone().unwrap_or_default();
12611 let execute = move |token: String| {
12612 let mut builder = self.clone();
12613 builder.0.request = builder.0.request.set_page_token(token);
12614 builder.send()
12615 };
12616 gax::paginator::internal::new_paginator(token, execute)
12617 }
12618
12619 pub fn by_item(
12621 self,
12622 ) -> impl gax::paginator::ItemPaginator<crate::model::MachineTypeList, gax::error::Error>
12623 {
12624 use gax::paginator::Paginator;
12625 self.by_page().items()
12626 }
12627
12628 pub fn set_filter<T>(mut self, v: T) -> Self
12630 where
12631 T: std::convert::Into<std::string::String>,
12632 {
12633 self.0.request.filter = std::option::Option::Some(v.into());
12634 self
12635 }
12636
12637 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
12639 where
12640 T: std::convert::Into<std::string::String>,
12641 {
12642 self.0.request.filter = v.map(|x| x.into());
12643 self
12644 }
12645
12646 pub fn set_max_results<T>(mut self, v: T) -> Self
12648 where
12649 T: std::convert::Into<u32>,
12650 {
12651 self.0.request.max_results = std::option::Option::Some(v.into());
12652 self
12653 }
12654
12655 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
12657 where
12658 T: std::convert::Into<u32>,
12659 {
12660 self.0.request.max_results = v.map(|x| x.into());
12661 self
12662 }
12663
12664 pub fn set_order_by<T>(mut self, v: T) -> Self
12666 where
12667 T: std::convert::Into<std::string::String>,
12668 {
12669 self.0.request.order_by = std::option::Option::Some(v.into());
12670 self
12671 }
12672
12673 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
12675 where
12676 T: std::convert::Into<std::string::String>,
12677 {
12678 self.0.request.order_by = v.map(|x| x.into());
12679 self
12680 }
12681
12682 pub fn set_page_token<T>(mut self, v: T) -> Self
12684 where
12685 T: std::convert::Into<std::string::String>,
12686 {
12687 self.0.request.page_token = std::option::Option::Some(v.into());
12688 self
12689 }
12690
12691 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
12693 where
12694 T: std::convert::Into<std::string::String>,
12695 {
12696 self.0.request.page_token = v.map(|x| x.into());
12697 self
12698 }
12699
12700 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12702 self.0.request.project = v.into();
12703 self
12704 }
12705
12706 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
12708 where
12709 T: std::convert::Into<bool>,
12710 {
12711 self.0.request.return_partial_success = std::option::Option::Some(v.into());
12712 self
12713 }
12714
12715 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
12717 where
12718 T: std::convert::Into<bool>,
12719 {
12720 self.0.request.return_partial_success = v.map(|x| x.into());
12721 self
12722 }
12723
12724 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
12726 self.0.request.zone = v.into();
12727 self
12728 }
12729 }
12730
12731 #[doc(hidden)]
12732 impl gax::options::internal::RequestBuilder for List {
12733 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12734 &mut self.0.options
12735 }
12736 }
12737}
12738
12739#[cfg(feature = "region-instance-group-managers")]
12740#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
12741pub mod region_instance_group_managers {
12742 use crate::Result;
12743
12744 pub type ClientBuilder =
12758 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12759
12760 pub(crate) mod client {
12761 use super::super::super::client::RegionInstanceGroupManagers;
12762 pub struct Factory;
12763 impl gax::client_builder::internal::ClientFactory for Factory {
12764 type Client = RegionInstanceGroupManagers;
12765 type Credentials = gaxi::options::Credentials;
12766 async fn build(
12767 self,
12768 config: gaxi::options::ClientConfig,
12769 ) -> gax::client_builder::Result<Self::Client> {
12770 Self::Client::new(config).await
12771 }
12772 }
12773 }
12774
12775 #[derive(Clone, Debug)]
12777 pub(crate) struct RequestBuilder<R: std::default::Default> {
12778 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
12779 request: R,
12780 options: gax::options::RequestOptions,
12781 }
12782
12783 impl<R> RequestBuilder<R>
12784 where
12785 R: std::default::Default,
12786 {
12787 pub(crate) fn new(
12788 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
12789 ) -> Self {
12790 Self {
12791 stub,
12792 request: R::default(),
12793 options: gax::options::RequestOptions::default(),
12794 }
12795 }
12796 }
12797
12798 #[derive(Clone, Debug)]
12816 pub struct AbandonInstances(
12817 RequestBuilder<crate::model::region_instance_group_managers::AbandonInstancesRequest>,
12818 );
12819
12820 impl AbandonInstances {
12821 pub(crate) fn new(
12822 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
12823 ) -> Self {
12824 Self(RequestBuilder::new(stub))
12825 }
12826
12827 pub fn with_request<
12829 V: Into<crate::model::region_instance_group_managers::AbandonInstancesRequest>,
12830 >(
12831 mut self,
12832 v: V,
12833 ) -> Self {
12834 self.0.request = v.into();
12835 self
12836 }
12837
12838 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12840 self.0.options = v.into();
12841 self
12842 }
12843
12844 pub async fn send(self) -> Result<crate::model::Operation> {
12846 (*self.0.stub)
12847 .abandon_instances(self.0.request, self.0.options)
12848 .await
12849 .map(gax::response::Response::into_body)
12850 }
12851
12852 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
12854 self.0.request.instance_group_manager = v.into();
12855 self
12856 }
12857
12858 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12860 self.0.request.project = v.into();
12861 self
12862 }
12863
12864 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
12866 self.0.request.region = v.into();
12867 self
12868 }
12869
12870 pub fn set_request_id<T>(mut self, v: T) -> Self
12872 where
12873 T: std::convert::Into<std::string::String>,
12874 {
12875 self.0.request.request_id = std::option::Option::Some(v.into());
12876 self
12877 }
12878
12879 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
12881 where
12882 T: std::convert::Into<std::string::String>,
12883 {
12884 self.0.request.request_id = v.map(|x| x.into());
12885 self
12886 }
12887
12888 pub fn set_body<T>(mut self, v: T) -> Self
12890 where
12891 T: std::convert::Into<crate::model::RegionInstanceGroupManagersAbandonInstancesRequest>,
12892 {
12893 self.0.request.body = std::option::Option::Some(v.into());
12894 self
12895 }
12896
12897 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
12899 where
12900 T: std::convert::Into<crate::model::RegionInstanceGroupManagersAbandonInstancesRequest>,
12901 {
12902 self.0.request.body = v.map(|x| x.into());
12903 self
12904 }
12905 }
12906
12907 #[doc(hidden)]
12908 impl gax::options::internal::RequestBuilder for AbandonInstances {
12909 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12910 &mut self.0.options
12911 }
12912 }
12913
12914 #[derive(Clone, Debug)]
12932 pub struct ApplyUpdatesToInstances(
12933 RequestBuilder<
12934 crate::model::region_instance_group_managers::ApplyUpdatesToInstancesRequest,
12935 >,
12936 );
12937
12938 impl ApplyUpdatesToInstances {
12939 pub(crate) fn new(
12940 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
12941 ) -> Self {
12942 Self(RequestBuilder::new(stub))
12943 }
12944
12945 pub fn with_request<
12947 V: Into<crate::model::region_instance_group_managers::ApplyUpdatesToInstancesRequest>,
12948 >(
12949 mut self,
12950 v: V,
12951 ) -> Self {
12952 self.0.request = v.into();
12953 self
12954 }
12955
12956 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12958 self.0.options = v.into();
12959 self
12960 }
12961
12962 pub async fn send(self) -> Result<crate::model::Operation> {
12964 (*self.0.stub)
12965 .apply_updates_to_instances(self.0.request, self.0.options)
12966 .await
12967 .map(gax::response::Response::into_body)
12968 }
12969
12970 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
12972 self.0.request.instance_group_manager = v.into();
12973 self
12974 }
12975
12976 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
12978 self.0.request.project = v.into();
12979 self
12980 }
12981
12982 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
12984 self.0.request.region = v.into();
12985 self
12986 }
12987
12988 pub fn set_body<T>(mut self, v: T) -> Self
12990 where
12991 T: std::convert::Into<crate::model::RegionInstanceGroupManagersApplyUpdatesRequest>,
12992 {
12993 self.0.request.body = std::option::Option::Some(v.into());
12994 self
12995 }
12996
12997 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
12999 where
13000 T: std::convert::Into<crate::model::RegionInstanceGroupManagersApplyUpdatesRequest>,
13001 {
13002 self.0.request.body = v.map(|x| x.into());
13003 self
13004 }
13005 }
13006
13007 #[doc(hidden)]
13008 impl gax::options::internal::RequestBuilder for ApplyUpdatesToInstances {
13009 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13010 &mut self.0.options
13011 }
13012 }
13013
13014 #[derive(Clone, Debug)]
13032 pub struct CreateInstances(
13033 RequestBuilder<crate::model::region_instance_group_managers::CreateInstancesRequest>,
13034 );
13035
13036 impl CreateInstances {
13037 pub(crate) fn new(
13038 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13039 ) -> Self {
13040 Self(RequestBuilder::new(stub))
13041 }
13042
13043 pub fn with_request<
13045 V: Into<crate::model::region_instance_group_managers::CreateInstancesRequest>,
13046 >(
13047 mut self,
13048 v: V,
13049 ) -> Self {
13050 self.0.request = v.into();
13051 self
13052 }
13053
13054 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13056 self.0.options = v.into();
13057 self
13058 }
13059
13060 pub async fn send(self) -> Result<crate::model::Operation> {
13062 (*self.0.stub)
13063 .create_instances(self.0.request, self.0.options)
13064 .await
13065 .map(gax::response::Response::into_body)
13066 }
13067
13068 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13070 self.0.request.instance_group_manager = v.into();
13071 self
13072 }
13073
13074 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13076 self.0.request.project = v.into();
13077 self
13078 }
13079
13080 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13082 self.0.request.region = v.into();
13083 self
13084 }
13085
13086 pub fn set_request_id<T>(mut self, v: T) -> Self
13088 where
13089 T: std::convert::Into<std::string::String>,
13090 {
13091 self.0.request.request_id = std::option::Option::Some(v.into());
13092 self
13093 }
13094
13095 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
13097 where
13098 T: std::convert::Into<std::string::String>,
13099 {
13100 self.0.request.request_id = v.map(|x| x.into());
13101 self
13102 }
13103
13104 pub fn set_body<T>(mut self, v: T) -> Self
13106 where
13107 T: std::convert::Into<crate::model::RegionInstanceGroupManagersCreateInstancesRequest>,
13108 {
13109 self.0.request.body = std::option::Option::Some(v.into());
13110 self
13111 }
13112
13113 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13115 where
13116 T: std::convert::Into<crate::model::RegionInstanceGroupManagersCreateInstancesRequest>,
13117 {
13118 self.0.request.body = v.map(|x| x.into());
13119 self
13120 }
13121 }
13122
13123 #[doc(hidden)]
13124 impl gax::options::internal::RequestBuilder for CreateInstances {
13125 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13126 &mut self.0.options
13127 }
13128 }
13129
13130 #[derive(Clone, Debug)]
13148 pub struct Delete(RequestBuilder<crate::model::region_instance_group_managers::DeleteRequest>);
13149
13150 impl Delete {
13151 pub(crate) fn new(
13152 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13153 ) -> Self {
13154 Self(RequestBuilder::new(stub))
13155 }
13156
13157 pub fn with_request<
13159 V: Into<crate::model::region_instance_group_managers::DeleteRequest>,
13160 >(
13161 mut self,
13162 v: V,
13163 ) -> Self {
13164 self.0.request = v.into();
13165 self
13166 }
13167
13168 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13170 self.0.options = v.into();
13171 self
13172 }
13173
13174 pub async fn send(self) -> Result<crate::model::Operation> {
13176 (*self.0.stub)
13177 .delete(self.0.request, self.0.options)
13178 .await
13179 .map(gax::response::Response::into_body)
13180 }
13181
13182 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13184 self.0.request.instance_group_manager = v.into();
13185 self
13186 }
13187
13188 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13190 self.0.request.project = v.into();
13191 self
13192 }
13193
13194 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13196 self.0.request.region = v.into();
13197 self
13198 }
13199
13200 pub fn set_request_id<T>(mut self, v: T) -> Self
13202 where
13203 T: std::convert::Into<std::string::String>,
13204 {
13205 self.0.request.request_id = std::option::Option::Some(v.into());
13206 self
13207 }
13208
13209 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
13211 where
13212 T: std::convert::Into<std::string::String>,
13213 {
13214 self.0.request.request_id = v.map(|x| x.into());
13215 self
13216 }
13217 }
13218
13219 #[doc(hidden)]
13220 impl gax::options::internal::RequestBuilder for Delete {
13221 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13222 &mut self.0.options
13223 }
13224 }
13225
13226 #[derive(Clone, Debug)]
13244 pub struct DeleteInstances(
13245 RequestBuilder<crate::model::region_instance_group_managers::DeleteInstancesRequest>,
13246 );
13247
13248 impl DeleteInstances {
13249 pub(crate) fn new(
13250 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13251 ) -> Self {
13252 Self(RequestBuilder::new(stub))
13253 }
13254
13255 pub fn with_request<
13257 V: Into<crate::model::region_instance_group_managers::DeleteInstancesRequest>,
13258 >(
13259 mut self,
13260 v: V,
13261 ) -> Self {
13262 self.0.request = v.into();
13263 self
13264 }
13265
13266 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13268 self.0.options = v.into();
13269 self
13270 }
13271
13272 pub async fn send(self) -> Result<crate::model::Operation> {
13274 (*self.0.stub)
13275 .delete_instances(self.0.request, self.0.options)
13276 .await
13277 .map(gax::response::Response::into_body)
13278 }
13279
13280 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13282 self.0.request.instance_group_manager = v.into();
13283 self
13284 }
13285
13286 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13288 self.0.request.project = v.into();
13289 self
13290 }
13291
13292 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13294 self.0.request.region = v.into();
13295 self
13296 }
13297
13298 pub fn set_request_id<T>(mut self, v: T) -> Self
13300 where
13301 T: std::convert::Into<std::string::String>,
13302 {
13303 self.0.request.request_id = std::option::Option::Some(v.into());
13304 self
13305 }
13306
13307 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
13309 where
13310 T: std::convert::Into<std::string::String>,
13311 {
13312 self.0.request.request_id = v.map(|x| x.into());
13313 self
13314 }
13315
13316 pub fn set_body<T>(mut self, v: T) -> Self
13318 where
13319 T: std::convert::Into<crate::model::RegionInstanceGroupManagersDeleteInstancesRequest>,
13320 {
13321 self.0.request.body = std::option::Option::Some(v.into());
13322 self
13323 }
13324
13325 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13327 where
13328 T: std::convert::Into<crate::model::RegionInstanceGroupManagersDeleteInstancesRequest>,
13329 {
13330 self.0.request.body = v.map(|x| x.into());
13331 self
13332 }
13333 }
13334
13335 #[doc(hidden)]
13336 impl gax::options::internal::RequestBuilder for DeleteInstances {
13337 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13338 &mut self.0.options
13339 }
13340 }
13341
13342 #[derive(Clone, Debug)]
13360 pub struct DeletePerInstanceConfigs(
13361 RequestBuilder<
13362 crate::model::region_instance_group_managers::DeletePerInstanceConfigsRequest,
13363 >,
13364 );
13365
13366 impl DeletePerInstanceConfigs {
13367 pub(crate) fn new(
13368 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13369 ) -> Self {
13370 Self(RequestBuilder::new(stub))
13371 }
13372
13373 pub fn with_request<
13375 V: Into<crate::model::region_instance_group_managers::DeletePerInstanceConfigsRequest>,
13376 >(
13377 mut self,
13378 v: V,
13379 ) -> Self {
13380 self.0.request = v.into();
13381 self
13382 }
13383
13384 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13386 self.0.options = v.into();
13387 self
13388 }
13389
13390 pub async fn send(self) -> Result<crate::model::Operation> {
13392 (*self.0.stub)
13393 .delete_per_instance_configs(self.0.request, self.0.options)
13394 .await
13395 .map(gax::response::Response::into_body)
13396 }
13397
13398 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13400 self.0.request.instance_group_manager = v.into();
13401 self
13402 }
13403
13404 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13406 self.0.request.project = v.into();
13407 self
13408 }
13409
13410 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13412 self.0.request.region = v.into();
13413 self
13414 }
13415
13416 pub fn set_body<T>(mut self, v: T) -> Self
13418 where
13419 T: std::convert::Into<crate::model::RegionInstanceGroupManagerDeleteInstanceConfigReq>,
13420 {
13421 self.0.request.body = std::option::Option::Some(v.into());
13422 self
13423 }
13424
13425 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13427 where
13428 T: std::convert::Into<crate::model::RegionInstanceGroupManagerDeleteInstanceConfigReq>,
13429 {
13430 self.0.request.body = v.map(|x| x.into());
13431 self
13432 }
13433 }
13434
13435 #[doc(hidden)]
13436 impl gax::options::internal::RequestBuilder for DeletePerInstanceConfigs {
13437 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13438 &mut self.0.options
13439 }
13440 }
13441
13442 #[derive(Clone, Debug)]
13460 pub struct Get(RequestBuilder<crate::model::region_instance_group_managers::GetRequest>);
13461
13462 impl Get {
13463 pub(crate) fn new(
13464 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13465 ) -> Self {
13466 Self(RequestBuilder::new(stub))
13467 }
13468
13469 pub fn with_request<V: Into<crate::model::region_instance_group_managers::GetRequest>>(
13471 mut self,
13472 v: V,
13473 ) -> Self {
13474 self.0.request = v.into();
13475 self
13476 }
13477
13478 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13480 self.0.options = v.into();
13481 self
13482 }
13483
13484 pub async fn send(self) -> Result<crate::model::InstanceGroupManager> {
13486 (*self.0.stub)
13487 .get(self.0.request, self.0.options)
13488 .await
13489 .map(gax::response::Response::into_body)
13490 }
13491
13492 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13494 self.0.request.instance_group_manager = v.into();
13495 self
13496 }
13497
13498 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13500 self.0.request.project = v.into();
13501 self
13502 }
13503
13504 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13506 self.0.request.region = v.into();
13507 self
13508 }
13509 }
13510
13511 #[doc(hidden)]
13512 impl gax::options::internal::RequestBuilder for Get {
13513 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13514 &mut self.0.options
13515 }
13516 }
13517
13518 #[derive(Clone, Debug)]
13536 pub struct Insert(RequestBuilder<crate::model::region_instance_group_managers::InsertRequest>);
13537
13538 impl Insert {
13539 pub(crate) fn new(
13540 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13541 ) -> Self {
13542 Self(RequestBuilder::new(stub))
13543 }
13544
13545 pub fn with_request<
13547 V: Into<crate::model::region_instance_group_managers::InsertRequest>,
13548 >(
13549 mut self,
13550 v: V,
13551 ) -> Self {
13552 self.0.request = v.into();
13553 self
13554 }
13555
13556 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13558 self.0.options = v.into();
13559 self
13560 }
13561
13562 pub async fn send(self) -> Result<crate::model::Operation> {
13564 (*self.0.stub)
13565 .insert(self.0.request, self.0.options)
13566 .await
13567 .map(gax::response::Response::into_body)
13568 }
13569
13570 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13572 self.0.request.project = v.into();
13573 self
13574 }
13575
13576 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13578 self.0.request.region = v.into();
13579 self
13580 }
13581
13582 pub fn set_request_id<T>(mut self, v: T) -> Self
13584 where
13585 T: std::convert::Into<std::string::String>,
13586 {
13587 self.0.request.request_id = std::option::Option::Some(v.into());
13588 self
13589 }
13590
13591 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
13593 where
13594 T: std::convert::Into<std::string::String>,
13595 {
13596 self.0.request.request_id = v.map(|x| x.into());
13597 self
13598 }
13599
13600 pub fn set_body<T>(mut self, v: T) -> Self
13602 where
13603 T: std::convert::Into<crate::model::InstanceGroupManager>,
13604 {
13605 self.0.request.body = std::option::Option::Some(v.into());
13606 self
13607 }
13608
13609 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
13611 where
13612 T: std::convert::Into<crate::model::InstanceGroupManager>,
13613 {
13614 self.0.request.body = v.map(|x| x.into());
13615 self
13616 }
13617 }
13618
13619 #[doc(hidden)]
13620 impl gax::options::internal::RequestBuilder for Insert {
13621 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13622 &mut self.0.options
13623 }
13624 }
13625
13626 #[derive(Clone, Debug)]
13648 pub struct List(RequestBuilder<crate::model::region_instance_group_managers::ListRequest>);
13649
13650 impl List {
13651 pub(crate) fn new(
13652 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13653 ) -> Self {
13654 Self(RequestBuilder::new(stub))
13655 }
13656
13657 pub fn with_request<V: Into<crate::model::region_instance_group_managers::ListRequest>>(
13659 mut self,
13660 v: V,
13661 ) -> Self {
13662 self.0.request = v.into();
13663 self
13664 }
13665
13666 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13668 self.0.options = v.into();
13669 self
13670 }
13671
13672 pub async fn send(self) -> Result<crate::model::RegionInstanceGroupManagerList> {
13674 (*self.0.stub)
13675 .list(self.0.request, self.0.options)
13676 .await
13677 .map(gax::response::Response::into_body)
13678 }
13679
13680 pub fn by_page(
13682 self,
13683 ) -> impl gax::paginator::Paginator<
13684 crate::model::RegionInstanceGroupManagerList,
13685 gax::error::Error,
13686 > {
13687 use std::clone::Clone;
13688 let token = self.0.request.page_token.clone().unwrap_or_default();
13689 let execute = move |token: String| {
13690 let mut builder = self.clone();
13691 builder.0.request = builder.0.request.set_page_token(token);
13692 builder.send()
13693 };
13694 gax::paginator::internal::new_paginator(token, execute)
13695 }
13696
13697 pub fn by_item(
13699 self,
13700 ) -> impl gax::paginator::ItemPaginator<
13701 crate::model::RegionInstanceGroupManagerList,
13702 gax::error::Error,
13703 > {
13704 use gax::paginator::Paginator;
13705 self.by_page().items()
13706 }
13707
13708 pub fn set_filter<T>(mut self, v: T) -> Self
13710 where
13711 T: std::convert::Into<std::string::String>,
13712 {
13713 self.0.request.filter = std::option::Option::Some(v.into());
13714 self
13715 }
13716
13717 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
13719 where
13720 T: std::convert::Into<std::string::String>,
13721 {
13722 self.0.request.filter = v.map(|x| x.into());
13723 self
13724 }
13725
13726 pub fn set_max_results<T>(mut self, v: T) -> Self
13728 where
13729 T: std::convert::Into<u32>,
13730 {
13731 self.0.request.max_results = std::option::Option::Some(v.into());
13732 self
13733 }
13734
13735 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
13737 where
13738 T: std::convert::Into<u32>,
13739 {
13740 self.0.request.max_results = v.map(|x| x.into());
13741 self
13742 }
13743
13744 pub fn set_order_by<T>(mut self, v: T) -> Self
13746 where
13747 T: std::convert::Into<std::string::String>,
13748 {
13749 self.0.request.order_by = std::option::Option::Some(v.into());
13750 self
13751 }
13752
13753 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
13755 where
13756 T: std::convert::Into<std::string::String>,
13757 {
13758 self.0.request.order_by = v.map(|x| x.into());
13759 self
13760 }
13761
13762 pub fn set_page_token<T>(mut self, v: T) -> Self
13764 where
13765 T: std::convert::Into<std::string::String>,
13766 {
13767 self.0.request.page_token = std::option::Option::Some(v.into());
13768 self
13769 }
13770
13771 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
13773 where
13774 T: std::convert::Into<std::string::String>,
13775 {
13776 self.0.request.page_token = v.map(|x| x.into());
13777 self
13778 }
13779
13780 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13782 self.0.request.project = v.into();
13783 self
13784 }
13785
13786 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13788 self.0.request.region = v.into();
13789 self
13790 }
13791
13792 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
13794 where
13795 T: std::convert::Into<bool>,
13796 {
13797 self.0.request.return_partial_success = std::option::Option::Some(v.into());
13798 self
13799 }
13800
13801 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
13803 where
13804 T: std::convert::Into<bool>,
13805 {
13806 self.0.request.return_partial_success = v.map(|x| x.into());
13807 self
13808 }
13809 }
13810
13811 #[doc(hidden)]
13812 impl gax::options::internal::RequestBuilder for List {
13813 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13814 &mut self.0.options
13815 }
13816 }
13817
13818 #[derive(Clone, Debug)]
13840 pub struct ListErrors(
13841 RequestBuilder<crate::model::region_instance_group_managers::ListErrorsRequest>,
13842 );
13843
13844 impl ListErrors {
13845 pub(crate) fn new(
13846 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
13847 ) -> Self {
13848 Self(RequestBuilder::new(stub))
13849 }
13850
13851 pub fn with_request<
13853 V: Into<crate::model::region_instance_group_managers::ListErrorsRequest>,
13854 >(
13855 mut self,
13856 v: V,
13857 ) -> Self {
13858 self.0.request = v.into();
13859 self
13860 }
13861
13862 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13864 self.0.options = v.into();
13865 self
13866 }
13867
13868 pub async fn send(
13870 self,
13871 ) -> Result<crate::model::RegionInstanceGroupManagersListErrorsResponse> {
13872 (*self.0.stub)
13873 .list_errors(self.0.request, self.0.options)
13874 .await
13875 .map(gax::response::Response::into_body)
13876 }
13877
13878 pub fn by_page(
13880 self,
13881 ) -> impl gax::paginator::Paginator<
13882 crate::model::RegionInstanceGroupManagersListErrorsResponse,
13883 gax::error::Error,
13884 > {
13885 use std::clone::Clone;
13886 let token = self.0.request.page_token.clone().unwrap_or_default();
13887 let execute = move |token: String| {
13888 let mut builder = self.clone();
13889 builder.0.request = builder.0.request.set_page_token(token);
13890 builder.send()
13891 };
13892 gax::paginator::internal::new_paginator(token, execute)
13893 }
13894
13895 pub fn by_item(
13897 self,
13898 ) -> impl gax::paginator::ItemPaginator<
13899 crate::model::RegionInstanceGroupManagersListErrorsResponse,
13900 gax::error::Error,
13901 > {
13902 use gax::paginator::Paginator;
13903 self.by_page().items()
13904 }
13905
13906 pub fn set_filter<T>(mut self, v: T) -> Self
13908 where
13909 T: std::convert::Into<std::string::String>,
13910 {
13911 self.0.request.filter = std::option::Option::Some(v.into());
13912 self
13913 }
13914
13915 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
13917 where
13918 T: std::convert::Into<std::string::String>,
13919 {
13920 self.0.request.filter = v.map(|x| x.into());
13921 self
13922 }
13923
13924 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
13926 self.0.request.instance_group_manager = v.into();
13927 self
13928 }
13929
13930 pub fn set_max_results<T>(mut self, v: T) -> Self
13932 where
13933 T: std::convert::Into<u32>,
13934 {
13935 self.0.request.max_results = std::option::Option::Some(v.into());
13936 self
13937 }
13938
13939 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
13941 where
13942 T: std::convert::Into<u32>,
13943 {
13944 self.0.request.max_results = v.map(|x| x.into());
13945 self
13946 }
13947
13948 pub fn set_order_by<T>(mut self, v: T) -> Self
13950 where
13951 T: std::convert::Into<std::string::String>,
13952 {
13953 self.0.request.order_by = std::option::Option::Some(v.into());
13954 self
13955 }
13956
13957 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
13959 where
13960 T: std::convert::Into<std::string::String>,
13961 {
13962 self.0.request.order_by = v.map(|x| x.into());
13963 self
13964 }
13965
13966 pub fn set_page_token<T>(mut self, v: T) -> Self
13968 where
13969 T: std::convert::Into<std::string::String>,
13970 {
13971 self.0.request.page_token = std::option::Option::Some(v.into());
13972 self
13973 }
13974
13975 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
13977 where
13978 T: std::convert::Into<std::string::String>,
13979 {
13980 self.0.request.page_token = v.map(|x| x.into());
13981 self
13982 }
13983
13984 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
13986 self.0.request.project = v.into();
13987 self
13988 }
13989
13990 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
13992 self.0.request.region = v.into();
13993 self
13994 }
13995
13996 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
13998 where
13999 T: std::convert::Into<bool>,
14000 {
14001 self.0.request.return_partial_success = std::option::Option::Some(v.into());
14002 self
14003 }
14004
14005 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
14007 where
14008 T: std::convert::Into<bool>,
14009 {
14010 self.0.request.return_partial_success = v.map(|x| x.into());
14011 self
14012 }
14013 }
14014
14015 #[doc(hidden)]
14016 impl gax::options::internal::RequestBuilder for ListErrors {
14017 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14018 &mut self.0.options
14019 }
14020 }
14021
14022 #[derive(Clone, Debug)]
14044 pub struct ListManagedInstances(
14045 RequestBuilder<crate::model::region_instance_group_managers::ListManagedInstancesRequest>,
14046 );
14047
14048 impl ListManagedInstances {
14049 pub(crate) fn new(
14050 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14051 ) -> Self {
14052 Self(RequestBuilder::new(stub))
14053 }
14054
14055 pub fn with_request<
14057 V: Into<crate::model::region_instance_group_managers::ListManagedInstancesRequest>,
14058 >(
14059 mut self,
14060 v: V,
14061 ) -> Self {
14062 self.0.request = v.into();
14063 self
14064 }
14065
14066 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14068 self.0.options = v.into();
14069 self
14070 }
14071
14072 pub async fn send(
14074 self,
14075 ) -> Result<crate::model::RegionInstanceGroupManagersListInstancesResponse> {
14076 (*self.0.stub)
14077 .list_managed_instances(self.0.request, self.0.options)
14078 .await
14079 .map(gax::response::Response::into_body)
14080 }
14081
14082 pub fn by_page(
14084 self,
14085 ) -> impl gax::paginator::Paginator<
14086 crate::model::RegionInstanceGroupManagersListInstancesResponse,
14087 gax::error::Error,
14088 > {
14089 use std::clone::Clone;
14090 let token = self.0.request.page_token.clone().unwrap_or_default();
14091 let execute = move |token: String| {
14092 let mut builder = self.clone();
14093 builder.0.request = builder.0.request.set_page_token(token);
14094 builder.send()
14095 };
14096 gax::paginator::internal::new_paginator(token, execute)
14097 }
14098
14099 pub fn by_item(
14101 self,
14102 ) -> impl gax::paginator::ItemPaginator<
14103 crate::model::RegionInstanceGroupManagersListInstancesResponse,
14104 gax::error::Error,
14105 > {
14106 use gax::paginator::Paginator;
14107 self.by_page().items()
14108 }
14109
14110 pub fn set_filter<T>(mut self, v: T) -> Self
14112 where
14113 T: std::convert::Into<std::string::String>,
14114 {
14115 self.0.request.filter = std::option::Option::Some(v.into());
14116 self
14117 }
14118
14119 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
14121 where
14122 T: std::convert::Into<std::string::String>,
14123 {
14124 self.0.request.filter = v.map(|x| x.into());
14125 self
14126 }
14127
14128 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14130 self.0.request.instance_group_manager = v.into();
14131 self
14132 }
14133
14134 pub fn set_max_results<T>(mut self, v: T) -> Self
14136 where
14137 T: std::convert::Into<u32>,
14138 {
14139 self.0.request.max_results = std::option::Option::Some(v.into());
14140 self
14141 }
14142
14143 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
14145 where
14146 T: std::convert::Into<u32>,
14147 {
14148 self.0.request.max_results = v.map(|x| x.into());
14149 self
14150 }
14151
14152 pub fn set_order_by<T>(mut self, v: T) -> Self
14154 where
14155 T: std::convert::Into<std::string::String>,
14156 {
14157 self.0.request.order_by = std::option::Option::Some(v.into());
14158 self
14159 }
14160
14161 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
14163 where
14164 T: std::convert::Into<std::string::String>,
14165 {
14166 self.0.request.order_by = v.map(|x| x.into());
14167 self
14168 }
14169
14170 pub fn set_page_token<T>(mut self, v: T) -> Self
14172 where
14173 T: std::convert::Into<std::string::String>,
14174 {
14175 self.0.request.page_token = std::option::Option::Some(v.into());
14176 self
14177 }
14178
14179 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
14181 where
14182 T: std::convert::Into<std::string::String>,
14183 {
14184 self.0.request.page_token = v.map(|x| x.into());
14185 self
14186 }
14187
14188 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14190 self.0.request.project = v.into();
14191 self
14192 }
14193
14194 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14196 self.0.request.region = v.into();
14197 self
14198 }
14199
14200 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
14202 where
14203 T: std::convert::Into<bool>,
14204 {
14205 self.0.request.return_partial_success = std::option::Option::Some(v.into());
14206 self
14207 }
14208
14209 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
14211 where
14212 T: std::convert::Into<bool>,
14213 {
14214 self.0.request.return_partial_success = v.map(|x| x.into());
14215 self
14216 }
14217 }
14218
14219 #[doc(hidden)]
14220 impl gax::options::internal::RequestBuilder for ListManagedInstances {
14221 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14222 &mut self.0.options
14223 }
14224 }
14225
14226 #[derive(Clone, Debug)]
14248 pub struct ListPerInstanceConfigs(
14249 RequestBuilder<crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest>,
14250 );
14251
14252 impl ListPerInstanceConfigs {
14253 pub(crate) fn new(
14254 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14255 ) -> Self {
14256 Self(RequestBuilder::new(stub))
14257 }
14258
14259 pub fn with_request<
14261 V: Into<crate::model::region_instance_group_managers::ListPerInstanceConfigsRequest>,
14262 >(
14263 mut self,
14264 v: V,
14265 ) -> Self {
14266 self.0.request = v.into();
14267 self
14268 }
14269
14270 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14272 self.0.options = v.into();
14273 self
14274 }
14275
14276 pub async fn send(
14278 self,
14279 ) -> Result<crate::model::RegionInstanceGroupManagersListInstanceConfigsResp> {
14280 (*self.0.stub)
14281 .list_per_instance_configs(self.0.request, self.0.options)
14282 .await
14283 .map(gax::response::Response::into_body)
14284 }
14285
14286 pub fn by_page(
14288 self,
14289 ) -> impl gax::paginator::Paginator<
14290 crate::model::RegionInstanceGroupManagersListInstanceConfigsResp,
14291 gax::error::Error,
14292 > {
14293 use std::clone::Clone;
14294 let token = self.0.request.page_token.clone().unwrap_or_default();
14295 let execute = move |token: String| {
14296 let mut builder = self.clone();
14297 builder.0.request = builder.0.request.set_page_token(token);
14298 builder.send()
14299 };
14300 gax::paginator::internal::new_paginator(token, execute)
14301 }
14302
14303 pub fn by_item(
14305 self,
14306 ) -> impl gax::paginator::ItemPaginator<
14307 crate::model::RegionInstanceGroupManagersListInstanceConfigsResp,
14308 gax::error::Error,
14309 > {
14310 use gax::paginator::Paginator;
14311 self.by_page().items()
14312 }
14313
14314 pub fn set_filter<T>(mut self, v: T) -> Self
14316 where
14317 T: std::convert::Into<std::string::String>,
14318 {
14319 self.0.request.filter = std::option::Option::Some(v.into());
14320 self
14321 }
14322
14323 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
14325 where
14326 T: std::convert::Into<std::string::String>,
14327 {
14328 self.0.request.filter = v.map(|x| x.into());
14329 self
14330 }
14331
14332 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14334 self.0.request.instance_group_manager = v.into();
14335 self
14336 }
14337
14338 pub fn set_max_results<T>(mut self, v: T) -> Self
14340 where
14341 T: std::convert::Into<u32>,
14342 {
14343 self.0.request.max_results = std::option::Option::Some(v.into());
14344 self
14345 }
14346
14347 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
14349 where
14350 T: std::convert::Into<u32>,
14351 {
14352 self.0.request.max_results = v.map(|x| x.into());
14353 self
14354 }
14355
14356 pub fn set_order_by<T>(mut self, v: T) -> Self
14358 where
14359 T: std::convert::Into<std::string::String>,
14360 {
14361 self.0.request.order_by = std::option::Option::Some(v.into());
14362 self
14363 }
14364
14365 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
14367 where
14368 T: std::convert::Into<std::string::String>,
14369 {
14370 self.0.request.order_by = v.map(|x| x.into());
14371 self
14372 }
14373
14374 pub fn set_page_token<T>(mut self, v: T) -> Self
14376 where
14377 T: std::convert::Into<std::string::String>,
14378 {
14379 self.0.request.page_token = std::option::Option::Some(v.into());
14380 self
14381 }
14382
14383 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
14385 where
14386 T: std::convert::Into<std::string::String>,
14387 {
14388 self.0.request.page_token = v.map(|x| x.into());
14389 self
14390 }
14391
14392 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14394 self.0.request.project = v.into();
14395 self
14396 }
14397
14398 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14400 self.0.request.region = v.into();
14401 self
14402 }
14403
14404 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
14406 where
14407 T: std::convert::Into<bool>,
14408 {
14409 self.0.request.return_partial_success = std::option::Option::Some(v.into());
14410 self
14411 }
14412
14413 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
14415 where
14416 T: std::convert::Into<bool>,
14417 {
14418 self.0.request.return_partial_success = v.map(|x| x.into());
14419 self
14420 }
14421 }
14422
14423 #[doc(hidden)]
14424 impl gax::options::internal::RequestBuilder for ListPerInstanceConfigs {
14425 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14426 &mut self.0.options
14427 }
14428 }
14429
14430 #[derive(Clone, Debug)]
14448 pub struct Patch(RequestBuilder<crate::model::region_instance_group_managers::PatchRequest>);
14449
14450 impl Patch {
14451 pub(crate) fn new(
14452 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14453 ) -> Self {
14454 Self(RequestBuilder::new(stub))
14455 }
14456
14457 pub fn with_request<V: Into<crate::model::region_instance_group_managers::PatchRequest>>(
14459 mut self,
14460 v: V,
14461 ) -> Self {
14462 self.0.request = v.into();
14463 self
14464 }
14465
14466 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14468 self.0.options = v.into();
14469 self
14470 }
14471
14472 pub async fn send(self) -> Result<crate::model::Operation> {
14474 (*self.0.stub)
14475 .patch(self.0.request, self.0.options)
14476 .await
14477 .map(gax::response::Response::into_body)
14478 }
14479
14480 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14482 self.0.request.instance_group_manager = v.into();
14483 self
14484 }
14485
14486 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14488 self.0.request.project = v.into();
14489 self
14490 }
14491
14492 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14494 self.0.request.region = v.into();
14495 self
14496 }
14497
14498 pub fn set_request_id<T>(mut self, v: T) -> Self
14500 where
14501 T: std::convert::Into<std::string::String>,
14502 {
14503 self.0.request.request_id = std::option::Option::Some(v.into());
14504 self
14505 }
14506
14507 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
14509 where
14510 T: std::convert::Into<std::string::String>,
14511 {
14512 self.0.request.request_id = v.map(|x| x.into());
14513 self
14514 }
14515
14516 pub fn set_body<T>(mut self, v: T) -> Self
14518 where
14519 T: std::convert::Into<crate::model::InstanceGroupManager>,
14520 {
14521 self.0.request.body = std::option::Option::Some(v.into());
14522 self
14523 }
14524
14525 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14527 where
14528 T: std::convert::Into<crate::model::InstanceGroupManager>,
14529 {
14530 self.0.request.body = v.map(|x| x.into());
14531 self
14532 }
14533 }
14534
14535 #[doc(hidden)]
14536 impl gax::options::internal::RequestBuilder for Patch {
14537 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14538 &mut self.0.options
14539 }
14540 }
14541
14542 #[derive(Clone, Debug)]
14560 pub struct PatchPerInstanceConfigs(
14561 RequestBuilder<
14562 crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest,
14563 >,
14564 );
14565
14566 impl PatchPerInstanceConfigs {
14567 pub(crate) fn new(
14568 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14569 ) -> Self {
14570 Self(RequestBuilder::new(stub))
14571 }
14572
14573 pub fn with_request<
14575 V: Into<crate::model::region_instance_group_managers::PatchPerInstanceConfigsRequest>,
14576 >(
14577 mut self,
14578 v: V,
14579 ) -> Self {
14580 self.0.request = v.into();
14581 self
14582 }
14583
14584 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14586 self.0.options = v.into();
14587 self
14588 }
14589
14590 pub async fn send(self) -> Result<crate::model::Operation> {
14592 (*self.0.stub)
14593 .patch_per_instance_configs(self.0.request, self.0.options)
14594 .await
14595 .map(gax::response::Response::into_body)
14596 }
14597
14598 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14600 self.0.request.instance_group_manager = v.into();
14601 self
14602 }
14603
14604 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14606 self.0.request.project = v.into();
14607 self
14608 }
14609
14610 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14612 self.0.request.region = v.into();
14613 self
14614 }
14615
14616 pub fn set_request_id<T>(mut self, v: T) -> Self
14618 where
14619 T: std::convert::Into<std::string::String>,
14620 {
14621 self.0.request.request_id = std::option::Option::Some(v.into());
14622 self
14623 }
14624
14625 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
14627 where
14628 T: std::convert::Into<std::string::String>,
14629 {
14630 self.0.request.request_id = v.map(|x| x.into());
14631 self
14632 }
14633
14634 pub fn set_body<T>(mut self, v: T) -> Self
14636 where
14637 T: std::convert::Into<crate::model::RegionInstanceGroupManagerPatchInstanceConfigReq>,
14638 {
14639 self.0.request.body = std::option::Option::Some(v.into());
14640 self
14641 }
14642
14643 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14645 where
14646 T: std::convert::Into<crate::model::RegionInstanceGroupManagerPatchInstanceConfigReq>,
14647 {
14648 self.0.request.body = v.map(|x| x.into());
14649 self
14650 }
14651 }
14652
14653 #[doc(hidden)]
14654 impl gax::options::internal::RequestBuilder for PatchPerInstanceConfigs {
14655 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14656 &mut self.0.options
14657 }
14658 }
14659
14660 #[derive(Clone, Debug)]
14678 pub struct RecreateInstances(
14679 RequestBuilder<crate::model::region_instance_group_managers::RecreateInstancesRequest>,
14680 );
14681
14682 impl RecreateInstances {
14683 pub(crate) fn new(
14684 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14685 ) -> Self {
14686 Self(RequestBuilder::new(stub))
14687 }
14688
14689 pub fn with_request<
14691 V: Into<crate::model::region_instance_group_managers::RecreateInstancesRequest>,
14692 >(
14693 mut self,
14694 v: V,
14695 ) -> Self {
14696 self.0.request = v.into();
14697 self
14698 }
14699
14700 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14702 self.0.options = v.into();
14703 self
14704 }
14705
14706 pub async fn send(self) -> Result<crate::model::Operation> {
14708 (*self.0.stub)
14709 .recreate_instances(self.0.request, self.0.options)
14710 .await
14711 .map(gax::response::Response::into_body)
14712 }
14713
14714 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14716 self.0.request.instance_group_manager = v.into();
14717 self
14718 }
14719
14720 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14722 self.0.request.project = v.into();
14723 self
14724 }
14725
14726 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14728 self.0.request.region = v.into();
14729 self
14730 }
14731
14732 pub fn set_request_id<T>(mut self, v: T) -> Self
14734 where
14735 T: std::convert::Into<std::string::String>,
14736 {
14737 self.0.request.request_id = std::option::Option::Some(v.into());
14738 self
14739 }
14740
14741 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
14743 where
14744 T: std::convert::Into<std::string::String>,
14745 {
14746 self.0.request.request_id = v.map(|x| x.into());
14747 self
14748 }
14749
14750 pub fn set_body<T>(mut self, v: T) -> Self
14752 where
14753 T: std::convert::Into<crate::model::RegionInstanceGroupManagersRecreateRequest>,
14754 {
14755 self.0.request.body = std::option::Option::Some(v.into());
14756 self
14757 }
14758
14759 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14761 where
14762 T: std::convert::Into<crate::model::RegionInstanceGroupManagersRecreateRequest>,
14763 {
14764 self.0.request.body = v.map(|x| x.into());
14765 self
14766 }
14767 }
14768
14769 #[doc(hidden)]
14770 impl gax::options::internal::RequestBuilder for RecreateInstances {
14771 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14772 &mut self.0.options
14773 }
14774 }
14775
14776 #[derive(Clone, Debug)]
14794 pub struct Resize(RequestBuilder<crate::model::region_instance_group_managers::ResizeRequest>);
14795
14796 impl Resize {
14797 pub(crate) fn new(
14798 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14799 ) -> Self {
14800 Self(RequestBuilder::new(stub))
14801 }
14802
14803 pub fn with_request<
14805 V: Into<crate::model::region_instance_group_managers::ResizeRequest>,
14806 >(
14807 mut self,
14808 v: V,
14809 ) -> Self {
14810 self.0.request = v.into();
14811 self
14812 }
14813
14814 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14816 self.0.options = v.into();
14817 self
14818 }
14819
14820 pub async fn send(self) -> Result<crate::model::Operation> {
14822 (*self.0.stub)
14823 .resize(self.0.request, self.0.options)
14824 .await
14825 .map(gax::response::Response::into_body)
14826 }
14827
14828 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14830 self.0.request.instance_group_manager = v.into();
14831 self
14832 }
14833
14834 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14836 self.0.request.project = v.into();
14837 self
14838 }
14839
14840 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14842 self.0.request.region = v.into();
14843 self
14844 }
14845
14846 pub fn set_request_id<T>(mut self, v: T) -> Self
14848 where
14849 T: std::convert::Into<std::string::String>,
14850 {
14851 self.0.request.request_id = std::option::Option::Some(v.into());
14852 self
14853 }
14854
14855 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
14857 where
14858 T: std::convert::Into<std::string::String>,
14859 {
14860 self.0.request.request_id = v.map(|x| x.into());
14861 self
14862 }
14863
14864 pub fn set_size<T: Into<i32>>(mut self, v: T) -> Self {
14866 self.0.request.size = v.into();
14867 self
14868 }
14869 }
14870
14871 #[doc(hidden)]
14872 impl gax::options::internal::RequestBuilder for Resize {
14873 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14874 &mut self.0.options
14875 }
14876 }
14877
14878 #[derive(Clone, Debug)]
14896 pub struct ResumeInstances(
14897 RequestBuilder<crate::model::region_instance_group_managers::ResumeInstancesRequest>,
14898 );
14899
14900 impl ResumeInstances {
14901 pub(crate) fn new(
14902 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
14903 ) -> Self {
14904 Self(RequestBuilder::new(stub))
14905 }
14906
14907 pub fn with_request<
14909 V: Into<crate::model::region_instance_group_managers::ResumeInstancesRequest>,
14910 >(
14911 mut self,
14912 v: V,
14913 ) -> Self {
14914 self.0.request = v.into();
14915 self
14916 }
14917
14918 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14920 self.0.options = v.into();
14921 self
14922 }
14923
14924 pub async fn send(self) -> Result<crate::model::Operation> {
14926 (*self.0.stub)
14927 .resume_instances(self.0.request, self.0.options)
14928 .await
14929 .map(gax::response::Response::into_body)
14930 }
14931
14932 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
14934 self.0.request.instance_group_manager = v.into();
14935 self
14936 }
14937
14938 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
14940 self.0.request.project = v.into();
14941 self
14942 }
14943
14944 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
14946 self.0.request.region = v.into();
14947 self
14948 }
14949
14950 pub fn set_request_id<T>(mut self, v: T) -> Self
14952 where
14953 T: std::convert::Into<std::string::String>,
14954 {
14955 self.0.request.request_id = std::option::Option::Some(v.into());
14956 self
14957 }
14958
14959 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
14961 where
14962 T: std::convert::Into<std::string::String>,
14963 {
14964 self.0.request.request_id = v.map(|x| x.into());
14965 self
14966 }
14967
14968 pub fn set_body<T>(mut self, v: T) -> Self
14970 where
14971 T: std::convert::Into<crate::model::RegionInstanceGroupManagersResumeInstancesRequest>,
14972 {
14973 self.0.request.body = std::option::Option::Some(v.into());
14974 self
14975 }
14976
14977 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
14979 where
14980 T: std::convert::Into<crate::model::RegionInstanceGroupManagersResumeInstancesRequest>,
14981 {
14982 self.0.request.body = v.map(|x| x.into());
14983 self
14984 }
14985 }
14986
14987 #[doc(hidden)]
14988 impl gax::options::internal::RequestBuilder for ResumeInstances {
14989 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14990 &mut self.0.options
14991 }
14992 }
14993
14994 #[derive(Clone, Debug)]
15012 pub struct SetInstanceTemplate(
15013 RequestBuilder<crate::model::region_instance_group_managers::SetInstanceTemplateRequest>,
15014 );
15015
15016 impl SetInstanceTemplate {
15017 pub(crate) fn new(
15018 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15019 ) -> Self {
15020 Self(RequestBuilder::new(stub))
15021 }
15022
15023 pub fn with_request<
15025 V: Into<crate::model::region_instance_group_managers::SetInstanceTemplateRequest>,
15026 >(
15027 mut self,
15028 v: V,
15029 ) -> Self {
15030 self.0.request = v.into();
15031 self
15032 }
15033
15034 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15036 self.0.options = v.into();
15037 self
15038 }
15039
15040 pub async fn send(self) -> Result<crate::model::Operation> {
15042 (*self.0.stub)
15043 .set_instance_template(self.0.request, self.0.options)
15044 .await
15045 .map(gax::response::Response::into_body)
15046 }
15047
15048 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15050 self.0.request.instance_group_manager = v.into();
15051 self
15052 }
15053
15054 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15056 self.0.request.project = v.into();
15057 self
15058 }
15059
15060 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15062 self.0.request.region = v.into();
15063 self
15064 }
15065
15066 pub fn set_request_id<T>(mut self, v: T) -> Self
15068 where
15069 T: std::convert::Into<std::string::String>,
15070 {
15071 self.0.request.request_id = std::option::Option::Some(v.into());
15072 self
15073 }
15074
15075 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15077 where
15078 T: std::convert::Into<std::string::String>,
15079 {
15080 self.0.request.request_id = v.map(|x| x.into());
15081 self
15082 }
15083
15084 pub fn set_body<T>(mut self, v: T) -> Self
15086 where
15087 T: std::convert::Into<crate::model::RegionInstanceGroupManagersSetTemplateRequest>,
15088 {
15089 self.0.request.body = std::option::Option::Some(v.into());
15090 self
15091 }
15092
15093 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15095 where
15096 T: std::convert::Into<crate::model::RegionInstanceGroupManagersSetTemplateRequest>,
15097 {
15098 self.0.request.body = v.map(|x| x.into());
15099 self
15100 }
15101 }
15102
15103 #[doc(hidden)]
15104 impl gax::options::internal::RequestBuilder for SetInstanceTemplate {
15105 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15106 &mut self.0.options
15107 }
15108 }
15109
15110 #[derive(Clone, Debug)]
15128 pub struct SetTargetPools(
15129 RequestBuilder<crate::model::region_instance_group_managers::SetTargetPoolsRequest>,
15130 );
15131
15132 impl SetTargetPools {
15133 pub(crate) fn new(
15134 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15135 ) -> Self {
15136 Self(RequestBuilder::new(stub))
15137 }
15138
15139 pub fn with_request<
15141 V: Into<crate::model::region_instance_group_managers::SetTargetPoolsRequest>,
15142 >(
15143 mut self,
15144 v: V,
15145 ) -> Self {
15146 self.0.request = v.into();
15147 self
15148 }
15149
15150 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15152 self.0.options = v.into();
15153 self
15154 }
15155
15156 pub async fn send(self) -> Result<crate::model::Operation> {
15158 (*self.0.stub)
15159 .set_target_pools(self.0.request, self.0.options)
15160 .await
15161 .map(gax::response::Response::into_body)
15162 }
15163
15164 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15166 self.0.request.instance_group_manager = v.into();
15167 self
15168 }
15169
15170 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15172 self.0.request.project = v.into();
15173 self
15174 }
15175
15176 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15178 self.0.request.region = v.into();
15179 self
15180 }
15181
15182 pub fn set_request_id<T>(mut self, v: T) -> Self
15184 where
15185 T: std::convert::Into<std::string::String>,
15186 {
15187 self.0.request.request_id = std::option::Option::Some(v.into());
15188 self
15189 }
15190
15191 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15193 where
15194 T: std::convert::Into<std::string::String>,
15195 {
15196 self.0.request.request_id = v.map(|x| x.into());
15197 self
15198 }
15199
15200 pub fn set_body<T>(mut self, v: T) -> Self
15202 where
15203 T: std::convert::Into<crate::model::RegionInstanceGroupManagersSetTargetPoolsRequest>,
15204 {
15205 self.0.request.body = std::option::Option::Some(v.into());
15206 self
15207 }
15208
15209 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15211 where
15212 T: std::convert::Into<crate::model::RegionInstanceGroupManagersSetTargetPoolsRequest>,
15213 {
15214 self.0.request.body = v.map(|x| x.into());
15215 self
15216 }
15217 }
15218
15219 #[doc(hidden)]
15220 impl gax::options::internal::RequestBuilder for SetTargetPools {
15221 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15222 &mut self.0.options
15223 }
15224 }
15225
15226 #[derive(Clone, Debug)]
15244 pub struct StartInstances(
15245 RequestBuilder<crate::model::region_instance_group_managers::StartInstancesRequest>,
15246 );
15247
15248 impl StartInstances {
15249 pub(crate) fn new(
15250 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15251 ) -> Self {
15252 Self(RequestBuilder::new(stub))
15253 }
15254
15255 pub fn with_request<
15257 V: Into<crate::model::region_instance_group_managers::StartInstancesRequest>,
15258 >(
15259 mut self,
15260 v: V,
15261 ) -> Self {
15262 self.0.request = v.into();
15263 self
15264 }
15265
15266 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15268 self.0.options = v.into();
15269 self
15270 }
15271
15272 pub async fn send(self) -> Result<crate::model::Operation> {
15274 (*self.0.stub)
15275 .start_instances(self.0.request, self.0.options)
15276 .await
15277 .map(gax::response::Response::into_body)
15278 }
15279
15280 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15282 self.0.request.instance_group_manager = v.into();
15283 self
15284 }
15285
15286 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15288 self.0.request.project = v.into();
15289 self
15290 }
15291
15292 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15294 self.0.request.region = v.into();
15295 self
15296 }
15297
15298 pub fn set_request_id<T>(mut self, v: T) -> Self
15300 where
15301 T: std::convert::Into<std::string::String>,
15302 {
15303 self.0.request.request_id = std::option::Option::Some(v.into());
15304 self
15305 }
15306
15307 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15309 where
15310 T: std::convert::Into<std::string::String>,
15311 {
15312 self.0.request.request_id = v.map(|x| x.into());
15313 self
15314 }
15315
15316 pub fn set_body<T>(mut self, v: T) -> Self
15318 where
15319 T: std::convert::Into<crate::model::RegionInstanceGroupManagersStartInstancesRequest>,
15320 {
15321 self.0.request.body = std::option::Option::Some(v.into());
15322 self
15323 }
15324
15325 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15327 where
15328 T: std::convert::Into<crate::model::RegionInstanceGroupManagersStartInstancesRequest>,
15329 {
15330 self.0.request.body = v.map(|x| x.into());
15331 self
15332 }
15333 }
15334
15335 #[doc(hidden)]
15336 impl gax::options::internal::RequestBuilder for StartInstances {
15337 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15338 &mut self.0.options
15339 }
15340 }
15341
15342 #[derive(Clone, Debug)]
15360 pub struct StopInstances(
15361 RequestBuilder<crate::model::region_instance_group_managers::StopInstancesRequest>,
15362 );
15363
15364 impl StopInstances {
15365 pub(crate) fn new(
15366 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15367 ) -> Self {
15368 Self(RequestBuilder::new(stub))
15369 }
15370
15371 pub fn with_request<
15373 V: Into<crate::model::region_instance_group_managers::StopInstancesRequest>,
15374 >(
15375 mut self,
15376 v: V,
15377 ) -> Self {
15378 self.0.request = v.into();
15379 self
15380 }
15381
15382 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15384 self.0.options = v.into();
15385 self
15386 }
15387
15388 pub async fn send(self) -> Result<crate::model::Operation> {
15390 (*self.0.stub)
15391 .stop_instances(self.0.request, self.0.options)
15392 .await
15393 .map(gax::response::Response::into_body)
15394 }
15395
15396 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15398 self.0.request.instance_group_manager = v.into();
15399 self
15400 }
15401
15402 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15404 self.0.request.project = v.into();
15405 self
15406 }
15407
15408 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15410 self.0.request.region = v.into();
15411 self
15412 }
15413
15414 pub fn set_request_id<T>(mut self, v: T) -> Self
15416 where
15417 T: std::convert::Into<std::string::String>,
15418 {
15419 self.0.request.request_id = std::option::Option::Some(v.into());
15420 self
15421 }
15422
15423 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15425 where
15426 T: std::convert::Into<std::string::String>,
15427 {
15428 self.0.request.request_id = v.map(|x| x.into());
15429 self
15430 }
15431
15432 pub fn set_body<T>(mut self, v: T) -> Self
15434 where
15435 T: std::convert::Into<crate::model::RegionInstanceGroupManagersStopInstancesRequest>,
15436 {
15437 self.0.request.body = std::option::Option::Some(v.into());
15438 self
15439 }
15440
15441 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15443 where
15444 T: std::convert::Into<crate::model::RegionInstanceGroupManagersStopInstancesRequest>,
15445 {
15446 self.0.request.body = v.map(|x| x.into());
15447 self
15448 }
15449 }
15450
15451 #[doc(hidden)]
15452 impl gax::options::internal::RequestBuilder for StopInstances {
15453 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15454 &mut self.0.options
15455 }
15456 }
15457
15458 #[derive(Clone, Debug)]
15476 pub struct SuspendInstances(
15477 RequestBuilder<crate::model::region_instance_group_managers::SuspendInstancesRequest>,
15478 );
15479
15480 impl SuspendInstances {
15481 pub(crate) fn new(
15482 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15483 ) -> Self {
15484 Self(RequestBuilder::new(stub))
15485 }
15486
15487 pub fn with_request<
15489 V: Into<crate::model::region_instance_group_managers::SuspendInstancesRequest>,
15490 >(
15491 mut self,
15492 v: V,
15493 ) -> Self {
15494 self.0.request = v.into();
15495 self
15496 }
15497
15498 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15500 self.0.options = v.into();
15501 self
15502 }
15503
15504 pub async fn send(self) -> Result<crate::model::Operation> {
15506 (*self.0.stub)
15507 .suspend_instances(self.0.request, self.0.options)
15508 .await
15509 .map(gax::response::Response::into_body)
15510 }
15511
15512 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15514 self.0.request.instance_group_manager = v.into();
15515 self
15516 }
15517
15518 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15520 self.0.request.project = v.into();
15521 self
15522 }
15523
15524 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15526 self.0.request.region = v.into();
15527 self
15528 }
15529
15530 pub fn set_request_id<T>(mut self, v: T) -> Self
15532 where
15533 T: std::convert::Into<std::string::String>,
15534 {
15535 self.0.request.request_id = std::option::Option::Some(v.into());
15536 self
15537 }
15538
15539 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15541 where
15542 T: std::convert::Into<std::string::String>,
15543 {
15544 self.0.request.request_id = v.map(|x| x.into());
15545 self
15546 }
15547
15548 pub fn set_body<T>(mut self, v: T) -> Self
15550 where
15551 T: std::convert::Into<crate::model::RegionInstanceGroupManagersSuspendInstancesRequest>,
15552 {
15553 self.0.request.body = std::option::Option::Some(v.into());
15554 self
15555 }
15556
15557 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15559 where
15560 T: std::convert::Into<crate::model::RegionInstanceGroupManagersSuspendInstancesRequest>,
15561 {
15562 self.0.request.body = v.map(|x| x.into());
15563 self
15564 }
15565 }
15566
15567 #[doc(hidden)]
15568 impl gax::options::internal::RequestBuilder for SuspendInstances {
15569 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15570 &mut self.0.options
15571 }
15572 }
15573
15574 #[derive(Clone, Debug)]
15592 pub struct UpdatePerInstanceConfigs(
15593 RequestBuilder<
15594 crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest,
15595 >,
15596 );
15597
15598 impl UpdatePerInstanceConfigs {
15599 pub(crate) fn new(
15600 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroupManagers>,
15601 ) -> Self {
15602 Self(RequestBuilder::new(stub))
15603 }
15604
15605 pub fn with_request<
15607 V: Into<crate::model::region_instance_group_managers::UpdatePerInstanceConfigsRequest>,
15608 >(
15609 mut self,
15610 v: V,
15611 ) -> Self {
15612 self.0.request = v.into();
15613 self
15614 }
15615
15616 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15618 self.0.options = v.into();
15619 self
15620 }
15621
15622 pub async fn send(self) -> Result<crate::model::Operation> {
15624 (*self.0.stub)
15625 .update_per_instance_configs(self.0.request, self.0.options)
15626 .await
15627 .map(gax::response::Response::into_body)
15628 }
15629
15630 pub fn set_instance_group_manager<T: Into<std::string::String>>(mut self, v: T) -> Self {
15632 self.0.request.instance_group_manager = v.into();
15633 self
15634 }
15635
15636 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15638 self.0.request.project = v.into();
15639 self
15640 }
15641
15642 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15644 self.0.request.region = v.into();
15645 self
15646 }
15647
15648 pub fn set_request_id<T>(mut self, v: T) -> Self
15650 where
15651 T: std::convert::Into<std::string::String>,
15652 {
15653 self.0.request.request_id = std::option::Option::Some(v.into());
15654 self
15655 }
15656
15657 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
15659 where
15660 T: std::convert::Into<std::string::String>,
15661 {
15662 self.0.request.request_id = v.map(|x| x.into());
15663 self
15664 }
15665
15666 pub fn set_body<T>(mut self, v: T) -> Self
15668 where
15669 T: std::convert::Into<crate::model::RegionInstanceGroupManagerUpdateInstanceConfigReq>,
15670 {
15671 self.0.request.body = std::option::Option::Some(v.into());
15672 self
15673 }
15674
15675 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15677 where
15678 T: std::convert::Into<crate::model::RegionInstanceGroupManagerUpdateInstanceConfigReq>,
15679 {
15680 self.0.request.body = v.map(|x| x.into());
15681 self
15682 }
15683 }
15684
15685 #[doc(hidden)]
15686 impl gax::options::internal::RequestBuilder for UpdatePerInstanceConfigs {
15687 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15688 &mut self.0.options
15689 }
15690 }
15691}
15692
15693#[cfg(feature = "region-instance-groups")]
15694#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
15695pub mod region_instance_groups {
15696 use crate::Result;
15697
15698 pub type ClientBuilder =
15712 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15713
15714 pub(crate) mod client {
15715 use super::super::super::client::RegionInstanceGroups;
15716 pub struct Factory;
15717 impl gax::client_builder::internal::ClientFactory for Factory {
15718 type Client = RegionInstanceGroups;
15719 type Credentials = gaxi::options::Credentials;
15720 async fn build(
15721 self,
15722 config: gaxi::options::ClientConfig,
15723 ) -> gax::client_builder::Result<Self::Client> {
15724 Self::Client::new(config).await
15725 }
15726 }
15727 }
15728
15729 #[derive(Clone, Debug)]
15731 pub(crate) struct RequestBuilder<R: std::default::Default> {
15732 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
15733 request: R,
15734 options: gax::options::RequestOptions,
15735 }
15736
15737 impl<R> RequestBuilder<R>
15738 where
15739 R: std::default::Default,
15740 {
15741 pub(crate) fn new(
15742 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
15743 ) -> Self {
15744 Self {
15745 stub,
15746 request: R::default(),
15747 options: gax::options::RequestOptions::default(),
15748 }
15749 }
15750 }
15751
15752 #[derive(Clone, Debug)]
15770 pub struct Get(RequestBuilder<crate::model::region_instance_groups::GetRequest>);
15771
15772 impl Get {
15773 pub(crate) fn new(
15774 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
15775 ) -> Self {
15776 Self(RequestBuilder::new(stub))
15777 }
15778
15779 pub fn with_request<V: Into<crate::model::region_instance_groups::GetRequest>>(
15781 mut self,
15782 v: V,
15783 ) -> Self {
15784 self.0.request = v.into();
15785 self
15786 }
15787
15788 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15790 self.0.options = v.into();
15791 self
15792 }
15793
15794 pub async fn send(self) -> Result<crate::model::InstanceGroup> {
15796 (*self.0.stub)
15797 .get(self.0.request, self.0.options)
15798 .await
15799 .map(gax::response::Response::into_body)
15800 }
15801
15802 pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
15804 self.0.request.instance_group = v.into();
15805 self
15806 }
15807
15808 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15810 self.0.request.project = v.into();
15811 self
15812 }
15813
15814 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15816 self.0.request.region = v.into();
15817 self
15818 }
15819 }
15820
15821 #[doc(hidden)]
15822 impl gax::options::internal::RequestBuilder for Get {
15823 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15824 &mut self.0.options
15825 }
15826 }
15827
15828 #[derive(Clone, Debug)]
15850 pub struct List(RequestBuilder<crate::model::region_instance_groups::ListRequest>);
15851
15852 impl List {
15853 pub(crate) fn new(
15854 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
15855 ) -> Self {
15856 Self(RequestBuilder::new(stub))
15857 }
15858
15859 pub fn with_request<V: Into<crate::model::region_instance_groups::ListRequest>>(
15861 mut self,
15862 v: V,
15863 ) -> Self {
15864 self.0.request = v.into();
15865 self
15866 }
15867
15868 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15870 self.0.options = v.into();
15871 self
15872 }
15873
15874 pub async fn send(self) -> Result<crate::model::RegionInstanceGroupList> {
15876 (*self.0.stub)
15877 .list(self.0.request, self.0.options)
15878 .await
15879 .map(gax::response::Response::into_body)
15880 }
15881
15882 pub fn by_page(
15884 self,
15885 ) -> impl gax::paginator::Paginator<crate::model::RegionInstanceGroupList, gax::error::Error>
15886 {
15887 use std::clone::Clone;
15888 let token = self.0.request.page_token.clone().unwrap_or_default();
15889 let execute = move |token: String| {
15890 let mut builder = self.clone();
15891 builder.0.request = builder.0.request.set_page_token(token);
15892 builder.send()
15893 };
15894 gax::paginator::internal::new_paginator(token, execute)
15895 }
15896
15897 pub fn by_item(
15899 self,
15900 ) -> impl gax::paginator::ItemPaginator<crate::model::RegionInstanceGroupList, gax::error::Error>
15901 {
15902 use gax::paginator::Paginator;
15903 self.by_page().items()
15904 }
15905
15906 pub fn set_filter<T>(mut self, v: T) -> Self
15908 where
15909 T: std::convert::Into<std::string::String>,
15910 {
15911 self.0.request.filter = std::option::Option::Some(v.into());
15912 self
15913 }
15914
15915 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
15917 where
15918 T: std::convert::Into<std::string::String>,
15919 {
15920 self.0.request.filter = v.map(|x| x.into());
15921 self
15922 }
15923
15924 pub fn set_max_results<T>(mut self, v: T) -> Self
15926 where
15927 T: std::convert::Into<u32>,
15928 {
15929 self.0.request.max_results = std::option::Option::Some(v.into());
15930 self
15931 }
15932
15933 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
15935 where
15936 T: std::convert::Into<u32>,
15937 {
15938 self.0.request.max_results = v.map(|x| x.into());
15939 self
15940 }
15941
15942 pub fn set_order_by<T>(mut self, v: T) -> Self
15944 where
15945 T: std::convert::Into<std::string::String>,
15946 {
15947 self.0.request.order_by = std::option::Option::Some(v.into());
15948 self
15949 }
15950
15951 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
15953 where
15954 T: std::convert::Into<std::string::String>,
15955 {
15956 self.0.request.order_by = v.map(|x| x.into());
15957 self
15958 }
15959
15960 pub fn set_page_token<T>(mut self, v: T) -> Self
15962 where
15963 T: std::convert::Into<std::string::String>,
15964 {
15965 self.0.request.page_token = std::option::Option::Some(v.into());
15966 self
15967 }
15968
15969 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
15971 where
15972 T: std::convert::Into<std::string::String>,
15973 {
15974 self.0.request.page_token = v.map(|x| x.into());
15975 self
15976 }
15977
15978 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
15980 self.0.request.project = v.into();
15981 self
15982 }
15983
15984 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
15986 self.0.request.region = v.into();
15987 self
15988 }
15989
15990 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
15992 where
15993 T: std::convert::Into<bool>,
15994 {
15995 self.0.request.return_partial_success = std::option::Option::Some(v.into());
15996 self
15997 }
15998
15999 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
16001 where
16002 T: std::convert::Into<bool>,
16003 {
16004 self.0.request.return_partial_success = v.map(|x| x.into());
16005 self
16006 }
16007 }
16008
16009 #[doc(hidden)]
16010 impl gax::options::internal::RequestBuilder for List {
16011 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16012 &mut self.0.options
16013 }
16014 }
16015
16016 #[derive(Clone, Debug)]
16038 pub struct ListInstances(
16039 RequestBuilder<crate::model::region_instance_groups::ListInstancesRequest>,
16040 );
16041
16042 impl ListInstances {
16043 pub(crate) fn new(
16044 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
16045 ) -> Self {
16046 Self(RequestBuilder::new(stub))
16047 }
16048
16049 pub fn with_request<V: Into<crate::model::region_instance_groups::ListInstancesRequest>>(
16051 mut self,
16052 v: V,
16053 ) -> Self {
16054 self.0.request = v.into();
16055 self
16056 }
16057
16058 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16060 self.0.options = v.into();
16061 self
16062 }
16063
16064 pub async fn send(self) -> Result<crate::model::RegionInstanceGroupsListInstances> {
16066 (*self.0.stub)
16067 .list_instances(self.0.request, self.0.options)
16068 .await
16069 .map(gax::response::Response::into_body)
16070 }
16071
16072 pub fn by_page(
16074 self,
16075 ) -> impl gax::paginator::Paginator<
16076 crate::model::RegionInstanceGroupsListInstances,
16077 gax::error::Error,
16078 > {
16079 use std::clone::Clone;
16080 let token = self.0.request.page_token.clone().unwrap_or_default();
16081 let execute = move |token: String| {
16082 let mut builder = self.clone();
16083 builder.0.request = builder.0.request.set_page_token(token);
16084 builder.send()
16085 };
16086 gax::paginator::internal::new_paginator(token, execute)
16087 }
16088
16089 pub fn by_item(
16091 self,
16092 ) -> impl gax::paginator::ItemPaginator<
16093 crate::model::RegionInstanceGroupsListInstances,
16094 gax::error::Error,
16095 > {
16096 use gax::paginator::Paginator;
16097 self.by_page().items()
16098 }
16099
16100 pub fn set_filter<T>(mut self, v: T) -> Self
16102 where
16103 T: std::convert::Into<std::string::String>,
16104 {
16105 self.0.request.filter = std::option::Option::Some(v.into());
16106 self
16107 }
16108
16109 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16111 where
16112 T: std::convert::Into<std::string::String>,
16113 {
16114 self.0.request.filter = v.map(|x| x.into());
16115 self
16116 }
16117
16118 pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
16120 self.0.request.instance_group = v.into();
16121 self
16122 }
16123
16124 pub fn set_max_results<T>(mut self, v: T) -> Self
16126 where
16127 T: std::convert::Into<u32>,
16128 {
16129 self.0.request.max_results = std::option::Option::Some(v.into());
16130 self
16131 }
16132
16133 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
16135 where
16136 T: std::convert::Into<u32>,
16137 {
16138 self.0.request.max_results = v.map(|x| x.into());
16139 self
16140 }
16141
16142 pub fn set_order_by<T>(mut self, v: T) -> Self
16144 where
16145 T: std::convert::Into<std::string::String>,
16146 {
16147 self.0.request.order_by = std::option::Option::Some(v.into());
16148 self
16149 }
16150
16151 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
16153 where
16154 T: std::convert::Into<std::string::String>,
16155 {
16156 self.0.request.order_by = v.map(|x| x.into());
16157 self
16158 }
16159
16160 pub fn set_page_token<T>(mut self, v: T) -> Self
16162 where
16163 T: std::convert::Into<std::string::String>,
16164 {
16165 self.0.request.page_token = std::option::Option::Some(v.into());
16166 self
16167 }
16168
16169 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
16171 where
16172 T: std::convert::Into<std::string::String>,
16173 {
16174 self.0.request.page_token = v.map(|x| x.into());
16175 self
16176 }
16177
16178 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16180 self.0.request.project = v.into();
16181 self
16182 }
16183
16184 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16186 self.0.request.region = v.into();
16187 self
16188 }
16189
16190 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
16192 where
16193 T: std::convert::Into<bool>,
16194 {
16195 self.0.request.return_partial_success = std::option::Option::Some(v.into());
16196 self
16197 }
16198
16199 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
16201 where
16202 T: std::convert::Into<bool>,
16203 {
16204 self.0.request.return_partial_success = v.map(|x| x.into());
16205 self
16206 }
16207
16208 pub fn set_body<T>(mut self, v: T) -> Self
16210 where
16211 T: std::convert::Into<crate::model::RegionInstanceGroupsListInstancesRequest>,
16212 {
16213 self.0.request.body = std::option::Option::Some(v.into());
16214 self
16215 }
16216
16217 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16219 where
16220 T: std::convert::Into<crate::model::RegionInstanceGroupsListInstancesRequest>,
16221 {
16222 self.0.request.body = v.map(|x| x.into());
16223 self
16224 }
16225 }
16226
16227 #[doc(hidden)]
16228 impl gax::options::internal::RequestBuilder for ListInstances {
16229 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16230 &mut self.0.options
16231 }
16232 }
16233
16234 #[derive(Clone, Debug)]
16252 pub struct SetNamedPorts(
16253 RequestBuilder<crate::model::region_instance_groups::SetNamedPortsRequest>,
16254 );
16255
16256 impl SetNamedPorts {
16257 pub(crate) fn new(
16258 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
16259 ) -> Self {
16260 Self(RequestBuilder::new(stub))
16261 }
16262
16263 pub fn with_request<V: Into<crate::model::region_instance_groups::SetNamedPortsRequest>>(
16265 mut self,
16266 v: V,
16267 ) -> Self {
16268 self.0.request = v.into();
16269 self
16270 }
16271
16272 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16274 self.0.options = v.into();
16275 self
16276 }
16277
16278 pub async fn send(self) -> Result<crate::model::Operation> {
16280 (*self.0.stub)
16281 .set_named_ports(self.0.request, self.0.options)
16282 .await
16283 .map(gax::response::Response::into_body)
16284 }
16285
16286 pub fn set_instance_group<T: Into<std::string::String>>(mut self, v: T) -> Self {
16288 self.0.request.instance_group = v.into();
16289 self
16290 }
16291
16292 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16294 self.0.request.project = v.into();
16295 self
16296 }
16297
16298 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16300 self.0.request.region = v.into();
16301 self
16302 }
16303
16304 pub fn set_request_id<T>(mut self, v: T) -> Self
16306 where
16307 T: std::convert::Into<std::string::String>,
16308 {
16309 self.0.request.request_id = std::option::Option::Some(v.into());
16310 self
16311 }
16312
16313 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
16315 where
16316 T: std::convert::Into<std::string::String>,
16317 {
16318 self.0.request.request_id = v.map(|x| x.into());
16319 self
16320 }
16321
16322 pub fn set_body<T>(mut self, v: T) -> Self
16324 where
16325 T: std::convert::Into<crate::model::RegionInstanceGroupsSetNamedPortsRequest>,
16326 {
16327 self.0.request.body = std::option::Option::Some(v.into());
16328 self
16329 }
16330
16331 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16333 where
16334 T: std::convert::Into<crate::model::RegionInstanceGroupsSetNamedPortsRequest>,
16335 {
16336 self.0.request.body = v.map(|x| x.into());
16337 self
16338 }
16339 }
16340
16341 #[doc(hidden)]
16342 impl gax::options::internal::RequestBuilder for SetNamedPorts {
16343 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16344 &mut self.0.options
16345 }
16346 }
16347
16348 #[derive(Clone, Debug)]
16366 pub struct TestIamPermissions(
16367 RequestBuilder<crate::model::region_instance_groups::TestIamPermissionsRequest>,
16368 );
16369
16370 impl TestIamPermissions {
16371 pub(crate) fn new(
16372 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceGroups>,
16373 ) -> Self {
16374 Self(RequestBuilder::new(stub))
16375 }
16376
16377 pub fn with_request<
16379 V: Into<crate::model::region_instance_groups::TestIamPermissionsRequest>,
16380 >(
16381 mut self,
16382 v: V,
16383 ) -> Self {
16384 self.0.request = v.into();
16385 self
16386 }
16387
16388 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16390 self.0.options = v.into();
16391 self
16392 }
16393
16394 pub async fn send(self) -> Result<crate::model::TestPermissionsResponse> {
16396 (*self.0.stub)
16397 .test_iam_permissions(self.0.request, self.0.options)
16398 .await
16399 .map(gax::response::Response::into_body)
16400 }
16401
16402 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16404 self.0.request.project = v.into();
16405 self
16406 }
16407
16408 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16410 self.0.request.region = v.into();
16411 self
16412 }
16413
16414 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
16416 self.0.request.resource = v.into();
16417 self
16418 }
16419
16420 pub fn set_body<T>(mut self, v: T) -> Self
16422 where
16423 T: std::convert::Into<crate::model::TestPermissionsRequest>,
16424 {
16425 self.0.request.body = std::option::Option::Some(v.into());
16426 self
16427 }
16428
16429 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16431 where
16432 T: std::convert::Into<crate::model::TestPermissionsRequest>,
16433 {
16434 self.0.request.body = v.map(|x| x.into());
16435 self
16436 }
16437 }
16438
16439 #[doc(hidden)]
16440 impl gax::options::internal::RequestBuilder for TestIamPermissions {
16441 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16442 &mut self.0.options
16443 }
16444 }
16445}
16446
16447#[cfg(feature = "region-instance-templates")]
16448#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
16449pub mod region_instance_templates {
16450 use crate::Result;
16451
16452 pub type ClientBuilder =
16466 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
16467
16468 pub(crate) mod client {
16469 use super::super::super::client::RegionInstanceTemplates;
16470 pub struct Factory;
16471 impl gax::client_builder::internal::ClientFactory for Factory {
16472 type Client = RegionInstanceTemplates;
16473 type Credentials = gaxi::options::Credentials;
16474 async fn build(
16475 self,
16476 config: gaxi::options::ClientConfig,
16477 ) -> gax::client_builder::Result<Self::Client> {
16478 Self::Client::new(config).await
16479 }
16480 }
16481 }
16482
16483 #[derive(Clone, Debug)]
16485 pub(crate) struct RequestBuilder<R: std::default::Default> {
16486 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16487 request: R,
16488 options: gax::options::RequestOptions,
16489 }
16490
16491 impl<R> RequestBuilder<R>
16492 where
16493 R: std::default::Default,
16494 {
16495 pub(crate) fn new(
16496 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16497 ) -> Self {
16498 Self {
16499 stub,
16500 request: R::default(),
16501 options: gax::options::RequestOptions::default(),
16502 }
16503 }
16504 }
16505
16506 #[derive(Clone, Debug)]
16524 pub struct Delete(RequestBuilder<crate::model::region_instance_templates::DeleteRequest>);
16525
16526 impl Delete {
16527 pub(crate) fn new(
16528 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16529 ) -> Self {
16530 Self(RequestBuilder::new(stub))
16531 }
16532
16533 pub fn with_request<V: Into<crate::model::region_instance_templates::DeleteRequest>>(
16535 mut self,
16536 v: V,
16537 ) -> Self {
16538 self.0.request = v.into();
16539 self
16540 }
16541
16542 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16544 self.0.options = v.into();
16545 self
16546 }
16547
16548 pub async fn send(self) -> Result<crate::model::Operation> {
16550 (*self.0.stub)
16551 .delete(self.0.request, self.0.options)
16552 .await
16553 .map(gax::response::Response::into_body)
16554 }
16555
16556 pub fn set_instance_template<T: Into<std::string::String>>(mut self, v: T) -> Self {
16558 self.0.request.instance_template = v.into();
16559 self
16560 }
16561
16562 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16564 self.0.request.project = v.into();
16565 self
16566 }
16567
16568 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16570 self.0.request.region = v.into();
16571 self
16572 }
16573
16574 pub fn set_request_id<T>(mut self, v: T) -> Self
16576 where
16577 T: std::convert::Into<std::string::String>,
16578 {
16579 self.0.request.request_id = std::option::Option::Some(v.into());
16580 self
16581 }
16582
16583 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
16585 where
16586 T: std::convert::Into<std::string::String>,
16587 {
16588 self.0.request.request_id = v.map(|x| x.into());
16589 self
16590 }
16591 }
16592
16593 #[doc(hidden)]
16594 impl gax::options::internal::RequestBuilder for Delete {
16595 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16596 &mut self.0.options
16597 }
16598 }
16599
16600 #[derive(Clone, Debug)]
16618 pub struct Get(RequestBuilder<crate::model::region_instance_templates::GetRequest>);
16619
16620 impl Get {
16621 pub(crate) fn new(
16622 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16623 ) -> Self {
16624 Self(RequestBuilder::new(stub))
16625 }
16626
16627 pub fn with_request<V: Into<crate::model::region_instance_templates::GetRequest>>(
16629 mut self,
16630 v: V,
16631 ) -> Self {
16632 self.0.request = v.into();
16633 self
16634 }
16635
16636 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16638 self.0.options = v.into();
16639 self
16640 }
16641
16642 pub async fn send(self) -> Result<crate::model::InstanceTemplate> {
16644 (*self.0.stub)
16645 .get(self.0.request, self.0.options)
16646 .await
16647 .map(gax::response::Response::into_body)
16648 }
16649
16650 pub fn set_instance_template<T: Into<std::string::String>>(mut self, v: T) -> Self {
16652 self.0.request.instance_template = v.into();
16653 self
16654 }
16655
16656 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16658 self.0.request.project = v.into();
16659 self
16660 }
16661
16662 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16664 self.0.request.region = v.into();
16665 self
16666 }
16667 }
16668
16669 #[doc(hidden)]
16670 impl gax::options::internal::RequestBuilder for Get {
16671 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16672 &mut self.0.options
16673 }
16674 }
16675
16676 #[derive(Clone, Debug)]
16694 pub struct Insert(RequestBuilder<crate::model::region_instance_templates::InsertRequest>);
16695
16696 impl Insert {
16697 pub(crate) fn new(
16698 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16699 ) -> Self {
16700 Self(RequestBuilder::new(stub))
16701 }
16702
16703 pub fn with_request<V: Into<crate::model::region_instance_templates::InsertRequest>>(
16705 mut self,
16706 v: V,
16707 ) -> Self {
16708 self.0.request = v.into();
16709 self
16710 }
16711
16712 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16714 self.0.options = v.into();
16715 self
16716 }
16717
16718 pub async fn send(self) -> Result<crate::model::Operation> {
16720 (*self.0.stub)
16721 .insert(self.0.request, self.0.options)
16722 .await
16723 .map(gax::response::Response::into_body)
16724 }
16725
16726 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16728 self.0.request.project = v.into();
16729 self
16730 }
16731
16732 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16734 self.0.request.region = v.into();
16735 self
16736 }
16737
16738 pub fn set_request_id<T>(mut self, v: T) -> Self
16740 where
16741 T: std::convert::Into<std::string::String>,
16742 {
16743 self.0.request.request_id = std::option::Option::Some(v.into());
16744 self
16745 }
16746
16747 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
16749 where
16750 T: std::convert::Into<std::string::String>,
16751 {
16752 self.0.request.request_id = v.map(|x| x.into());
16753 self
16754 }
16755
16756 pub fn set_body<T>(mut self, v: T) -> Self
16758 where
16759 T: std::convert::Into<crate::model::InstanceTemplate>,
16760 {
16761 self.0.request.body = std::option::Option::Some(v.into());
16762 self
16763 }
16764
16765 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16767 where
16768 T: std::convert::Into<crate::model::InstanceTemplate>,
16769 {
16770 self.0.request.body = v.map(|x| x.into());
16771 self
16772 }
16773 }
16774
16775 #[doc(hidden)]
16776 impl gax::options::internal::RequestBuilder for Insert {
16777 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16778 &mut self.0.options
16779 }
16780 }
16781
16782 #[derive(Clone, Debug)]
16804 pub struct List(RequestBuilder<crate::model::region_instance_templates::ListRequest>);
16805
16806 impl List {
16807 pub(crate) fn new(
16808 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstanceTemplates>,
16809 ) -> Self {
16810 Self(RequestBuilder::new(stub))
16811 }
16812
16813 pub fn with_request<V: Into<crate::model::region_instance_templates::ListRequest>>(
16815 mut self,
16816 v: V,
16817 ) -> Self {
16818 self.0.request = v.into();
16819 self
16820 }
16821
16822 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16824 self.0.options = v.into();
16825 self
16826 }
16827
16828 pub async fn send(self) -> Result<crate::model::InstanceTemplateList> {
16830 (*self.0.stub)
16831 .list(self.0.request, self.0.options)
16832 .await
16833 .map(gax::response::Response::into_body)
16834 }
16835
16836 pub fn by_page(
16838 self,
16839 ) -> impl gax::paginator::Paginator<crate::model::InstanceTemplateList, gax::error::Error>
16840 {
16841 use std::clone::Clone;
16842 let token = self.0.request.page_token.clone().unwrap_or_default();
16843 let execute = move |token: String| {
16844 let mut builder = self.clone();
16845 builder.0.request = builder.0.request.set_page_token(token);
16846 builder.send()
16847 };
16848 gax::paginator::internal::new_paginator(token, execute)
16849 }
16850
16851 pub fn by_item(
16853 self,
16854 ) -> impl gax::paginator::ItemPaginator<crate::model::InstanceTemplateList, gax::error::Error>
16855 {
16856 use gax::paginator::Paginator;
16857 self.by_page().items()
16858 }
16859
16860 pub fn set_filter<T>(mut self, v: T) -> Self
16862 where
16863 T: std::convert::Into<std::string::String>,
16864 {
16865 self.0.request.filter = std::option::Option::Some(v.into());
16866 self
16867 }
16868
16869 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16871 where
16872 T: std::convert::Into<std::string::String>,
16873 {
16874 self.0.request.filter = v.map(|x| x.into());
16875 self
16876 }
16877
16878 pub fn set_max_results<T>(mut self, v: T) -> Self
16880 where
16881 T: std::convert::Into<u32>,
16882 {
16883 self.0.request.max_results = std::option::Option::Some(v.into());
16884 self
16885 }
16886
16887 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
16889 where
16890 T: std::convert::Into<u32>,
16891 {
16892 self.0.request.max_results = v.map(|x| x.into());
16893 self
16894 }
16895
16896 pub fn set_order_by<T>(mut self, v: T) -> Self
16898 where
16899 T: std::convert::Into<std::string::String>,
16900 {
16901 self.0.request.order_by = std::option::Option::Some(v.into());
16902 self
16903 }
16904
16905 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
16907 where
16908 T: std::convert::Into<std::string::String>,
16909 {
16910 self.0.request.order_by = v.map(|x| x.into());
16911 self
16912 }
16913
16914 pub fn set_page_token<T>(mut self, v: T) -> Self
16916 where
16917 T: std::convert::Into<std::string::String>,
16918 {
16919 self.0.request.page_token = std::option::Option::Some(v.into());
16920 self
16921 }
16922
16923 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
16925 where
16926 T: std::convert::Into<std::string::String>,
16927 {
16928 self.0.request.page_token = v.map(|x| x.into());
16929 self
16930 }
16931
16932 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
16934 self.0.request.project = v.into();
16935 self
16936 }
16937
16938 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
16940 self.0.request.region = v.into();
16941 self
16942 }
16943
16944 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
16946 where
16947 T: std::convert::Into<bool>,
16948 {
16949 self.0.request.return_partial_success = std::option::Option::Some(v.into());
16950 self
16951 }
16952
16953 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
16955 where
16956 T: std::convert::Into<bool>,
16957 {
16958 self.0.request.return_partial_success = v.map(|x| x.into());
16959 self
16960 }
16961 }
16962
16963 #[doc(hidden)]
16964 impl gax::options::internal::RequestBuilder for List {
16965 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16966 &mut self.0.options
16967 }
16968 }
16969}
16970
16971#[cfg(feature = "region-instances")]
16972#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
16973pub mod region_instances {
16974 use crate::Result;
16975
16976 pub type ClientBuilder =
16990 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
16991
16992 pub(crate) mod client {
16993 use super::super::super::client::RegionInstances;
16994 pub struct Factory;
16995 impl gax::client_builder::internal::ClientFactory for Factory {
16996 type Client = RegionInstances;
16997 type Credentials = gaxi::options::Credentials;
16998 async fn build(
16999 self,
17000 config: gaxi::options::ClientConfig,
17001 ) -> gax::client_builder::Result<Self::Client> {
17002 Self::Client::new(config).await
17003 }
17004 }
17005 }
17006
17007 #[derive(Clone, Debug)]
17009 pub(crate) struct RequestBuilder<R: std::default::Default> {
17010 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstances>,
17011 request: R,
17012 options: gax::options::RequestOptions,
17013 }
17014
17015 impl<R> RequestBuilder<R>
17016 where
17017 R: std::default::Default,
17018 {
17019 pub(crate) fn new(
17020 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstances>,
17021 ) -> Self {
17022 Self {
17023 stub,
17024 request: R::default(),
17025 options: gax::options::RequestOptions::default(),
17026 }
17027 }
17028 }
17029
17030 #[derive(Clone, Debug)]
17048 pub struct BulkInsert(RequestBuilder<crate::model::region_instances::BulkInsertRequest>);
17049
17050 impl BulkInsert {
17051 pub(crate) fn new(
17052 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionInstances>,
17053 ) -> Self {
17054 Self(RequestBuilder::new(stub))
17055 }
17056
17057 pub fn with_request<V: Into<crate::model::region_instances::BulkInsertRequest>>(
17059 mut self,
17060 v: V,
17061 ) -> Self {
17062 self.0.request = v.into();
17063 self
17064 }
17065
17066 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17068 self.0.options = v.into();
17069 self
17070 }
17071
17072 pub async fn send(self) -> Result<crate::model::Operation> {
17074 (*self.0.stub)
17075 .bulk_insert(self.0.request, self.0.options)
17076 .await
17077 .map(gax::response::Response::into_body)
17078 }
17079
17080 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17082 self.0.request.project = v.into();
17083 self
17084 }
17085
17086 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
17088 self.0.request.region = v.into();
17089 self
17090 }
17091
17092 pub fn set_request_id<T>(mut self, v: T) -> Self
17094 where
17095 T: std::convert::Into<std::string::String>,
17096 {
17097 self.0.request.request_id = std::option::Option::Some(v.into());
17098 self
17099 }
17100
17101 pub fn set_or_clear_request_id<T>(mut self, v: std::option::Option<T>) -> Self
17103 where
17104 T: std::convert::Into<std::string::String>,
17105 {
17106 self.0.request.request_id = v.map(|x| x.into());
17107 self
17108 }
17109
17110 pub fn set_body<T>(mut self, v: T) -> Self
17112 where
17113 T: std::convert::Into<crate::model::BulkInsertInstanceResource>,
17114 {
17115 self.0.request.body = std::option::Option::Some(v.into());
17116 self
17117 }
17118
17119 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
17121 where
17122 T: std::convert::Into<crate::model::BulkInsertInstanceResource>,
17123 {
17124 self.0.request.body = v.map(|x| x.into());
17125 self
17126 }
17127 }
17128
17129 #[doc(hidden)]
17130 impl gax::options::internal::RequestBuilder for BulkInsert {
17131 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17132 &mut self.0.options
17133 }
17134 }
17135}
17136
17137#[cfg(feature = "region-operations")]
17138#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
17139pub mod region_operations {
17140 use crate::Result;
17141
17142 pub type ClientBuilder =
17156 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17157
17158 pub(crate) mod client {
17159 use super::super::super::client::RegionOperations;
17160 pub struct Factory;
17161 impl gax::client_builder::internal::ClientFactory for Factory {
17162 type Client = RegionOperations;
17163 type Credentials = gaxi::options::Credentials;
17164 async fn build(
17165 self,
17166 config: gaxi::options::ClientConfig,
17167 ) -> gax::client_builder::Result<Self::Client> {
17168 Self::Client::new(config).await
17169 }
17170 }
17171 }
17172
17173 #[derive(Clone, Debug)]
17175 pub(crate) struct RequestBuilder<R: std::default::Default> {
17176 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17177 request: R,
17178 options: gax::options::RequestOptions,
17179 }
17180
17181 impl<R> RequestBuilder<R>
17182 where
17183 R: std::default::Default,
17184 {
17185 pub(crate) fn new(
17186 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17187 ) -> Self {
17188 Self {
17189 stub,
17190 request: R::default(),
17191 options: gax::options::RequestOptions::default(),
17192 }
17193 }
17194 }
17195
17196 #[derive(Clone, Debug)]
17214 pub struct Delete(RequestBuilder<crate::model::region_operations::DeleteRequest>);
17215
17216 impl Delete {
17217 pub(crate) fn new(
17218 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17219 ) -> Self {
17220 Self(RequestBuilder::new(stub))
17221 }
17222
17223 pub fn with_request<V: Into<crate::model::region_operations::DeleteRequest>>(
17225 mut self,
17226 v: V,
17227 ) -> Self {
17228 self.0.request = v.into();
17229 self
17230 }
17231
17232 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17234 self.0.options = v.into();
17235 self
17236 }
17237
17238 pub async fn send(self) -> Result<wkt::Empty> {
17240 (*self.0.stub)
17241 .delete(self.0.request, self.0.options)
17242 .await
17243 .map(gax::response::Response::into_body)
17244 }
17245
17246 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
17248 self.0.request.operation = v.into();
17249 self
17250 }
17251
17252 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17254 self.0.request.project = v.into();
17255 self
17256 }
17257
17258 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
17260 self.0.request.region = v.into();
17261 self
17262 }
17263 }
17264
17265 #[doc(hidden)]
17266 impl gax::options::internal::RequestBuilder for Delete {
17267 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17268 &mut self.0.options
17269 }
17270 }
17271
17272 #[derive(Clone, Debug)]
17290 pub struct Get(RequestBuilder<crate::model::region_operations::GetRequest>);
17291
17292 impl Get {
17293 pub(crate) fn new(
17294 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17295 ) -> Self {
17296 Self(RequestBuilder::new(stub))
17297 }
17298
17299 pub fn with_request<V: Into<crate::model::region_operations::GetRequest>>(
17301 mut self,
17302 v: V,
17303 ) -> Self {
17304 self.0.request = v.into();
17305 self
17306 }
17307
17308 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17310 self.0.options = v.into();
17311 self
17312 }
17313
17314 pub async fn send(self) -> Result<crate::model::Operation> {
17316 (*self.0.stub)
17317 .get(self.0.request, self.0.options)
17318 .await
17319 .map(gax::response::Response::into_body)
17320 }
17321
17322 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
17324 self.0.request.operation = v.into();
17325 self
17326 }
17327
17328 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17330 self.0.request.project = v.into();
17331 self
17332 }
17333
17334 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
17336 self.0.request.region = v.into();
17337 self
17338 }
17339 }
17340
17341 #[doc(hidden)]
17342 impl gax::options::internal::RequestBuilder for Get {
17343 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17344 &mut self.0.options
17345 }
17346 }
17347
17348 #[derive(Clone, Debug)]
17370 pub struct List(RequestBuilder<crate::model::region_operations::ListRequest>);
17371
17372 impl List {
17373 pub(crate) fn new(
17374 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17375 ) -> Self {
17376 Self(RequestBuilder::new(stub))
17377 }
17378
17379 pub fn with_request<V: Into<crate::model::region_operations::ListRequest>>(
17381 mut self,
17382 v: V,
17383 ) -> Self {
17384 self.0.request = v.into();
17385 self
17386 }
17387
17388 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17390 self.0.options = v.into();
17391 self
17392 }
17393
17394 pub async fn send(self) -> Result<crate::model::OperationList> {
17396 (*self.0.stub)
17397 .list(self.0.request, self.0.options)
17398 .await
17399 .map(gax::response::Response::into_body)
17400 }
17401
17402 pub fn by_page(
17404 self,
17405 ) -> impl gax::paginator::Paginator<crate::model::OperationList, gax::error::Error>
17406 {
17407 use std::clone::Clone;
17408 let token = self.0.request.page_token.clone().unwrap_or_default();
17409 let execute = move |token: String| {
17410 let mut builder = self.clone();
17411 builder.0.request = builder.0.request.set_page_token(token);
17412 builder.send()
17413 };
17414 gax::paginator::internal::new_paginator(token, execute)
17415 }
17416
17417 pub fn by_item(
17419 self,
17420 ) -> impl gax::paginator::ItemPaginator<crate::model::OperationList, gax::error::Error>
17421 {
17422 use gax::paginator::Paginator;
17423 self.by_page().items()
17424 }
17425
17426 pub fn set_filter<T>(mut self, v: T) -> Self
17428 where
17429 T: std::convert::Into<std::string::String>,
17430 {
17431 self.0.request.filter = std::option::Option::Some(v.into());
17432 self
17433 }
17434
17435 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
17437 where
17438 T: std::convert::Into<std::string::String>,
17439 {
17440 self.0.request.filter = v.map(|x| x.into());
17441 self
17442 }
17443
17444 pub fn set_max_results<T>(mut self, v: T) -> Self
17446 where
17447 T: std::convert::Into<u32>,
17448 {
17449 self.0.request.max_results = std::option::Option::Some(v.into());
17450 self
17451 }
17452
17453 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
17455 where
17456 T: std::convert::Into<u32>,
17457 {
17458 self.0.request.max_results = v.map(|x| x.into());
17459 self
17460 }
17461
17462 pub fn set_order_by<T>(mut self, v: T) -> Self
17464 where
17465 T: std::convert::Into<std::string::String>,
17466 {
17467 self.0.request.order_by = std::option::Option::Some(v.into());
17468 self
17469 }
17470
17471 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
17473 where
17474 T: std::convert::Into<std::string::String>,
17475 {
17476 self.0.request.order_by = v.map(|x| x.into());
17477 self
17478 }
17479
17480 pub fn set_page_token<T>(mut self, v: T) -> Self
17482 where
17483 T: std::convert::Into<std::string::String>,
17484 {
17485 self.0.request.page_token = std::option::Option::Some(v.into());
17486 self
17487 }
17488
17489 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
17491 where
17492 T: std::convert::Into<std::string::String>,
17493 {
17494 self.0.request.page_token = v.map(|x| x.into());
17495 self
17496 }
17497
17498 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17500 self.0.request.project = v.into();
17501 self
17502 }
17503
17504 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
17506 self.0.request.region = v.into();
17507 self
17508 }
17509
17510 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
17512 where
17513 T: std::convert::Into<bool>,
17514 {
17515 self.0.request.return_partial_success = std::option::Option::Some(v.into());
17516 self
17517 }
17518
17519 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
17521 where
17522 T: std::convert::Into<bool>,
17523 {
17524 self.0.request.return_partial_success = v.map(|x| x.into());
17525 self
17526 }
17527 }
17528
17529 #[doc(hidden)]
17530 impl gax::options::internal::RequestBuilder for List {
17531 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17532 &mut self.0.options
17533 }
17534 }
17535
17536 #[derive(Clone, Debug)]
17554 pub struct Wait(RequestBuilder<crate::model::region_operations::WaitRequest>);
17555
17556 impl Wait {
17557 pub(crate) fn new(
17558 stub: std::sync::Arc<dyn super::super::stub::dynamic::RegionOperations>,
17559 ) -> Self {
17560 Self(RequestBuilder::new(stub))
17561 }
17562
17563 pub fn with_request<V: Into<crate::model::region_operations::WaitRequest>>(
17565 mut self,
17566 v: V,
17567 ) -> Self {
17568 self.0.request = v.into();
17569 self
17570 }
17571
17572 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17574 self.0.options = v.into();
17575 self
17576 }
17577
17578 pub async fn send(self) -> Result<crate::model::Operation> {
17580 (*self.0.stub)
17581 .wait(self.0.request, self.0.options)
17582 .await
17583 .map(gax::response::Response::into_body)
17584 }
17585
17586 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
17588 self.0.request.operation = v.into();
17589 self
17590 }
17591
17592 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17594 self.0.request.project = v.into();
17595 self
17596 }
17597
17598 pub fn set_region<T: Into<std::string::String>>(mut self, v: T) -> Self {
17600 self.0.request.region = v.into();
17601 self
17602 }
17603 }
17604
17605 #[doc(hidden)]
17606 impl gax::options::internal::RequestBuilder for Wait {
17607 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17608 &mut self.0.options
17609 }
17610 }
17611}
17612
17613#[cfg(feature = "zone-operations")]
17614#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
17615pub mod zone_operations {
17616 use crate::Result;
17617
17618 pub type ClientBuilder =
17632 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17633
17634 pub(crate) mod client {
17635 use super::super::super::client::ZoneOperations;
17636 pub struct Factory;
17637 impl gax::client_builder::internal::ClientFactory for Factory {
17638 type Client = ZoneOperations;
17639 type Credentials = gaxi::options::Credentials;
17640 async fn build(
17641 self,
17642 config: gaxi::options::ClientConfig,
17643 ) -> gax::client_builder::Result<Self::Client> {
17644 Self::Client::new(config).await
17645 }
17646 }
17647 }
17648
17649 #[derive(Clone, Debug)]
17651 pub(crate) struct RequestBuilder<R: std::default::Default> {
17652 stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
17653 request: R,
17654 options: gax::options::RequestOptions,
17655 }
17656
17657 impl<R> RequestBuilder<R>
17658 where
17659 R: std::default::Default,
17660 {
17661 pub(crate) fn new(
17662 stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
17663 ) -> Self {
17664 Self {
17665 stub,
17666 request: R::default(),
17667 options: gax::options::RequestOptions::default(),
17668 }
17669 }
17670 }
17671
17672 #[derive(Clone, Debug)]
17690 pub struct Delete(RequestBuilder<crate::model::zone_operations::DeleteRequest>);
17691
17692 impl Delete {
17693 pub(crate) fn new(
17694 stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
17695 ) -> Self {
17696 Self(RequestBuilder::new(stub))
17697 }
17698
17699 pub fn with_request<V: Into<crate::model::zone_operations::DeleteRequest>>(
17701 mut self,
17702 v: V,
17703 ) -> Self {
17704 self.0.request = v.into();
17705 self
17706 }
17707
17708 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17710 self.0.options = v.into();
17711 self
17712 }
17713
17714 pub async fn send(self) -> Result<wkt::Empty> {
17716 (*self.0.stub)
17717 .delete(self.0.request, self.0.options)
17718 .await
17719 .map(gax::response::Response::into_body)
17720 }
17721
17722 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
17724 self.0.request.operation = v.into();
17725 self
17726 }
17727
17728 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17730 self.0.request.project = v.into();
17731 self
17732 }
17733
17734 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
17736 self.0.request.zone = v.into();
17737 self
17738 }
17739 }
17740
17741 #[doc(hidden)]
17742 impl gax::options::internal::RequestBuilder for Delete {
17743 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17744 &mut self.0.options
17745 }
17746 }
17747
17748 #[derive(Clone, Debug)]
17766 pub struct Get(RequestBuilder<crate::model::zone_operations::GetRequest>);
17767
17768 impl Get {
17769 pub(crate) fn new(
17770 stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
17771 ) -> Self {
17772 Self(RequestBuilder::new(stub))
17773 }
17774
17775 pub fn with_request<V: Into<crate::model::zone_operations::GetRequest>>(
17777 mut self,
17778 v: V,
17779 ) -> Self {
17780 self.0.request = v.into();
17781 self
17782 }
17783
17784 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17786 self.0.options = v.into();
17787 self
17788 }
17789
17790 pub async fn send(self) -> Result<crate::model::Operation> {
17792 (*self.0.stub)
17793 .get(self.0.request, self.0.options)
17794 .await
17795 .map(gax::response::Response::into_body)
17796 }
17797
17798 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
17800 self.0.request.operation = v.into();
17801 self
17802 }
17803
17804 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17806 self.0.request.project = v.into();
17807 self
17808 }
17809
17810 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
17812 self.0.request.zone = v.into();
17813 self
17814 }
17815 }
17816
17817 #[doc(hidden)]
17818 impl gax::options::internal::RequestBuilder for Get {
17819 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17820 &mut self.0.options
17821 }
17822 }
17823
17824 #[derive(Clone, Debug)]
17846 pub struct List(RequestBuilder<crate::model::zone_operations::ListRequest>);
17847
17848 impl List {
17849 pub(crate) fn new(
17850 stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
17851 ) -> Self {
17852 Self(RequestBuilder::new(stub))
17853 }
17854
17855 pub fn with_request<V: Into<crate::model::zone_operations::ListRequest>>(
17857 mut self,
17858 v: V,
17859 ) -> Self {
17860 self.0.request = v.into();
17861 self
17862 }
17863
17864 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17866 self.0.options = v.into();
17867 self
17868 }
17869
17870 pub async fn send(self) -> Result<crate::model::OperationList> {
17872 (*self.0.stub)
17873 .list(self.0.request, self.0.options)
17874 .await
17875 .map(gax::response::Response::into_body)
17876 }
17877
17878 pub fn by_page(
17880 self,
17881 ) -> impl gax::paginator::Paginator<crate::model::OperationList, gax::error::Error>
17882 {
17883 use std::clone::Clone;
17884 let token = self.0.request.page_token.clone().unwrap_or_default();
17885 let execute = move |token: String| {
17886 let mut builder = self.clone();
17887 builder.0.request = builder.0.request.set_page_token(token);
17888 builder.send()
17889 };
17890 gax::paginator::internal::new_paginator(token, execute)
17891 }
17892
17893 pub fn by_item(
17895 self,
17896 ) -> impl gax::paginator::ItemPaginator<crate::model::OperationList, gax::error::Error>
17897 {
17898 use gax::paginator::Paginator;
17899 self.by_page().items()
17900 }
17901
17902 pub fn set_filter<T>(mut self, v: T) -> Self
17904 where
17905 T: std::convert::Into<std::string::String>,
17906 {
17907 self.0.request.filter = std::option::Option::Some(v.into());
17908 self
17909 }
17910
17911 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
17913 where
17914 T: std::convert::Into<std::string::String>,
17915 {
17916 self.0.request.filter = v.map(|x| x.into());
17917 self
17918 }
17919
17920 pub fn set_max_results<T>(mut self, v: T) -> Self
17922 where
17923 T: std::convert::Into<u32>,
17924 {
17925 self.0.request.max_results = std::option::Option::Some(v.into());
17926 self
17927 }
17928
17929 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
17931 where
17932 T: std::convert::Into<u32>,
17933 {
17934 self.0.request.max_results = v.map(|x| x.into());
17935 self
17936 }
17937
17938 pub fn set_order_by<T>(mut self, v: T) -> Self
17940 where
17941 T: std::convert::Into<std::string::String>,
17942 {
17943 self.0.request.order_by = std::option::Option::Some(v.into());
17944 self
17945 }
17946
17947 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
17949 where
17950 T: std::convert::Into<std::string::String>,
17951 {
17952 self.0.request.order_by = v.map(|x| x.into());
17953 self
17954 }
17955
17956 pub fn set_page_token<T>(mut self, v: T) -> Self
17958 where
17959 T: std::convert::Into<std::string::String>,
17960 {
17961 self.0.request.page_token = std::option::Option::Some(v.into());
17962 self
17963 }
17964
17965 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
17967 where
17968 T: std::convert::Into<std::string::String>,
17969 {
17970 self.0.request.page_token = v.map(|x| x.into());
17971 self
17972 }
17973
17974 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
17976 self.0.request.project = v.into();
17977 self
17978 }
17979
17980 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
17982 where
17983 T: std::convert::Into<bool>,
17984 {
17985 self.0.request.return_partial_success = std::option::Option::Some(v.into());
17986 self
17987 }
17988
17989 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
17991 where
17992 T: std::convert::Into<bool>,
17993 {
17994 self.0.request.return_partial_success = v.map(|x| x.into());
17995 self
17996 }
17997
17998 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
18000 self.0.request.zone = v.into();
18001 self
18002 }
18003 }
18004
18005 #[doc(hidden)]
18006 impl gax::options::internal::RequestBuilder for List {
18007 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18008 &mut self.0.options
18009 }
18010 }
18011
18012 #[derive(Clone, Debug)]
18030 pub struct Wait(RequestBuilder<crate::model::zone_operations::WaitRequest>);
18031
18032 impl Wait {
18033 pub(crate) fn new(
18034 stub: std::sync::Arc<dyn super::super::stub::dynamic::ZoneOperations>,
18035 ) -> Self {
18036 Self(RequestBuilder::new(stub))
18037 }
18038
18039 pub fn with_request<V: Into<crate::model::zone_operations::WaitRequest>>(
18041 mut self,
18042 v: V,
18043 ) -> Self {
18044 self.0.request = v.into();
18045 self
18046 }
18047
18048 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18050 self.0.options = v.into();
18051 self
18052 }
18053
18054 pub async fn send(self) -> Result<crate::model::Operation> {
18056 (*self.0.stub)
18057 .wait(self.0.request, self.0.options)
18058 .await
18059 .map(gax::response::Response::into_body)
18060 }
18061
18062 pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
18064 self.0.request.operation = v.into();
18065 self
18066 }
18067
18068 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
18070 self.0.request.project = v.into();
18071 self
18072 }
18073
18074 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
18076 self.0.request.zone = v.into();
18077 self
18078 }
18079 }
18080
18081 #[doc(hidden)]
18082 impl gax::options::internal::RequestBuilder for Wait {
18083 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18084 &mut self.0.options
18085 }
18086 }
18087}
18088
18089#[cfg(feature = "zones")]
18090#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
18091pub mod zones {
18092 use crate::Result;
18093
18094 pub type ClientBuilder =
18108 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
18109
18110 pub(crate) mod client {
18111 use super::super::super::client::Zones;
18112 pub struct Factory;
18113 impl gax::client_builder::internal::ClientFactory for Factory {
18114 type Client = Zones;
18115 type Credentials = gaxi::options::Credentials;
18116 async fn build(
18117 self,
18118 config: gaxi::options::ClientConfig,
18119 ) -> gax::client_builder::Result<Self::Client> {
18120 Self::Client::new(config).await
18121 }
18122 }
18123 }
18124
18125 #[derive(Clone, Debug)]
18127 pub(crate) struct RequestBuilder<R: std::default::Default> {
18128 stub: std::sync::Arc<dyn super::super::stub::dynamic::Zones>,
18129 request: R,
18130 options: gax::options::RequestOptions,
18131 }
18132
18133 impl<R> RequestBuilder<R>
18134 where
18135 R: std::default::Default,
18136 {
18137 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Zones>) -> Self {
18138 Self {
18139 stub,
18140 request: R::default(),
18141 options: gax::options::RequestOptions::default(),
18142 }
18143 }
18144 }
18145
18146 #[derive(Clone, Debug)]
18164 pub struct Get(RequestBuilder<crate::model::zones::GetRequest>);
18165
18166 impl Get {
18167 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Zones>) -> Self {
18168 Self(RequestBuilder::new(stub))
18169 }
18170
18171 pub fn with_request<V: Into<crate::model::zones::GetRequest>>(mut self, v: V) -> Self {
18173 self.0.request = v.into();
18174 self
18175 }
18176
18177 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18179 self.0.options = v.into();
18180 self
18181 }
18182
18183 pub async fn send(self) -> Result<crate::model::Zone> {
18185 (*self.0.stub)
18186 .get(self.0.request, self.0.options)
18187 .await
18188 .map(gax::response::Response::into_body)
18189 }
18190
18191 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
18193 self.0.request.project = v.into();
18194 self
18195 }
18196
18197 pub fn set_zone<T: Into<std::string::String>>(mut self, v: T) -> Self {
18199 self.0.request.zone = v.into();
18200 self
18201 }
18202 }
18203
18204 #[doc(hidden)]
18205 impl gax::options::internal::RequestBuilder for Get {
18206 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18207 &mut self.0.options
18208 }
18209 }
18210
18211 #[derive(Clone, Debug)]
18233 pub struct List(RequestBuilder<crate::model::zones::ListRequest>);
18234
18235 impl List {
18236 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Zones>) -> Self {
18237 Self(RequestBuilder::new(stub))
18238 }
18239
18240 pub fn with_request<V: Into<crate::model::zones::ListRequest>>(mut self, v: V) -> Self {
18242 self.0.request = v.into();
18243 self
18244 }
18245
18246 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18248 self.0.options = v.into();
18249 self
18250 }
18251
18252 pub async fn send(self) -> Result<crate::model::ZoneList> {
18254 (*self.0.stub)
18255 .list(self.0.request, self.0.options)
18256 .await
18257 .map(gax::response::Response::into_body)
18258 }
18259
18260 pub fn by_page(
18262 self,
18263 ) -> impl gax::paginator::Paginator<crate::model::ZoneList, gax::error::Error> {
18264 use std::clone::Clone;
18265 let token = self.0.request.page_token.clone().unwrap_or_default();
18266 let execute = move |token: String| {
18267 let mut builder = self.clone();
18268 builder.0.request = builder.0.request.set_page_token(token);
18269 builder.send()
18270 };
18271 gax::paginator::internal::new_paginator(token, execute)
18272 }
18273
18274 pub fn by_item(
18276 self,
18277 ) -> impl gax::paginator::ItemPaginator<crate::model::ZoneList, gax::error::Error> {
18278 use gax::paginator::Paginator;
18279 self.by_page().items()
18280 }
18281
18282 pub fn set_filter<T>(mut self, v: T) -> Self
18284 where
18285 T: std::convert::Into<std::string::String>,
18286 {
18287 self.0.request.filter = std::option::Option::Some(v.into());
18288 self
18289 }
18290
18291 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
18293 where
18294 T: std::convert::Into<std::string::String>,
18295 {
18296 self.0.request.filter = v.map(|x| x.into());
18297 self
18298 }
18299
18300 pub fn set_max_results<T>(mut self, v: T) -> Self
18302 where
18303 T: std::convert::Into<u32>,
18304 {
18305 self.0.request.max_results = std::option::Option::Some(v.into());
18306 self
18307 }
18308
18309 pub fn set_or_clear_max_results<T>(mut self, v: std::option::Option<T>) -> Self
18311 where
18312 T: std::convert::Into<u32>,
18313 {
18314 self.0.request.max_results = v.map(|x| x.into());
18315 self
18316 }
18317
18318 pub fn set_order_by<T>(mut self, v: T) -> Self
18320 where
18321 T: std::convert::Into<std::string::String>,
18322 {
18323 self.0.request.order_by = std::option::Option::Some(v.into());
18324 self
18325 }
18326
18327 pub fn set_or_clear_order_by<T>(mut self, v: std::option::Option<T>) -> Self
18329 where
18330 T: std::convert::Into<std::string::String>,
18331 {
18332 self.0.request.order_by = v.map(|x| x.into());
18333 self
18334 }
18335
18336 pub fn set_page_token<T>(mut self, v: T) -> Self
18338 where
18339 T: std::convert::Into<std::string::String>,
18340 {
18341 self.0.request.page_token = std::option::Option::Some(v.into());
18342 self
18343 }
18344
18345 pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
18347 where
18348 T: std::convert::Into<std::string::String>,
18349 {
18350 self.0.request.page_token = v.map(|x| x.into());
18351 self
18352 }
18353
18354 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
18356 self.0.request.project = v.into();
18357 self
18358 }
18359
18360 pub fn set_return_partial_success<T>(mut self, v: T) -> Self
18362 where
18363 T: std::convert::Into<bool>,
18364 {
18365 self.0.request.return_partial_success = std::option::Option::Some(v.into());
18366 self
18367 }
18368
18369 pub fn set_or_clear_return_partial_success<T>(mut self, v: std::option::Option<T>) -> Self
18371 where
18372 T: std::convert::Into<bool>,
18373 {
18374 self.0.request.return_partial_success = v.map(|x| x.into());
18375 self
18376 }
18377 }
18378
18379 #[doc(hidden)]
18380 impl gax::options::internal::RequestBuilder for List {
18381 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18382 &mut self.0.options
18383 }
18384 }
18385}