1pub mod bare_metal_solution {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::BareMetalSolution;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = BareMetalSolution;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
96 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
97
98 impl ListInstances {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
107 self.0.request = v.into();
108 self
109 }
110
111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113 self.0.options = v.into();
114 self
115 }
116
117 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
119 (*self.0.stub)
120 .list_instances(self.0.request, self.0.options)
121 .await
122 .map(gax::response::Response::into_body)
123 }
124
125 pub fn by_page(
127 self,
128 ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
129 {
130 use std::clone::Clone;
131 let token = self.0.request.page_token.clone();
132 let execute = move |token: String| {
133 let mut builder = self.clone();
134 builder.0.request = builder.0.request.set_page_token(token);
135 builder.send()
136 };
137 gax::paginator::internal::new_paginator(token, execute)
138 }
139
140 pub fn by_item(
142 self,
143 ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
144 {
145 use gax::paginator::Paginator;
146 self.by_page().items()
147 }
148
149 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153 self.0.request.parent = v.into();
154 self
155 }
156
157 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159 self.0.request.page_size = v.into();
160 self
161 }
162
163 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165 self.0.request.page_token = v.into();
166 self
167 }
168
169 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.filter = v.into();
172 self
173 }
174 }
175
176 #[doc(hidden)]
177 impl gax::options::internal::RequestBuilder for ListInstances {
178 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
179 &mut self.0.options
180 }
181 }
182
183 #[derive(Clone, Debug)]
201 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
202
203 impl GetInstance {
204 pub(crate) fn new(
205 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
206 ) -> Self {
207 Self(RequestBuilder::new(stub))
208 }
209
210 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
212 self.0.request = v.into();
213 self
214 }
215
216 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
218 self.0.options = v.into();
219 self
220 }
221
222 pub async fn send(self) -> Result<crate::model::Instance> {
224 (*self.0.stub)
225 .get_instance(self.0.request, self.0.options)
226 .await
227 .map(gax::response::Response::into_body)
228 }
229
230 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
234 self.0.request.name = v.into();
235 self
236 }
237 }
238
239 #[doc(hidden)]
240 impl gax::options::internal::RequestBuilder for GetInstance {
241 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
242 &mut self.0.options
243 }
244 }
245
246 #[derive(Clone, Debug)]
265 pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
266
267 impl UpdateInstance {
268 pub(crate) fn new(
269 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
270 ) -> Self {
271 Self(RequestBuilder::new(stub))
272 }
273
274 pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
276 self.0.request = v.into();
277 self
278 }
279
280 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
282 self.0.options = v.into();
283 self
284 }
285
286 pub async fn send(self) -> Result<longrunning::model::Operation> {
293 (*self.0.stub)
294 .update_instance(self.0.request, self.0.options)
295 .await
296 .map(gax::response::Response::into_body)
297 }
298
299 pub fn poller(
301 self,
302 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
303 type Operation =
304 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
305 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
306 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
307
308 let stub = self.0.stub.clone();
309 let mut options = self.0.options.clone();
310 options.set_retry_policy(gax::retry_policy::NeverRetry);
311 let query = move |name| {
312 let stub = stub.clone();
313 let options = options.clone();
314 async {
315 let op = GetOperation::new(stub)
316 .set_name(name)
317 .with_options(options)
318 .send()
319 .await?;
320 Ok(Operation::new(op))
321 }
322 };
323
324 let start = move || async {
325 let op = self.send().await?;
326 Ok(Operation::new(op))
327 };
328
329 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
330 }
331
332 pub fn set_instance<T>(mut self, v: T) -> Self
336 where
337 T: std::convert::Into<crate::model::Instance>,
338 {
339 self.0.request.instance = std::option::Option::Some(v.into());
340 self
341 }
342
343 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
347 where
348 T: std::convert::Into<crate::model::Instance>,
349 {
350 self.0.request.instance = v.map(|x| x.into());
351 self
352 }
353
354 pub fn set_update_mask<T>(mut self, v: T) -> Self
356 where
357 T: std::convert::Into<wkt::FieldMask>,
358 {
359 self.0.request.update_mask = std::option::Option::Some(v.into());
360 self
361 }
362
363 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
365 where
366 T: std::convert::Into<wkt::FieldMask>,
367 {
368 self.0.request.update_mask = v.map(|x| x.into());
369 self
370 }
371 }
372
373 #[doc(hidden)]
374 impl gax::options::internal::RequestBuilder for UpdateInstance {
375 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
376 &mut self.0.options
377 }
378 }
379
380 #[derive(Clone, Debug)]
398 pub struct RenameInstance(RequestBuilder<crate::model::RenameInstanceRequest>);
399
400 impl RenameInstance {
401 pub(crate) fn new(
402 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
403 ) -> Self {
404 Self(RequestBuilder::new(stub))
405 }
406
407 pub fn with_request<V: Into<crate::model::RenameInstanceRequest>>(mut self, v: V) -> Self {
409 self.0.request = v.into();
410 self
411 }
412
413 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
415 self.0.options = v.into();
416 self
417 }
418
419 pub async fn send(self) -> Result<crate::model::Instance> {
421 (*self.0.stub)
422 .rename_instance(self.0.request, self.0.options)
423 .await
424 .map(gax::response::Response::into_body)
425 }
426
427 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
431 self.0.request.name = v.into();
432 self
433 }
434
435 pub fn set_new_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
439 self.0.request.new_instance_id = v.into();
440 self
441 }
442 }
443
444 #[doc(hidden)]
445 impl gax::options::internal::RequestBuilder for RenameInstance {
446 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
447 &mut self.0.options
448 }
449 }
450
451 #[derive(Clone, Debug)]
470 pub struct ResetInstance(RequestBuilder<crate::model::ResetInstanceRequest>);
471
472 impl ResetInstance {
473 pub(crate) fn new(
474 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
475 ) -> Self {
476 Self(RequestBuilder::new(stub))
477 }
478
479 pub fn with_request<V: Into<crate::model::ResetInstanceRequest>>(mut self, v: V) -> Self {
481 self.0.request = v.into();
482 self
483 }
484
485 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
487 self.0.options = v.into();
488 self
489 }
490
491 pub async fn send(self) -> Result<longrunning::model::Operation> {
498 (*self.0.stub)
499 .reset_instance(self.0.request, self.0.options)
500 .await
501 .map(gax::response::Response::into_body)
502 }
503
504 pub fn poller(
506 self,
507 ) -> impl lro::Poller<crate::model::ResetInstanceResponse, crate::model::OperationMetadata>
508 {
509 type Operation = lro::internal::Operation<
510 crate::model::ResetInstanceResponse,
511 crate::model::OperationMetadata,
512 >;
513 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
514 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
515
516 let stub = self.0.stub.clone();
517 let mut options = self.0.options.clone();
518 options.set_retry_policy(gax::retry_policy::NeverRetry);
519 let query = move |name| {
520 let stub = stub.clone();
521 let options = options.clone();
522 async {
523 let op = GetOperation::new(stub)
524 .set_name(name)
525 .with_options(options)
526 .send()
527 .await?;
528 Ok(Operation::new(op))
529 }
530 };
531
532 let start = move || async {
533 let op = self.send().await?;
534 Ok(Operation::new(op))
535 };
536
537 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
538 }
539
540 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
544 self.0.request.name = v.into();
545 self
546 }
547 }
548
549 #[doc(hidden)]
550 impl gax::options::internal::RequestBuilder for ResetInstance {
551 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
552 &mut self.0.options
553 }
554 }
555
556 #[derive(Clone, Debug)]
575 pub struct StartInstance(RequestBuilder<crate::model::StartInstanceRequest>);
576
577 impl StartInstance {
578 pub(crate) fn new(
579 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
580 ) -> Self {
581 Self(RequestBuilder::new(stub))
582 }
583
584 pub fn with_request<V: Into<crate::model::StartInstanceRequest>>(mut self, v: V) -> Self {
586 self.0.request = v.into();
587 self
588 }
589
590 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
592 self.0.options = v.into();
593 self
594 }
595
596 pub async fn send(self) -> Result<longrunning::model::Operation> {
603 (*self.0.stub)
604 .start_instance(self.0.request, self.0.options)
605 .await
606 .map(gax::response::Response::into_body)
607 }
608
609 pub fn poller(
611 self,
612 ) -> impl lro::Poller<crate::model::StartInstanceResponse, crate::model::OperationMetadata>
613 {
614 type Operation = lro::internal::Operation<
615 crate::model::StartInstanceResponse,
616 crate::model::OperationMetadata,
617 >;
618 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
619 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
620
621 let stub = self.0.stub.clone();
622 let mut options = self.0.options.clone();
623 options.set_retry_policy(gax::retry_policy::NeverRetry);
624 let query = move |name| {
625 let stub = stub.clone();
626 let options = options.clone();
627 async {
628 let op = GetOperation::new(stub)
629 .set_name(name)
630 .with_options(options)
631 .send()
632 .await?;
633 Ok(Operation::new(op))
634 }
635 };
636
637 let start = move || async {
638 let op = self.send().await?;
639 Ok(Operation::new(op))
640 };
641
642 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
643 }
644
645 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
649 self.0.request.name = v.into();
650 self
651 }
652 }
653
654 #[doc(hidden)]
655 impl gax::options::internal::RequestBuilder for StartInstance {
656 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
657 &mut self.0.options
658 }
659 }
660
661 #[derive(Clone, Debug)]
680 pub struct StopInstance(RequestBuilder<crate::model::StopInstanceRequest>);
681
682 impl StopInstance {
683 pub(crate) fn new(
684 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
685 ) -> Self {
686 Self(RequestBuilder::new(stub))
687 }
688
689 pub fn with_request<V: Into<crate::model::StopInstanceRequest>>(mut self, v: V) -> Self {
691 self.0.request = v.into();
692 self
693 }
694
695 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
697 self.0.options = v.into();
698 self
699 }
700
701 pub async fn send(self) -> Result<longrunning::model::Operation> {
708 (*self.0.stub)
709 .stop_instance(self.0.request, self.0.options)
710 .await
711 .map(gax::response::Response::into_body)
712 }
713
714 pub fn poller(
716 self,
717 ) -> impl lro::Poller<crate::model::StopInstanceResponse, crate::model::OperationMetadata>
718 {
719 type Operation = lro::internal::Operation<
720 crate::model::StopInstanceResponse,
721 crate::model::OperationMetadata,
722 >;
723 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
724 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
725
726 let stub = self.0.stub.clone();
727 let mut options = self.0.options.clone();
728 options.set_retry_policy(gax::retry_policy::NeverRetry);
729 let query = move |name| {
730 let stub = stub.clone();
731 let options = options.clone();
732 async {
733 let op = GetOperation::new(stub)
734 .set_name(name)
735 .with_options(options)
736 .send()
737 .await?;
738 Ok(Operation::new(op))
739 }
740 };
741
742 let start = move || async {
743 let op = self.send().await?;
744 Ok(Operation::new(op))
745 };
746
747 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
748 }
749
750 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
754 self.0.request.name = v.into();
755 self
756 }
757 }
758
759 #[doc(hidden)]
760 impl gax::options::internal::RequestBuilder for StopInstance {
761 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
762 &mut self.0.options
763 }
764 }
765
766 #[derive(Clone, Debug)]
785 pub struct EnableInteractiveSerialConsole(
786 RequestBuilder<crate::model::EnableInteractiveSerialConsoleRequest>,
787 );
788
789 impl EnableInteractiveSerialConsole {
790 pub(crate) fn new(
791 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
792 ) -> Self {
793 Self(RequestBuilder::new(stub))
794 }
795
796 pub fn with_request<V: Into<crate::model::EnableInteractiveSerialConsoleRequest>>(
798 mut self,
799 v: V,
800 ) -> Self {
801 self.0.request = v.into();
802 self
803 }
804
805 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
807 self.0.options = v.into();
808 self
809 }
810
811 pub async fn send(self) -> Result<longrunning::model::Operation> {
818 (*self.0.stub)
819 .enable_interactive_serial_console(self.0.request, self.0.options)
820 .await
821 .map(gax::response::Response::into_body)
822 }
823
824 pub fn poller(
826 self,
827 ) -> impl lro::Poller<
828 crate::model::EnableInteractiveSerialConsoleResponse,
829 crate::model::OperationMetadata,
830 > {
831 type Operation = lro::internal::Operation<
832 crate::model::EnableInteractiveSerialConsoleResponse,
833 crate::model::OperationMetadata,
834 >;
835 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
836 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
837
838 let stub = self.0.stub.clone();
839 let mut options = self.0.options.clone();
840 options.set_retry_policy(gax::retry_policy::NeverRetry);
841 let query = move |name| {
842 let stub = stub.clone();
843 let options = options.clone();
844 async {
845 let op = GetOperation::new(stub)
846 .set_name(name)
847 .with_options(options)
848 .send()
849 .await?;
850 Ok(Operation::new(op))
851 }
852 };
853
854 let start = move || async {
855 let op = self.send().await?;
856 Ok(Operation::new(op))
857 };
858
859 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
860 }
861
862 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
866 self.0.request.name = v.into();
867 self
868 }
869 }
870
871 #[doc(hidden)]
872 impl gax::options::internal::RequestBuilder for EnableInteractiveSerialConsole {
873 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
874 &mut self.0.options
875 }
876 }
877
878 #[derive(Clone, Debug)]
897 pub struct DisableInteractiveSerialConsole(
898 RequestBuilder<crate::model::DisableInteractiveSerialConsoleRequest>,
899 );
900
901 impl DisableInteractiveSerialConsole {
902 pub(crate) fn new(
903 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
904 ) -> Self {
905 Self(RequestBuilder::new(stub))
906 }
907
908 pub fn with_request<V: Into<crate::model::DisableInteractiveSerialConsoleRequest>>(
910 mut self,
911 v: V,
912 ) -> Self {
913 self.0.request = v.into();
914 self
915 }
916
917 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
919 self.0.options = v.into();
920 self
921 }
922
923 pub async fn send(self) -> Result<longrunning::model::Operation> {
930 (*self.0.stub)
931 .disable_interactive_serial_console(self.0.request, self.0.options)
932 .await
933 .map(gax::response::Response::into_body)
934 }
935
936 pub fn poller(
938 self,
939 ) -> impl lro::Poller<
940 crate::model::DisableInteractiveSerialConsoleResponse,
941 crate::model::OperationMetadata,
942 > {
943 type Operation = lro::internal::Operation<
944 crate::model::DisableInteractiveSerialConsoleResponse,
945 crate::model::OperationMetadata,
946 >;
947 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
948 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
949
950 let stub = self.0.stub.clone();
951 let mut options = self.0.options.clone();
952 options.set_retry_policy(gax::retry_policy::NeverRetry);
953 let query = move |name| {
954 let stub = stub.clone();
955 let options = options.clone();
956 async {
957 let op = GetOperation::new(stub)
958 .set_name(name)
959 .with_options(options)
960 .send()
961 .await?;
962 Ok(Operation::new(op))
963 }
964 };
965
966 let start = move || async {
967 let op = self.send().await?;
968 Ok(Operation::new(op))
969 };
970
971 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
972 }
973
974 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
978 self.0.request.name = v.into();
979 self
980 }
981 }
982
983 #[doc(hidden)]
984 impl gax::options::internal::RequestBuilder for DisableInteractiveSerialConsole {
985 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
986 &mut self.0.options
987 }
988 }
989
990 #[derive(Clone, Debug)]
1009 pub struct DetachLun(RequestBuilder<crate::model::DetachLunRequest>);
1010
1011 impl DetachLun {
1012 pub(crate) fn new(
1013 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1014 ) -> Self {
1015 Self(RequestBuilder::new(stub))
1016 }
1017
1018 pub fn with_request<V: Into<crate::model::DetachLunRequest>>(mut self, v: V) -> Self {
1020 self.0.request = v.into();
1021 self
1022 }
1023
1024 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1026 self.0.options = v.into();
1027 self
1028 }
1029
1030 pub async fn send(self) -> Result<longrunning::model::Operation> {
1037 (*self.0.stub)
1038 .detach_lun(self.0.request, self.0.options)
1039 .await
1040 .map(gax::response::Response::into_body)
1041 }
1042
1043 pub fn poller(
1045 self,
1046 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
1047 type Operation =
1048 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
1049 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1050 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1051
1052 let stub = self.0.stub.clone();
1053 let mut options = self.0.options.clone();
1054 options.set_retry_policy(gax::retry_policy::NeverRetry);
1055 let query = move |name| {
1056 let stub = stub.clone();
1057 let options = options.clone();
1058 async {
1059 let op = GetOperation::new(stub)
1060 .set_name(name)
1061 .with_options(options)
1062 .send()
1063 .await?;
1064 Ok(Operation::new(op))
1065 }
1066 };
1067
1068 let start = move || async {
1069 let op = self.send().await?;
1070 Ok(Operation::new(op))
1071 };
1072
1073 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1074 }
1075
1076 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1080 self.0.request.instance = v.into();
1081 self
1082 }
1083
1084 pub fn set_lun<T: Into<std::string::String>>(mut self, v: T) -> Self {
1088 self.0.request.lun = v.into();
1089 self
1090 }
1091
1092 pub fn set_skip_reboot<T: Into<bool>>(mut self, v: T) -> Self {
1094 self.0.request.skip_reboot = v.into();
1095 self
1096 }
1097 }
1098
1099 #[doc(hidden)]
1100 impl gax::options::internal::RequestBuilder for DetachLun {
1101 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1102 &mut self.0.options
1103 }
1104 }
1105
1106 #[derive(Clone, Debug)]
1128 pub struct ListSSHKeys(RequestBuilder<crate::model::ListSSHKeysRequest>);
1129
1130 impl ListSSHKeys {
1131 pub(crate) fn new(
1132 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1133 ) -> Self {
1134 Self(RequestBuilder::new(stub))
1135 }
1136
1137 pub fn with_request<V: Into<crate::model::ListSSHKeysRequest>>(mut self, v: V) -> Self {
1139 self.0.request = v.into();
1140 self
1141 }
1142
1143 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1145 self.0.options = v.into();
1146 self
1147 }
1148
1149 pub async fn send(self) -> Result<crate::model::ListSSHKeysResponse> {
1151 (*self.0.stub)
1152 .list_ssh_keys(self.0.request, self.0.options)
1153 .await
1154 .map(gax::response::Response::into_body)
1155 }
1156
1157 pub fn by_page(
1159 self,
1160 ) -> impl gax::paginator::Paginator<crate::model::ListSSHKeysResponse, gax::error::Error>
1161 {
1162 use std::clone::Clone;
1163 let token = self.0.request.page_token.clone();
1164 let execute = move |token: String| {
1165 let mut builder = self.clone();
1166 builder.0.request = builder.0.request.set_page_token(token);
1167 builder.send()
1168 };
1169 gax::paginator::internal::new_paginator(token, execute)
1170 }
1171
1172 pub fn by_item(
1174 self,
1175 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSSHKeysResponse, gax::error::Error>
1176 {
1177 use gax::paginator::Paginator;
1178 self.by_page().items()
1179 }
1180
1181 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1185 self.0.request.parent = v.into();
1186 self
1187 }
1188
1189 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1191 self.0.request.page_size = v.into();
1192 self
1193 }
1194
1195 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1197 self.0.request.page_token = v.into();
1198 self
1199 }
1200 }
1201
1202 #[doc(hidden)]
1203 impl gax::options::internal::RequestBuilder for ListSSHKeys {
1204 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1205 &mut self.0.options
1206 }
1207 }
1208
1209 #[derive(Clone, Debug)]
1227 pub struct CreateSSHKey(RequestBuilder<crate::model::CreateSSHKeyRequest>);
1228
1229 impl CreateSSHKey {
1230 pub(crate) fn new(
1231 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1232 ) -> Self {
1233 Self(RequestBuilder::new(stub))
1234 }
1235
1236 pub fn with_request<V: Into<crate::model::CreateSSHKeyRequest>>(mut self, v: V) -> Self {
1238 self.0.request = v.into();
1239 self
1240 }
1241
1242 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1244 self.0.options = v.into();
1245 self
1246 }
1247
1248 pub async fn send(self) -> Result<crate::model::SSHKey> {
1250 (*self.0.stub)
1251 .create_ssh_key(self.0.request, self.0.options)
1252 .await
1253 .map(gax::response::Response::into_body)
1254 }
1255
1256 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1260 self.0.request.parent = v.into();
1261 self
1262 }
1263
1264 pub fn set_ssh_key<T>(mut self, v: T) -> Self
1268 where
1269 T: std::convert::Into<crate::model::SSHKey>,
1270 {
1271 self.0.request.ssh_key = std::option::Option::Some(v.into());
1272 self
1273 }
1274
1275 pub fn set_or_clear_ssh_key<T>(mut self, v: std::option::Option<T>) -> Self
1279 where
1280 T: std::convert::Into<crate::model::SSHKey>,
1281 {
1282 self.0.request.ssh_key = v.map(|x| x.into());
1283 self
1284 }
1285
1286 pub fn set_ssh_key_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1290 self.0.request.ssh_key_id = v.into();
1291 self
1292 }
1293 }
1294
1295 #[doc(hidden)]
1296 impl gax::options::internal::RequestBuilder for CreateSSHKey {
1297 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1298 &mut self.0.options
1299 }
1300 }
1301
1302 #[derive(Clone, Debug)]
1320 pub struct DeleteSSHKey(RequestBuilder<crate::model::DeleteSSHKeyRequest>);
1321
1322 impl DeleteSSHKey {
1323 pub(crate) fn new(
1324 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1325 ) -> Self {
1326 Self(RequestBuilder::new(stub))
1327 }
1328
1329 pub fn with_request<V: Into<crate::model::DeleteSSHKeyRequest>>(mut self, v: V) -> Self {
1331 self.0.request = v.into();
1332 self
1333 }
1334
1335 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1337 self.0.options = v.into();
1338 self
1339 }
1340
1341 pub async fn send(self) -> Result<()> {
1343 (*self.0.stub)
1344 .delete_ssh_key(self.0.request, self.0.options)
1345 .await
1346 .map(gax::response::Response::into_body)
1347 }
1348
1349 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1353 self.0.request.name = v.into();
1354 self
1355 }
1356 }
1357
1358 #[doc(hidden)]
1359 impl gax::options::internal::RequestBuilder for DeleteSSHKey {
1360 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1361 &mut self.0.options
1362 }
1363 }
1364
1365 #[derive(Clone, Debug)]
1387 pub struct ListVolumes(RequestBuilder<crate::model::ListVolumesRequest>);
1388
1389 impl ListVolumes {
1390 pub(crate) fn new(
1391 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1392 ) -> Self {
1393 Self(RequestBuilder::new(stub))
1394 }
1395
1396 pub fn with_request<V: Into<crate::model::ListVolumesRequest>>(mut self, v: V) -> Self {
1398 self.0.request = v.into();
1399 self
1400 }
1401
1402 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1404 self.0.options = v.into();
1405 self
1406 }
1407
1408 pub async fn send(self) -> Result<crate::model::ListVolumesResponse> {
1410 (*self.0.stub)
1411 .list_volumes(self.0.request, self.0.options)
1412 .await
1413 .map(gax::response::Response::into_body)
1414 }
1415
1416 pub fn by_page(
1418 self,
1419 ) -> impl gax::paginator::Paginator<crate::model::ListVolumesResponse, gax::error::Error>
1420 {
1421 use std::clone::Clone;
1422 let token = self.0.request.page_token.clone();
1423 let execute = move |token: String| {
1424 let mut builder = self.clone();
1425 builder.0.request = builder.0.request.set_page_token(token);
1426 builder.send()
1427 };
1428 gax::paginator::internal::new_paginator(token, execute)
1429 }
1430
1431 pub fn by_item(
1433 self,
1434 ) -> impl gax::paginator::ItemPaginator<crate::model::ListVolumesResponse, gax::error::Error>
1435 {
1436 use gax::paginator::Paginator;
1437 self.by_page().items()
1438 }
1439
1440 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1444 self.0.request.parent = v.into();
1445 self
1446 }
1447
1448 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1450 self.0.request.page_size = v.into();
1451 self
1452 }
1453
1454 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1456 self.0.request.page_token = v.into();
1457 self
1458 }
1459
1460 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1462 self.0.request.filter = v.into();
1463 self
1464 }
1465 }
1466
1467 #[doc(hidden)]
1468 impl gax::options::internal::RequestBuilder for ListVolumes {
1469 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1470 &mut self.0.options
1471 }
1472 }
1473
1474 #[derive(Clone, Debug)]
1492 pub struct GetVolume(RequestBuilder<crate::model::GetVolumeRequest>);
1493
1494 impl GetVolume {
1495 pub(crate) fn new(
1496 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1497 ) -> Self {
1498 Self(RequestBuilder::new(stub))
1499 }
1500
1501 pub fn with_request<V: Into<crate::model::GetVolumeRequest>>(mut self, v: V) -> Self {
1503 self.0.request = v.into();
1504 self
1505 }
1506
1507 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1509 self.0.options = v.into();
1510 self
1511 }
1512
1513 pub async fn send(self) -> Result<crate::model::Volume> {
1515 (*self.0.stub)
1516 .get_volume(self.0.request, self.0.options)
1517 .await
1518 .map(gax::response::Response::into_body)
1519 }
1520
1521 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1525 self.0.request.name = v.into();
1526 self
1527 }
1528 }
1529
1530 #[doc(hidden)]
1531 impl gax::options::internal::RequestBuilder for GetVolume {
1532 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1533 &mut self.0.options
1534 }
1535 }
1536
1537 #[derive(Clone, Debug)]
1556 pub struct UpdateVolume(RequestBuilder<crate::model::UpdateVolumeRequest>);
1557
1558 impl UpdateVolume {
1559 pub(crate) fn new(
1560 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1561 ) -> Self {
1562 Self(RequestBuilder::new(stub))
1563 }
1564
1565 pub fn with_request<V: Into<crate::model::UpdateVolumeRequest>>(mut self, v: V) -> Self {
1567 self.0.request = v.into();
1568 self
1569 }
1570
1571 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1573 self.0.options = v.into();
1574 self
1575 }
1576
1577 pub async fn send(self) -> Result<longrunning::model::Operation> {
1584 (*self.0.stub)
1585 .update_volume(self.0.request, self.0.options)
1586 .await
1587 .map(gax::response::Response::into_body)
1588 }
1589
1590 pub fn poller(
1592 self,
1593 ) -> impl lro::Poller<crate::model::Volume, crate::model::OperationMetadata> {
1594 type Operation =
1595 lro::internal::Operation<crate::model::Volume, crate::model::OperationMetadata>;
1596 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1597 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1598
1599 let stub = self.0.stub.clone();
1600 let mut options = self.0.options.clone();
1601 options.set_retry_policy(gax::retry_policy::NeverRetry);
1602 let query = move |name| {
1603 let stub = stub.clone();
1604 let options = options.clone();
1605 async {
1606 let op = GetOperation::new(stub)
1607 .set_name(name)
1608 .with_options(options)
1609 .send()
1610 .await?;
1611 Ok(Operation::new(op))
1612 }
1613 };
1614
1615 let start = move || async {
1616 let op = self.send().await?;
1617 Ok(Operation::new(op))
1618 };
1619
1620 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1621 }
1622
1623 pub fn set_volume<T>(mut self, v: T) -> Self
1627 where
1628 T: std::convert::Into<crate::model::Volume>,
1629 {
1630 self.0.request.volume = std::option::Option::Some(v.into());
1631 self
1632 }
1633
1634 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
1638 where
1639 T: std::convert::Into<crate::model::Volume>,
1640 {
1641 self.0.request.volume = v.map(|x| x.into());
1642 self
1643 }
1644
1645 pub fn set_update_mask<T>(mut self, v: T) -> Self
1647 where
1648 T: std::convert::Into<wkt::FieldMask>,
1649 {
1650 self.0.request.update_mask = std::option::Option::Some(v.into());
1651 self
1652 }
1653
1654 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1656 where
1657 T: std::convert::Into<wkt::FieldMask>,
1658 {
1659 self.0.request.update_mask = v.map(|x| x.into());
1660 self
1661 }
1662 }
1663
1664 #[doc(hidden)]
1665 impl gax::options::internal::RequestBuilder for UpdateVolume {
1666 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1667 &mut self.0.options
1668 }
1669 }
1670
1671 #[derive(Clone, Debug)]
1689 pub struct RenameVolume(RequestBuilder<crate::model::RenameVolumeRequest>);
1690
1691 impl RenameVolume {
1692 pub(crate) fn new(
1693 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1694 ) -> Self {
1695 Self(RequestBuilder::new(stub))
1696 }
1697
1698 pub fn with_request<V: Into<crate::model::RenameVolumeRequest>>(mut self, v: V) -> Self {
1700 self.0.request = v.into();
1701 self
1702 }
1703
1704 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1706 self.0.options = v.into();
1707 self
1708 }
1709
1710 pub async fn send(self) -> Result<crate::model::Volume> {
1712 (*self.0.stub)
1713 .rename_volume(self.0.request, self.0.options)
1714 .await
1715 .map(gax::response::Response::into_body)
1716 }
1717
1718 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1722 self.0.request.name = v.into();
1723 self
1724 }
1725
1726 pub fn set_new_volume_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1730 self.0.request.new_volume_id = v.into();
1731 self
1732 }
1733 }
1734
1735 #[doc(hidden)]
1736 impl gax::options::internal::RequestBuilder for RenameVolume {
1737 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1738 &mut self.0.options
1739 }
1740 }
1741
1742 #[derive(Clone, Debug)]
1761 pub struct EvictVolume(RequestBuilder<crate::model::EvictVolumeRequest>);
1762
1763 impl EvictVolume {
1764 pub(crate) fn new(
1765 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1766 ) -> Self {
1767 Self(RequestBuilder::new(stub))
1768 }
1769
1770 pub fn with_request<V: Into<crate::model::EvictVolumeRequest>>(mut self, v: V) -> Self {
1772 self.0.request = v.into();
1773 self
1774 }
1775
1776 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1778 self.0.options = v.into();
1779 self
1780 }
1781
1782 pub async fn send(self) -> Result<longrunning::model::Operation> {
1789 (*self.0.stub)
1790 .evict_volume(self.0.request, self.0.options)
1791 .await
1792 .map(gax::response::Response::into_body)
1793 }
1794
1795 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1797 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1798 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1799 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1800
1801 let stub = self.0.stub.clone();
1802 let mut options = self.0.options.clone();
1803 options.set_retry_policy(gax::retry_policy::NeverRetry);
1804 let query = move |name| {
1805 let stub = stub.clone();
1806 let options = options.clone();
1807 async {
1808 let op = GetOperation::new(stub)
1809 .set_name(name)
1810 .with_options(options)
1811 .send()
1812 .await?;
1813 Ok(Operation::new(op))
1814 }
1815 };
1816
1817 let start = move || async {
1818 let op = self.send().await?;
1819 Ok(Operation::new(op))
1820 };
1821
1822 lro::internal::new_unit_response_poller(
1823 polling_error_policy,
1824 polling_backoff_policy,
1825 start,
1826 query,
1827 )
1828 }
1829
1830 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1834 self.0.request.name = v.into();
1835 self
1836 }
1837 }
1838
1839 #[doc(hidden)]
1840 impl gax::options::internal::RequestBuilder for EvictVolume {
1841 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1842 &mut self.0.options
1843 }
1844 }
1845
1846 #[derive(Clone, Debug)]
1865 pub struct ResizeVolume(RequestBuilder<crate::model::ResizeVolumeRequest>);
1866
1867 impl ResizeVolume {
1868 pub(crate) fn new(
1869 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1870 ) -> Self {
1871 Self(RequestBuilder::new(stub))
1872 }
1873
1874 pub fn with_request<V: Into<crate::model::ResizeVolumeRequest>>(mut self, v: V) -> Self {
1876 self.0.request = v.into();
1877 self
1878 }
1879
1880 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1882 self.0.options = v.into();
1883 self
1884 }
1885
1886 pub async fn send(self) -> Result<longrunning::model::Operation> {
1893 (*self.0.stub)
1894 .resize_volume(self.0.request, self.0.options)
1895 .await
1896 .map(gax::response::Response::into_body)
1897 }
1898
1899 pub fn poller(
1901 self,
1902 ) -> impl lro::Poller<crate::model::Volume, crate::model::OperationMetadata> {
1903 type Operation =
1904 lro::internal::Operation<crate::model::Volume, crate::model::OperationMetadata>;
1905 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1906 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1907
1908 let stub = self.0.stub.clone();
1909 let mut options = self.0.options.clone();
1910 options.set_retry_policy(gax::retry_policy::NeverRetry);
1911 let query = move |name| {
1912 let stub = stub.clone();
1913 let options = options.clone();
1914 async {
1915 let op = GetOperation::new(stub)
1916 .set_name(name)
1917 .with_options(options)
1918 .send()
1919 .await?;
1920 Ok(Operation::new(op))
1921 }
1922 };
1923
1924 let start = move || async {
1925 let op = self.send().await?;
1926 Ok(Operation::new(op))
1927 };
1928
1929 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1930 }
1931
1932 pub fn set_volume<T: Into<std::string::String>>(mut self, v: T) -> Self {
1936 self.0.request.volume = v.into();
1937 self
1938 }
1939
1940 pub fn set_size_gib<T: Into<i64>>(mut self, v: T) -> Self {
1942 self.0.request.size_gib = v.into();
1943 self
1944 }
1945 }
1946
1947 #[doc(hidden)]
1948 impl gax::options::internal::RequestBuilder for ResizeVolume {
1949 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1950 &mut self.0.options
1951 }
1952 }
1953
1954 #[derive(Clone, Debug)]
1976 pub struct ListNetworks(RequestBuilder<crate::model::ListNetworksRequest>);
1977
1978 impl ListNetworks {
1979 pub(crate) fn new(
1980 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1981 ) -> Self {
1982 Self(RequestBuilder::new(stub))
1983 }
1984
1985 pub fn with_request<V: Into<crate::model::ListNetworksRequest>>(mut self, v: V) -> Self {
1987 self.0.request = v.into();
1988 self
1989 }
1990
1991 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1993 self.0.options = v.into();
1994 self
1995 }
1996
1997 pub async fn send(self) -> Result<crate::model::ListNetworksResponse> {
1999 (*self.0.stub)
2000 .list_networks(self.0.request, self.0.options)
2001 .await
2002 .map(gax::response::Response::into_body)
2003 }
2004
2005 pub fn by_page(
2007 self,
2008 ) -> impl gax::paginator::Paginator<crate::model::ListNetworksResponse, gax::error::Error>
2009 {
2010 use std::clone::Clone;
2011 let token = self.0.request.page_token.clone();
2012 let execute = move |token: String| {
2013 let mut builder = self.clone();
2014 builder.0.request = builder.0.request.set_page_token(token);
2015 builder.send()
2016 };
2017 gax::paginator::internal::new_paginator(token, execute)
2018 }
2019
2020 pub fn by_item(
2022 self,
2023 ) -> impl gax::paginator::ItemPaginator<crate::model::ListNetworksResponse, gax::error::Error>
2024 {
2025 use gax::paginator::Paginator;
2026 self.by_page().items()
2027 }
2028
2029 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2033 self.0.request.parent = v.into();
2034 self
2035 }
2036
2037 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2039 self.0.request.page_size = v.into();
2040 self
2041 }
2042
2043 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2045 self.0.request.page_token = v.into();
2046 self
2047 }
2048
2049 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2051 self.0.request.filter = v.into();
2052 self
2053 }
2054 }
2055
2056 #[doc(hidden)]
2057 impl gax::options::internal::RequestBuilder for ListNetworks {
2058 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2059 &mut self.0.options
2060 }
2061 }
2062
2063 #[derive(Clone, Debug)]
2081 pub struct ListNetworkUsage(RequestBuilder<crate::model::ListNetworkUsageRequest>);
2082
2083 impl ListNetworkUsage {
2084 pub(crate) fn new(
2085 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2086 ) -> Self {
2087 Self(RequestBuilder::new(stub))
2088 }
2089
2090 pub fn with_request<V: Into<crate::model::ListNetworkUsageRequest>>(
2092 mut self,
2093 v: V,
2094 ) -> Self {
2095 self.0.request = v.into();
2096 self
2097 }
2098
2099 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2101 self.0.options = v.into();
2102 self
2103 }
2104
2105 pub async fn send(self) -> Result<crate::model::ListNetworkUsageResponse> {
2107 (*self.0.stub)
2108 .list_network_usage(self.0.request, self.0.options)
2109 .await
2110 .map(gax::response::Response::into_body)
2111 }
2112
2113 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2117 self.0.request.location = v.into();
2118 self
2119 }
2120 }
2121
2122 #[doc(hidden)]
2123 impl gax::options::internal::RequestBuilder for ListNetworkUsage {
2124 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2125 &mut self.0.options
2126 }
2127 }
2128
2129 #[derive(Clone, Debug)]
2147 pub struct GetNetwork(RequestBuilder<crate::model::GetNetworkRequest>);
2148
2149 impl GetNetwork {
2150 pub(crate) fn new(
2151 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2152 ) -> Self {
2153 Self(RequestBuilder::new(stub))
2154 }
2155
2156 pub fn with_request<V: Into<crate::model::GetNetworkRequest>>(mut self, v: V) -> Self {
2158 self.0.request = v.into();
2159 self
2160 }
2161
2162 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2164 self.0.options = v.into();
2165 self
2166 }
2167
2168 pub async fn send(self) -> Result<crate::model::Network> {
2170 (*self.0.stub)
2171 .get_network(self.0.request, self.0.options)
2172 .await
2173 .map(gax::response::Response::into_body)
2174 }
2175
2176 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2180 self.0.request.name = v.into();
2181 self
2182 }
2183 }
2184
2185 #[doc(hidden)]
2186 impl gax::options::internal::RequestBuilder for GetNetwork {
2187 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2188 &mut self.0.options
2189 }
2190 }
2191
2192 #[derive(Clone, Debug)]
2211 pub struct UpdateNetwork(RequestBuilder<crate::model::UpdateNetworkRequest>);
2212
2213 impl UpdateNetwork {
2214 pub(crate) fn new(
2215 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2216 ) -> Self {
2217 Self(RequestBuilder::new(stub))
2218 }
2219
2220 pub fn with_request<V: Into<crate::model::UpdateNetworkRequest>>(mut self, v: V) -> Self {
2222 self.0.request = v.into();
2223 self
2224 }
2225
2226 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2228 self.0.options = v.into();
2229 self
2230 }
2231
2232 pub async fn send(self) -> Result<longrunning::model::Operation> {
2239 (*self.0.stub)
2240 .update_network(self.0.request, self.0.options)
2241 .await
2242 .map(gax::response::Response::into_body)
2243 }
2244
2245 pub fn poller(
2247 self,
2248 ) -> impl lro::Poller<crate::model::Network, crate::model::OperationMetadata> {
2249 type Operation =
2250 lro::internal::Operation<crate::model::Network, crate::model::OperationMetadata>;
2251 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2252 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2253
2254 let stub = self.0.stub.clone();
2255 let mut options = self.0.options.clone();
2256 options.set_retry_policy(gax::retry_policy::NeverRetry);
2257 let query = move |name| {
2258 let stub = stub.clone();
2259 let options = options.clone();
2260 async {
2261 let op = GetOperation::new(stub)
2262 .set_name(name)
2263 .with_options(options)
2264 .send()
2265 .await?;
2266 Ok(Operation::new(op))
2267 }
2268 };
2269
2270 let start = move || async {
2271 let op = self.send().await?;
2272 Ok(Operation::new(op))
2273 };
2274
2275 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2276 }
2277
2278 pub fn set_network<T>(mut self, v: T) -> Self
2282 where
2283 T: std::convert::Into<crate::model::Network>,
2284 {
2285 self.0.request.network = std::option::Option::Some(v.into());
2286 self
2287 }
2288
2289 pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
2293 where
2294 T: std::convert::Into<crate::model::Network>,
2295 {
2296 self.0.request.network = v.map(|x| x.into());
2297 self
2298 }
2299
2300 pub fn set_update_mask<T>(mut self, v: T) -> Self
2302 where
2303 T: std::convert::Into<wkt::FieldMask>,
2304 {
2305 self.0.request.update_mask = std::option::Option::Some(v.into());
2306 self
2307 }
2308
2309 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2311 where
2312 T: std::convert::Into<wkt::FieldMask>,
2313 {
2314 self.0.request.update_mask = v.map(|x| x.into());
2315 self
2316 }
2317 }
2318
2319 #[doc(hidden)]
2320 impl gax::options::internal::RequestBuilder for UpdateNetwork {
2321 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2322 &mut self.0.options
2323 }
2324 }
2325
2326 #[derive(Clone, Debug)]
2344 pub struct CreateVolumeSnapshot(RequestBuilder<crate::model::CreateVolumeSnapshotRequest>);
2345
2346 impl CreateVolumeSnapshot {
2347 pub(crate) fn new(
2348 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2349 ) -> Self {
2350 Self(RequestBuilder::new(stub))
2351 }
2352
2353 pub fn with_request<V: Into<crate::model::CreateVolumeSnapshotRequest>>(
2355 mut self,
2356 v: V,
2357 ) -> Self {
2358 self.0.request = v.into();
2359 self
2360 }
2361
2362 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2364 self.0.options = v.into();
2365 self
2366 }
2367
2368 pub async fn send(self) -> Result<crate::model::VolumeSnapshot> {
2370 (*self.0.stub)
2371 .create_volume_snapshot(self.0.request, self.0.options)
2372 .await
2373 .map(gax::response::Response::into_body)
2374 }
2375
2376 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2380 self.0.request.parent = v.into();
2381 self
2382 }
2383
2384 pub fn set_volume_snapshot<T>(mut self, v: T) -> Self
2388 where
2389 T: std::convert::Into<crate::model::VolumeSnapshot>,
2390 {
2391 self.0.request.volume_snapshot = std::option::Option::Some(v.into());
2392 self
2393 }
2394
2395 pub fn set_or_clear_volume_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
2399 where
2400 T: std::convert::Into<crate::model::VolumeSnapshot>,
2401 {
2402 self.0.request.volume_snapshot = v.map(|x| x.into());
2403 self
2404 }
2405 }
2406
2407 #[doc(hidden)]
2408 impl gax::options::internal::RequestBuilder for CreateVolumeSnapshot {
2409 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2410 &mut self.0.options
2411 }
2412 }
2413
2414 #[derive(Clone, Debug)]
2433 pub struct RestoreVolumeSnapshot(RequestBuilder<crate::model::RestoreVolumeSnapshotRequest>);
2434
2435 impl RestoreVolumeSnapshot {
2436 pub(crate) fn new(
2437 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2438 ) -> Self {
2439 Self(RequestBuilder::new(stub))
2440 }
2441
2442 pub fn with_request<V: Into<crate::model::RestoreVolumeSnapshotRequest>>(
2444 mut self,
2445 v: V,
2446 ) -> Self {
2447 self.0.request = v.into();
2448 self
2449 }
2450
2451 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2453 self.0.options = v.into();
2454 self
2455 }
2456
2457 pub async fn send(self) -> Result<longrunning::model::Operation> {
2464 (*self.0.stub)
2465 .restore_volume_snapshot(self.0.request, self.0.options)
2466 .await
2467 .map(gax::response::Response::into_body)
2468 }
2469
2470 pub fn poller(
2472 self,
2473 ) -> impl lro::Poller<crate::model::VolumeSnapshot, crate::model::OperationMetadata>
2474 {
2475 type Operation = lro::internal::Operation<
2476 crate::model::VolumeSnapshot,
2477 crate::model::OperationMetadata,
2478 >;
2479 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2480 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2481
2482 let stub = self.0.stub.clone();
2483 let mut options = self.0.options.clone();
2484 options.set_retry_policy(gax::retry_policy::NeverRetry);
2485 let query = move |name| {
2486 let stub = stub.clone();
2487 let options = options.clone();
2488 async {
2489 let op = GetOperation::new(stub)
2490 .set_name(name)
2491 .with_options(options)
2492 .send()
2493 .await?;
2494 Ok(Operation::new(op))
2495 }
2496 };
2497
2498 let start = move || async {
2499 let op = self.send().await?;
2500 Ok(Operation::new(op))
2501 };
2502
2503 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2504 }
2505
2506 pub fn set_volume_snapshot<T: Into<std::string::String>>(mut self, v: T) -> Self {
2510 self.0.request.volume_snapshot = v.into();
2511 self
2512 }
2513 }
2514
2515 #[doc(hidden)]
2516 impl gax::options::internal::RequestBuilder for RestoreVolumeSnapshot {
2517 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2518 &mut self.0.options
2519 }
2520 }
2521
2522 #[derive(Clone, Debug)]
2540 pub struct DeleteVolumeSnapshot(RequestBuilder<crate::model::DeleteVolumeSnapshotRequest>);
2541
2542 impl DeleteVolumeSnapshot {
2543 pub(crate) fn new(
2544 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2545 ) -> Self {
2546 Self(RequestBuilder::new(stub))
2547 }
2548
2549 pub fn with_request<V: Into<crate::model::DeleteVolumeSnapshotRequest>>(
2551 mut self,
2552 v: V,
2553 ) -> Self {
2554 self.0.request = v.into();
2555 self
2556 }
2557
2558 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2560 self.0.options = v.into();
2561 self
2562 }
2563
2564 pub async fn send(self) -> Result<()> {
2566 (*self.0.stub)
2567 .delete_volume_snapshot(self.0.request, self.0.options)
2568 .await
2569 .map(gax::response::Response::into_body)
2570 }
2571
2572 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2576 self.0.request.name = v.into();
2577 self
2578 }
2579 }
2580
2581 #[doc(hidden)]
2582 impl gax::options::internal::RequestBuilder for DeleteVolumeSnapshot {
2583 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2584 &mut self.0.options
2585 }
2586 }
2587
2588 #[derive(Clone, Debug)]
2606 pub struct GetVolumeSnapshot(RequestBuilder<crate::model::GetVolumeSnapshotRequest>);
2607
2608 impl GetVolumeSnapshot {
2609 pub(crate) fn new(
2610 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2611 ) -> Self {
2612 Self(RequestBuilder::new(stub))
2613 }
2614
2615 pub fn with_request<V: Into<crate::model::GetVolumeSnapshotRequest>>(
2617 mut self,
2618 v: V,
2619 ) -> Self {
2620 self.0.request = v.into();
2621 self
2622 }
2623
2624 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2626 self.0.options = v.into();
2627 self
2628 }
2629
2630 pub async fn send(self) -> Result<crate::model::VolumeSnapshot> {
2632 (*self.0.stub)
2633 .get_volume_snapshot(self.0.request, self.0.options)
2634 .await
2635 .map(gax::response::Response::into_body)
2636 }
2637
2638 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2642 self.0.request.name = v.into();
2643 self
2644 }
2645 }
2646
2647 #[doc(hidden)]
2648 impl gax::options::internal::RequestBuilder for GetVolumeSnapshot {
2649 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2650 &mut self.0.options
2651 }
2652 }
2653
2654 #[derive(Clone, Debug)]
2676 pub struct ListVolumeSnapshots(RequestBuilder<crate::model::ListVolumeSnapshotsRequest>);
2677
2678 impl ListVolumeSnapshots {
2679 pub(crate) fn new(
2680 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2681 ) -> Self {
2682 Self(RequestBuilder::new(stub))
2683 }
2684
2685 pub fn with_request<V: Into<crate::model::ListVolumeSnapshotsRequest>>(
2687 mut self,
2688 v: V,
2689 ) -> Self {
2690 self.0.request = v.into();
2691 self
2692 }
2693
2694 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2696 self.0.options = v.into();
2697 self
2698 }
2699
2700 pub async fn send(self) -> Result<crate::model::ListVolumeSnapshotsResponse> {
2702 (*self.0.stub)
2703 .list_volume_snapshots(self.0.request, self.0.options)
2704 .await
2705 .map(gax::response::Response::into_body)
2706 }
2707
2708 pub fn by_page(
2710 self,
2711 ) -> impl gax::paginator::Paginator<crate::model::ListVolumeSnapshotsResponse, gax::error::Error>
2712 {
2713 use std::clone::Clone;
2714 let token = self.0.request.page_token.clone();
2715 let execute = move |token: String| {
2716 let mut builder = self.clone();
2717 builder.0.request = builder.0.request.set_page_token(token);
2718 builder.send()
2719 };
2720 gax::paginator::internal::new_paginator(token, execute)
2721 }
2722
2723 pub fn by_item(
2725 self,
2726 ) -> impl gax::paginator::ItemPaginator<
2727 crate::model::ListVolumeSnapshotsResponse,
2728 gax::error::Error,
2729 > {
2730 use gax::paginator::Paginator;
2731 self.by_page().items()
2732 }
2733
2734 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2738 self.0.request.parent = v.into();
2739 self
2740 }
2741
2742 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2744 self.0.request.page_size = v.into();
2745 self
2746 }
2747
2748 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2750 self.0.request.page_token = v.into();
2751 self
2752 }
2753 }
2754
2755 #[doc(hidden)]
2756 impl gax::options::internal::RequestBuilder for ListVolumeSnapshots {
2757 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2758 &mut self.0.options
2759 }
2760 }
2761
2762 #[derive(Clone, Debug)]
2780 pub struct GetLun(RequestBuilder<crate::model::GetLunRequest>);
2781
2782 impl GetLun {
2783 pub(crate) fn new(
2784 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2785 ) -> Self {
2786 Self(RequestBuilder::new(stub))
2787 }
2788
2789 pub fn with_request<V: Into<crate::model::GetLunRequest>>(mut self, v: V) -> Self {
2791 self.0.request = v.into();
2792 self
2793 }
2794
2795 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2797 self.0.options = v.into();
2798 self
2799 }
2800
2801 pub async fn send(self) -> Result<crate::model::Lun> {
2803 (*self.0.stub)
2804 .get_lun(self.0.request, self.0.options)
2805 .await
2806 .map(gax::response::Response::into_body)
2807 }
2808
2809 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2813 self.0.request.name = v.into();
2814 self
2815 }
2816 }
2817
2818 #[doc(hidden)]
2819 impl gax::options::internal::RequestBuilder for GetLun {
2820 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2821 &mut self.0.options
2822 }
2823 }
2824
2825 #[derive(Clone, Debug)]
2847 pub struct ListLuns(RequestBuilder<crate::model::ListLunsRequest>);
2848
2849 impl ListLuns {
2850 pub(crate) fn new(
2851 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2852 ) -> Self {
2853 Self(RequestBuilder::new(stub))
2854 }
2855
2856 pub fn with_request<V: Into<crate::model::ListLunsRequest>>(mut self, v: V) -> Self {
2858 self.0.request = v.into();
2859 self
2860 }
2861
2862 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2864 self.0.options = v.into();
2865 self
2866 }
2867
2868 pub async fn send(self) -> Result<crate::model::ListLunsResponse> {
2870 (*self.0.stub)
2871 .list_luns(self.0.request, self.0.options)
2872 .await
2873 .map(gax::response::Response::into_body)
2874 }
2875
2876 pub fn by_page(
2878 self,
2879 ) -> impl gax::paginator::Paginator<crate::model::ListLunsResponse, gax::error::Error>
2880 {
2881 use std::clone::Clone;
2882 let token = self.0.request.page_token.clone();
2883 let execute = move |token: String| {
2884 let mut builder = self.clone();
2885 builder.0.request = builder.0.request.set_page_token(token);
2886 builder.send()
2887 };
2888 gax::paginator::internal::new_paginator(token, execute)
2889 }
2890
2891 pub fn by_item(
2893 self,
2894 ) -> impl gax::paginator::ItemPaginator<crate::model::ListLunsResponse, gax::error::Error>
2895 {
2896 use gax::paginator::Paginator;
2897 self.by_page().items()
2898 }
2899
2900 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2904 self.0.request.parent = v.into();
2905 self
2906 }
2907
2908 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2910 self.0.request.page_size = v.into();
2911 self
2912 }
2913
2914 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2916 self.0.request.page_token = v.into();
2917 self
2918 }
2919 }
2920
2921 #[doc(hidden)]
2922 impl gax::options::internal::RequestBuilder for ListLuns {
2923 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2924 &mut self.0.options
2925 }
2926 }
2927
2928 #[derive(Clone, Debug)]
2947 pub struct EvictLun(RequestBuilder<crate::model::EvictLunRequest>);
2948
2949 impl EvictLun {
2950 pub(crate) fn new(
2951 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2952 ) -> Self {
2953 Self(RequestBuilder::new(stub))
2954 }
2955
2956 pub fn with_request<V: Into<crate::model::EvictLunRequest>>(mut self, v: V) -> Self {
2958 self.0.request = v.into();
2959 self
2960 }
2961
2962 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2964 self.0.options = v.into();
2965 self
2966 }
2967
2968 pub async fn send(self) -> Result<longrunning::model::Operation> {
2975 (*self.0.stub)
2976 .evict_lun(self.0.request, self.0.options)
2977 .await
2978 .map(gax::response::Response::into_body)
2979 }
2980
2981 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2983 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2984 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2985 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2986
2987 let stub = self.0.stub.clone();
2988 let mut options = self.0.options.clone();
2989 options.set_retry_policy(gax::retry_policy::NeverRetry);
2990 let query = move |name| {
2991 let stub = stub.clone();
2992 let options = options.clone();
2993 async {
2994 let op = GetOperation::new(stub)
2995 .set_name(name)
2996 .with_options(options)
2997 .send()
2998 .await?;
2999 Ok(Operation::new(op))
3000 }
3001 };
3002
3003 let start = move || async {
3004 let op = self.send().await?;
3005 Ok(Operation::new(op))
3006 };
3007
3008 lro::internal::new_unit_response_poller(
3009 polling_error_policy,
3010 polling_backoff_policy,
3011 start,
3012 query,
3013 )
3014 }
3015
3016 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3020 self.0.request.name = v.into();
3021 self
3022 }
3023 }
3024
3025 #[doc(hidden)]
3026 impl gax::options::internal::RequestBuilder for EvictLun {
3027 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3028 &mut self.0.options
3029 }
3030 }
3031
3032 #[derive(Clone, Debug)]
3050 pub struct GetNfsShare(RequestBuilder<crate::model::GetNfsShareRequest>);
3051
3052 impl GetNfsShare {
3053 pub(crate) fn new(
3054 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3055 ) -> Self {
3056 Self(RequestBuilder::new(stub))
3057 }
3058
3059 pub fn with_request<V: Into<crate::model::GetNfsShareRequest>>(mut self, v: V) -> Self {
3061 self.0.request = v.into();
3062 self
3063 }
3064
3065 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3067 self.0.options = v.into();
3068 self
3069 }
3070
3071 pub async fn send(self) -> Result<crate::model::NfsShare> {
3073 (*self.0.stub)
3074 .get_nfs_share(self.0.request, self.0.options)
3075 .await
3076 .map(gax::response::Response::into_body)
3077 }
3078
3079 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3083 self.0.request.name = v.into();
3084 self
3085 }
3086 }
3087
3088 #[doc(hidden)]
3089 impl gax::options::internal::RequestBuilder for GetNfsShare {
3090 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3091 &mut self.0.options
3092 }
3093 }
3094
3095 #[derive(Clone, Debug)]
3117 pub struct ListNfsShares(RequestBuilder<crate::model::ListNfsSharesRequest>);
3118
3119 impl ListNfsShares {
3120 pub(crate) fn new(
3121 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3122 ) -> Self {
3123 Self(RequestBuilder::new(stub))
3124 }
3125
3126 pub fn with_request<V: Into<crate::model::ListNfsSharesRequest>>(mut self, v: V) -> Self {
3128 self.0.request = v.into();
3129 self
3130 }
3131
3132 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3134 self.0.options = v.into();
3135 self
3136 }
3137
3138 pub async fn send(self) -> Result<crate::model::ListNfsSharesResponse> {
3140 (*self.0.stub)
3141 .list_nfs_shares(self.0.request, self.0.options)
3142 .await
3143 .map(gax::response::Response::into_body)
3144 }
3145
3146 pub fn by_page(
3148 self,
3149 ) -> impl gax::paginator::Paginator<crate::model::ListNfsSharesResponse, gax::error::Error>
3150 {
3151 use std::clone::Clone;
3152 let token = self.0.request.page_token.clone();
3153 let execute = move |token: String| {
3154 let mut builder = self.clone();
3155 builder.0.request = builder.0.request.set_page_token(token);
3156 builder.send()
3157 };
3158 gax::paginator::internal::new_paginator(token, execute)
3159 }
3160
3161 pub fn by_item(
3163 self,
3164 ) -> impl gax::paginator::ItemPaginator<crate::model::ListNfsSharesResponse, gax::error::Error>
3165 {
3166 use gax::paginator::Paginator;
3167 self.by_page().items()
3168 }
3169
3170 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3174 self.0.request.parent = v.into();
3175 self
3176 }
3177
3178 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3180 self.0.request.page_size = v.into();
3181 self
3182 }
3183
3184 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3186 self.0.request.page_token = v.into();
3187 self
3188 }
3189
3190 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3192 self.0.request.filter = v.into();
3193 self
3194 }
3195 }
3196
3197 #[doc(hidden)]
3198 impl gax::options::internal::RequestBuilder for ListNfsShares {
3199 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3200 &mut self.0.options
3201 }
3202 }
3203
3204 #[derive(Clone, Debug)]
3223 pub struct UpdateNfsShare(RequestBuilder<crate::model::UpdateNfsShareRequest>);
3224
3225 impl UpdateNfsShare {
3226 pub(crate) fn new(
3227 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3228 ) -> Self {
3229 Self(RequestBuilder::new(stub))
3230 }
3231
3232 pub fn with_request<V: Into<crate::model::UpdateNfsShareRequest>>(mut self, v: V) -> Self {
3234 self.0.request = v.into();
3235 self
3236 }
3237
3238 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3240 self.0.options = v.into();
3241 self
3242 }
3243
3244 pub async fn send(self) -> Result<longrunning::model::Operation> {
3251 (*self.0.stub)
3252 .update_nfs_share(self.0.request, self.0.options)
3253 .await
3254 .map(gax::response::Response::into_body)
3255 }
3256
3257 pub fn poller(
3259 self,
3260 ) -> impl lro::Poller<crate::model::NfsShare, crate::model::OperationMetadata> {
3261 type Operation =
3262 lro::internal::Operation<crate::model::NfsShare, crate::model::OperationMetadata>;
3263 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3264 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3265
3266 let stub = self.0.stub.clone();
3267 let mut options = self.0.options.clone();
3268 options.set_retry_policy(gax::retry_policy::NeverRetry);
3269 let query = move |name| {
3270 let stub = stub.clone();
3271 let options = options.clone();
3272 async {
3273 let op = GetOperation::new(stub)
3274 .set_name(name)
3275 .with_options(options)
3276 .send()
3277 .await?;
3278 Ok(Operation::new(op))
3279 }
3280 };
3281
3282 let start = move || async {
3283 let op = self.send().await?;
3284 Ok(Operation::new(op))
3285 };
3286
3287 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3288 }
3289
3290 pub fn set_nfs_share<T>(mut self, v: T) -> Self
3294 where
3295 T: std::convert::Into<crate::model::NfsShare>,
3296 {
3297 self.0.request.nfs_share = std::option::Option::Some(v.into());
3298 self
3299 }
3300
3301 pub fn set_or_clear_nfs_share<T>(mut self, v: std::option::Option<T>) -> Self
3305 where
3306 T: std::convert::Into<crate::model::NfsShare>,
3307 {
3308 self.0.request.nfs_share = v.map(|x| x.into());
3309 self
3310 }
3311
3312 pub fn set_update_mask<T>(mut self, v: T) -> Self
3314 where
3315 T: std::convert::Into<wkt::FieldMask>,
3316 {
3317 self.0.request.update_mask = std::option::Option::Some(v.into());
3318 self
3319 }
3320
3321 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3323 where
3324 T: std::convert::Into<wkt::FieldMask>,
3325 {
3326 self.0.request.update_mask = v.map(|x| x.into());
3327 self
3328 }
3329 }
3330
3331 #[doc(hidden)]
3332 impl gax::options::internal::RequestBuilder for UpdateNfsShare {
3333 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3334 &mut self.0.options
3335 }
3336 }
3337
3338 #[derive(Clone, Debug)]
3357 pub struct CreateNfsShare(RequestBuilder<crate::model::CreateNfsShareRequest>);
3358
3359 impl CreateNfsShare {
3360 pub(crate) fn new(
3361 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3362 ) -> Self {
3363 Self(RequestBuilder::new(stub))
3364 }
3365
3366 pub fn with_request<V: Into<crate::model::CreateNfsShareRequest>>(mut self, v: V) -> Self {
3368 self.0.request = v.into();
3369 self
3370 }
3371
3372 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3374 self.0.options = v.into();
3375 self
3376 }
3377
3378 pub async fn send(self) -> Result<longrunning::model::Operation> {
3385 (*self.0.stub)
3386 .create_nfs_share(self.0.request, self.0.options)
3387 .await
3388 .map(gax::response::Response::into_body)
3389 }
3390
3391 pub fn poller(
3393 self,
3394 ) -> impl lro::Poller<crate::model::NfsShare, crate::model::OperationMetadata> {
3395 type Operation =
3396 lro::internal::Operation<crate::model::NfsShare, crate::model::OperationMetadata>;
3397 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3398 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3399
3400 let stub = self.0.stub.clone();
3401 let mut options = self.0.options.clone();
3402 options.set_retry_policy(gax::retry_policy::NeverRetry);
3403 let query = move |name| {
3404 let stub = stub.clone();
3405 let options = options.clone();
3406 async {
3407 let op = GetOperation::new(stub)
3408 .set_name(name)
3409 .with_options(options)
3410 .send()
3411 .await?;
3412 Ok(Operation::new(op))
3413 }
3414 };
3415
3416 let start = move || async {
3417 let op = self.send().await?;
3418 Ok(Operation::new(op))
3419 };
3420
3421 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3422 }
3423
3424 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3428 self.0.request.parent = v.into();
3429 self
3430 }
3431
3432 pub fn set_nfs_share<T>(mut self, v: T) -> Self
3436 where
3437 T: std::convert::Into<crate::model::NfsShare>,
3438 {
3439 self.0.request.nfs_share = std::option::Option::Some(v.into());
3440 self
3441 }
3442
3443 pub fn set_or_clear_nfs_share<T>(mut self, v: std::option::Option<T>) -> Self
3447 where
3448 T: std::convert::Into<crate::model::NfsShare>,
3449 {
3450 self.0.request.nfs_share = v.map(|x| x.into());
3451 self
3452 }
3453 }
3454
3455 #[doc(hidden)]
3456 impl gax::options::internal::RequestBuilder for CreateNfsShare {
3457 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3458 &mut self.0.options
3459 }
3460 }
3461
3462 #[derive(Clone, Debug)]
3480 pub struct RenameNfsShare(RequestBuilder<crate::model::RenameNfsShareRequest>);
3481
3482 impl RenameNfsShare {
3483 pub(crate) fn new(
3484 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3485 ) -> Self {
3486 Self(RequestBuilder::new(stub))
3487 }
3488
3489 pub fn with_request<V: Into<crate::model::RenameNfsShareRequest>>(mut self, v: V) -> Self {
3491 self.0.request = v.into();
3492 self
3493 }
3494
3495 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3497 self.0.options = v.into();
3498 self
3499 }
3500
3501 pub async fn send(self) -> Result<crate::model::NfsShare> {
3503 (*self.0.stub)
3504 .rename_nfs_share(self.0.request, self.0.options)
3505 .await
3506 .map(gax::response::Response::into_body)
3507 }
3508
3509 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3513 self.0.request.name = v.into();
3514 self
3515 }
3516
3517 pub fn set_new_nfsshare_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3521 self.0.request.new_nfsshare_id = v.into();
3522 self
3523 }
3524 }
3525
3526 #[doc(hidden)]
3527 impl gax::options::internal::RequestBuilder for RenameNfsShare {
3528 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3529 &mut self.0.options
3530 }
3531 }
3532
3533 #[derive(Clone, Debug)]
3552 pub struct DeleteNfsShare(RequestBuilder<crate::model::DeleteNfsShareRequest>);
3553
3554 impl DeleteNfsShare {
3555 pub(crate) fn new(
3556 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3557 ) -> Self {
3558 Self(RequestBuilder::new(stub))
3559 }
3560
3561 pub fn with_request<V: Into<crate::model::DeleteNfsShareRequest>>(mut self, v: V) -> Self {
3563 self.0.request = v.into();
3564 self
3565 }
3566
3567 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3569 self.0.options = v.into();
3570 self
3571 }
3572
3573 pub async fn send(self) -> Result<longrunning::model::Operation> {
3580 (*self.0.stub)
3581 .delete_nfs_share(self.0.request, self.0.options)
3582 .await
3583 .map(gax::response::Response::into_body)
3584 }
3585
3586 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3588 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3589 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3590 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3591
3592 let stub = self.0.stub.clone();
3593 let mut options = self.0.options.clone();
3594 options.set_retry_policy(gax::retry_policy::NeverRetry);
3595 let query = move |name| {
3596 let stub = stub.clone();
3597 let options = options.clone();
3598 async {
3599 let op = GetOperation::new(stub)
3600 .set_name(name)
3601 .with_options(options)
3602 .send()
3603 .await?;
3604 Ok(Operation::new(op))
3605 }
3606 };
3607
3608 let start = move || async {
3609 let op = self.send().await?;
3610 Ok(Operation::new(op))
3611 };
3612
3613 lro::internal::new_unit_response_poller(
3614 polling_error_policy,
3615 polling_backoff_policy,
3616 start,
3617 query,
3618 )
3619 }
3620
3621 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3625 self.0.request.name = v.into();
3626 self
3627 }
3628 }
3629
3630 #[doc(hidden)]
3631 impl gax::options::internal::RequestBuilder for DeleteNfsShare {
3632 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3633 &mut self.0.options
3634 }
3635 }
3636
3637 #[derive(Clone, Debug)]
3659 pub struct ListProvisioningQuotas(RequestBuilder<crate::model::ListProvisioningQuotasRequest>);
3660
3661 impl ListProvisioningQuotas {
3662 pub(crate) fn new(
3663 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3664 ) -> Self {
3665 Self(RequestBuilder::new(stub))
3666 }
3667
3668 pub fn with_request<V: Into<crate::model::ListProvisioningQuotasRequest>>(
3670 mut self,
3671 v: V,
3672 ) -> Self {
3673 self.0.request = v.into();
3674 self
3675 }
3676
3677 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3679 self.0.options = v.into();
3680 self
3681 }
3682
3683 pub async fn send(self) -> Result<crate::model::ListProvisioningQuotasResponse> {
3685 (*self.0.stub)
3686 .list_provisioning_quotas(self.0.request, self.0.options)
3687 .await
3688 .map(gax::response::Response::into_body)
3689 }
3690
3691 pub fn by_page(
3693 self,
3694 ) -> impl gax::paginator::Paginator<
3695 crate::model::ListProvisioningQuotasResponse,
3696 gax::error::Error,
3697 > {
3698 use std::clone::Clone;
3699 let token = self.0.request.page_token.clone();
3700 let execute = move |token: String| {
3701 let mut builder = self.clone();
3702 builder.0.request = builder.0.request.set_page_token(token);
3703 builder.send()
3704 };
3705 gax::paginator::internal::new_paginator(token, execute)
3706 }
3707
3708 pub fn by_item(
3710 self,
3711 ) -> impl gax::paginator::ItemPaginator<
3712 crate::model::ListProvisioningQuotasResponse,
3713 gax::error::Error,
3714 > {
3715 use gax::paginator::Paginator;
3716 self.by_page().items()
3717 }
3718
3719 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3723 self.0.request.parent = v.into();
3724 self
3725 }
3726
3727 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3729 self.0.request.page_size = v.into();
3730 self
3731 }
3732
3733 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3735 self.0.request.page_token = v.into();
3736 self
3737 }
3738 }
3739
3740 #[doc(hidden)]
3741 impl gax::options::internal::RequestBuilder for ListProvisioningQuotas {
3742 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3743 &mut self.0.options
3744 }
3745 }
3746
3747 #[derive(Clone, Debug)]
3765 pub struct SubmitProvisioningConfig(
3766 RequestBuilder<crate::model::SubmitProvisioningConfigRequest>,
3767 );
3768
3769 impl SubmitProvisioningConfig {
3770 pub(crate) fn new(
3771 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3772 ) -> Self {
3773 Self(RequestBuilder::new(stub))
3774 }
3775
3776 pub fn with_request<V: Into<crate::model::SubmitProvisioningConfigRequest>>(
3778 mut self,
3779 v: V,
3780 ) -> Self {
3781 self.0.request = v.into();
3782 self
3783 }
3784
3785 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3787 self.0.options = v.into();
3788 self
3789 }
3790
3791 pub async fn send(self) -> Result<crate::model::SubmitProvisioningConfigResponse> {
3793 (*self.0.stub)
3794 .submit_provisioning_config(self.0.request, self.0.options)
3795 .await
3796 .map(gax::response::Response::into_body)
3797 }
3798
3799 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3803 self.0.request.parent = v.into();
3804 self
3805 }
3806
3807 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
3811 where
3812 T: std::convert::Into<crate::model::ProvisioningConfig>,
3813 {
3814 self.0.request.provisioning_config = std::option::Option::Some(v.into());
3815 self
3816 }
3817
3818 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
3822 where
3823 T: std::convert::Into<crate::model::ProvisioningConfig>,
3824 {
3825 self.0.request.provisioning_config = v.map(|x| x.into());
3826 self
3827 }
3828
3829 pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
3831 self.0.request.email = v.into();
3832 self
3833 }
3834 }
3835
3836 #[doc(hidden)]
3837 impl gax::options::internal::RequestBuilder for SubmitProvisioningConfig {
3838 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3839 &mut self.0.options
3840 }
3841 }
3842
3843 #[derive(Clone, Debug)]
3861 pub struct GetProvisioningConfig(RequestBuilder<crate::model::GetProvisioningConfigRequest>);
3862
3863 impl GetProvisioningConfig {
3864 pub(crate) fn new(
3865 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3866 ) -> Self {
3867 Self(RequestBuilder::new(stub))
3868 }
3869
3870 pub fn with_request<V: Into<crate::model::GetProvisioningConfigRequest>>(
3872 mut self,
3873 v: V,
3874 ) -> Self {
3875 self.0.request = v.into();
3876 self
3877 }
3878
3879 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3881 self.0.options = v.into();
3882 self
3883 }
3884
3885 pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
3887 (*self.0.stub)
3888 .get_provisioning_config(self.0.request, self.0.options)
3889 .await
3890 .map(gax::response::Response::into_body)
3891 }
3892
3893 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3897 self.0.request.name = v.into();
3898 self
3899 }
3900 }
3901
3902 #[doc(hidden)]
3903 impl gax::options::internal::RequestBuilder for GetProvisioningConfig {
3904 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3905 &mut self.0.options
3906 }
3907 }
3908
3909 #[derive(Clone, Debug)]
3927 pub struct CreateProvisioningConfig(
3928 RequestBuilder<crate::model::CreateProvisioningConfigRequest>,
3929 );
3930
3931 impl CreateProvisioningConfig {
3932 pub(crate) fn new(
3933 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3934 ) -> Self {
3935 Self(RequestBuilder::new(stub))
3936 }
3937
3938 pub fn with_request<V: Into<crate::model::CreateProvisioningConfigRequest>>(
3940 mut self,
3941 v: V,
3942 ) -> Self {
3943 self.0.request = v.into();
3944 self
3945 }
3946
3947 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3949 self.0.options = v.into();
3950 self
3951 }
3952
3953 pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
3955 (*self.0.stub)
3956 .create_provisioning_config(self.0.request, self.0.options)
3957 .await
3958 .map(gax::response::Response::into_body)
3959 }
3960
3961 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3965 self.0.request.parent = v.into();
3966 self
3967 }
3968
3969 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
3973 where
3974 T: std::convert::Into<crate::model::ProvisioningConfig>,
3975 {
3976 self.0.request.provisioning_config = std::option::Option::Some(v.into());
3977 self
3978 }
3979
3980 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
3984 where
3985 T: std::convert::Into<crate::model::ProvisioningConfig>,
3986 {
3987 self.0.request.provisioning_config = v.map(|x| x.into());
3988 self
3989 }
3990
3991 pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
3993 self.0.request.email = v.into();
3994 self
3995 }
3996 }
3997
3998 #[doc(hidden)]
3999 impl gax::options::internal::RequestBuilder for CreateProvisioningConfig {
4000 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4001 &mut self.0.options
4002 }
4003 }
4004
4005 #[derive(Clone, Debug)]
4023 pub struct UpdateProvisioningConfig(
4024 RequestBuilder<crate::model::UpdateProvisioningConfigRequest>,
4025 );
4026
4027 impl UpdateProvisioningConfig {
4028 pub(crate) fn new(
4029 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4030 ) -> Self {
4031 Self(RequestBuilder::new(stub))
4032 }
4033
4034 pub fn with_request<V: Into<crate::model::UpdateProvisioningConfigRequest>>(
4036 mut self,
4037 v: V,
4038 ) -> Self {
4039 self.0.request = v.into();
4040 self
4041 }
4042
4043 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4045 self.0.options = v.into();
4046 self
4047 }
4048
4049 pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
4051 (*self.0.stub)
4052 .update_provisioning_config(self.0.request, self.0.options)
4053 .await
4054 .map(gax::response::Response::into_body)
4055 }
4056
4057 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
4061 where
4062 T: std::convert::Into<crate::model::ProvisioningConfig>,
4063 {
4064 self.0.request.provisioning_config = std::option::Option::Some(v.into());
4065 self
4066 }
4067
4068 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
4072 where
4073 T: std::convert::Into<crate::model::ProvisioningConfig>,
4074 {
4075 self.0.request.provisioning_config = v.map(|x| x.into());
4076 self
4077 }
4078
4079 pub fn set_update_mask<T>(mut self, v: T) -> Self
4083 where
4084 T: std::convert::Into<wkt::FieldMask>,
4085 {
4086 self.0.request.update_mask = std::option::Option::Some(v.into());
4087 self
4088 }
4089
4090 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4094 where
4095 T: std::convert::Into<wkt::FieldMask>,
4096 {
4097 self.0.request.update_mask = v.map(|x| x.into());
4098 self
4099 }
4100
4101 pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
4103 self.0.request.email = v.into();
4104 self
4105 }
4106 }
4107
4108 #[doc(hidden)]
4109 impl gax::options::internal::RequestBuilder for UpdateProvisioningConfig {
4110 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4111 &mut self.0.options
4112 }
4113 }
4114
4115 #[derive(Clone, Debug)]
4133 pub struct RenameNetwork(RequestBuilder<crate::model::RenameNetworkRequest>);
4134
4135 impl RenameNetwork {
4136 pub(crate) fn new(
4137 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4138 ) -> Self {
4139 Self(RequestBuilder::new(stub))
4140 }
4141
4142 pub fn with_request<V: Into<crate::model::RenameNetworkRequest>>(mut self, v: V) -> Self {
4144 self.0.request = v.into();
4145 self
4146 }
4147
4148 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4150 self.0.options = v.into();
4151 self
4152 }
4153
4154 pub async fn send(self) -> Result<crate::model::Network> {
4156 (*self.0.stub)
4157 .rename_network(self.0.request, self.0.options)
4158 .await
4159 .map(gax::response::Response::into_body)
4160 }
4161
4162 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4166 self.0.request.name = v.into();
4167 self
4168 }
4169
4170 pub fn set_new_network_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4174 self.0.request.new_network_id = v.into();
4175 self
4176 }
4177 }
4178
4179 #[doc(hidden)]
4180 impl gax::options::internal::RequestBuilder for RenameNetwork {
4181 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4182 &mut self.0.options
4183 }
4184 }
4185
4186 #[derive(Clone, Debug)]
4208 pub struct ListOSImages(RequestBuilder<crate::model::ListOSImagesRequest>);
4209
4210 impl ListOSImages {
4211 pub(crate) fn new(
4212 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4213 ) -> Self {
4214 Self(RequestBuilder::new(stub))
4215 }
4216
4217 pub fn with_request<V: Into<crate::model::ListOSImagesRequest>>(mut self, v: V) -> Self {
4219 self.0.request = v.into();
4220 self
4221 }
4222
4223 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4225 self.0.options = v.into();
4226 self
4227 }
4228
4229 pub async fn send(self) -> Result<crate::model::ListOSImagesResponse> {
4231 (*self.0.stub)
4232 .list_os_images(self.0.request, self.0.options)
4233 .await
4234 .map(gax::response::Response::into_body)
4235 }
4236
4237 pub fn by_page(
4239 self,
4240 ) -> impl gax::paginator::Paginator<crate::model::ListOSImagesResponse, gax::error::Error>
4241 {
4242 use std::clone::Clone;
4243 let token = self.0.request.page_token.clone();
4244 let execute = move |token: String| {
4245 let mut builder = self.clone();
4246 builder.0.request = builder.0.request.set_page_token(token);
4247 builder.send()
4248 };
4249 gax::paginator::internal::new_paginator(token, execute)
4250 }
4251
4252 pub fn by_item(
4254 self,
4255 ) -> impl gax::paginator::ItemPaginator<crate::model::ListOSImagesResponse, gax::error::Error>
4256 {
4257 use gax::paginator::Paginator;
4258 self.by_page().items()
4259 }
4260
4261 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4265 self.0.request.parent = v.into();
4266 self
4267 }
4268
4269 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4271 self.0.request.page_size = v.into();
4272 self
4273 }
4274
4275 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4277 self.0.request.page_token = v.into();
4278 self
4279 }
4280 }
4281
4282 #[doc(hidden)]
4283 impl gax::options::internal::RequestBuilder for ListOSImages {
4284 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4285 &mut self.0.options
4286 }
4287 }
4288
4289 #[derive(Clone, Debug)]
4311 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4312
4313 impl ListLocations {
4314 pub(crate) fn new(
4315 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4316 ) -> Self {
4317 Self(RequestBuilder::new(stub))
4318 }
4319
4320 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4322 mut self,
4323 v: V,
4324 ) -> Self {
4325 self.0.request = v.into();
4326 self
4327 }
4328
4329 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4331 self.0.options = v.into();
4332 self
4333 }
4334
4335 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4337 (*self.0.stub)
4338 .list_locations(self.0.request, self.0.options)
4339 .await
4340 .map(gax::response::Response::into_body)
4341 }
4342
4343 pub fn by_page(
4345 self,
4346 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4347 {
4348 use std::clone::Clone;
4349 let token = self.0.request.page_token.clone();
4350 let execute = move |token: String| {
4351 let mut builder = self.clone();
4352 builder.0.request = builder.0.request.set_page_token(token);
4353 builder.send()
4354 };
4355 gax::paginator::internal::new_paginator(token, execute)
4356 }
4357
4358 pub fn by_item(
4360 self,
4361 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4362 {
4363 use gax::paginator::Paginator;
4364 self.by_page().items()
4365 }
4366
4367 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4369 self.0.request.name = v.into();
4370 self
4371 }
4372
4373 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4375 self.0.request.filter = v.into();
4376 self
4377 }
4378
4379 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4381 self.0.request.page_size = v.into();
4382 self
4383 }
4384
4385 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4387 self.0.request.page_token = v.into();
4388 self
4389 }
4390 }
4391
4392 #[doc(hidden)]
4393 impl gax::options::internal::RequestBuilder for ListLocations {
4394 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4395 &mut self.0.options
4396 }
4397 }
4398
4399 #[derive(Clone, Debug)]
4417 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4418
4419 impl GetLocation {
4420 pub(crate) fn new(
4421 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4422 ) -> Self {
4423 Self(RequestBuilder::new(stub))
4424 }
4425
4426 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4428 self.0.request = v.into();
4429 self
4430 }
4431
4432 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4434 self.0.options = v.into();
4435 self
4436 }
4437
4438 pub async fn send(self) -> Result<location::model::Location> {
4440 (*self.0.stub)
4441 .get_location(self.0.request, self.0.options)
4442 .await
4443 .map(gax::response::Response::into_body)
4444 }
4445
4446 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4448 self.0.request.name = v.into();
4449 self
4450 }
4451 }
4452
4453 #[doc(hidden)]
4454 impl gax::options::internal::RequestBuilder for GetLocation {
4455 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4456 &mut self.0.options
4457 }
4458 }
4459
4460 #[derive(Clone, Debug)]
4478 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4479
4480 impl GetOperation {
4481 pub(crate) fn new(
4482 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4483 ) -> Self {
4484 Self(RequestBuilder::new(stub))
4485 }
4486
4487 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4489 mut self,
4490 v: V,
4491 ) -> Self {
4492 self.0.request = v.into();
4493 self
4494 }
4495
4496 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4498 self.0.options = v.into();
4499 self
4500 }
4501
4502 pub async fn send(self) -> Result<longrunning::model::Operation> {
4504 (*self.0.stub)
4505 .get_operation(self.0.request, self.0.options)
4506 .await
4507 .map(gax::response::Response::into_body)
4508 }
4509
4510 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4512 self.0.request.name = v.into();
4513 self
4514 }
4515 }
4516
4517 #[doc(hidden)]
4518 impl gax::options::internal::RequestBuilder for GetOperation {
4519 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4520 &mut self.0.options
4521 }
4522 }
4523}