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)]
95 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
96
97 impl ListInstances {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
118 (*self.0.stub)
119 .list_instances(self.0.request, self.0.options)
120 .await
121 .map(gax::response::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
143 {
144 use gax::paginator::Paginator;
145 self.by_page().items()
146 }
147
148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152 self.0.request.parent = v.into();
153 self
154 }
155
156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158 self.0.request.page_size = v.into();
159 self
160 }
161
162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.page_token = v.into();
165 self
166 }
167
168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.filter = v.into();
171 self
172 }
173 }
174
175 #[doc(hidden)]
176 impl gax::options::internal::RequestBuilder for ListInstances {
177 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
178 &mut self.0.options
179 }
180 }
181
182 #[derive(Clone, Debug)]
199 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
200
201 impl GetInstance {
202 pub(crate) fn new(
203 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
204 ) -> Self {
205 Self(RequestBuilder::new(stub))
206 }
207
208 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
210 self.0.request = v.into();
211 self
212 }
213
214 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
216 self.0.options = v.into();
217 self
218 }
219
220 pub async fn send(self) -> Result<crate::model::Instance> {
222 (*self.0.stub)
223 .get_instance(self.0.request, self.0.options)
224 .await
225 .map(gax::response::Response::into_body)
226 }
227
228 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
232 self.0.request.name = v.into();
233 self
234 }
235 }
236
237 #[doc(hidden)]
238 impl gax::options::internal::RequestBuilder for GetInstance {
239 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
240 &mut self.0.options
241 }
242 }
243
244 #[derive(Clone, Debug)]
262 pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
263
264 impl UpdateInstance {
265 pub(crate) fn new(
266 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
267 ) -> Self {
268 Self(RequestBuilder::new(stub))
269 }
270
271 pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
273 self.0.request = v.into();
274 self
275 }
276
277 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
279 self.0.options = v.into();
280 self
281 }
282
283 pub async fn send(self) -> Result<longrunning::model::Operation> {
290 (*self.0.stub)
291 .update_instance(self.0.request, self.0.options)
292 .await
293 .map(gax::response::Response::into_body)
294 }
295
296 pub fn poller(
298 self,
299 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
300 type Operation =
301 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
302 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
303 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
304
305 let stub = self.0.stub.clone();
306 let mut options = self.0.options.clone();
307 options.set_retry_policy(gax::retry_policy::NeverRetry);
308 let query = move |name| {
309 let stub = stub.clone();
310 let options = options.clone();
311 async {
312 let op = GetOperation::new(stub)
313 .set_name(name)
314 .with_options(options)
315 .send()
316 .await?;
317 Ok(Operation::new(op))
318 }
319 };
320
321 let start = move || async {
322 let op = self.send().await?;
323 Ok(Operation::new(op))
324 };
325
326 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
327 }
328
329 pub fn set_instance<T>(mut self, v: T) -> Self
333 where
334 T: std::convert::Into<crate::model::Instance>,
335 {
336 self.0.request.instance = std::option::Option::Some(v.into());
337 self
338 }
339
340 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
344 where
345 T: std::convert::Into<crate::model::Instance>,
346 {
347 self.0.request.instance = v.map(|x| x.into());
348 self
349 }
350
351 pub fn set_update_mask<T>(mut self, v: T) -> Self
353 where
354 T: std::convert::Into<wkt::FieldMask>,
355 {
356 self.0.request.update_mask = std::option::Option::Some(v.into());
357 self
358 }
359
360 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
362 where
363 T: std::convert::Into<wkt::FieldMask>,
364 {
365 self.0.request.update_mask = v.map(|x| x.into());
366 self
367 }
368 }
369
370 #[doc(hidden)]
371 impl gax::options::internal::RequestBuilder for UpdateInstance {
372 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
373 &mut self.0.options
374 }
375 }
376
377 #[derive(Clone, Debug)]
394 pub struct RenameInstance(RequestBuilder<crate::model::RenameInstanceRequest>);
395
396 impl RenameInstance {
397 pub(crate) fn new(
398 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
399 ) -> Self {
400 Self(RequestBuilder::new(stub))
401 }
402
403 pub fn with_request<V: Into<crate::model::RenameInstanceRequest>>(mut self, v: V) -> Self {
405 self.0.request = v.into();
406 self
407 }
408
409 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
411 self.0.options = v.into();
412 self
413 }
414
415 pub async fn send(self) -> Result<crate::model::Instance> {
417 (*self.0.stub)
418 .rename_instance(self.0.request, self.0.options)
419 .await
420 .map(gax::response::Response::into_body)
421 }
422
423 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
427 self.0.request.name = v.into();
428 self
429 }
430
431 pub fn set_new_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
435 self.0.request.new_instance_id = v.into();
436 self
437 }
438 }
439
440 #[doc(hidden)]
441 impl gax::options::internal::RequestBuilder for RenameInstance {
442 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
443 &mut self.0.options
444 }
445 }
446
447 #[derive(Clone, Debug)]
465 pub struct ResetInstance(RequestBuilder<crate::model::ResetInstanceRequest>);
466
467 impl ResetInstance {
468 pub(crate) fn new(
469 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
470 ) -> Self {
471 Self(RequestBuilder::new(stub))
472 }
473
474 pub fn with_request<V: Into<crate::model::ResetInstanceRequest>>(mut self, v: V) -> Self {
476 self.0.request = v.into();
477 self
478 }
479
480 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
482 self.0.options = v.into();
483 self
484 }
485
486 pub async fn send(self) -> Result<longrunning::model::Operation> {
493 (*self.0.stub)
494 .reset_instance(self.0.request, self.0.options)
495 .await
496 .map(gax::response::Response::into_body)
497 }
498
499 pub fn poller(
501 self,
502 ) -> impl lro::Poller<crate::model::ResetInstanceResponse, crate::model::OperationMetadata>
503 {
504 type Operation = lro::internal::Operation<
505 crate::model::ResetInstanceResponse,
506 crate::model::OperationMetadata,
507 >;
508 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
509 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
510
511 let stub = self.0.stub.clone();
512 let mut options = self.0.options.clone();
513 options.set_retry_policy(gax::retry_policy::NeverRetry);
514 let query = move |name| {
515 let stub = stub.clone();
516 let options = options.clone();
517 async {
518 let op = GetOperation::new(stub)
519 .set_name(name)
520 .with_options(options)
521 .send()
522 .await?;
523 Ok(Operation::new(op))
524 }
525 };
526
527 let start = move || async {
528 let op = self.send().await?;
529 Ok(Operation::new(op))
530 };
531
532 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
533 }
534
535 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
539 self.0.request.name = v.into();
540 self
541 }
542 }
543
544 #[doc(hidden)]
545 impl gax::options::internal::RequestBuilder for ResetInstance {
546 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
547 &mut self.0.options
548 }
549 }
550
551 #[derive(Clone, Debug)]
569 pub struct StartInstance(RequestBuilder<crate::model::StartInstanceRequest>);
570
571 impl StartInstance {
572 pub(crate) fn new(
573 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
574 ) -> Self {
575 Self(RequestBuilder::new(stub))
576 }
577
578 pub fn with_request<V: Into<crate::model::StartInstanceRequest>>(mut self, v: V) -> Self {
580 self.0.request = v.into();
581 self
582 }
583
584 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
586 self.0.options = v.into();
587 self
588 }
589
590 pub async fn send(self) -> Result<longrunning::model::Operation> {
597 (*self.0.stub)
598 .start_instance(self.0.request, self.0.options)
599 .await
600 .map(gax::response::Response::into_body)
601 }
602
603 pub fn poller(
605 self,
606 ) -> impl lro::Poller<crate::model::StartInstanceResponse, crate::model::OperationMetadata>
607 {
608 type Operation = lro::internal::Operation<
609 crate::model::StartInstanceResponse,
610 crate::model::OperationMetadata,
611 >;
612 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
613 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
614
615 let stub = self.0.stub.clone();
616 let mut options = self.0.options.clone();
617 options.set_retry_policy(gax::retry_policy::NeverRetry);
618 let query = move |name| {
619 let stub = stub.clone();
620 let options = options.clone();
621 async {
622 let op = GetOperation::new(stub)
623 .set_name(name)
624 .with_options(options)
625 .send()
626 .await?;
627 Ok(Operation::new(op))
628 }
629 };
630
631 let start = move || async {
632 let op = self.send().await?;
633 Ok(Operation::new(op))
634 };
635
636 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
637 }
638
639 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
643 self.0.request.name = v.into();
644 self
645 }
646 }
647
648 #[doc(hidden)]
649 impl gax::options::internal::RequestBuilder for StartInstance {
650 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
651 &mut self.0.options
652 }
653 }
654
655 #[derive(Clone, Debug)]
673 pub struct StopInstance(RequestBuilder<crate::model::StopInstanceRequest>);
674
675 impl StopInstance {
676 pub(crate) fn new(
677 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
678 ) -> Self {
679 Self(RequestBuilder::new(stub))
680 }
681
682 pub fn with_request<V: Into<crate::model::StopInstanceRequest>>(mut self, v: V) -> Self {
684 self.0.request = v.into();
685 self
686 }
687
688 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
690 self.0.options = v.into();
691 self
692 }
693
694 pub async fn send(self) -> Result<longrunning::model::Operation> {
701 (*self.0.stub)
702 .stop_instance(self.0.request, self.0.options)
703 .await
704 .map(gax::response::Response::into_body)
705 }
706
707 pub fn poller(
709 self,
710 ) -> impl lro::Poller<crate::model::StopInstanceResponse, crate::model::OperationMetadata>
711 {
712 type Operation = lro::internal::Operation<
713 crate::model::StopInstanceResponse,
714 crate::model::OperationMetadata,
715 >;
716 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
717 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
718
719 let stub = self.0.stub.clone();
720 let mut options = self.0.options.clone();
721 options.set_retry_policy(gax::retry_policy::NeverRetry);
722 let query = move |name| {
723 let stub = stub.clone();
724 let options = options.clone();
725 async {
726 let op = GetOperation::new(stub)
727 .set_name(name)
728 .with_options(options)
729 .send()
730 .await?;
731 Ok(Operation::new(op))
732 }
733 };
734
735 let start = move || async {
736 let op = self.send().await?;
737 Ok(Operation::new(op))
738 };
739
740 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
741 }
742
743 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
747 self.0.request.name = v.into();
748 self
749 }
750 }
751
752 #[doc(hidden)]
753 impl gax::options::internal::RequestBuilder for StopInstance {
754 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
755 &mut self.0.options
756 }
757 }
758
759 #[derive(Clone, Debug)]
777 pub struct EnableInteractiveSerialConsole(
778 RequestBuilder<crate::model::EnableInteractiveSerialConsoleRequest>,
779 );
780
781 impl EnableInteractiveSerialConsole {
782 pub(crate) fn new(
783 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
784 ) -> Self {
785 Self(RequestBuilder::new(stub))
786 }
787
788 pub fn with_request<V: Into<crate::model::EnableInteractiveSerialConsoleRequest>>(
790 mut self,
791 v: V,
792 ) -> Self {
793 self.0.request = v.into();
794 self
795 }
796
797 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
799 self.0.options = v.into();
800 self
801 }
802
803 pub async fn send(self) -> Result<longrunning::model::Operation> {
810 (*self.0.stub)
811 .enable_interactive_serial_console(self.0.request, self.0.options)
812 .await
813 .map(gax::response::Response::into_body)
814 }
815
816 pub fn poller(
818 self,
819 ) -> impl lro::Poller<
820 crate::model::EnableInteractiveSerialConsoleResponse,
821 crate::model::OperationMetadata,
822 > {
823 type Operation = lro::internal::Operation<
824 crate::model::EnableInteractiveSerialConsoleResponse,
825 crate::model::OperationMetadata,
826 >;
827 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
828 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
829
830 let stub = self.0.stub.clone();
831 let mut options = self.0.options.clone();
832 options.set_retry_policy(gax::retry_policy::NeverRetry);
833 let query = move |name| {
834 let stub = stub.clone();
835 let options = options.clone();
836 async {
837 let op = GetOperation::new(stub)
838 .set_name(name)
839 .with_options(options)
840 .send()
841 .await?;
842 Ok(Operation::new(op))
843 }
844 };
845
846 let start = move || async {
847 let op = self.send().await?;
848 Ok(Operation::new(op))
849 };
850
851 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
852 }
853
854 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
858 self.0.request.name = v.into();
859 self
860 }
861 }
862
863 #[doc(hidden)]
864 impl gax::options::internal::RequestBuilder for EnableInteractiveSerialConsole {
865 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
866 &mut self.0.options
867 }
868 }
869
870 #[derive(Clone, Debug)]
888 pub struct DisableInteractiveSerialConsole(
889 RequestBuilder<crate::model::DisableInteractiveSerialConsoleRequest>,
890 );
891
892 impl DisableInteractiveSerialConsole {
893 pub(crate) fn new(
894 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
895 ) -> Self {
896 Self(RequestBuilder::new(stub))
897 }
898
899 pub fn with_request<V: Into<crate::model::DisableInteractiveSerialConsoleRequest>>(
901 mut self,
902 v: V,
903 ) -> Self {
904 self.0.request = v.into();
905 self
906 }
907
908 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
910 self.0.options = v.into();
911 self
912 }
913
914 pub async fn send(self) -> Result<longrunning::model::Operation> {
921 (*self.0.stub)
922 .disable_interactive_serial_console(self.0.request, self.0.options)
923 .await
924 .map(gax::response::Response::into_body)
925 }
926
927 pub fn poller(
929 self,
930 ) -> impl lro::Poller<
931 crate::model::DisableInteractiveSerialConsoleResponse,
932 crate::model::OperationMetadata,
933 > {
934 type Operation = lro::internal::Operation<
935 crate::model::DisableInteractiveSerialConsoleResponse,
936 crate::model::OperationMetadata,
937 >;
938 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
939 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
940
941 let stub = self.0.stub.clone();
942 let mut options = self.0.options.clone();
943 options.set_retry_policy(gax::retry_policy::NeverRetry);
944 let query = move |name| {
945 let stub = stub.clone();
946 let options = options.clone();
947 async {
948 let op = GetOperation::new(stub)
949 .set_name(name)
950 .with_options(options)
951 .send()
952 .await?;
953 Ok(Operation::new(op))
954 }
955 };
956
957 let start = move || async {
958 let op = self.send().await?;
959 Ok(Operation::new(op))
960 };
961
962 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
963 }
964
965 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
969 self.0.request.name = v.into();
970 self
971 }
972 }
973
974 #[doc(hidden)]
975 impl gax::options::internal::RequestBuilder for DisableInteractiveSerialConsole {
976 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
977 &mut self.0.options
978 }
979 }
980
981 #[derive(Clone, Debug)]
999 pub struct DetachLun(RequestBuilder<crate::model::DetachLunRequest>);
1000
1001 impl DetachLun {
1002 pub(crate) fn new(
1003 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1004 ) -> Self {
1005 Self(RequestBuilder::new(stub))
1006 }
1007
1008 pub fn with_request<V: Into<crate::model::DetachLunRequest>>(mut self, v: V) -> Self {
1010 self.0.request = v.into();
1011 self
1012 }
1013
1014 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1016 self.0.options = v.into();
1017 self
1018 }
1019
1020 pub async fn send(self) -> Result<longrunning::model::Operation> {
1027 (*self.0.stub)
1028 .detach_lun(self.0.request, self.0.options)
1029 .await
1030 .map(gax::response::Response::into_body)
1031 }
1032
1033 pub fn poller(
1035 self,
1036 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
1037 type Operation =
1038 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
1039 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1040 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1041
1042 let stub = self.0.stub.clone();
1043 let mut options = self.0.options.clone();
1044 options.set_retry_policy(gax::retry_policy::NeverRetry);
1045 let query = move |name| {
1046 let stub = stub.clone();
1047 let options = options.clone();
1048 async {
1049 let op = GetOperation::new(stub)
1050 .set_name(name)
1051 .with_options(options)
1052 .send()
1053 .await?;
1054 Ok(Operation::new(op))
1055 }
1056 };
1057
1058 let start = move || async {
1059 let op = self.send().await?;
1060 Ok(Operation::new(op))
1061 };
1062
1063 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1064 }
1065
1066 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1070 self.0.request.instance = v.into();
1071 self
1072 }
1073
1074 pub fn set_lun<T: Into<std::string::String>>(mut self, v: T) -> Self {
1078 self.0.request.lun = v.into();
1079 self
1080 }
1081
1082 pub fn set_skip_reboot<T: Into<bool>>(mut self, v: T) -> Self {
1084 self.0.request.skip_reboot = v.into();
1085 self
1086 }
1087 }
1088
1089 #[doc(hidden)]
1090 impl gax::options::internal::RequestBuilder for DetachLun {
1091 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1092 &mut self.0.options
1093 }
1094 }
1095
1096 #[derive(Clone, Debug)]
1117 pub struct ListSSHKeys(RequestBuilder<crate::model::ListSSHKeysRequest>);
1118
1119 impl ListSSHKeys {
1120 pub(crate) fn new(
1121 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1122 ) -> Self {
1123 Self(RequestBuilder::new(stub))
1124 }
1125
1126 pub fn with_request<V: Into<crate::model::ListSSHKeysRequest>>(mut self, v: V) -> Self {
1128 self.0.request = v.into();
1129 self
1130 }
1131
1132 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1134 self.0.options = v.into();
1135 self
1136 }
1137
1138 pub async fn send(self) -> Result<crate::model::ListSSHKeysResponse> {
1140 (*self.0.stub)
1141 .list_ssh_keys(self.0.request, self.0.options)
1142 .await
1143 .map(gax::response::Response::into_body)
1144 }
1145
1146 pub fn by_page(
1148 self,
1149 ) -> impl gax::paginator::Paginator<crate::model::ListSSHKeysResponse, gax::error::Error>
1150 {
1151 use std::clone::Clone;
1152 let token = self.0.request.page_token.clone();
1153 let execute = move |token: String| {
1154 let mut builder = self.clone();
1155 builder.0.request = builder.0.request.set_page_token(token);
1156 builder.send()
1157 };
1158 gax::paginator::internal::new_paginator(token, execute)
1159 }
1160
1161 pub fn by_item(
1163 self,
1164 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSSHKeysResponse, gax::error::Error>
1165 {
1166 use gax::paginator::Paginator;
1167 self.by_page().items()
1168 }
1169
1170 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1174 self.0.request.parent = v.into();
1175 self
1176 }
1177
1178 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1180 self.0.request.page_size = v.into();
1181 self
1182 }
1183
1184 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1186 self.0.request.page_token = v.into();
1187 self
1188 }
1189 }
1190
1191 #[doc(hidden)]
1192 impl gax::options::internal::RequestBuilder for ListSSHKeys {
1193 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1194 &mut self.0.options
1195 }
1196 }
1197
1198 #[derive(Clone, Debug)]
1215 pub struct CreateSSHKey(RequestBuilder<crate::model::CreateSSHKeyRequest>);
1216
1217 impl CreateSSHKey {
1218 pub(crate) fn new(
1219 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1220 ) -> Self {
1221 Self(RequestBuilder::new(stub))
1222 }
1223
1224 pub fn with_request<V: Into<crate::model::CreateSSHKeyRequest>>(mut self, v: V) -> Self {
1226 self.0.request = v.into();
1227 self
1228 }
1229
1230 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1232 self.0.options = v.into();
1233 self
1234 }
1235
1236 pub async fn send(self) -> Result<crate::model::SSHKey> {
1238 (*self.0.stub)
1239 .create_ssh_key(self.0.request, self.0.options)
1240 .await
1241 .map(gax::response::Response::into_body)
1242 }
1243
1244 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1248 self.0.request.parent = v.into();
1249 self
1250 }
1251
1252 pub fn set_ssh_key<T>(mut self, v: T) -> Self
1256 where
1257 T: std::convert::Into<crate::model::SSHKey>,
1258 {
1259 self.0.request.ssh_key = std::option::Option::Some(v.into());
1260 self
1261 }
1262
1263 pub fn set_or_clear_ssh_key<T>(mut self, v: std::option::Option<T>) -> Self
1267 where
1268 T: std::convert::Into<crate::model::SSHKey>,
1269 {
1270 self.0.request.ssh_key = v.map(|x| x.into());
1271 self
1272 }
1273
1274 pub fn set_ssh_key_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1278 self.0.request.ssh_key_id = v.into();
1279 self
1280 }
1281 }
1282
1283 #[doc(hidden)]
1284 impl gax::options::internal::RequestBuilder for CreateSSHKey {
1285 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1286 &mut self.0.options
1287 }
1288 }
1289
1290 #[derive(Clone, Debug)]
1307 pub struct DeleteSSHKey(RequestBuilder<crate::model::DeleteSSHKeyRequest>);
1308
1309 impl DeleteSSHKey {
1310 pub(crate) fn new(
1311 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1312 ) -> Self {
1313 Self(RequestBuilder::new(stub))
1314 }
1315
1316 pub fn with_request<V: Into<crate::model::DeleteSSHKeyRequest>>(mut self, v: V) -> Self {
1318 self.0.request = v.into();
1319 self
1320 }
1321
1322 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1324 self.0.options = v.into();
1325 self
1326 }
1327
1328 pub async fn send(self) -> Result<()> {
1330 (*self.0.stub)
1331 .delete_ssh_key(self.0.request, self.0.options)
1332 .await
1333 .map(gax::response::Response::into_body)
1334 }
1335
1336 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1340 self.0.request.name = v.into();
1341 self
1342 }
1343 }
1344
1345 #[doc(hidden)]
1346 impl gax::options::internal::RequestBuilder for DeleteSSHKey {
1347 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1348 &mut self.0.options
1349 }
1350 }
1351
1352 #[derive(Clone, Debug)]
1373 pub struct ListVolumes(RequestBuilder<crate::model::ListVolumesRequest>);
1374
1375 impl ListVolumes {
1376 pub(crate) fn new(
1377 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1378 ) -> Self {
1379 Self(RequestBuilder::new(stub))
1380 }
1381
1382 pub fn with_request<V: Into<crate::model::ListVolumesRequest>>(mut self, v: V) -> Self {
1384 self.0.request = v.into();
1385 self
1386 }
1387
1388 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1390 self.0.options = v.into();
1391 self
1392 }
1393
1394 pub async fn send(self) -> Result<crate::model::ListVolumesResponse> {
1396 (*self.0.stub)
1397 .list_volumes(self.0.request, self.0.options)
1398 .await
1399 .map(gax::response::Response::into_body)
1400 }
1401
1402 pub fn by_page(
1404 self,
1405 ) -> impl gax::paginator::Paginator<crate::model::ListVolumesResponse, gax::error::Error>
1406 {
1407 use std::clone::Clone;
1408 let token = self.0.request.page_token.clone();
1409 let execute = move |token: String| {
1410 let mut builder = self.clone();
1411 builder.0.request = builder.0.request.set_page_token(token);
1412 builder.send()
1413 };
1414 gax::paginator::internal::new_paginator(token, execute)
1415 }
1416
1417 pub fn by_item(
1419 self,
1420 ) -> impl gax::paginator::ItemPaginator<crate::model::ListVolumesResponse, gax::error::Error>
1421 {
1422 use gax::paginator::Paginator;
1423 self.by_page().items()
1424 }
1425
1426 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1430 self.0.request.parent = v.into();
1431 self
1432 }
1433
1434 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1436 self.0.request.page_size = v.into();
1437 self
1438 }
1439
1440 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1442 self.0.request.page_token = v.into();
1443 self
1444 }
1445
1446 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1448 self.0.request.filter = v.into();
1449 self
1450 }
1451 }
1452
1453 #[doc(hidden)]
1454 impl gax::options::internal::RequestBuilder for ListVolumes {
1455 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1456 &mut self.0.options
1457 }
1458 }
1459
1460 #[derive(Clone, Debug)]
1477 pub struct GetVolume(RequestBuilder<crate::model::GetVolumeRequest>);
1478
1479 impl GetVolume {
1480 pub(crate) fn new(
1481 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1482 ) -> Self {
1483 Self(RequestBuilder::new(stub))
1484 }
1485
1486 pub fn with_request<V: Into<crate::model::GetVolumeRequest>>(mut self, v: V) -> Self {
1488 self.0.request = v.into();
1489 self
1490 }
1491
1492 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1494 self.0.options = v.into();
1495 self
1496 }
1497
1498 pub async fn send(self) -> Result<crate::model::Volume> {
1500 (*self.0.stub)
1501 .get_volume(self.0.request, self.0.options)
1502 .await
1503 .map(gax::response::Response::into_body)
1504 }
1505
1506 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1510 self.0.request.name = v.into();
1511 self
1512 }
1513 }
1514
1515 #[doc(hidden)]
1516 impl gax::options::internal::RequestBuilder for GetVolume {
1517 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1518 &mut self.0.options
1519 }
1520 }
1521
1522 #[derive(Clone, Debug)]
1540 pub struct UpdateVolume(RequestBuilder<crate::model::UpdateVolumeRequest>);
1541
1542 impl UpdateVolume {
1543 pub(crate) fn new(
1544 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1545 ) -> Self {
1546 Self(RequestBuilder::new(stub))
1547 }
1548
1549 pub fn with_request<V: Into<crate::model::UpdateVolumeRequest>>(mut self, v: V) -> Self {
1551 self.0.request = v.into();
1552 self
1553 }
1554
1555 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1557 self.0.options = v.into();
1558 self
1559 }
1560
1561 pub async fn send(self) -> Result<longrunning::model::Operation> {
1568 (*self.0.stub)
1569 .update_volume(self.0.request, self.0.options)
1570 .await
1571 .map(gax::response::Response::into_body)
1572 }
1573
1574 pub fn poller(
1576 self,
1577 ) -> impl lro::Poller<crate::model::Volume, crate::model::OperationMetadata> {
1578 type Operation =
1579 lro::internal::Operation<crate::model::Volume, crate::model::OperationMetadata>;
1580 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1581 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1582
1583 let stub = self.0.stub.clone();
1584 let mut options = self.0.options.clone();
1585 options.set_retry_policy(gax::retry_policy::NeverRetry);
1586 let query = move |name| {
1587 let stub = stub.clone();
1588 let options = options.clone();
1589 async {
1590 let op = GetOperation::new(stub)
1591 .set_name(name)
1592 .with_options(options)
1593 .send()
1594 .await?;
1595 Ok(Operation::new(op))
1596 }
1597 };
1598
1599 let start = move || async {
1600 let op = self.send().await?;
1601 Ok(Operation::new(op))
1602 };
1603
1604 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1605 }
1606
1607 pub fn set_volume<T>(mut self, v: T) -> Self
1611 where
1612 T: std::convert::Into<crate::model::Volume>,
1613 {
1614 self.0.request.volume = std::option::Option::Some(v.into());
1615 self
1616 }
1617
1618 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
1622 where
1623 T: std::convert::Into<crate::model::Volume>,
1624 {
1625 self.0.request.volume = v.map(|x| x.into());
1626 self
1627 }
1628
1629 pub fn set_update_mask<T>(mut self, v: T) -> Self
1631 where
1632 T: std::convert::Into<wkt::FieldMask>,
1633 {
1634 self.0.request.update_mask = std::option::Option::Some(v.into());
1635 self
1636 }
1637
1638 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1640 where
1641 T: std::convert::Into<wkt::FieldMask>,
1642 {
1643 self.0.request.update_mask = v.map(|x| x.into());
1644 self
1645 }
1646 }
1647
1648 #[doc(hidden)]
1649 impl gax::options::internal::RequestBuilder for UpdateVolume {
1650 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1651 &mut self.0.options
1652 }
1653 }
1654
1655 #[derive(Clone, Debug)]
1672 pub struct RenameVolume(RequestBuilder<crate::model::RenameVolumeRequest>);
1673
1674 impl RenameVolume {
1675 pub(crate) fn new(
1676 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1677 ) -> Self {
1678 Self(RequestBuilder::new(stub))
1679 }
1680
1681 pub fn with_request<V: Into<crate::model::RenameVolumeRequest>>(mut self, v: V) -> Self {
1683 self.0.request = v.into();
1684 self
1685 }
1686
1687 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1689 self.0.options = v.into();
1690 self
1691 }
1692
1693 pub async fn send(self) -> Result<crate::model::Volume> {
1695 (*self.0.stub)
1696 .rename_volume(self.0.request, self.0.options)
1697 .await
1698 .map(gax::response::Response::into_body)
1699 }
1700
1701 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1705 self.0.request.name = v.into();
1706 self
1707 }
1708
1709 pub fn set_new_volume_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1713 self.0.request.new_volume_id = v.into();
1714 self
1715 }
1716 }
1717
1718 #[doc(hidden)]
1719 impl gax::options::internal::RequestBuilder for RenameVolume {
1720 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1721 &mut self.0.options
1722 }
1723 }
1724
1725 #[derive(Clone, Debug)]
1743 pub struct EvictVolume(RequestBuilder<crate::model::EvictVolumeRequest>);
1744
1745 impl EvictVolume {
1746 pub(crate) fn new(
1747 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1748 ) -> Self {
1749 Self(RequestBuilder::new(stub))
1750 }
1751
1752 pub fn with_request<V: Into<crate::model::EvictVolumeRequest>>(mut self, v: V) -> Self {
1754 self.0.request = v.into();
1755 self
1756 }
1757
1758 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1760 self.0.options = v.into();
1761 self
1762 }
1763
1764 pub async fn send(self) -> Result<longrunning::model::Operation> {
1771 (*self.0.stub)
1772 .evict_volume(self.0.request, self.0.options)
1773 .await
1774 .map(gax::response::Response::into_body)
1775 }
1776
1777 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1779 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1780 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1781 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1782
1783 let stub = self.0.stub.clone();
1784 let mut options = self.0.options.clone();
1785 options.set_retry_policy(gax::retry_policy::NeverRetry);
1786 let query = move |name| {
1787 let stub = stub.clone();
1788 let options = options.clone();
1789 async {
1790 let op = GetOperation::new(stub)
1791 .set_name(name)
1792 .with_options(options)
1793 .send()
1794 .await?;
1795 Ok(Operation::new(op))
1796 }
1797 };
1798
1799 let start = move || async {
1800 let op = self.send().await?;
1801 Ok(Operation::new(op))
1802 };
1803
1804 lro::internal::new_unit_response_poller(
1805 polling_error_policy,
1806 polling_backoff_policy,
1807 start,
1808 query,
1809 )
1810 }
1811
1812 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1816 self.0.request.name = v.into();
1817 self
1818 }
1819 }
1820
1821 #[doc(hidden)]
1822 impl gax::options::internal::RequestBuilder for EvictVolume {
1823 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1824 &mut self.0.options
1825 }
1826 }
1827
1828 #[derive(Clone, Debug)]
1846 pub struct ResizeVolume(RequestBuilder<crate::model::ResizeVolumeRequest>);
1847
1848 impl ResizeVolume {
1849 pub(crate) fn new(
1850 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1851 ) -> Self {
1852 Self(RequestBuilder::new(stub))
1853 }
1854
1855 pub fn with_request<V: Into<crate::model::ResizeVolumeRequest>>(mut self, v: V) -> Self {
1857 self.0.request = v.into();
1858 self
1859 }
1860
1861 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1863 self.0.options = v.into();
1864 self
1865 }
1866
1867 pub async fn send(self) -> Result<longrunning::model::Operation> {
1874 (*self.0.stub)
1875 .resize_volume(self.0.request, self.0.options)
1876 .await
1877 .map(gax::response::Response::into_body)
1878 }
1879
1880 pub fn poller(
1882 self,
1883 ) -> impl lro::Poller<crate::model::Volume, crate::model::OperationMetadata> {
1884 type Operation =
1885 lro::internal::Operation<crate::model::Volume, crate::model::OperationMetadata>;
1886 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1887 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1888
1889 let stub = self.0.stub.clone();
1890 let mut options = self.0.options.clone();
1891 options.set_retry_policy(gax::retry_policy::NeverRetry);
1892 let query = move |name| {
1893 let stub = stub.clone();
1894 let options = options.clone();
1895 async {
1896 let op = GetOperation::new(stub)
1897 .set_name(name)
1898 .with_options(options)
1899 .send()
1900 .await?;
1901 Ok(Operation::new(op))
1902 }
1903 };
1904
1905 let start = move || async {
1906 let op = self.send().await?;
1907 Ok(Operation::new(op))
1908 };
1909
1910 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1911 }
1912
1913 pub fn set_volume<T: Into<std::string::String>>(mut self, v: T) -> Self {
1917 self.0.request.volume = v.into();
1918 self
1919 }
1920
1921 pub fn set_size_gib<T: Into<i64>>(mut self, v: T) -> Self {
1923 self.0.request.size_gib = v.into();
1924 self
1925 }
1926 }
1927
1928 #[doc(hidden)]
1929 impl gax::options::internal::RequestBuilder for ResizeVolume {
1930 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1931 &mut self.0.options
1932 }
1933 }
1934
1935 #[derive(Clone, Debug)]
1956 pub struct ListNetworks(RequestBuilder<crate::model::ListNetworksRequest>);
1957
1958 impl ListNetworks {
1959 pub(crate) fn new(
1960 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1961 ) -> Self {
1962 Self(RequestBuilder::new(stub))
1963 }
1964
1965 pub fn with_request<V: Into<crate::model::ListNetworksRequest>>(mut self, v: V) -> Self {
1967 self.0.request = v.into();
1968 self
1969 }
1970
1971 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1973 self.0.options = v.into();
1974 self
1975 }
1976
1977 pub async fn send(self) -> Result<crate::model::ListNetworksResponse> {
1979 (*self.0.stub)
1980 .list_networks(self.0.request, self.0.options)
1981 .await
1982 .map(gax::response::Response::into_body)
1983 }
1984
1985 pub fn by_page(
1987 self,
1988 ) -> impl gax::paginator::Paginator<crate::model::ListNetworksResponse, gax::error::Error>
1989 {
1990 use std::clone::Clone;
1991 let token = self.0.request.page_token.clone();
1992 let execute = move |token: String| {
1993 let mut builder = self.clone();
1994 builder.0.request = builder.0.request.set_page_token(token);
1995 builder.send()
1996 };
1997 gax::paginator::internal::new_paginator(token, execute)
1998 }
1999
2000 pub fn by_item(
2002 self,
2003 ) -> impl gax::paginator::ItemPaginator<crate::model::ListNetworksResponse, gax::error::Error>
2004 {
2005 use gax::paginator::Paginator;
2006 self.by_page().items()
2007 }
2008
2009 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2013 self.0.request.parent = v.into();
2014 self
2015 }
2016
2017 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2019 self.0.request.page_size = v.into();
2020 self
2021 }
2022
2023 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2025 self.0.request.page_token = v.into();
2026 self
2027 }
2028
2029 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2031 self.0.request.filter = v.into();
2032 self
2033 }
2034 }
2035
2036 #[doc(hidden)]
2037 impl gax::options::internal::RequestBuilder for ListNetworks {
2038 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2039 &mut self.0.options
2040 }
2041 }
2042
2043 #[derive(Clone, Debug)]
2060 pub struct ListNetworkUsage(RequestBuilder<crate::model::ListNetworkUsageRequest>);
2061
2062 impl ListNetworkUsage {
2063 pub(crate) fn new(
2064 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2065 ) -> Self {
2066 Self(RequestBuilder::new(stub))
2067 }
2068
2069 pub fn with_request<V: Into<crate::model::ListNetworkUsageRequest>>(
2071 mut self,
2072 v: V,
2073 ) -> Self {
2074 self.0.request = v.into();
2075 self
2076 }
2077
2078 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2080 self.0.options = v.into();
2081 self
2082 }
2083
2084 pub async fn send(self) -> Result<crate::model::ListNetworkUsageResponse> {
2086 (*self.0.stub)
2087 .list_network_usage(self.0.request, self.0.options)
2088 .await
2089 .map(gax::response::Response::into_body)
2090 }
2091
2092 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2096 self.0.request.location = v.into();
2097 self
2098 }
2099 }
2100
2101 #[doc(hidden)]
2102 impl gax::options::internal::RequestBuilder for ListNetworkUsage {
2103 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2104 &mut self.0.options
2105 }
2106 }
2107
2108 #[derive(Clone, Debug)]
2125 pub struct GetNetwork(RequestBuilder<crate::model::GetNetworkRequest>);
2126
2127 impl GetNetwork {
2128 pub(crate) fn new(
2129 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2130 ) -> Self {
2131 Self(RequestBuilder::new(stub))
2132 }
2133
2134 pub fn with_request<V: Into<crate::model::GetNetworkRequest>>(mut self, v: V) -> Self {
2136 self.0.request = v.into();
2137 self
2138 }
2139
2140 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2142 self.0.options = v.into();
2143 self
2144 }
2145
2146 pub async fn send(self) -> Result<crate::model::Network> {
2148 (*self.0.stub)
2149 .get_network(self.0.request, self.0.options)
2150 .await
2151 .map(gax::response::Response::into_body)
2152 }
2153
2154 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2158 self.0.request.name = v.into();
2159 self
2160 }
2161 }
2162
2163 #[doc(hidden)]
2164 impl gax::options::internal::RequestBuilder for GetNetwork {
2165 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2166 &mut self.0.options
2167 }
2168 }
2169
2170 #[derive(Clone, Debug)]
2188 pub struct UpdateNetwork(RequestBuilder<crate::model::UpdateNetworkRequest>);
2189
2190 impl UpdateNetwork {
2191 pub(crate) fn new(
2192 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2193 ) -> Self {
2194 Self(RequestBuilder::new(stub))
2195 }
2196
2197 pub fn with_request<V: Into<crate::model::UpdateNetworkRequest>>(mut self, v: V) -> Self {
2199 self.0.request = v.into();
2200 self
2201 }
2202
2203 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2205 self.0.options = v.into();
2206 self
2207 }
2208
2209 pub async fn send(self) -> Result<longrunning::model::Operation> {
2216 (*self.0.stub)
2217 .update_network(self.0.request, self.0.options)
2218 .await
2219 .map(gax::response::Response::into_body)
2220 }
2221
2222 pub fn poller(
2224 self,
2225 ) -> impl lro::Poller<crate::model::Network, crate::model::OperationMetadata> {
2226 type Operation =
2227 lro::internal::Operation<crate::model::Network, crate::model::OperationMetadata>;
2228 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2229 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2230
2231 let stub = self.0.stub.clone();
2232 let mut options = self.0.options.clone();
2233 options.set_retry_policy(gax::retry_policy::NeverRetry);
2234 let query = move |name| {
2235 let stub = stub.clone();
2236 let options = options.clone();
2237 async {
2238 let op = GetOperation::new(stub)
2239 .set_name(name)
2240 .with_options(options)
2241 .send()
2242 .await?;
2243 Ok(Operation::new(op))
2244 }
2245 };
2246
2247 let start = move || async {
2248 let op = self.send().await?;
2249 Ok(Operation::new(op))
2250 };
2251
2252 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2253 }
2254
2255 pub fn set_network<T>(mut self, v: T) -> Self
2259 where
2260 T: std::convert::Into<crate::model::Network>,
2261 {
2262 self.0.request.network = std::option::Option::Some(v.into());
2263 self
2264 }
2265
2266 pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
2270 where
2271 T: std::convert::Into<crate::model::Network>,
2272 {
2273 self.0.request.network = v.map(|x| x.into());
2274 self
2275 }
2276
2277 pub fn set_update_mask<T>(mut self, v: T) -> Self
2279 where
2280 T: std::convert::Into<wkt::FieldMask>,
2281 {
2282 self.0.request.update_mask = std::option::Option::Some(v.into());
2283 self
2284 }
2285
2286 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2288 where
2289 T: std::convert::Into<wkt::FieldMask>,
2290 {
2291 self.0.request.update_mask = v.map(|x| x.into());
2292 self
2293 }
2294 }
2295
2296 #[doc(hidden)]
2297 impl gax::options::internal::RequestBuilder for UpdateNetwork {
2298 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2299 &mut self.0.options
2300 }
2301 }
2302
2303 #[derive(Clone, Debug)]
2320 pub struct CreateVolumeSnapshot(RequestBuilder<crate::model::CreateVolumeSnapshotRequest>);
2321
2322 impl CreateVolumeSnapshot {
2323 pub(crate) fn new(
2324 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2325 ) -> Self {
2326 Self(RequestBuilder::new(stub))
2327 }
2328
2329 pub fn with_request<V: Into<crate::model::CreateVolumeSnapshotRequest>>(
2331 mut self,
2332 v: V,
2333 ) -> Self {
2334 self.0.request = v.into();
2335 self
2336 }
2337
2338 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2340 self.0.options = v.into();
2341 self
2342 }
2343
2344 pub async fn send(self) -> Result<crate::model::VolumeSnapshot> {
2346 (*self.0.stub)
2347 .create_volume_snapshot(self.0.request, self.0.options)
2348 .await
2349 .map(gax::response::Response::into_body)
2350 }
2351
2352 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2356 self.0.request.parent = v.into();
2357 self
2358 }
2359
2360 pub fn set_volume_snapshot<T>(mut self, v: T) -> Self
2364 where
2365 T: std::convert::Into<crate::model::VolumeSnapshot>,
2366 {
2367 self.0.request.volume_snapshot = std::option::Option::Some(v.into());
2368 self
2369 }
2370
2371 pub fn set_or_clear_volume_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
2375 where
2376 T: std::convert::Into<crate::model::VolumeSnapshot>,
2377 {
2378 self.0.request.volume_snapshot = v.map(|x| x.into());
2379 self
2380 }
2381 }
2382
2383 #[doc(hidden)]
2384 impl gax::options::internal::RequestBuilder for CreateVolumeSnapshot {
2385 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2386 &mut self.0.options
2387 }
2388 }
2389
2390 #[derive(Clone, Debug)]
2408 pub struct RestoreVolumeSnapshot(RequestBuilder<crate::model::RestoreVolumeSnapshotRequest>);
2409
2410 impl RestoreVolumeSnapshot {
2411 pub(crate) fn new(
2412 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2413 ) -> Self {
2414 Self(RequestBuilder::new(stub))
2415 }
2416
2417 pub fn with_request<V: Into<crate::model::RestoreVolumeSnapshotRequest>>(
2419 mut self,
2420 v: V,
2421 ) -> Self {
2422 self.0.request = v.into();
2423 self
2424 }
2425
2426 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2428 self.0.options = v.into();
2429 self
2430 }
2431
2432 pub async fn send(self) -> Result<longrunning::model::Operation> {
2439 (*self.0.stub)
2440 .restore_volume_snapshot(self.0.request, self.0.options)
2441 .await
2442 .map(gax::response::Response::into_body)
2443 }
2444
2445 pub fn poller(
2447 self,
2448 ) -> impl lro::Poller<crate::model::VolumeSnapshot, crate::model::OperationMetadata>
2449 {
2450 type Operation = lro::internal::Operation<
2451 crate::model::VolumeSnapshot,
2452 crate::model::OperationMetadata,
2453 >;
2454 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2455 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2456
2457 let stub = self.0.stub.clone();
2458 let mut options = self.0.options.clone();
2459 options.set_retry_policy(gax::retry_policy::NeverRetry);
2460 let query = move |name| {
2461 let stub = stub.clone();
2462 let options = options.clone();
2463 async {
2464 let op = GetOperation::new(stub)
2465 .set_name(name)
2466 .with_options(options)
2467 .send()
2468 .await?;
2469 Ok(Operation::new(op))
2470 }
2471 };
2472
2473 let start = move || async {
2474 let op = self.send().await?;
2475 Ok(Operation::new(op))
2476 };
2477
2478 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2479 }
2480
2481 pub fn set_volume_snapshot<T: Into<std::string::String>>(mut self, v: T) -> Self {
2485 self.0.request.volume_snapshot = v.into();
2486 self
2487 }
2488 }
2489
2490 #[doc(hidden)]
2491 impl gax::options::internal::RequestBuilder for RestoreVolumeSnapshot {
2492 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2493 &mut self.0.options
2494 }
2495 }
2496
2497 #[derive(Clone, Debug)]
2514 pub struct DeleteVolumeSnapshot(RequestBuilder<crate::model::DeleteVolumeSnapshotRequest>);
2515
2516 impl DeleteVolumeSnapshot {
2517 pub(crate) fn new(
2518 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2519 ) -> Self {
2520 Self(RequestBuilder::new(stub))
2521 }
2522
2523 pub fn with_request<V: Into<crate::model::DeleteVolumeSnapshotRequest>>(
2525 mut self,
2526 v: V,
2527 ) -> Self {
2528 self.0.request = v.into();
2529 self
2530 }
2531
2532 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2534 self.0.options = v.into();
2535 self
2536 }
2537
2538 pub async fn send(self) -> Result<()> {
2540 (*self.0.stub)
2541 .delete_volume_snapshot(self.0.request, self.0.options)
2542 .await
2543 .map(gax::response::Response::into_body)
2544 }
2545
2546 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2550 self.0.request.name = v.into();
2551 self
2552 }
2553 }
2554
2555 #[doc(hidden)]
2556 impl gax::options::internal::RequestBuilder for DeleteVolumeSnapshot {
2557 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2558 &mut self.0.options
2559 }
2560 }
2561
2562 #[derive(Clone, Debug)]
2579 pub struct GetVolumeSnapshot(RequestBuilder<crate::model::GetVolumeSnapshotRequest>);
2580
2581 impl GetVolumeSnapshot {
2582 pub(crate) fn new(
2583 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2584 ) -> Self {
2585 Self(RequestBuilder::new(stub))
2586 }
2587
2588 pub fn with_request<V: Into<crate::model::GetVolumeSnapshotRequest>>(
2590 mut self,
2591 v: V,
2592 ) -> Self {
2593 self.0.request = v.into();
2594 self
2595 }
2596
2597 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2599 self.0.options = v.into();
2600 self
2601 }
2602
2603 pub async fn send(self) -> Result<crate::model::VolumeSnapshot> {
2605 (*self.0.stub)
2606 .get_volume_snapshot(self.0.request, self.0.options)
2607 .await
2608 .map(gax::response::Response::into_body)
2609 }
2610
2611 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2615 self.0.request.name = v.into();
2616 self
2617 }
2618 }
2619
2620 #[doc(hidden)]
2621 impl gax::options::internal::RequestBuilder for GetVolumeSnapshot {
2622 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2623 &mut self.0.options
2624 }
2625 }
2626
2627 #[derive(Clone, Debug)]
2648 pub struct ListVolumeSnapshots(RequestBuilder<crate::model::ListVolumeSnapshotsRequest>);
2649
2650 impl ListVolumeSnapshots {
2651 pub(crate) fn new(
2652 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2653 ) -> Self {
2654 Self(RequestBuilder::new(stub))
2655 }
2656
2657 pub fn with_request<V: Into<crate::model::ListVolumeSnapshotsRequest>>(
2659 mut self,
2660 v: V,
2661 ) -> Self {
2662 self.0.request = v.into();
2663 self
2664 }
2665
2666 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2668 self.0.options = v.into();
2669 self
2670 }
2671
2672 pub async fn send(self) -> Result<crate::model::ListVolumeSnapshotsResponse> {
2674 (*self.0.stub)
2675 .list_volume_snapshots(self.0.request, self.0.options)
2676 .await
2677 .map(gax::response::Response::into_body)
2678 }
2679
2680 pub fn by_page(
2682 self,
2683 ) -> impl gax::paginator::Paginator<crate::model::ListVolumeSnapshotsResponse, gax::error::Error>
2684 {
2685 use std::clone::Clone;
2686 let token = self.0.request.page_token.clone();
2687 let execute = move |token: String| {
2688 let mut builder = self.clone();
2689 builder.0.request = builder.0.request.set_page_token(token);
2690 builder.send()
2691 };
2692 gax::paginator::internal::new_paginator(token, execute)
2693 }
2694
2695 pub fn by_item(
2697 self,
2698 ) -> impl gax::paginator::ItemPaginator<
2699 crate::model::ListVolumeSnapshotsResponse,
2700 gax::error::Error,
2701 > {
2702 use gax::paginator::Paginator;
2703 self.by_page().items()
2704 }
2705
2706 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2710 self.0.request.parent = v.into();
2711 self
2712 }
2713
2714 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2716 self.0.request.page_size = v.into();
2717 self
2718 }
2719
2720 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2722 self.0.request.page_token = v.into();
2723 self
2724 }
2725 }
2726
2727 #[doc(hidden)]
2728 impl gax::options::internal::RequestBuilder for ListVolumeSnapshots {
2729 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2730 &mut self.0.options
2731 }
2732 }
2733
2734 #[derive(Clone, Debug)]
2751 pub struct GetLun(RequestBuilder<crate::model::GetLunRequest>);
2752
2753 impl GetLun {
2754 pub(crate) fn new(
2755 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2756 ) -> Self {
2757 Self(RequestBuilder::new(stub))
2758 }
2759
2760 pub fn with_request<V: Into<crate::model::GetLunRequest>>(mut self, v: V) -> Self {
2762 self.0.request = v.into();
2763 self
2764 }
2765
2766 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2768 self.0.options = v.into();
2769 self
2770 }
2771
2772 pub async fn send(self) -> Result<crate::model::Lun> {
2774 (*self.0.stub)
2775 .get_lun(self.0.request, self.0.options)
2776 .await
2777 .map(gax::response::Response::into_body)
2778 }
2779
2780 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2784 self.0.request.name = v.into();
2785 self
2786 }
2787 }
2788
2789 #[doc(hidden)]
2790 impl gax::options::internal::RequestBuilder for GetLun {
2791 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2792 &mut self.0.options
2793 }
2794 }
2795
2796 #[derive(Clone, Debug)]
2817 pub struct ListLuns(RequestBuilder<crate::model::ListLunsRequest>);
2818
2819 impl ListLuns {
2820 pub(crate) fn new(
2821 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2822 ) -> Self {
2823 Self(RequestBuilder::new(stub))
2824 }
2825
2826 pub fn with_request<V: Into<crate::model::ListLunsRequest>>(mut self, v: V) -> Self {
2828 self.0.request = v.into();
2829 self
2830 }
2831
2832 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2834 self.0.options = v.into();
2835 self
2836 }
2837
2838 pub async fn send(self) -> Result<crate::model::ListLunsResponse> {
2840 (*self.0.stub)
2841 .list_luns(self.0.request, self.0.options)
2842 .await
2843 .map(gax::response::Response::into_body)
2844 }
2845
2846 pub fn by_page(
2848 self,
2849 ) -> impl gax::paginator::Paginator<crate::model::ListLunsResponse, gax::error::Error>
2850 {
2851 use std::clone::Clone;
2852 let token = self.0.request.page_token.clone();
2853 let execute = move |token: String| {
2854 let mut builder = self.clone();
2855 builder.0.request = builder.0.request.set_page_token(token);
2856 builder.send()
2857 };
2858 gax::paginator::internal::new_paginator(token, execute)
2859 }
2860
2861 pub fn by_item(
2863 self,
2864 ) -> impl gax::paginator::ItemPaginator<crate::model::ListLunsResponse, gax::error::Error>
2865 {
2866 use gax::paginator::Paginator;
2867 self.by_page().items()
2868 }
2869
2870 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2874 self.0.request.parent = v.into();
2875 self
2876 }
2877
2878 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2880 self.0.request.page_size = v.into();
2881 self
2882 }
2883
2884 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2886 self.0.request.page_token = v.into();
2887 self
2888 }
2889 }
2890
2891 #[doc(hidden)]
2892 impl gax::options::internal::RequestBuilder for ListLuns {
2893 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2894 &mut self.0.options
2895 }
2896 }
2897
2898 #[derive(Clone, Debug)]
2916 pub struct EvictLun(RequestBuilder<crate::model::EvictLunRequest>);
2917
2918 impl EvictLun {
2919 pub(crate) fn new(
2920 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2921 ) -> Self {
2922 Self(RequestBuilder::new(stub))
2923 }
2924
2925 pub fn with_request<V: Into<crate::model::EvictLunRequest>>(mut self, v: V) -> Self {
2927 self.0.request = v.into();
2928 self
2929 }
2930
2931 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2933 self.0.options = v.into();
2934 self
2935 }
2936
2937 pub async fn send(self) -> Result<longrunning::model::Operation> {
2944 (*self.0.stub)
2945 .evict_lun(self.0.request, self.0.options)
2946 .await
2947 .map(gax::response::Response::into_body)
2948 }
2949
2950 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2952 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2953 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2954 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2955
2956 let stub = self.0.stub.clone();
2957 let mut options = self.0.options.clone();
2958 options.set_retry_policy(gax::retry_policy::NeverRetry);
2959 let query = move |name| {
2960 let stub = stub.clone();
2961 let options = options.clone();
2962 async {
2963 let op = GetOperation::new(stub)
2964 .set_name(name)
2965 .with_options(options)
2966 .send()
2967 .await?;
2968 Ok(Operation::new(op))
2969 }
2970 };
2971
2972 let start = move || async {
2973 let op = self.send().await?;
2974 Ok(Operation::new(op))
2975 };
2976
2977 lro::internal::new_unit_response_poller(
2978 polling_error_policy,
2979 polling_backoff_policy,
2980 start,
2981 query,
2982 )
2983 }
2984
2985 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2989 self.0.request.name = v.into();
2990 self
2991 }
2992 }
2993
2994 #[doc(hidden)]
2995 impl gax::options::internal::RequestBuilder for EvictLun {
2996 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2997 &mut self.0.options
2998 }
2999 }
3000
3001 #[derive(Clone, Debug)]
3018 pub struct GetNfsShare(RequestBuilder<crate::model::GetNfsShareRequest>);
3019
3020 impl GetNfsShare {
3021 pub(crate) fn new(
3022 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3023 ) -> Self {
3024 Self(RequestBuilder::new(stub))
3025 }
3026
3027 pub fn with_request<V: Into<crate::model::GetNfsShareRequest>>(mut self, v: V) -> Self {
3029 self.0.request = v.into();
3030 self
3031 }
3032
3033 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3035 self.0.options = v.into();
3036 self
3037 }
3038
3039 pub async fn send(self) -> Result<crate::model::NfsShare> {
3041 (*self.0.stub)
3042 .get_nfs_share(self.0.request, self.0.options)
3043 .await
3044 .map(gax::response::Response::into_body)
3045 }
3046
3047 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3051 self.0.request.name = v.into();
3052 self
3053 }
3054 }
3055
3056 #[doc(hidden)]
3057 impl gax::options::internal::RequestBuilder for GetNfsShare {
3058 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3059 &mut self.0.options
3060 }
3061 }
3062
3063 #[derive(Clone, Debug)]
3084 pub struct ListNfsShares(RequestBuilder<crate::model::ListNfsSharesRequest>);
3085
3086 impl ListNfsShares {
3087 pub(crate) fn new(
3088 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3089 ) -> Self {
3090 Self(RequestBuilder::new(stub))
3091 }
3092
3093 pub fn with_request<V: Into<crate::model::ListNfsSharesRequest>>(mut self, v: V) -> Self {
3095 self.0.request = v.into();
3096 self
3097 }
3098
3099 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3101 self.0.options = v.into();
3102 self
3103 }
3104
3105 pub async fn send(self) -> Result<crate::model::ListNfsSharesResponse> {
3107 (*self.0.stub)
3108 .list_nfs_shares(self.0.request, self.0.options)
3109 .await
3110 .map(gax::response::Response::into_body)
3111 }
3112
3113 pub fn by_page(
3115 self,
3116 ) -> impl gax::paginator::Paginator<crate::model::ListNfsSharesResponse, gax::error::Error>
3117 {
3118 use std::clone::Clone;
3119 let token = self.0.request.page_token.clone();
3120 let execute = move |token: String| {
3121 let mut builder = self.clone();
3122 builder.0.request = builder.0.request.set_page_token(token);
3123 builder.send()
3124 };
3125 gax::paginator::internal::new_paginator(token, execute)
3126 }
3127
3128 pub fn by_item(
3130 self,
3131 ) -> impl gax::paginator::ItemPaginator<crate::model::ListNfsSharesResponse, gax::error::Error>
3132 {
3133 use gax::paginator::Paginator;
3134 self.by_page().items()
3135 }
3136
3137 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3141 self.0.request.parent = v.into();
3142 self
3143 }
3144
3145 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3147 self.0.request.page_size = v.into();
3148 self
3149 }
3150
3151 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3153 self.0.request.page_token = v.into();
3154 self
3155 }
3156
3157 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3159 self.0.request.filter = v.into();
3160 self
3161 }
3162 }
3163
3164 #[doc(hidden)]
3165 impl gax::options::internal::RequestBuilder for ListNfsShares {
3166 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3167 &mut self.0.options
3168 }
3169 }
3170
3171 #[derive(Clone, Debug)]
3189 pub struct UpdateNfsShare(RequestBuilder<crate::model::UpdateNfsShareRequest>);
3190
3191 impl UpdateNfsShare {
3192 pub(crate) fn new(
3193 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3194 ) -> Self {
3195 Self(RequestBuilder::new(stub))
3196 }
3197
3198 pub fn with_request<V: Into<crate::model::UpdateNfsShareRequest>>(mut self, v: V) -> Self {
3200 self.0.request = v.into();
3201 self
3202 }
3203
3204 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3206 self.0.options = v.into();
3207 self
3208 }
3209
3210 pub async fn send(self) -> Result<longrunning::model::Operation> {
3217 (*self.0.stub)
3218 .update_nfs_share(self.0.request, self.0.options)
3219 .await
3220 .map(gax::response::Response::into_body)
3221 }
3222
3223 pub fn poller(
3225 self,
3226 ) -> impl lro::Poller<crate::model::NfsShare, crate::model::OperationMetadata> {
3227 type Operation =
3228 lro::internal::Operation<crate::model::NfsShare, crate::model::OperationMetadata>;
3229 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3230 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3231
3232 let stub = self.0.stub.clone();
3233 let mut options = self.0.options.clone();
3234 options.set_retry_policy(gax::retry_policy::NeverRetry);
3235 let query = move |name| {
3236 let stub = stub.clone();
3237 let options = options.clone();
3238 async {
3239 let op = GetOperation::new(stub)
3240 .set_name(name)
3241 .with_options(options)
3242 .send()
3243 .await?;
3244 Ok(Operation::new(op))
3245 }
3246 };
3247
3248 let start = move || async {
3249 let op = self.send().await?;
3250 Ok(Operation::new(op))
3251 };
3252
3253 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3254 }
3255
3256 pub fn set_nfs_share<T>(mut self, v: T) -> Self
3260 where
3261 T: std::convert::Into<crate::model::NfsShare>,
3262 {
3263 self.0.request.nfs_share = std::option::Option::Some(v.into());
3264 self
3265 }
3266
3267 pub fn set_or_clear_nfs_share<T>(mut self, v: std::option::Option<T>) -> Self
3271 where
3272 T: std::convert::Into<crate::model::NfsShare>,
3273 {
3274 self.0.request.nfs_share = v.map(|x| x.into());
3275 self
3276 }
3277
3278 pub fn set_update_mask<T>(mut self, v: T) -> Self
3280 where
3281 T: std::convert::Into<wkt::FieldMask>,
3282 {
3283 self.0.request.update_mask = std::option::Option::Some(v.into());
3284 self
3285 }
3286
3287 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3289 where
3290 T: std::convert::Into<wkt::FieldMask>,
3291 {
3292 self.0.request.update_mask = v.map(|x| x.into());
3293 self
3294 }
3295 }
3296
3297 #[doc(hidden)]
3298 impl gax::options::internal::RequestBuilder for UpdateNfsShare {
3299 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3300 &mut self.0.options
3301 }
3302 }
3303
3304 #[derive(Clone, Debug)]
3322 pub struct CreateNfsShare(RequestBuilder<crate::model::CreateNfsShareRequest>);
3323
3324 impl CreateNfsShare {
3325 pub(crate) fn new(
3326 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3327 ) -> Self {
3328 Self(RequestBuilder::new(stub))
3329 }
3330
3331 pub fn with_request<V: Into<crate::model::CreateNfsShareRequest>>(mut self, v: V) -> Self {
3333 self.0.request = v.into();
3334 self
3335 }
3336
3337 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3339 self.0.options = v.into();
3340 self
3341 }
3342
3343 pub async fn send(self) -> Result<longrunning::model::Operation> {
3350 (*self.0.stub)
3351 .create_nfs_share(self.0.request, self.0.options)
3352 .await
3353 .map(gax::response::Response::into_body)
3354 }
3355
3356 pub fn poller(
3358 self,
3359 ) -> impl lro::Poller<crate::model::NfsShare, crate::model::OperationMetadata> {
3360 type Operation =
3361 lro::internal::Operation<crate::model::NfsShare, crate::model::OperationMetadata>;
3362 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3363 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3364
3365 let stub = self.0.stub.clone();
3366 let mut options = self.0.options.clone();
3367 options.set_retry_policy(gax::retry_policy::NeverRetry);
3368 let query = move |name| {
3369 let stub = stub.clone();
3370 let options = options.clone();
3371 async {
3372 let op = GetOperation::new(stub)
3373 .set_name(name)
3374 .with_options(options)
3375 .send()
3376 .await?;
3377 Ok(Operation::new(op))
3378 }
3379 };
3380
3381 let start = move || async {
3382 let op = self.send().await?;
3383 Ok(Operation::new(op))
3384 };
3385
3386 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3387 }
3388
3389 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3393 self.0.request.parent = v.into();
3394 self
3395 }
3396
3397 pub fn set_nfs_share<T>(mut self, v: T) -> Self
3401 where
3402 T: std::convert::Into<crate::model::NfsShare>,
3403 {
3404 self.0.request.nfs_share = std::option::Option::Some(v.into());
3405 self
3406 }
3407
3408 pub fn set_or_clear_nfs_share<T>(mut self, v: std::option::Option<T>) -> Self
3412 where
3413 T: std::convert::Into<crate::model::NfsShare>,
3414 {
3415 self.0.request.nfs_share = v.map(|x| x.into());
3416 self
3417 }
3418 }
3419
3420 #[doc(hidden)]
3421 impl gax::options::internal::RequestBuilder for CreateNfsShare {
3422 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3423 &mut self.0.options
3424 }
3425 }
3426
3427 #[derive(Clone, Debug)]
3444 pub struct RenameNfsShare(RequestBuilder<crate::model::RenameNfsShareRequest>);
3445
3446 impl RenameNfsShare {
3447 pub(crate) fn new(
3448 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3449 ) -> Self {
3450 Self(RequestBuilder::new(stub))
3451 }
3452
3453 pub fn with_request<V: Into<crate::model::RenameNfsShareRequest>>(mut self, v: V) -> Self {
3455 self.0.request = v.into();
3456 self
3457 }
3458
3459 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3461 self.0.options = v.into();
3462 self
3463 }
3464
3465 pub async fn send(self) -> Result<crate::model::NfsShare> {
3467 (*self.0.stub)
3468 .rename_nfs_share(self.0.request, self.0.options)
3469 .await
3470 .map(gax::response::Response::into_body)
3471 }
3472
3473 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3477 self.0.request.name = v.into();
3478 self
3479 }
3480
3481 pub fn set_new_nfsshare_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3485 self.0.request.new_nfsshare_id = v.into();
3486 self
3487 }
3488 }
3489
3490 #[doc(hidden)]
3491 impl gax::options::internal::RequestBuilder for RenameNfsShare {
3492 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3493 &mut self.0.options
3494 }
3495 }
3496
3497 #[derive(Clone, Debug)]
3515 pub struct DeleteNfsShare(RequestBuilder<crate::model::DeleteNfsShareRequest>);
3516
3517 impl DeleteNfsShare {
3518 pub(crate) fn new(
3519 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3520 ) -> Self {
3521 Self(RequestBuilder::new(stub))
3522 }
3523
3524 pub fn with_request<V: Into<crate::model::DeleteNfsShareRequest>>(mut self, v: V) -> Self {
3526 self.0.request = v.into();
3527 self
3528 }
3529
3530 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3532 self.0.options = v.into();
3533 self
3534 }
3535
3536 pub async fn send(self) -> Result<longrunning::model::Operation> {
3543 (*self.0.stub)
3544 .delete_nfs_share(self.0.request, self.0.options)
3545 .await
3546 .map(gax::response::Response::into_body)
3547 }
3548
3549 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3551 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3552 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3553 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3554
3555 let stub = self.0.stub.clone();
3556 let mut options = self.0.options.clone();
3557 options.set_retry_policy(gax::retry_policy::NeverRetry);
3558 let query = move |name| {
3559 let stub = stub.clone();
3560 let options = options.clone();
3561 async {
3562 let op = GetOperation::new(stub)
3563 .set_name(name)
3564 .with_options(options)
3565 .send()
3566 .await?;
3567 Ok(Operation::new(op))
3568 }
3569 };
3570
3571 let start = move || async {
3572 let op = self.send().await?;
3573 Ok(Operation::new(op))
3574 };
3575
3576 lro::internal::new_unit_response_poller(
3577 polling_error_policy,
3578 polling_backoff_policy,
3579 start,
3580 query,
3581 )
3582 }
3583
3584 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3588 self.0.request.name = v.into();
3589 self
3590 }
3591 }
3592
3593 #[doc(hidden)]
3594 impl gax::options::internal::RequestBuilder for DeleteNfsShare {
3595 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3596 &mut self.0.options
3597 }
3598 }
3599
3600 #[derive(Clone, Debug)]
3621 pub struct ListProvisioningQuotas(RequestBuilder<crate::model::ListProvisioningQuotasRequest>);
3622
3623 impl ListProvisioningQuotas {
3624 pub(crate) fn new(
3625 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3626 ) -> Self {
3627 Self(RequestBuilder::new(stub))
3628 }
3629
3630 pub fn with_request<V: Into<crate::model::ListProvisioningQuotasRequest>>(
3632 mut self,
3633 v: V,
3634 ) -> Self {
3635 self.0.request = v.into();
3636 self
3637 }
3638
3639 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3641 self.0.options = v.into();
3642 self
3643 }
3644
3645 pub async fn send(self) -> Result<crate::model::ListProvisioningQuotasResponse> {
3647 (*self.0.stub)
3648 .list_provisioning_quotas(self.0.request, self.0.options)
3649 .await
3650 .map(gax::response::Response::into_body)
3651 }
3652
3653 pub fn by_page(
3655 self,
3656 ) -> impl gax::paginator::Paginator<
3657 crate::model::ListProvisioningQuotasResponse,
3658 gax::error::Error,
3659 > {
3660 use std::clone::Clone;
3661 let token = self.0.request.page_token.clone();
3662 let execute = move |token: String| {
3663 let mut builder = self.clone();
3664 builder.0.request = builder.0.request.set_page_token(token);
3665 builder.send()
3666 };
3667 gax::paginator::internal::new_paginator(token, execute)
3668 }
3669
3670 pub fn by_item(
3672 self,
3673 ) -> impl gax::paginator::ItemPaginator<
3674 crate::model::ListProvisioningQuotasResponse,
3675 gax::error::Error,
3676 > {
3677 use gax::paginator::Paginator;
3678 self.by_page().items()
3679 }
3680
3681 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3685 self.0.request.parent = v.into();
3686 self
3687 }
3688
3689 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3691 self.0.request.page_size = v.into();
3692 self
3693 }
3694
3695 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3697 self.0.request.page_token = v.into();
3698 self
3699 }
3700 }
3701
3702 #[doc(hidden)]
3703 impl gax::options::internal::RequestBuilder for ListProvisioningQuotas {
3704 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3705 &mut self.0.options
3706 }
3707 }
3708
3709 #[derive(Clone, Debug)]
3726 pub struct SubmitProvisioningConfig(
3727 RequestBuilder<crate::model::SubmitProvisioningConfigRequest>,
3728 );
3729
3730 impl SubmitProvisioningConfig {
3731 pub(crate) fn new(
3732 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3733 ) -> Self {
3734 Self(RequestBuilder::new(stub))
3735 }
3736
3737 pub fn with_request<V: Into<crate::model::SubmitProvisioningConfigRequest>>(
3739 mut self,
3740 v: V,
3741 ) -> Self {
3742 self.0.request = v.into();
3743 self
3744 }
3745
3746 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3748 self.0.options = v.into();
3749 self
3750 }
3751
3752 pub async fn send(self) -> Result<crate::model::SubmitProvisioningConfigResponse> {
3754 (*self.0.stub)
3755 .submit_provisioning_config(self.0.request, self.0.options)
3756 .await
3757 .map(gax::response::Response::into_body)
3758 }
3759
3760 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3764 self.0.request.parent = v.into();
3765 self
3766 }
3767
3768 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
3772 where
3773 T: std::convert::Into<crate::model::ProvisioningConfig>,
3774 {
3775 self.0.request.provisioning_config = std::option::Option::Some(v.into());
3776 self
3777 }
3778
3779 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
3783 where
3784 T: std::convert::Into<crate::model::ProvisioningConfig>,
3785 {
3786 self.0.request.provisioning_config = v.map(|x| x.into());
3787 self
3788 }
3789
3790 pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
3792 self.0.request.email = v.into();
3793 self
3794 }
3795 }
3796
3797 #[doc(hidden)]
3798 impl gax::options::internal::RequestBuilder for SubmitProvisioningConfig {
3799 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3800 &mut self.0.options
3801 }
3802 }
3803
3804 #[derive(Clone, Debug)]
3821 pub struct GetProvisioningConfig(RequestBuilder<crate::model::GetProvisioningConfigRequest>);
3822
3823 impl GetProvisioningConfig {
3824 pub(crate) fn new(
3825 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3826 ) -> Self {
3827 Self(RequestBuilder::new(stub))
3828 }
3829
3830 pub fn with_request<V: Into<crate::model::GetProvisioningConfigRequest>>(
3832 mut self,
3833 v: V,
3834 ) -> Self {
3835 self.0.request = v.into();
3836 self
3837 }
3838
3839 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3841 self.0.options = v.into();
3842 self
3843 }
3844
3845 pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
3847 (*self.0.stub)
3848 .get_provisioning_config(self.0.request, self.0.options)
3849 .await
3850 .map(gax::response::Response::into_body)
3851 }
3852
3853 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3857 self.0.request.name = v.into();
3858 self
3859 }
3860 }
3861
3862 #[doc(hidden)]
3863 impl gax::options::internal::RequestBuilder for GetProvisioningConfig {
3864 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3865 &mut self.0.options
3866 }
3867 }
3868
3869 #[derive(Clone, Debug)]
3886 pub struct CreateProvisioningConfig(
3887 RequestBuilder<crate::model::CreateProvisioningConfigRequest>,
3888 );
3889
3890 impl CreateProvisioningConfig {
3891 pub(crate) fn new(
3892 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3893 ) -> Self {
3894 Self(RequestBuilder::new(stub))
3895 }
3896
3897 pub fn with_request<V: Into<crate::model::CreateProvisioningConfigRequest>>(
3899 mut self,
3900 v: V,
3901 ) -> Self {
3902 self.0.request = v.into();
3903 self
3904 }
3905
3906 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3908 self.0.options = v.into();
3909 self
3910 }
3911
3912 pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
3914 (*self.0.stub)
3915 .create_provisioning_config(self.0.request, self.0.options)
3916 .await
3917 .map(gax::response::Response::into_body)
3918 }
3919
3920 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3924 self.0.request.parent = v.into();
3925 self
3926 }
3927
3928 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
3932 where
3933 T: std::convert::Into<crate::model::ProvisioningConfig>,
3934 {
3935 self.0.request.provisioning_config = std::option::Option::Some(v.into());
3936 self
3937 }
3938
3939 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
3943 where
3944 T: std::convert::Into<crate::model::ProvisioningConfig>,
3945 {
3946 self.0.request.provisioning_config = v.map(|x| x.into());
3947 self
3948 }
3949
3950 pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
3952 self.0.request.email = v.into();
3953 self
3954 }
3955 }
3956
3957 #[doc(hidden)]
3958 impl gax::options::internal::RequestBuilder for CreateProvisioningConfig {
3959 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3960 &mut self.0.options
3961 }
3962 }
3963
3964 #[derive(Clone, Debug)]
3981 pub struct UpdateProvisioningConfig(
3982 RequestBuilder<crate::model::UpdateProvisioningConfigRequest>,
3983 );
3984
3985 impl UpdateProvisioningConfig {
3986 pub(crate) fn new(
3987 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3988 ) -> Self {
3989 Self(RequestBuilder::new(stub))
3990 }
3991
3992 pub fn with_request<V: Into<crate::model::UpdateProvisioningConfigRequest>>(
3994 mut self,
3995 v: V,
3996 ) -> Self {
3997 self.0.request = v.into();
3998 self
3999 }
4000
4001 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4003 self.0.options = v.into();
4004 self
4005 }
4006
4007 pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
4009 (*self.0.stub)
4010 .update_provisioning_config(self.0.request, self.0.options)
4011 .await
4012 .map(gax::response::Response::into_body)
4013 }
4014
4015 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
4019 where
4020 T: std::convert::Into<crate::model::ProvisioningConfig>,
4021 {
4022 self.0.request.provisioning_config = std::option::Option::Some(v.into());
4023 self
4024 }
4025
4026 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
4030 where
4031 T: std::convert::Into<crate::model::ProvisioningConfig>,
4032 {
4033 self.0.request.provisioning_config = v.map(|x| x.into());
4034 self
4035 }
4036
4037 pub fn set_update_mask<T>(mut self, v: T) -> Self
4041 where
4042 T: std::convert::Into<wkt::FieldMask>,
4043 {
4044 self.0.request.update_mask = std::option::Option::Some(v.into());
4045 self
4046 }
4047
4048 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4052 where
4053 T: std::convert::Into<wkt::FieldMask>,
4054 {
4055 self.0.request.update_mask = v.map(|x| x.into());
4056 self
4057 }
4058
4059 pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
4061 self.0.request.email = v.into();
4062 self
4063 }
4064 }
4065
4066 #[doc(hidden)]
4067 impl gax::options::internal::RequestBuilder for UpdateProvisioningConfig {
4068 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4069 &mut self.0.options
4070 }
4071 }
4072
4073 #[derive(Clone, Debug)]
4090 pub struct RenameNetwork(RequestBuilder<crate::model::RenameNetworkRequest>);
4091
4092 impl RenameNetwork {
4093 pub(crate) fn new(
4094 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4095 ) -> Self {
4096 Self(RequestBuilder::new(stub))
4097 }
4098
4099 pub fn with_request<V: Into<crate::model::RenameNetworkRequest>>(mut self, v: V) -> Self {
4101 self.0.request = v.into();
4102 self
4103 }
4104
4105 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4107 self.0.options = v.into();
4108 self
4109 }
4110
4111 pub async fn send(self) -> Result<crate::model::Network> {
4113 (*self.0.stub)
4114 .rename_network(self.0.request, self.0.options)
4115 .await
4116 .map(gax::response::Response::into_body)
4117 }
4118
4119 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4123 self.0.request.name = v.into();
4124 self
4125 }
4126
4127 pub fn set_new_network_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4131 self.0.request.new_network_id = v.into();
4132 self
4133 }
4134 }
4135
4136 #[doc(hidden)]
4137 impl gax::options::internal::RequestBuilder for RenameNetwork {
4138 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4139 &mut self.0.options
4140 }
4141 }
4142
4143 #[derive(Clone, Debug)]
4164 pub struct ListOSImages(RequestBuilder<crate::model::ListOSImagesRequest>);
4165
4166 impl ListOSImages {
4167 pub(crate) fn new(
4168 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4169 ) -> Self {
4170 Self(RequestBuilder::new(stub))
4171 }
4172
4173 pub fn with_request<V: Into<crate::model::ListOSImagesRequest>>(mut self, v: V) -> Self {
4175 self.0.request = v.into();
4176 self
4177 }
4178
4179 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4181 self.0.options = v.into();
4182 self
4183 }
4184
4185 pub async fn send(self) -> Result<crate::model::ListOSImagesResponse> {
4187 (*self.0.stub)
4188 .list_os_images(self.0.request, self.0.options)
4189 .await
4190 .map(gax::response::Response::into_body)
4191 }
4192
4193 pub fn by_page(
4195 self,
4196 ) -> impl gax::paginator::Paginator<crate::model::ListOSImagesResponse, gax::error::Error>
4197 {
4198 use std::clone::Clone;
4199 let token = self.0.request.page_token.clone();
4200 let execute = move |token: String| {
4201 let mut builder = self.clone();
4202 builder.0.request = builder.0.request.set_page_token(token);
4203 builder.send()
4204 };
4205 gax::paginator::internal::new_paginator(token, execute)
4206 }
4207
4208 pub fn by_item(
4210 self,
4211 ) -> impl gax::paginator::ItemPaginator<crate::model::ListOSImagesResponse, gax::error::Error>
4212 {
4213 use gax::paginator::Paginator;
4214 self.by_page().items()
4215 }
4216
4217 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4221 self.0.request.parent = v.into();
4222 self
4223 }
4224
4225 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4227 self.0.request.page_size = v.into();
4228 self
4229 }
4230
4231 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4233 self.0.request.page_token = v.into();
4234 self
4235 }
4236 }
4237
4238 #[doc(hidden)]
4239 impl gax::options::internal::RequestBuilder for ListOSImages {
4240 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4241 &mut self.0.options
4242 }
4243 }
4244
4245 #[derive(Clone, Debug)]
4266 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4267
4268 impl ListLocations {
4269 pub(crate) fn new(
4270 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4271 ) -> Self {
4272 Self(RequestBuilder::new(stub))
4273 }
4274
4275 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4277 mut self,
4278 v: V,
4279 ) -> Self {
4280 self.0.request = v.into();
4281 self
4282 }
4283
4284 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4286 self.0.options = v.into();
4287 self
4288 }
4289
4290 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4292 (*self.0.stub)
4293 .list_locations(self.0.request, self.0.options)
4294 .await
4295 .map(gax::response::Response::into_body)
4296 }
4297
4298 pub fn by_page(
4300 self,
4301 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4302 {
4303 use std::clone::Clone;
4304 let token = self.0.request.page_token.clone();
4305 let execute = move |token: String| {
4306 let mut builder = self.clone();
4307 builder.0.request = builder.0.request.set_page_token(token);
4308 builder.send()
4309 };
4310 gax::paginator::internal::new_paginator(token, execute)
4311 }
4312
4313 pub fn by_item(
4315 self,
4316 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4317 {
4318 use gax::paginator::Paginator;
4319 self.by_page().items()
4320 }
4321
4322 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4324 self.0.request.name = v.into();
4325 self
4326 }
4327
4328 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4330 self.0.request.filter = v.into();
4331 self
4332 }
4333
4334 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4336 self.0.request.page_size = v.into();
4337 self
4338 }
4339
4340 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4342 self.0.request.page_token = v.into();
4343 self
4344 }
4345 }
4346
4347 #[doc(hidden)]
4348 impl gax::options::internal::RequestBuilder for ListLocations {
4349 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4350 &mut self.0.options
4351 }
4352 }
4353
4354 #[derive(Clone, Debug)]
4371 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4372
4373 impl GetLocation {
4374 pub(crate) fn new(
4375 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4376 ) -> Self {
4377 Self(RequestBuilder::new(stub))
4378 }
4379
4380 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4382 self.0.request = v.into();
4383 self
4384 }
4385
4386 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4388 self.0.options = v.into();
4389 self
4390 }
4391
4392 pub async fn send(self) -> Result<location::model::Location> {
4394 (*self.0.stub)
4395 .get_location(self.0.request, self.0.options)
4396 .await
4397 .map(gax::response::Response::into_body)
4398 }
4399
4400 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4402 self.0.request.name = v.into();
4403 self
4404 }
4405 }
4406
4407 #[doc(hidden)]
4408 impl gax::options::internal::RequestBuilder for GetLocation {
4409 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4410 &mut self.0.options
4411 }
4412 }
4413
4414 #[derive(Clone, Debug)]
4431 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4432
4433 impl GetOperation {
4434 pub(crate) fn new(
4435 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4436 ) -> Self {
4437 Self(RequestBuilder::new(stub))
4438 }
4439
4440 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4442 mut self,
4443 v: V,
4444 ) -> Self {
4445 self.0.request = v.into();
4446 self
4447 }
4448
4449 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4451 self.0.options = v.into();
4452 self
4453 }
4454
4455 pub async fn send(self) -> Result<longrunning::model::Operation> {
4457 (*self.0.stub)
4458 .get_operation(self.0.request, self.0.options)
4459 .await
4460 .map(gax::response::Response::into_body)
4461 }
4462
4463 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4465 self.0.request.name = v.into();
4466 self
4467 }
4468 }
4469
4470 #[doc(hidden)]
4471 impl gax::options::internal::RequestBuilder for GetOperation {
4472 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4473 &mut self.0.options
4474 }
4475 }
4476}