1pub mod bare_metal_solution {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::BareMetalSolution;
38 pub struct Factory;
39 impl crate::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 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::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<crate::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(crate::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::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 google_cloud_gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl google_cloud_gax::paginator::ItemPaginator<
143 crate::model::ListInstancesResponse,
144 crate::Error,
145 > {
146 use google_cloud_gax::paginator::Paginator;
147 self.by_page().items()
148 }
149
150 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154 self.0.request.parent = v.into();
155 self
156 }
157
158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160 self.0.request.page_size = v.into();
161 self
162 }
163
164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
166 self.0.request.page_token = v.into();
167 self
168 }
169
170 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.filter = v.into();
173 self
174 }
175 }
176
177 #[doc(hidden)]
178 impl crate::RequestBuilder for ListInstances {
179 fn request_options(&mut self) -> &mut crate::RequestOptions {
180 &mut self.0.options
181 }
182 }
183
184 #[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<crate::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(crate::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 crate::RequestBuilder for GetInstance {
241 fn request_options(&mut self) -> &mut crate::RequestOptions {
242 &mut self.0.options
243 }
244 }
245
246 #[derive(Clone, Debug)]
264 pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
265
266 impl UpdateInstance {
267 pub(crate) fn new(
268 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
269 ) -> Self {
270 Self(RequestBuilder::new(stub))
271 }
272
273 pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
275 self.0.request = v.into();
276 self
277 }
278
279 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
281 self.0.options = v.into();
282 self
283 }
284
285 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
292 (*self.0.stub)
293 .update_instance(self.0.request, self.0.options)
294 .await
295 .map(crate::Response::into_body)
296 }
297
298 pub fn poller(
300 self,
301 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
302 {
303 type Operation = google_cloud_lro::internal::Operation<
304 crate::model::Instance,
305 crate::model::OperationMetadata,
306 >;
307 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
308 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
309 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
310 if let Some(ref mut details) = poller_options.tracing {
311 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::update_instance::until_done";
312 }
313
314 let stub = self.0.stub.clone();
315 let mut options = self.0.options.clone();
316 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
317 let query = move |name| {
318 let stub = stub.clone();
319 let options = options.clone();
320 async {
321 let op = GetOperation::new(stub)
322 .set_name(name)
323 .with_options(options)
324 .send()
325 .await?;
326 Ok(Operation::new(op))
327 }
328 };
329
330 let start = move || async {
331 let op = self.send().await?;
332 Ok(Operation::new(op))
333 };
334
335 use google_cloud_lro::internal::PollerExt;
336 {
337 google_cloud_lro::internal::new_poller(
338 polling_error_policy,
339 polling_backoff_policy,
340 start,
341 query,
342 )
343 }
344 .with_options(poller_options)
345 }
346
347 pub fn set_instance<T>(mut self, v: T) -> Self
351 where
352 T: std::convert::Into<crate::model::Instance>,
353 {
354 self.0.request.instance = std::option::Option::Some(v.into());
355 self
356 }
357
358 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
362 where
363 T: std::convert::Into<crate::model::Instance>,
364 {
365 self.0.request.instance = v.map(|x| x.into());
366 self
367 }
368
369 pub fn set_update_mask<T>(mut self, v: T) -> Self
371 where
372 T: std::convert::Into<wkt::FieldMask>,
373 {
374 self.0.request.update_mask = std::option::Option::Some(v.into());
375 self
376 }
377
378 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
380 where
381 T: std::convert::Into<wkt::FieldMask>,
382 {
383 self.0.request.update_mask = v.map(|x| x.into());
384 self
385 }
386 }
387
388 #[doc(hidden)]
389 impl crate::RequestBuilder for UpdateInstance {
390 fn request_options(&mut self) -> &mut crate::RequestOptions {
391 &mut self.0.options
392 }
393 }
394
395 #[derive(Clone, Debug)]
412 pub struct RenameInstance(RequestBuilder<crate::model::RenameInstanceRequest>);
413
414 impl RenameInstance {
415 pub(crate) fn new(
416 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
417 ) -> Self {
418 Self(RequestBuilder::new(stub))
419 }
420
421 pub fn with_request<V: Into<crate::model::RenameInstanceRequest>>(mut self, v: V) -> Self {
423 self.0.request = v.into();
424 self
425 }
426
427 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
429 self.0.options = v.into();
430 self
431 }
432
433 pub async fn send(self) -> Result<crate::model::Instance> {
435 (*self.0.stub)
436 .rename_instance(self.0.request, self.0.options)
437 .await
438 .map(crate::Response::into_body)
439 }
440
441 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
445 self.0.request.name = v.into();
446 self
447 }
448
449 pub fn set_new_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
453 self.0.request.new_instance_id = v.into();
454 self
455 }
456 }
457
458 #[doc(hidden)]
459 impl crate::RequestBuilder for RenameInstance {
460 fn request_options(&mut self) -> &mut crate::RequestOptions {
461 &mut self.0.options
462 }
463 }
464
465 #[derive(Clone, Debug)]
483 pub struct ResetInstance(RequestBuilder<crate::model::ResetInstanceRequest>);
484
485 impl ResetInstance {
486 pub(crate) fn new(
487 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
488 ) -> Self {
489 Self(RequestBuilder::new(stub))
490 }
491
492 pub fn with_request<V: Into<crate::model::ResetInstanceRequest>>(mut self, v: V) -> Self {
494 self.0.request = v.into();
495 self
496 }
497
498 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
500 self.0.options = v.into();
501 self
502 }
503
504 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
511 (*self.0.stub)
512 .reset_instance(self.0.request, self.0.options)
513 .await
514 .map(crate::Response::into_body)
515 }
516
517 pub fn poller(
519 self,
520 ) -> impl google_cloud_lro::Poller<
521 crate::model::ResetInstanceResponse,
522 crate::model::OperationMetadata,
523 > {
524 type Operation = google_cloud_lro::internal::Operation<
525 crate::model::ResetInstanceResponse,
526 crate::model::OperationMetadata,
527 >;
528 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
529 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
530 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
531 if let Some(ref mut details) = poller_options.tracing {
532 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::reset_instance::until_done";
533 }
534
535 let stub = self.0.stub.clone();
536 let mut options = self.0.options.clone();
537 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
538 let query = move |name| {
539 let stub = stub.clone();
540 let options = options.clone();
541 async {
542 let op = GetOperation::new(stub)
543 .set_name(name)
544 .with_options(options)
545 .send()
546 .await?;
547 Ok(Operation::new(op))
548 }
549 };
550
551 let start = move || async {
552 let op = self.send().await?;
553 Ok(Operation::new(op))
554 };
555
556 use google_cloud_lro::internal::PollerExt;
557 {
558 google_cloud_lro::internal::new_poller(
559 polling_error_policy,
560 polling_backoff_policy,
561 start,
562 query,
563 )
564 }
565 .with_options(poller_options)
566 }
567
568 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
572 self.0.request.name = v.into();
573 self
574 }
575 }
576
577 #[doc(hidden)]
578 impl crate::RequestBuilder for ResetInstance {
579 fn request_options(&mut self) -> &mut crate::RequestOptions {
580 &mut self.0.options
581 }
582 }
583
584 #[derive(Clone, Debug)]
602 pub struct StartInstance(RequestBuilder<crate::model::StartInstanceRequest>);
603
604 impl StartInstance {
605 pub(crate) fn new(
606 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
607 ) -> Self {
608 Self(RequestBuilder::new(stub))
609 }
610
611 pub fn with_request<V: Into<crate::model::StartInstanceRequest>>(mut self, v: V) -> Self {
613 self.0.request = v.into();
614 self
615 }
616
617 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
619 self.0.options = v.into();
620 self
621 }
622
623 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
630 (*self.0.stub)
631 .start_instance(self.0.request, self.0.options)
632 .await
633 .map(crate::Response::into_body)
634 }
635
636 pub fn poller(
638 self,
639 ) -> impl google_cloud_lro::Poller<
640 crate::model::StartInstanceResponse,
641 crate::model::OperationMetadata,
642 > {
643 type Operation = google_cloud_lro::internal::Operation<
644 crate::model::StartInstanceResponse,
645 crate::model::OperationMetadata,
646 >;
647 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
648 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
649 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
650 if let Some(ref mut details) = poller_options.tracing {
651 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::start_instance::until_done";
652 }
653
654 let stub = self.0.stub.clone();
655 let mut options = self.0.options.clone();
656 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
657 let query = move |name| {
658 let stub = stub.clone();
659 let options = options.clone();
660 async {
661 let op = GetOperation::new(stub)
662 .set_name(name)
663 .with_options(options)
664 .send()
665 .await?;
666 Ok(Operation::new(op))
667 }
668 };
669
670 let start = move || async {
671 let op = self.send().await?;
672 Ok(Operation::new(op))
673 };
674
675 use google_cloud_lro::internal::PollerExt;
676 {
677 google_cloud_lro::internal::new_poller(
678 polling_error_policy,
679 polling_backoff_policy,
680 start,
681 query,
682 )
683 }
684 .with_options(poller_options)
685 }
686
687 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
691 self.0.request.name = v.into();
692 self
693 }
694 }
695
696 #[doc(hidden)]
697 impl crate::RequestBuilder for StartInstance {
698 fn request_options(&mut self) -> &mut crate::RequestOptions {
699 &mut self.0.options
700 }
701 }
702
703 #[derive(Clone, Debug)]
721 pub struct StopInstance(RequestBuilder<crate::model::StopInstanceRequest>);
722
723 impl StopInstance {
724 pub(crate) fn new(
725 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
726 ) -> Self {
727 Self(RequestBuilder::new(stub))
728 }
729
730 pub fn with_request<V: Into<crate::model::StopInstanceRequest>>(mut self, v: V) -> Self {
732 self.0.request = v.into();
733 self
734 }
735
736 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
738 self.0.options = v.into();
739 self
740 }
741
742 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
749 (*self.0.stub)
750 .stop_instance(self.0.request, self.0.options)
751 .await
752 .map(crate::Response::into_body)
753 }
754
755 pub fn poller(
757 self,
758 ) -> impl google_cloud_lro::Poller<
759 crate::model::StopInstanceResponse,
760 crate::model::OperationMetadata,
761 > {
762 type Operation = google_cloud_lro::internal::Operation<
763 crate::model::StopInstanceResponse,
764 crate::model::OperationMetadata,
765 >;
766 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
767 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
768 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
769 if let Some(ref mut details) = poller_options.tracing {
770 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::stop_instance::until_done";
771 }
772
773 let stub = self.0.stub.clone();
774 let mut options = self.0.options.clone();
775 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
776 let query = move |name| {
777 let stub = stub.clone();
778 let options = options.clone();
779 async {
780 let op = GetOperation::new(stub)
781 .set_name(name)
782 .with_options(options)
783 .send()
784 .await?;
785 Ok(Operation::new(op))
786 }
787 };
788
789 let start = move || async {
790 let op = self.send().await?;
791 Ok(Operation::new(op))
792 };
793
794 use google_cloud_lro::internal::PollerExt;
795 {
796 google_cloud_lro::internal::new_poller(
797 polling_error_policy,
798 polling_backoff_policy,
799 start,
800 query,
801 )
802 }
803 .with_options(poller_options)
804 }
805
806 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
810 self.0.request.name = v.into();
811 self
812 }
813 }
814
815 #[doc(hidden)]
816 impl crate::RequestBuilder for StopInstance {
817 fn request_options(&mut self) -> &mut crate::RequestOptions {
818 &mut self.0.options
819 }
820 }
821
822 #[derive(Clone, Debug)]
840 pub struct EnableInteractiveSerialConsole(
841 RequestBuilder<crate::model::EnableInteractiveSerialConsoleRequest>,
842 );
843
844 impl EnableInteractiveSerialConsole {
845 pub(crate) fn new(
846 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
847 ) -> Self {
848 Self(RequestBuilder::new(stub))
849 }
850
851 pub fn with_request<V: Into<crate::model::EnableInteractiveSerialConsoleRequest>>(
853 mut self,
854 v: V,
855 ) -> Self {
856 self.0.request = v.into();
857 self
858 }
859
860 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
862 self.0.options = v.into();
863 self
864 }
865
866 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
873 (*self.0.stub)
874 .enable_interactive_serial_console(self.0.request, self.0.options)
875 .await
876 .map(crate::Response::into_body)
877 }
878
879 pub fn poller(
881 self,
882 ) -> impl google_cloud_lro::Poller<
883 crate::model::EnableInteractiveSerialConsoleResponse,
884 crate::model::OperationMetadata,
885 > {
886 type Operation = google_cloud_lro::internal::Operation<
887 crate::model::EnableInteractiveSerialConsoleResponse,
888 crate::model::OperationMetadata,
889 >;
890 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
891 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
892 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
893 if let Some(ref mut details) = poller_options.tracing {
894 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::enable_interactive_serial_console::until_done";
895 }
896
897 let stub = self.0.stub.clone();
898 let mut options = self.0.options.clone();
899 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
900 let query = move |name| {
901 let stub = stub.clone();
902 let options = options.clone();
903 async {
904 let op = GetOperation::new(stub)
905 .set_name(name)
906 .with_options(options)
907 .send()
908 .await?;
909 Ok(Operation::new(op))
910 }
911 };
912
913 let start = move || async {
914 let op = self.send().await?;
915 Ok(Operation::new(op))
916 };
917
918 use google_cloud_lro::internal::PollerExt;
919 {
920 google_cloud_lro::internal::new_poller(
921 polling_error_policy,
922 polling_backoff_policy,
923 start,
924 query,
925 )
926 }
927 .with_options(poller_options)
928 }
929
930 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
934 self.0.request.name = v.into();
935 self
936 }
937 }
938
939 #[doc(hidden)]
940 impl crate::RequestBuilder for EnableInteractiveSerialConsole {
941 fn request_options(&mut self) -> &mut crate::RequestOptions {
942 &mut self.0.options
943 }
944 }
945
946 #[derive(Clone, Debug)]
964 pub struct DisableInteractiveSerialConsole(
965 RequestBuilder<crate::model::DisableInteractiveSerialConsoleRequest>,
966 );
967
968 impl DisableInteractiveSerialConsole {
969 pub(crate) fn new(
970 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
971 ) -> Self {
972 Self(RequestBuilder::new(stub))
973 }
974
975 pub fn with_request<V: Into<crate::model::DisableInteractiveSerialConsoleRequest>>(
977 mut self,
978 v: V,
979 ) -> Self {
980 self.0.request = v.into();
981 self
982 }
983
984 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
986 self.0.options = v.into();
987 self
988 }
989
990 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
997 (*self.0.stub)
998 .disable_interactive_serial_console(self.0.request, self.0.options)
999 .await
1000 .map(crate::Response::into_body)
1001 }
1002
1003 pub fn poller(
1005 self,
1006 ) -> impl google_cloud_lro::Poller<
1007 crate::model::DisableInteractiveSerialConsoleResponse,
1008 crate::model::OperationMetadata,
1009 > {
1010 type Operation = google_cloud_lro::internal::Operation<
1011 crate::model::DisableInteractiveSerialConsoleResponse,
1012 crate::model::OperationMetadata,
1013 >;
1014 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1015 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1016 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1017 if let Some(ref mut details) = poller_options.tracing {
1018 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::disable_interactive_serial_console::until_done";
1019 }
1020
1021 let stub = self.0.stub.clone();
1022 let mut options = self.0.options.clone();
1023 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1024 let query = move |name| {
1025 let stub = stub.clone();
1026 let options = options.clone();
1027 async {
1028 let op = GetOperation::new(stub)
1029 .set_name(name)
1030 .with_options(options)
1031 .send()
1032 .await?;
1033 Ok(Operation::new(op))
1034 }
1035 };
1036
1037 let start = move || async {
1038 let op = self.send().await?;
1039 Ok(Operation::new(op))
1040 };
1041
1042 use google_cloud_lro::internal::PollerExt;
1043 {
1044 google_cloud_lro::internal::new_poller(
1045 polling_error_policy,
1046 polling_backoff_policy,
1047 start,
1048 query,
1049 )
1050 }
1051 .with_options(poller_options)
1052 }
1053
1054 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1058 self.0.request.name = v.into();
1059 self
1060 }
1061 }
1062
1063 #[doc(hidden)]
1064 impl crate::RequestBuilder for DisableInteractiveSerialConsole {
1065 fn request_options(&mut self) -> &mut crate::RequestOptions {
1066 &mut self.0.options
1067 }
1068 }
1069
1070 #[derive(Clone, Debug)]
1088 pub struct DetachLun(RequestBuilder<crate::model::DetachLunRequest>);
1089
1090 impl DetachLun {
1091 pub(crate) fn new(
1092 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1093 ) -> Self {
1094 Self(RequestBuilder::new(stub))
1095 }
1096
1097 pub fn with_request<V: Into<crate::model::DetachLunRequest>>(mut self, v: V) -> Self {
1099 self.0.request = v.into();
1100 self
1101 }
1102
1103 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1105 self.0.options = v.into();
1106 self
1107 }
1108
1109 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1116 (*self.0.stub)
1117 .detach_lun(self.0.request, self.0.options)
1118 .await
1119 .map(crate::Response::into_body)
1120 }
1121
1122 pub fn poller(
1124 self,
1125 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
1126 {
1127 type Operation = google_cloud_lro::internal::Operation<
1128 crate::model::Instance,
1129 crate::model::OperationMetadata,
1130 >;
1131 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1132 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1133 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1134 if let Some(ref mut details) = poller_options.tracing {
1135 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::detach_lun::until_done";
1136 }
1137
1138 let stub = self.0.stub.clone();
1139 let mut options = self.0.options.clone();
1140 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1141 let query = move |name| {
1142 let stub = stub.clone();
1143 let options = options.clone();
1144 async {
1145 let op = GetOperation::new(stub)
1146 .set_name(name)
1147 .with_options(options)
1148 .send()
1149 .await?;
1150 Ok(Operation::new(op))
1151 }
1152 };
1153
1154 let start = move || async {
1155 let op = self.send().await?;
1156 Ok(Operation::new(op))
1157 };
1158
1159 use google_cloud_lro::internal::PollerExt;
1160 {
1161 google_cloud_lro::internal::new_poller(
1162 polling_error_policy,
1163 polling_backoff_policy,
1164 start,
1165 query,
1166 )
1167 }
1168 .with_options(poller_options)
1169 }
1170
1171 pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1175 self.0.request.instance = v.into();
1176 self
1177 }
1178
1179 pub fn set_lun<T: Into<std::string::String>>(mut self, v: T) -> Self {
1183 self.0.request.lun = v.into();
1184 self
1185 }
1186
1187 pub fn set_skip_reboot<T: Into<bool>>(mut self, v: T) -> Self {
1189 self.0.request.skip_reboot = v.into();
1190 self
1191 }
1192 }
1193
1194 #[doc(hidden)]
1195 impl crate::RequestBuilder for DetachLun {
1196 fn request_options(&mut self) -> &mut crate::RequestOptions {
1197 &mut self.0.options
1198 }
1199 }
1200
1201 #[derive(Clone, Debug)]
1222 pub struct ListSSHKeys(RequestBuilder<crate::model::ListSSHKeysRequest>);
1223
1224 impl ListSSHKeys {
1225 pub(crate) fn new(
1226 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1227 ) -> Self {
1228 Self(RequestBuilder::new(stub))
1229 }
1230
1231 pub fn with_request<V: Into<crate::model::ListSSHKeysRequest>>(mut self, v: V) -> Self {
1233 self.0.request = v.into();
1234 self
1235 }
1236
1237 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1239 self.0.options = v.into();
1240 self
1241 }
1242
1243 pub async fn send(self) -> Result<crate::model::ListSSHKeysResponse> {
1245 (*self.0.stub)
1246 .list_ssh_keys(self.0.request, self.0.options)
1247 .await
1248 .map(crate::Response::into_body)
1249 }
1250
1251 pub fn by_page(
1253 self,
1254 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSSHKeysResponse, crate::Error>
1255 {
1256 use std::clone::Clone;
1257 let token = self.0.request.page_token.clone();
1258 let execute = move |token: String| {
1259 let mut builder = self.clone();
1260 builder.0.request = builder.0.request.set_page_token(token);
1261 builder.send()
1262 };
1263 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1264 }
1265
1266 pub fn by_item(
1268 self,
1269 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1270 crate::model::ListSSHKeysResponse,
1271 crate::Error,
1272 > {
1273 use google_cloud_gax::paginator::Paginator;
1274 self.by_page().items()
1275 }
1276
1277 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1281 self.0.request.parent = v.into();
1282 self
1283 }
1284
1285 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1287 self.0.request.page_size = v.into();
1288 self
1289 }
1290
1291 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1293 self.0.request.page_token = v.into();
1294 self
1295 }
1296 }
1297
1298 #[doc(hidden)]
1299 impl crate::RequestBuilder for ListSSHKeys {
1300 fn request_options(&mut self) -> &mut crate::RequestOptions {
1301 &mut self.0.options
1302 }
1303 }
1304
1305 #[derive(Clone, Debug)]
1322 pub struct CreateSSHKey(RequestBuilder<crate::model::CreateSSHKeyRequest>);
1323
1324 impl CreateSSHKey {
1325 pub(crate) fn new(
1326 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1327 ) -> Self {
1328 Self(RequestBuilder::new(stub))
1329 }
1330
1331 pub fn with_request<V: Into<crate::model::CreateSSHKeyRequest>>(mut self, v: V) -> Self {
1333 self.0.request = v.into();
1334 self
1335 }
1336
1337 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1339 self.0.options = v.into();
1340 self
1341 }
1342
1343 pub async fn send(self) -> Result<crate::model::SSHKey> {
1345 (*self.0.stub)
1346 .create_ssh_key(self.0.request, self.0.options)
1347 .await
1348 .map(crate::Response::into_body)
1349 }
1350
1351 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1355 self.0.request.parent = v.into();
1356 self
1357 }
1358
1359 pub fn set_ssh_key<T>(mut self, v: T) -> Self
1363 where
1364 T: std::convert::Into<crate::model::SSHKey>,
1365 {
1366 self.0.request.ssh_key = std::option::Option::Some(v.into());
1367 self
1368 }
1369
1370 pub fn set_or_clear_ssh_key<T>(mut self, v: std::option::Option<T>) -> Self
1374 where
1375 T: std::convert::Into<crate::model::SSHKey>,
1376 {
1377 self.0.request.ssh_key = v.map(|x| x.into());
1378 self
1379 }
1380
1381 pub fn set_ssh_key_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1385 self.0.request.ssh_key_id = v.into();
1386 self
1387 }
1388 }
1389
1390 #[doc(hidden)]
1391 impl crate::RequestBuilder for CreateSSHKey {
1392 fn request_options(&mut self) -> &mut crate::RequestOptions {
1393 &mut self.0.options
1394 }
1395 }
1396
1397 #[derive(Clone, Debug)]
1414 pub struct DeleteSSHKey(RequestBuilder<crate::model::DeleteSSHKeyRequest>);
1415
1416 impl DeleteSSHKey {
1417 pub(crate) fn new(
1418 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1419 ) -> Self {
1420 Self(RequestBuilder::new(stub))
1421 }
1422
1423 pub fn with_request<V: Into<crate::model::DeleteSSHKeyRequest>>(mut self, v: V) -> Self {
1425 self.0.request = v.into();
1426 self
1427 }
1428
1429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1431 self.0.options = v.into();
1432 self
1433 }
1434
1435 pub async fn send(self) -> Result<()> {
1437 (*self.0.stub)
1438 .delete_ssh_key(self.0.request, self.0.options)
1439 .await
1440 .map(crate::Response::into_body)
1441 }
1442
1443 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1447 self.0.request.name = v.into();
1448 self
1449 }
1450 }
1451
1452 #[doc(hidden)]
1453 impl crate::RequestBuilder for DeleteSSHKey {
1454 fn request_options(&mut self) -> &mut crate::RequestOptions {
1455 &mut self.0.options
1456 }
1457 }
1458
1459 #[derive(Clone, Debug)]
1480 pub struct ListVolumes(RequestBuilder<crate::model::ListVolumesRequest>);
1481
1482 impl ListVolumes {
1483 pub(crate) fn new(
1484 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1485 ) -> Self {
1486 Self(RequestBuilder::new(stub))
1487 }
1488
1489 pub fn with_request<V: Into<crate::model::ListVolumesRequest>>(mut self, v: V) -> Self {
1491 self.0.request = v.into();
1492 self
1493 }
1494
1495 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1497 self.0.options = v.into();
1498 self
1499 }
1500
1501 pub async fn send(self) -> Result<crate::model::ListVolumesResponse> {
1503 (*self.0.stub)
1504 .list_volumes(self.0.request, self.0.options)
1505 .await
1506 .map(crate::Response::into_body)
1507 }
1508
1509 pub fn by_page(
1511 self,
1512 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVolumesResponse, crate::Error>
1513 {
1514 use std::clone::Clone;
1515 let token = self.0.request.page_token.clone();
1516 let execute = move |token: String| {
1517 let mut builder = self.clone();
1518 builder.0.request = builder.0.request.set_page_token(token);
1519 builder.send()
1520 };
1521 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1522 }
1523
1524 pub fn by_item(
1526 self,
1527 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1528 crate::model::ListVolumesResponse,
1529 crate::Error,
1530 > {
1531 use google_cloud_gax::paginator::Paginator;
1532 self.by_page().items()
1533 }
1534
1535 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1539 self.0.request.parent = v.into();
1540 self
1541 }
1542
1543 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1545 self.0.request.page_size = v.into();
1546 self
1547 }
1548
1549 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1551 self.0.request.page_token = v.into();
1552 self
1553 }
1554
1555 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1557 self.0.request.filter = v.into();
1558 self
1559 }
1560 }
1561
1562 #[doc(hidden)]
1563 impl crate::RequestBuilder for ListVolumes {
1564 fn request_options(&mut self) -> &mut crate::RequestOptions {
1565 &mut self.0.options
1566 }
1567 }
1568
1569 #[derive(Clone, Debug)]
1586 pub struct GetVolume(RequestBuilder<crate::model::GetVolumeRequest>);
1587
1588 impl GetVolume {
1589 pub(crate) fn new(
1590 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1591 ) -> Self {
1592 Self(RequestBuilder::new(stub))
1593 }
1594
1595 pub fn with_request<V: Into<crate::model::GetVolumeRequest>>(mut self, v: V) -> Self {
1597 self.0.request = v.into();
1598 self
1599 }
1600
1601 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1603 self.0.options = v.into();
1604 self
1605 }
1606
1607 pub async fn send(self) -> Result<crate::model::Volume> {
1609 (*self.0.stub)
1610 .get_volume(self.0.request, self.0.options)
1611 .await
1612 .map(crate::Response::into_body)
1613 }
1614
1615 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1619 self.0.request.name = v.into();
1620 self
1621 }
1622 }
1623
1624 #[doc(hidden)]
1625 impl crate::RequestBuilder for GetVolume {
1626 fn request_options(&mut self) -> &mut crate::RequestOptions {
1627 &mut self.0.options
1628 }
1629 }
1630
1631 #[derive(Clone, Debug)]
1649 pub struct UpdateVolume(RequestBuilder<crate::model::UpdateVolumeRequest>);
1650
1651 impl UpdateVolume {
1652 pub(crate) fn new(
1653 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1654 ) -> Self {
1655 Self(RequestBuilder::new(stub))
1656 }
1657
1658 pub fn with_request<V: Into<crate::model::UpdateVolumeRequest>>(mut self, v: V) -> Self {
1660 self.0.request = v.into();
1661 self
1662 }
1663
1664 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1666 self.0.options = v.into();
1667 self
1668 }
1669
1670 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1677 (*self.0.stub)
1678 .update_volume(self.0.request, self.0.options)
1679 .await
1680 .map(crate::Response::into_body)
1681 }
1682
1683 pub fn poller(
1685 self,
1686 ) -> impl google_cloud_lro::Poller<crate::model::Volume, crate::model::OperationMetadata>
1687 {
1688 type Operation = google_cloud_lro::internal::Operation<
1689 crate::model::Volume,
1690 crate::model::OperationMetadata,
1691 >;
1692 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1693 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1694 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1695 if let Some(ref mut details) = poller_options.tracing {
1696 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::update_volume::until_done";
1697 }
1698
1699 let stub = self.0.stub.clone();
1700 let mut options = self.0.options.clone();
1701 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1702 let query = move |name| {
1703 let stub = stub.clone();
1704 let options = options.clone();
1705 async {
1706 let op = GetOperation::new(stub)
1707 .set_name(name)
1708 .with_options(options)
1709 .send()
1710 .await?;
1711 Ok(Operation::new(op))
1712 }
1713 };
1714
1715 let start = move || async {
1716 let op = self.send().await?;
1717 Ok(Operation::new(op))
1718 };
1719
1720 use google_cloud_lro::internal::PollerExt;
1721 {
1722 google_cloud_lro::internal::new_poller(
1723 polling_error_policy,
1724 polling_backoff_policy,
1725 start,
1726 query,
1727 )
1728 }
1729 .with_options(poller_options)
1730 }
1731
1732 pub fn set_volume<T>(mut self, v: T) -> Self
1736 where
1737 T: std::convert::Into<crate::model::Volume>,
1738 {
1739 self.0.request.volume = std::option::Option::Some(v.into());
1740 self
1741 }
1742
1743 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
1747 where
1748 T: std::convert::Into<crate::model::Volume>,
1749 {
1750 self.0.request.volume = v.map(|x| x.into());
1751 self
1752 }
1753
1754 pub fn set_update_mask<T>(mut self, v: T) -> Self
1756 where
1757 T: std::convert::Into<wkt::FieldMask>,
1758 {
1759 self.0.request.update_mask = std::option::Option::Some(v.into());
1760 self
1761 }
1762
1763 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1765 where
1766 T: std::convert::Into<wkt::FieldMask>,
1767 {
1768 self.0.request.update_mask = v.map(|x| x.into());
1769 self
1770 }
1771 }
1772
1773 #[doc(hidden)]
1774 impl crate::RequestBuilder for UpdateVolume {
1775 fn request_options(&mut self) -> &mut crate::RequestOptions {
1776 &mut self.0.options
1777 }
1778 }
1779
1780 #[derive(Clone, Debug)]
1797 pub struct RenameVolume(RequestBuilder<crate::model::RenameVolumeRequest>);
1798
1799 impl RenameVolume {
1800 pub(crate) fn new(
1801 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1802 ) -> Self {
1803 Self(RequestBuilder::new(stub))
1804 }
1805
1806 pub fn with_request<V: Into<crate::model::RenameVolumeRequest>>(mut self, v: V) -> Self {
1808 self.0.request = v.into();
1809 self
1810 }
1811
1812 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1814 self.0.options = v.into();
1815 self
1816 }
1817
1818 pub async fn send(self) -> Result<crate::model::Volume> {
1820 (*self.0.stub)
1821 .rename_volume(self.0.request, self.0.options)
1822 .await
1823 .map(crate::Response::into_body)
1824 }
1825
1826 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1830 self.0.request.name = v.into();
1831 self
1832 }
1833
1834 pub fn set_new_volume_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1838 self.0.request.new_volume_id = v.into();
1839 self
1840 }
1841 }
1842
1843 #[doc(hidden)]
1844 impl crate::RequestBuilder for RenameVolume {
1845 fn request_options(&mut self) -> &mut crate::RequestOptions {
1846 &mut self.0.options
1847 }
1848 }
1849
1850 #[derive(Clone, Debug)]
1868 pub struct EvictVolume(RequestBuilder<crate::model::EvictVolumeRequest>);
1869
1870 impl EvictVolume {
1871 pub(crate) fn new(
1872 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1873 ) -> Self {
1874 Self(RequestBuilder::new(stub))
1875 }
1876
1877 pub fn with_request<V: Into<crate::model::EvictVolumeRequest>>(mut self, v: V) -> Self {
1879 self.0.request = v.into();
1880 self
1881 }
1882
1883 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1885 self.0.options = v.into();
1886 self
1887 }
1888
1889 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1896 (*self.0.stub)
1897 .evict_volume(self.0.request, self.0.options)
1898 .await
1899 .map(crate::Response::into_body)
1900 }
1901
1902 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1904 type Operation =
1905 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1906 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1907 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1908 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1909 if let Some(ref mut details) = poller_options.tracing {
1910 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::evict_volume::until_done";
1911 }
1912
1913 let stub = self.0.stub.clone();
1914 let mut options = self.0.options.clone();
1915 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1916 let query = move |name| {
1917 let stub = stub.clone();
1918 let options = options.clone();
1919 async {
1920 let op = GetOperation::new(stub)
1921 .set_name(name)
1922 .with_options(options)
1923 .send()
1924 .await?;
1925 Ok(Operation::new(op))
1926 }
1927 };
1928
1929 let start = move || async {
1930 let op = self.send().await?;
1931 Ok(Operation::new(op))
1932 };
1933
1934 use google_cloud_lro::internal::PollerExt;
1935 {
1936 google_cloud_lro::internal::new_unit_response_poller(
1937 polling_error_policy,
1938 polling_backoff_policy,
1939 start,
1940 query,
1941 )
1942 }
1943 .with_options(poller_options)
1944 }
1945
1946 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1950 self.0.request.name = v.into();
1951 self
1952 }
1953 }
1954
1955 #[doc(hidden)]
1956 impl crate::RequestBuilder for EvictVolume {
1957 fn request_options(&mut self) -> &mut crate::RequestOptions {
1958 &mut self.0.options
1959 }
1960 }
1961
1962 #[derive(Clone, Debug)]
1980 pub struct ResizeVolume(RequestBuilder<crate::model::ResizeVolumeRequest>);
1981
1982 impl ResizeVolume {
1983 pub(crate) fn new(
1984 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
1985 ) -> Self {
1986 Self(RequestBuilder::new(stub))
1987 }
1988
1989 pub fn with_request<V: Into<crate::model::ResizeVolumeRequest>>(mut self, v: V) -> Self {
1991 self.0.request = v.into();
1992 self
1993 }
1994
1995 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1997 self.0.options = v.into();
1998 self
1999 }
2000
2001 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2008 (*self.0.stub)
2009 .resize_volume(self.0.request, self.0.options)
2010 .await
2011 .map(crate::Response::into_body)
2012 }
2013
2014 pub fn poller(
2016 self,
2017 ) -> impl google_cloud_lro::Poller<crate::model::Volume, crate::model::OperationMetadata>
2018 {
2019 type Operation = google_cloud_lro::internal::Operation<
2020 crate::model::Volume,
2021 crate::model::OperationMetadata,
2022 >;
2023 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2024 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2025 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2026 if let Some(ref mut details) = poller_options.tracing {
2027 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::resize_volume::until_done";
2028 }
2029
2030 let stub = self.0.stub.clone();
2031 let mut options = self.0.options.clone();
2032 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2033 let query = move |name| {
2034 let stub = stub.clone();
2035 let options = options.clone();
2036 async {
2037 let op = GetOperation::new(stub)
2038 .set_name(name)
2039 .with_options(options)
2040 .send()
2041 .await?;
2042 Ok(Operation::new(op))
2043 }
2044 };
2045
2046 let start = move || async {
2047 let op = self.send().await?;
2048 Ok(Operation::new(op))
2049 };
2050
2051 use google_cloud_lro::internal::PollerExt;
2052 {
2053 google_cloud_lro::internal::new_poller(
2054 polling_error_policy,
2055 polling_backoff_policy,
2056 start,
2057 query,
2058 )
2059 }
2060 .with_options(poller_options)
2061 }
2062
2063 pub fn set_volume<T: Into<std::string::String>>(mut self, v: T) -> Self {
2067 self.0.request.volume = v.into();
2068 self
2069 }
2070
2071 pub fn set_size_gib<T: Into<i64>>(mut self, v: T) -> Self {
2073 self.0.request.size_gib = v.into();
2074 self
2075 }
2076 }
2077
2078 #[doc(hidden)]
2079 impl crate::RequestBuilder for ResizeVolume {
2080 fn request_options(&mut self) -> &mut crate::RequestOptions {
2081 &mut self.0.options
2082 }
2083 }
2084
2085 #[derive(Clone, Debug)]
2106 pub struct ListNetworks(RequestBuilder<crate::model::ListNetworksRequest>);
2107
2108 impl ListNetworks {
2109 pub(crate) fn new(
2110 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2111 ) -> Self {
2112 Self(RequestBuilder::new(stub))
2113 }
2114
2115 pub fn with_request<V: Into<crate::model::ListNetworksRequest>>(mut self, v: V) -> Self {
2117 self.0.request = v.into();
2118 self
2119 }
2120
2121 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2123 self.0.options = v.into();
2124 self
2125 }
2126
2127 pub async fn send(self) -> Result<crate::model::ListNetworksResponse> {
2129 (*self.0.stub)
2130 .list_networks(self.0.request, self.0.options)
2131 .await
2132 .map(crate::Response::into_body)
2133 }
2134
2135 pub fn by_page(
2137 self,
2138 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListNetworksResponse, crate::Error>
2139 {
2140 use std::clone::Clone;
2141 let token = self.0.request.page_token.clone();
2142 let execute = move |token: String| {
2143 let mut builder = self.clone();
2144 builder.0.request = builder.0.request.set_page_token(token);
2145 builder.send()
2146 };
2147 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2148 }
2149
2150 pub fn by_item(
2152 self,
2153 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2154 crate::model::ListNetworksResponse,
2155 crate::Error,
2156 > {
2157 use google_cloud_gax::paginator::Paginator;
2158 self.by_page().items()
2159 }
2160
2161 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2165 self.0.request.parent = v.into();
2166 self
2167 }
2168
2169 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2171 self.0.request.page_size = v.into();
2172 self
2173 }
2174
2175 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2177 self.0.request.page_token = v.into();
2178 self
2179 }
2180
2181 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2183 self.0.request.filter = v.into();
2184 self
2185 }
2186 }
2187
2188 #[doc(hidden)]
2189 impl crate::RequestBuilder for ListNetworks {
2190 fn request_options(&mut self) -> &mut crate::RequestOptions {
2191 &mut self.0.options
2192 }
2193 }
2194
2195 #[derive(Clone, Debug)]
2212 pub struct ListNetworkUsage(RequestBuilder<crate::model::ListNetworkUsageRequest>);
2213
2214 impl ListNetworkUsage {
2215 pub(crate) fn new(
2216 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2217 ) -> Self {
2218 Self(RequestBuilder::new(stub))
2219 }
2220
2221 pub fn with_request<V: Into<crate::model::ListNetworkUsageRequest>>(
2223 mut self,
2224 v: V,
2225 ) -> Self {
2226 self.0.request = v.into();
2227 self
2228 }
2229
2230 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2232 self.0.options = v.into();
2233 self
2234 }
2235
2236 pub async fn send(self) -> Result<crate::model::ListNetworkUsageResponse> {
2238 (*self.0.stub)
2239 .list_network_usage(self.0.request, self.0.options)
2240 .await
2241 .map(crate::Response::into_body)
2242 }
2243
2244 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
2248 self.0.request.location = v.into();
2249 self
2250 }
2251 }
2252
2253 #[doc(hidden)]
2254 impl crate::RequestBuilder for ListNetworkUsage {
2255 fn request_options(&mut self) -> &mut crate::RequestOptions {
2256 &mut self.0.options
2257 }
2258 }
2259
2260 #[derive(Clone, Debug)]
2277 pub struct GetNetwork(RequestBuilder<crate::model::GetNetworkRequest>);
2278
2279 impl GetNetwork {
2280 pub(crate) fn new(
2281 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2282 ) -> Self {
2283 Self(RequestBuilder::new(stub))
2284 }
2285
2286 pub fn with_request<V: Into<crate::model::GetNetworkRequest>>(mut self, v: V) -> Self {
2288 self.0.request = v.into();
2289 self
2290 }
2291
2292 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2294 self.0.options = v.into();
2295 self
2296 }
2297
2298 pub async fn send(self) -> Result<crate::model::Network> {
2300 (*self.0.stub)
2301 .get_network(self.0.request, self.0.options)
2302 .await
2303 .map(crate::Response::into_body)
2304 }
2305
2306 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2310 self.0.request.name = v.into();
2311 self
2312 }
2313 }
2314
2315 #[doc(hidden)]
2316 impl crate::RequestBuilder for GetNetwork {
2317 fn request_options(&mut self) -> &mut crate::RequestOptions {
2318 &mut self.0.options
2319 }
2320 }
2321
2322 #[derive(Clone, Debug)]
2340 pub struct UpdateNetwork(RequestBuilder<crate::model::UpdateNetworkRequest>);
2341
2342 impl UpdateNetwork {
2343 pub(crate) fn new(
2344 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2345 ) -> Self {
2346 Self(RequestBuilder::new(stub))
2347 }
2348
2349 pub fn with_request<V: Into<crate::model::UpdateNetworkRequest>>(mut self, v: V) -> Self {
2351 self.0.request = v.into();
2352 self
2353 }
2354
2355 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2357 self.0.options = v.into();
2358 self
2359 }
2360
2361 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2368 (*self.0.stub)
2369 .update_network(self.0.request, self.0.options)
2370 .await
2371 .map(crate::Response::into_body)
2372 }
2373
2374 pub fn poller(
2376 self,
2377 ) -> impl google_cloud_lro::Poller<crate::model::Network, crate::model::OperationMetadata>
2378 {
2379 type Operation = google_cloud_lro::internal::Operation<
2380 crate::model::Network,
2381 crate::model::OperationMetadata,
2382 >;
2383 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2384 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2385 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2386 if let Some(ref mut details) = poller_options.tracing {
2387 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::update_network::until_done";
2388 }
2389
2390 let stub = self.0.stub.clone();
2391 let mut options = self.0.options.clone();
2392 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2393 let query = move |name| {
2394 let stub = stub.clone();
2395 let options = options.clone();
2396 async {
2397 let op = GetOperation::new(stub)
2398 .set_name(name)
2399 .with_options(options)
2400 .send()
2401 .await?;
2402 Ok(Operation::new(op))
2403 }
2404 };
2405
2406 let start = move || async {
2407 let op = self.send().await?;
2408 Ok(Operation::new(op))
2409 };
2410
2411 use google_cloud_lro::internal::PollerExt;
2412 {
2413 google_cloud_lro::internal::new_poller(
2414 polling_error_policy,
2415 polling_backoff_policy,
2416 start,
2417 query,
2418 )
2419 }
2420 .with_options(poller_options)
2421 }
2422
2423 pub fn set_network<T>(mut self, v: T) -> Self
2427 where
2428 T: std::convert::Into<crate::model::Network>,
2429 {
2430 self.0.request.network = std::option::Option::Some(v.into());
2431 self
2432 }
2433
2434 pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
2438 where
2439 T: std::convert::Into<crate::model::Network>,
2440 {
2441 self.0.request.network = v.map(|x| x.into());
2442 self
2443 }
2444
2445 pub fn set_update_mask<T>(mut self, v: T) -> Self
2447 where
2448 T: std::convert::Into<wkt::FieldMask>,
2449 {
2450 self.0.request.update_mask = std::option::Option::Some(v.into());
2451 self
2452 }
2453
2454 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2456 where
2457 T: std::convert::Into<wkt::FieldMask>,
2458 {
2459 self.0.request.update_mask = v.map(|x| x.into());
2460 self
2461 }
2462 }
2463
2464 #[doc(hidden)]
2465 impl crate::RequestBuilder for UpdateNetwork {
2466 fn request_options(&mut self) -> &mut crate::RequestOptions {
2467 &mut self.0.options
2468 }
2469 }
2470
2471 #[derive(Clone, Debug)]
2488 pub struct CreateVolumeSnapshot(RequestBuilder<crate::model::CreateVolumeSnapshotRequest>);
2489
2490 impl CreateVolumeSnapshot {
2491 pub(crate) fn new(
2492 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2493 ) -> Self {
2494 Self(RequestBuilder::new(stub))
2495 }
2496
2497 pub fn with_request<V: Into<crate::model::CreateVolumeSnapshotRequest>>(
2499 mut self,
2500 v: V,
2501 ) -> Self {
2502 self.0.request = v.into();
2503 self
2504 }
2505
2506 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2508 self.0.options = v.into();
2509 self
2510 }
2511
2512 pub async fn send(self) -> Result<crate::model::VolumeSnapshot> {
2514 (*self.0.stub)
2515 .create_volume_snapshot(self.0.request, self.0.options)
2516 .await
2517 .map(crate::Response::into_body)
2518 }
2519
2520 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2524 self.0.request.parent = v.into();
2525 self
2526 }
2527
2528 pub fn set_volume_snapshot<T>(mut self, v: T) -> Self
2532 where
2533 T: std::convert::Into<crate::model::VolumeSnapshot>,
2534 {
2535 self.0.request.volume_snapshot = std::option::Option::Some(v.into());
2536 self
2537 }
2538
2539 pub fn set_or_clear_volume_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
2543 where
2544 T: std::convert::Into<crate::model::VolumeSnapshot>,
2545 {
2546 self.0.request.volume_snapshot = v.map(|x| x.into());
2547 self
2548 }
2549 }
2550
2551 #[doc(hidden)]
2552 impl crate::RequestBuilder for CreateVolumeSnapshot {
2553 fn request_options(&mut self) -> &mut crate::RequestOptions {
2554 &mut self.0.options
2555 }
2556 }
2557
2558 #[derive(Clone, Debug)]
2576 pub struct RestoreVolumeSnapshot(RequestBuilder<crate::model::RestoreVolumeSnapshotRequest>);
2577
2578 impl RestoreVolumeSnapshot {
2579 pub(crate) fn new(
2580 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2581 ) -> Self {
2582 Self(RequestBuilder::new(stub))
2583 }
2584
2585 pub fn with_request<V: Into<crate::model::RestoreVolumeSnapshotRequest>>(
2587 mut self,
2588 v: V,
2589 ) -> Self {
2590 self.0.request = v.into();
2591 self
2592 }
2593
2594 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2596 self.0.options = v.into();
2597 self
2598 }
2599
2600 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2607 (*self.0.stub)
2608 .restore_volume_snapshot(self.0.request, self.0.options)
2609 .await
2610 .map(crate::Response::into_body)
2611 }
2612
2613 pub fn poller(
2615 self,
2616 ) -> impl google_cloud_lro::Poller<crate::model::VolumeSnapshot, crate::model::OperationMetadata>
2617 {
2618 type Operation = google_cloud_lro::internal::Operation<
2619 crate::model::VolumeSnapshot,
2620 crate::model::OperationMetadata,
2621 >;
2622 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2623 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2624 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2625 if let Some(ref mut details) = poller_options.tracing {
2626 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::restore_volume_snapshot::until_done";
2627 }
2628
2629 let stub = self.0.stub.clone();
2630 let mut options = self.0.options.clone();
2631 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2632 let query = move |name| {
2633 let stub = stub.clone();
2634 let options = options.clone();
2635 async {
2636 let op = GetOperation::new(stub)
2637 .set_name(name)
2638 .with_options(options)
2639 .send()
2640 .await?;
2641 Ok(Operation::new(op))
2642 }
2643 };
2644
2645 let start = move || async {
2646 let op = self.send().await?;
2647 Ok(Operation::new(op))
2648 };
2649
2650 use google_cloud_lro::internal::PollerExt;
2651 {
2652 google_cloud_lro::internal::new_poller(
2653 polling_error_policy,
2654 polling_backoff_policy,
2655 start,
2656 query,
2657 )
2658 }
2659 .with_options(poller_options)
2660 }
2661
2662 pub fn set_volume_snapshot<T: Into<std::string::String>>(mut self, v: T) -> Self {
2666 self.0.request.volume_snapshot = v.into();
2667 self
2668 }
2669 }
2670
2671 #[doc(hidden)]
2672 impl crate::RequestBuilder for RestoreVolumeSnapshot {
2673 fn request_options(&mut self) -> &mut crate::RequestOptions {
2674 &mut self.0.options
2675 }
2676 }
2677
2678 #[derive(Clone, Debug)]
2695 pub struct DeleteVolumeSnapshot(RequestBuilder<crate::model::DeleteVolumeSnapshotRequest>);
2696
2697 impl DeleteVolumeSnapshot {
2698 pub(crate) fn new(
2699 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2700 ) -> Self {
2701 Self(RequestBuilder::new(stub))
2702 }
2703
2704 pub fn with_request<V: Into<crate::model::DeleteVolumeSnapshotRequest>>(
2706 mut self,
2707 v: V,
2708 ) -> Self {
2709 self.0.request = v.into();
2710 self
2711 }
2712
2713 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2715 self.0.options = v.into();
2716 self
2717 }
2718
2719 pub async fn send(self) -> Result<()> {
2721 (*self.0.stub)
2722 .delete_volume_snapshot(self.0.request, self.0.options)
2723 .await
2724 .map(crate::Response::into_body)
2725 }
2726
2727 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2731 self.0.request.name = v.into();
2732 self
2733 }
2734 }
2735
2736 #[doc(hidden)]
2737 impl crate::RequestBuilder for DeleteVolumeSnapshot {
2738 fn request_options(&mut self) -> &mut crate::RequestOptions {
2739 &mut self.0.options
2740 }
2741 }
2742
2743 #[derive(Clone, Debug)]
2760 pub struct GetVolumeSnapshot(RequestBuilder<crate::model::GetVolumeSnapshotRequest>);
2761
2762 impl GetVolumeSnapshot {
2763 pub(crate) fn new(
2764 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2765 ) -> Self {
2766 Self(RequestBuilder::new(stub))
2767 }
2768
2769 pub fn with_request<V: Into<crate::model::GetVolumeSnapshotRequest>>(
2771 mut self,
2772 v: V,
2773 ) -> Self {
2774 self.0.request = v.into();
2775 self
2776 }
2777
2778 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2780 self.0.options = v.into();
2781 self
2782 }
2783
2784 pub async fn send(self) -> Result<crate::model::VolumeSnapshot> {
2786 (*self.0.stub)
2787 .get_volume_snapshot(self.0.request, self.0.options)
2788 .await
2789 .map(crate::Response::into_body)
2790 }
2791
2792 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2796 self.0.request.name = v.into();
2797 self
2798 }
2799 }
2800
2801 #[doc(hidden)]
2802 impl crate::RequestBuilder for GetVolumeSnapshot {
2803 fn request_options(&mut self) -> &mut crate::RequestOptions {
2804 &mut self.0.options
2805 }
2806 }
2807
2808 #[derive(Clone, Debug)]
2829 pub struct ListVolumeSnapshots(RequestBuilder<crate::model::ListVolumeSnapshotsRequest>);
2830
2831 impl ListVolumeSnapshots {
2832 pub(crate) fn new(
2833 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2834 ) -> Self {
2835 Self(RequestBuilder::new(stub))
2836 }
2837
2838 pub fn with_request<V: Into<crate::model::ListVolumeSnapshotsRequest>>(
2840 mut self,
2841 v: V,
2842 ) -> Self {
2843 self.0.request = v.into();
2844 self
2845 }
2846
2847 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2849 self.0.options = v.into();
2850 self
2851 }
2852
2853 pub async fn send(self) -> Result<crate::model::ListVolumeSnapshotsResponse> {
2855 (*self.0.stub)
2856 .list_volume_snapshots(self.0.request, self.0.options)
2857 .await
2858 .map(crate::Response::into_body)
2859 }
2860
2861 pub fn by_page(
2863 self,
2864 ) -> impl google_cloud_gax::paginator::Paginator<
2865 crate::model::ListVolumeSnapshotsResponse,
2866 crate::Error,
2867 > {
2868 use std::clone::Clone;
2869 let token = self.0.request.page_token.clone();
2870 let execute = move |token: String| {
2871 let mut builder = self.clone();
2872 builder.0.request = builder.0.request.set_page_token(token);
2873 builder.send()
2874 };
2875 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2876 }
2877
2878 pub fn by_item(
2880 self,
2881 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2882 crate::model::ListVolumeSnapshotsResponse,
2883 crate::Error,
2884 > {
2885 use google_cloud_gax::paginator::Paginator;
2886 self.by_page().items()
2887 }
2888
2889 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2893 self.0.request.parent = v.into();
2894 self
2895 }
2896
2897 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2899 self.0.request.page_size = v.into();
2900 self
2901 }
2902
2903 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2905 self.0.request.page_token = v.into();
2906 self
2907 }
2908 }
2909
2910 #[doc(hidden)]
2911 impl crate::RequestBuilder for ListVolumeSnapshots {
2912 fn request_options(&mut self) -> &mut crate::RequestOptions {
2913 &mut self.0.options
2914 }
2915 }
2916
2917 #[derive(Clone, Debug)]
2934 pub struct GetLun(RequestBuilder<crate::model::GetLunRequest>);
2935
2936 impl GetLun {
2937 pub(crate) fn new(
2938 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
2939 ) -> Self {
2940 Self(RequestBuilder::new(stub))
2941 }
2942
2943 pub fn with_request<V: Into<crate::model::GetLunRequest>>(mut self, v: V) -> Self {
2945 self.0.request = v.into();
2946 self
2947 }
2948
2949 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2951 self.0.options = v.into();
2952 self
2953 }
2954
2955 pub async fn send(self) -> Result<crate::model::Lun> {
2957 (*self.0.stub)
2958 .get_lun(self.0.request, self.0.options)
2959 .await
2960 .map(crate::Response::into_body)
2961 }
2962
2963 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2967 self.0.request.name = v.into();
2968 self
2969 }
2970 }
2971
2972 #[doc(hidden)]
2973 impl crate::RequestBuilder for GetLun {
2974 fn request_options(&mut self) -> &mut crate::RequestOptions {
2975 &mut self.0.options
2976 }
2977 }
2978
2979 #[derive(Clone, Debug)]
3000 pub struct ListLuns(RequestBuilder<crate::model::ListLunsRequest>);
3001
3002 impl ListLuns {
3003 pub(crate) fn new(
3004 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3005 ) -> Self {
3006 Self(RequestBuilder::new(stub))
3007 }
3008
3009 pub fn with_request<V: Into<crate::model::ListLunsRequest>>(mut self, v: V) -> Self {
3011 self.0.request = v.into();
3012 self
3013 }
3014
3015 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3017 self.0.options = v.into();
3018 self
3019 }
3020
3021 pub async fn send(self) -> Result<crate::model::ListLunsResponse> {
3023 (*self.0.stub)
3024 .list_luns(self.0.request, self.0.options)
3025 .await
3026 .map(crate::Response::into_body)
3027 }
3028
3029 pub fn by_page(
3031 self,
3032 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListLunsResponse, crate::Error>
3033 {
3034 use std::clone::Clone;
3035 let token = self.0.request.page_token.clone();
3036 let execute = move |token: String| {
3037 let mut builder = self.clone();
3038 builder.0.request = builder.0.request.set_page_token(token);
3039 builder.send()
3040 };
3041 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3042 }
3043
3044 pub fn by_item(
3046 self,
3047 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListLunsResponse, crate::Error>
3048 {
3049 use google_cloud_gax::paginator::Paginator;
3050 self.by_page().items()
3051 }
3052
3053 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3057 self.0.request.parent = v.into();
3058 self
3059 }
3060
3061 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3063 self.0.request.page_size = v.into();
3064 self
3065 }
3066
3067 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3069 self.0.request.page_token = v.into();
3070 self
3071 }
3072 }
3073
3074 #[doc(hidden)]
3075 impl crate::RequestBuilder for ListLuns {
3076 fn request_options(&mut self) -> &mut crate::RequestOptions {
3077 &mut self.0.options
3078 }
3079 }
3080
3081 #[derive(Clone, Debug)]
3099 pub struct EvictLun(RequestBuilder<crate::model::EvictLunRequest>);
3100
3101 impl EvictLun {
3102 pub(crate) fn new(
3103 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3104 ) -> Self {
3105 Self(RequestBuilder::new(stub))
3106 }
3107
3108 pub fn with_request<V: Into<crate::model::EvictLunRequest>>(mut self, v: V) -> Self {
3110 self.0.request = v.into();
3111 self
3112 }
3113
3114 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3116 self.0.options = v.into();
3117 self
3118 }
3119
3120 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3127 (*self.0.stub)
3128 .evict_lun(self.0.request, self.0.options)
3129 .await
3130 .map(crate::Response::into_body)
3131 }
3132
3133 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3135 type Operation =
3136 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3137 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3138 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3139 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3140 if let Some(ref mut details) = poller_options.tracing {
3141 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::evict_lun::until_done";
3142 }
3143
3144 let stub = self.0.stub.clone();
3145 let mut options = self.0.options.clone();
3146 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3147 let query = move |name| {
3148 let stub = stub.clone();
3149 let options = options.clone();
3150 async {
3151 let op = GetOperation::new(stub)
3152 .set_name(name)
3153 .with_options(options)
3154 .send()
3155 .await?;
3156 Ok(Operation::new(op))
3157 }
3158 };
3159
3160 let start = move || async {
3161 let op = self.send().await?;
3162 Ok(Operation::new(op))
3163 };
3164
3165 use google_cloud_lro::internal::PollerExt;
3166 {
3167 google_cloud_lro::internal::new_unit_response_poller(
3168 polling_error_policy,
3169 polling_backoff_policy,
3170 start,
3171 query,
3172 )
3173 }
3174 .with_options(poller_options)
3175 }
3176
3177 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3181 self.0.request.name = v.into();
3182 self
3183 }
3184 }
3185
3186 #[doc(hidden)]
3187 impl crate::RequestBuilder for EvictLun {
3188 fn request_options(&mut self) -> &mut crate::RequestOptions {
3189 &mut self.0.options
3190 }
3191 }
3192
3193 #[derive(Clone, Debug)]
3210 pub struct GetNfsShare(RequestBuilder<crate::model::GetNfsShareRequest>);
3211
3212 impl GetNfsShare {
3213 pub(crate) fn new(
3214 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3215 ) -> Self {
3216 Self(RequestBuilder::new(stub))
3217 }
3218
3219 pub fn with_request<V: Into<crate::model::GetNfsShareRequest>>(mut self, v: V) -> Self {
3221 self.0.request = v.into();
3222 self
3223 }
3224
3225 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3227 self.0.options = v.into();
3228 self
3229 }
3230
3231 pub async fn send(self) -> Result<crate::model::NfsShare> {
3233 (*self.0.stub)
3234 .get_nfs_share(self.0.request, self.0.options)
3235 .await
3236 .map(crate::Response::into_body)
3237 }
3238
3239 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3243 self.0.request.name = v.into();
3244 self
3245 }
3246 }
3247
3248 #[doc(hidden)]
3249 impl crate::RequestBuilder for GetNfsShare {
3250 fn request_options(&mut self) -> &mut crate::RequestOptions {
3251 &mut self.0.options
3252 }
3253 }
3254
3255 #[derive(Clone, Debug)]
3276 pub struct ListNfsShares(RequestBuilder<crate::model::ListNfsSharesRequest>);
3277
3278 impl ListNfsShares {
3279 pub(crate) fn new(
3280 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3281 ) -> Self {
3282 Self(RequestBuilder::new(stub))
3283 }
3284
3285 pub fn with_request<V: Into<crate::model::ListNfsSharesRequest>>(mut self, v: V) -> Self {
3287 self.0.request = v.into();
3288 self
3289 }
3290
3291 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3293 self.0.options = v.into();
3294 self
3295 }
3296
3297 pub async fn send(self) -> Result<crate::model::ListNfsSharesResponse> {
3299 (*self.0.stub)
3300 .list_nfs_shares(self.0.request, self.0.options)
3301 .await
3302 .map(crate::Response::into_body)
3303 }
3304
3305 pub fn by_page(
3307 self,
3308 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListNfsSharesResponse, crate::Error>
3309 {
3310 use std::clone::Clone;
3311 let token = self.0.request.page_token.clone();
3312 let execute = move |token: String| {
3313 let mut builder = self.clone();
3314 builder.0.request = builder.0.request.set_page_token(token);
3315 builder.send()
3316 };
3317 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3318 }
3319
3320 pub fn by_item(
3322 self,
3323 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3324 crate::model::ListNfsSharesResponse,
3325 crate::Error,
3326 > {
3327 use google_cloud_gax::paginator::Paginator;
3328 self.by_page().items()
3329 }
3330
3331 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3335 self.0.request.parent = v.into();
3336 self
3337 }
3338
3339 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3341 self.0.request.page_size = v.into();
3342 self
3343 }
3344
3345 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3347 self.0.request.page_token = v.into();
3348 self
3349 }
3350
3351 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3353 self.0.request.filter = v.into();
3354 self
3355 }
3356 }
3357
3358 #[doc(hidden)]
3359 impl crate::RequestBuilder for ListNfsShares {
3360 fn request_options(&mut self) -> &mut crate::RequestOptions {
3361 &mut self.0.options
3362 }
3363 }
3364
3365 #[derive(Clone, Debug)]
3383 pub struct UpdateNfsShare(RequestBuilder<crate::model::UpdateNfsShareRequest>);
3384
3385 impl UpdateNfsShare {
3386 pub(crate) fn new(
3387 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3388 ) -> Self {
3389 Self(RequestBuilder::new(stub))
3390 }
3391
3392 pub fn with_request<V: Into<crate::model::UpdateNfsShareRequest>>(mut self, v: V) -> Self {
3394 self.0.request = v.into();
3395 self
3396 }
3397
3398 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3400 self.0.options = v.into();
3401 self
3402 }
3403
3404 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3411 (*self.0.stub)
3412 .update_nfs_share(self.0.request, self.0.options)
3413 .await
3414 .map(crate::Response::into_body)
3415 }
3416
3417 pub fn poller(
3419 self,
3420 ) -> impl google_cloud_lro::Poller<crate::model::NfsShare, crate::model::OperationMetadata>
3421 {
3422 type Operation = google_cloud_lro::internal::Operation<
3423 crate::model::NfsShare,
3424 crate::model::OperationMetadata,
3425 >;
3426 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3427 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3428 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3429 if let Some(ref mut details) = poller_options.tracing {
3430 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::update_nfs_share::until_done";
3431 }
3432
3433 let stub = self.0.stub.clone();
3434 let mut options = self.0.options.clone();
3435 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3436 let query = move |name| {
3437 let stub = stub.clone();
3438 let options = options.clone();
3439 async {
3440 let op = GetOperation::new(stub)
3441 .set_name(name)
3442 .with_options(options)
3443 .send()
3444 .await?;
3445 Ok(Operation::new(op))
3446 }
3447 };
3448
3449 let start = move || async {
3450 let op = self.send().await?;
3451 Ok(Operation::new(op))
3452 };
3453
3454 use google_cloud_lro::internal::PollerExt;
3455 {
3456 google_cloud_lro::internal::new_poller(
3457 polling_error_policy,
3458 polling_backoff_policy,
3459 start,
3460 query,
3461 )
3462 }
3463 .with_options(poller_options)
3464 }
3465
3466 pub fn set_nfs_share<T>(mut self, v: T) -> Self
3470 where
3471 T: std::convert::Into<crate::model::NfsShare>,
3472 {
3473 self.0.request.nfs_share = std::option::Option::Some(v.into());
3474 self
3475 }
3476
3477 pub fn set_or_clear_nfs_share<T>(mut self, v: std::option::Option<T>) -> Self
3481 where
3482 T: std::convert::Into<crate::model::NfsShare>,
3483 {
3484 self.0.request.nfs_share = v.map(|x| x.into());
3485 self
3486 }
3487
3488 pub fn set_update_mask<T>(mut self, v: T) -> Self
3490 where
3491 T: std::convert::Into<wkt::FieldMask>,
3492 {
3493 self.0.request.update_mask = std::option::Option::Some(v.into());
3494 self
3495 }
3496
3497 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3499 where
3500 T: std::convert::Into<wkt::FieldMask>,
3501 {
3502 self.0.request.update_mask = v.map(|x| x.into());
3503 self
3504 }
3505 }
3506
3507 #[doc(hidden)]
3508 impl crate::RequestBuilder for UpdateNfsShare {
3509 fn request_options(&mut self) -> &mut crate::RequestOptions {
3510 &mut self.0.options
3511 }
3512 }
3513
3514 #[derive(Clone, Debug)]
3532 pub struct CreateNfsShare(RequestBuilder<crate::model::CreateNfsShareRequest>);
3533
3534 impl CreateNfsShare {
3535 pub(crate) fn new(
3536 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3537 ) -> Self {
3538 Self(RequestBuilder::new(stub))
3539 }
3540
3541 pub fn with_request<V: Into<crate::model::CreateNfsShareRequest>>(mut self, v: V) -> Self {
3543 self.0.request = v.into();
3544 self
3545 }
3546
3547 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3549 self.0.options = v.into();
3550 self
3551 }
3552
3553 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3560 (*self.0.stub)
3561 .create_nfs_share(self.0.request, self.0.options)
3562 .await
3563 .map(crate::Response::into_body)
3564 }
3565
3566 pub fn poller(
3568 self,
3569 ) -> impl google_cloud_lro::Poller<crate::model::NfsShare, crate::model::OperationMetadata>
3570 {
3571 type Operation = google_cloud_lro::internal::Operation<
3572 crate::model::NfsShare,
3573 crate::model::OperationMetadata,
3574 >;
3575 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3576 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3577 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3578 if let Some(ref mut details) = poller_options.tracing {
3579 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::create_nfs_share::until_done";
3580 }
3581
3582 let stub = self.0.stub.clone();
3583 let mut options = self.0.options.clone();
3584 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3585 let query = move |name| {
3586 let stub = stub.clone();
3587 let options = options.clone();
3588 async {
3589 let op = GetOperation::new(stub)
3590 .set_name(name)
3591 .with_options(options)
3592 .send()
3593 .await?;
3594 Ok(Operation::new(op))
3595 }
3596 };
3597
3598 let start = move || async {
3599 let op = self.send().await?;
3600 Ok(Operation::new(op))
3601 };
3602
3603 use google_cloud_lro::internal::PollerExt;
3604 {
3605 google_cloud_lro::internal::new_poller(
3606 polling_error_policy,
3607 polling_backoff_policy,
3608 start,
3609 query,
3610 )
3611 }
3612 .with_options(poller_options)
3613 }
3614
3615 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3619 self.0.request.parent = v.into();
3620 self
3621 }
3622
3623 pub fn set_nfs_share<T>(mut self, v: T) -> Self
3627 where
3628 T: std::convert::Into<crate::model::NfsShare>,
3629 {
3630 self.0.request.nfs_share = std::option::Option::Some(v.into());
3631 self
3632 }
3633
3634 pub fn set_or_clear_nfs_share<T>(mut self, v: std::option::Option<T>) -> Self
3638 where
3639 T: std::convert::Into<crate::model::NfsShare>,
3640 {
3641 self.0.request.nfs_share = v.map(|x| x.into());
3642 self
3643 }
3644 }
3645
3646 #[doc(hidden)]
3647 impl crate::RequestBuilder for CreateNfsShare {
3648 fn request_options(&mut self) -> &mut crate::RequestOptions {
3649 &mut self.0.options
3650 }
3651 }
3652
3653 #[derive(Clone, Debug)]
3670 pub struct RenameNfsShare(RequestBuilder<crate::model::RenameNfsShareRequest>);
3671
3672 impl RenameNfsShare {
3673 pub(crate) fn new(
3674 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3675 ) -> Self {
3676 Self(RequestBuilder::new(stub))
3677 }
3678
3679 pub fn with_request<V: Into<crate::model::RenameNfsShareRequest>>(mut self, v: V) -> Self {
3681 self.0.request = v.into();
3682 self
3683 }
3684
3685 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3687 self.0.options = v.into();
3688 self
3689 }
3690
3691 pub async fn send(self) -> Result<crate::model::NfsShare> {
3693 (*self.0.stub)
3694 .rename_nfs_share(self.0.request, self.0.options)
3695 .await
3696 .map(crate::Response::into_body)
3697 }
3698
3699 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3703 self.0.request.name = v.into();
3704 self
3705 }
3706
3707 pub fn set_new_nfsshare_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3711 self.0.request.new_nfsshare_id = v.into();
3712 self
3713 }
3714 }
3715
3716 #[doc(hidden)]
3717 impl crate::RequestBuilder for RenameNfsShare {
3718 fn request_options(&mut self) -> &mut crate::RequestOptions {
3719 &mut self.0.options
3720 }
3721 }
3722
3723 #[derive(Clone, Debug)]
3741 pub struct DeleteNfsShare(RequestBuilder<crate::model::DeleteNfsShareRequest>);
3742
3743 impl DeleteNfsShare {
3744 pub(crate) fn new(
3745 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3746 ) -> Self {
3747 Self(RequestBuilder::new(stub))
3748 }
3749
3750 pub fn with_request<V: Into<crate::model::DeleteNfsShareRequest>>(mut self, v: V) -> Self {
3752 self.0.request = v.into();
3753 self
3754 }
3755
3756 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3758 self.0.options = v.into();
3759 self
3760 }
3761
3762 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3769 (*self.0.stub)
3770 .delete_nfs_share(self.0.request, self.0.options)
3771 .await
3772 .map(crate::Response::into_body)
3773 }
3774
3775 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3777 type Operation =
3778 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3779 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3780 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3781 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3782 if let Some(ref mut details) = poller_options.tracing {
3783 details.method_name = "google_cloud_baremetalsolution_v2::client::BareMetalSolution::delete_nfs_share::until_done";
3784 }
3785
3786 let stub = self.0.stub.clone();
3787 let mut options = self.0.options.clone();
3788 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3789 let query = move |name| {
3790 let stub = stub.clone();
3791 let options = options.clone();
3792 async {
3793 let op = GetOperation::new(stub)
3794 .set_name(name)
3795 .with_options(options)
3796 .send()
3797 .await?;
3798 Ok(Operation::new(op))
3799 }
3800 };
3801
3802 let start = move || async {
3803 let op = self.send().await?;
3804 Ok(Operation::new(op))
3805 };
3806
3807 use google_cloud_lro::internal::PollerExt;
3808 {
3809 google_cloud_lro::internal::new_unit_response_poller(
3810 polling_error_policy,
3811 polling_backoff_policy,
3812 start,
3813 query,
3814 )
3815 }
3816 .with_options(poller_options)
3817 }
3818
3819 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3823 self.0.request.name = v.into();
3824 self
3825 }
3826 }
3827
3828 #[doc(hidden)]
3829 impl crate::RequestBuilder for DeleteNfsShare {
3830 fn request_options(&mut self) -> &mut crate::RequestOptions {
3831 &mut self.0.options
3832 }
3833 }
3834
3835 #[derive(Clone, Debug)]
3856 pub struct ListProvisioningQuotas(RequestBuilder<crate::model::ListProvisioningQuotasRequest>);
3857
3858 impl ListProvisioningQuotas {
3859 pub(crate) fn new(
3860 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3861 ) -> Self {
3862 Self(RequestBuilder::new(stub))
3863 }
3864
3865 pub fn with_request<V: Into<crate::model::ListProvisioningQuotasRequest>>(
3867 mut self,
3868 v: V,
3869 ) -> Self {
3870 self.0.request = v.into();
3871 self
3872 }
3873
3874 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3876 self.0.options = v.into();
3877 self
3878 }
3879
3880 pub async fn send(self) -> Result<crate::model::ListProvisioningQuotasResponse> {
3882 (*self.0.stub)
3883 .list_provisioning_quotas(self.0.request, self.0.options)
3884 .await
3885 .map(crate::Response::into_body)
3886 }
3887
3888 pub fn by_page(
3890 self,
3891 ) -> impl google_cloud_gax::paginator::Paginator<
3892 crate::model::ListProvisioningQuotasResponse,
3893 crate::Error,
3894 > {
3895 use std::clone::Clone;
3896 let token = self.0.request.page_token.clone();
3897 let execute = move |token: String| {
3898 let mut builder = self.clone();
3899 builder.0.request = builder.0.request.set_page_token(token);
3900 builder.send()
3901 };
3902 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3903 }
3904
3905 pub fn by_item(
3907 self,
3908 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3909 crate::model::ListProvisioningQuotasResponse,
3910 crate::Error,
3911 > {
3912 use google_cloud_gax::paginator::Paginator;
3913 self.by_page().items()
3914 }
3915
3916 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3920 self.0.request.parent = v.into();
3921 self
3922 }
3923
3924 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3926 self.0.request.page_size = v.into();
3927 self
3928 }
3929
3930 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3932 self.0.request.page_token = v.into();
3933 self
3934 }
3935 }
3936
3937 #[doc(hidden)]
3938 impl crate::RequestBuilder for ListProvisioningQuotas {
3939 fn request_options(&mut self) -> &mut crate::RequestOptions {
3940 &mut self.0.options
3941 }
3942 }
3943
3944 #[derive(Clone, Debug)]
3961 pub struct SubmitProvisioningConfig(
3962 RequestBuilder<crate::model::SubmitProvisioningConfigRequest>,
3963 );
3964
3965 impl SubmitProvisioningConfig {
3966 pub(crate) fn new(
3967 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
3968 ) -> Self {
3969 Self(RequestBuilder::new(stub))
3970 }
3971
3972 pub fn with_request<V: Into<crate::model::SubmitProvisioningConfigRequest>>(
3974 mut self,
3975 v: V,
3976 ) -> Self {
3977 self.0.request = v.into();
3978 self
3979 }
3980
3981 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3983 self.0.options = v.into();
3984 self
3985 }
3986
3987 pub async fn send(self) -> Result<crate::model::SubmitProvisioningConfigResponse> {
3989 (*self.0.stub)
3990 .submit_provisioning_config(self.0.request, self.0.options)
3991 .await
3992 .map(crate::Response::into_body)
3993 }
3994
3995 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3999 self.0.request.parent = v.into();
4000 self
4001 }
4002
4003 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
4007 where
4008 T: std::convert::Into<crate::model::ProvisioningConfig>,
4009 {
4010 self.0.request.provisioning_config = std::option::Option::Some(v.into());
4011 self
4012 }
4013
4014 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
4018 where
4019 T: std::convert::Into<crate::model::ProvisioningConfig>,
4020 {
4021 self.0.request.provisioning_config = v.map(|x| x.into());
4022 self
4023 }
4024
4025 pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
4027 self.0.request.email = v.into();
4028 self
4029 }
4030 }
4031
4032 #[doc(hidden)]
4033 impl crate::RequestBuilder for SubmitProvisioningConfig {
4034 fn request_options(&mut self) -> &mut crate::RequestOptions {
4035 &mut self.0.options
4036 }
4037 }
4038
4039 #[derive(Clone, Debug)]
4056 pub struct GetProvisioningConfig(RequestBuilder<crate::model::GetProvisioningConfigRequest>);
4057
4058 impl GetProvisioningConfig {
4059 pub(crate) fn new(
4060 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4061 ) -> Self {
4062 Self(RequestBuilder::new(stub))
4063 }
4064
4065 pub fn with_request<V: Into<crate::model::GetProvisioningConfigRequest>>(
4067 mut self,
4068 v: V,
4069 ) -> Self {
4070 self.0.request = v.into();
4071 self
4072 }
4073
4074 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4076 self.0.options = v.into();
4077 self
4078 }
4079
4080 pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
4082 (*self.0.stub)
4083 .get_provisioning_config(self.0.request, self.0.options)
4084 .await
4085 .map(crate::Response::into_body)
4086 }
4087
4088 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4092 self.0.request.name = v.into();
4093 self
4094 }
4095 }
4096
4097 #[doc(hidden)]
4098 impl crate::RequestBuilder for GetProvisioningConfig {
4099 fn request_options(&mut self) -> &mut crate::RequestOptions {
4100 &mut self.0.options
4101 }
4102 }
4103
4104 #[derive(Clone, Debug)]
4121 pub struct CreateProvisioningConfig(
4122 RequestBuilder<crate::model::CreateProvisioningConfigRequest>,
4123 );
4124
4125 impl CreateProvisioningConfig {
4126 pub(crate) fn new(
4127 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4128 ) -> Self {
4129 Self(RequestBuilder::new(stub))
4130 }
4131
4132 pub fn with_request<V: Into<crate::model::CreateProvisioningConfigRequest>>(
4134 mut self,
4135 v: V,
4136 ) -> Self {
4137 self.0.request = v.into();
4138 self
4139 }
4140
4141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4143 self.0.options = v.into();
4144 self
4145 }
4146
4147 pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
4149 (*self.0.stub)
4150 .create_provisioning_config(self.0.request, self.0.options)
4151 .await
4152 .map(crate::Response::into_body)
4153 }
4154
4155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4159 self.0.request.parent = v.into();
4160 self
4161 }
4162
4163 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
4167 where
4168 T: std::convert::Into<crate::model::ProvisioningConfig>,
4169 {
4170 self.0.request.provisioning_config = std::option::Option::Some(v.into());
4171 self
4172 }
4173
4174 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
4178 where
4179 T: std::convert::Into<crate::model::ProvisioningConfig>,
4180 {
4181 self.0.request.provisioning_config = v.map(|x| x.into());
4182 self
4183 }
4184
4185 pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
4187 self.0.request.email = v.into();
4188 self
4189 }
4190 }
4191
4192 #[doc(hidden)]
4193 impl crate::RequestBuilder for CreateProvisioningConfig {
4194 fn request_options(&mut self) -> &mut crate::RequestOptions {
4195 &mut self.0.options
4196 }
4197 }
4198
4199 #[derive(Clone, Debug)]
4216 pub struct UpdateProvisioningConfig(
4217 RequestBuilder<crate::model::UpdateProvisioningConfigRequest>,
4218 );
4219
4220 impl UpdateProvisioningConfig {
4221 pub(crate) fn new(
4222 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4223 ) -> Self {
4224 Self(RequestBuilder::new(stub))
4225 }
4226
4227 pub fn with_request<V: Into<crate::model::UpdateProvisioningConfigRequest>>(
4229 mut self,
4230 v: V,
4231 ) -> Self {
4232 self.0.request = v.into();
4233 self
4234 }
4235
4236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4238 self.0.options = v.into();
4239 self
4240 }
4241
4242 pub async fn send(self) -> Result<crate::model::ProvisioningConfig> {
4244 (*self.0.stub)
4245 .update_provisioning_config(self.0.request, self.0.options)
4246 .await
4247 .map(crate::Response::into_body)
4248 }
4249
4250 pub fn set_provisioning_config<T>(mut self, v: T) -> Self
4254 where
4255 T: std::convert::Into<crate::model::ProvisioningConfig>,
4256 {
4257 self.0.request.provisioning_config = std::option::Option::Some(v.into());
4258 self
4259 }
4260
4261 pub fn set_or_clear_provisioning_config<T>(mut self, v: std::option::Option<T>) -> Self
4265 where
4266 T: std::convert::Into<crate::model::ProvisioningConfig>,
4267 {
4268 self.0.request.provisioning_config = v.map(|x| x.into());
4269 self
4270 }
4271
4272 pub fn set_update_mask<T>(mut self, v: T) -> Self
4276 where
4277 T: std::convert::Into<wkt::FieldMask>,
4278 {
4279 self.0.request.update_mask = std::option::Option::Some(v.into());
4280 self
4281 }
4282
4283 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4287 where
4288 T: std::convert::Into<wkt::FieldMask>,
4289 {
4290 self.0.request.update_mask = v.map(|x| x.into());
4291 self
4292 }
4293
4294 pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
4296 self.0.request.email = v.into();
4297 self
4298 }
4299 }
4300
4301 #[doc(hidden)]
4302 impl crate::RequestBuilder for UpdateProvisioningConfig {
4303 fn request_options(&mut self) -> &mut crate::RequestOptions {
4304 &mut self.0.options
4305 }
4306 }
4307
4308 #[derive(Clone, Debug)]
4325 pub struct RenameNetwork(RequestBuilder<crate::model::RenameNetworkRequest>);
4326
4327 impl RenameNetwork {
4328 pub(crate) fn new(
4329 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4330 ) -> Self {
4331 Self(RequestBuilder::new(stub))
4332 }
4333
4334 pub fn with_request<V: Into<crate::model::RenameNetworkRequest>>(mut self, v: V) -> Self {
4336 self.0.request = v.into();
4337 self
4338 }
4339
4340 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4342 self.0.options = v.into();
4343 self
4344 }
4345
4346 pub async fn send(self) -> Result<crate::model::Network> {
4348 (*self.0.stub)
4349 .rename_network(self.0.request, self.0.options)
4350 .await
4351 .map(crate::Response::into_body)
4352 }
4353
4354 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4358 self.0.request.name = v.into();
4359 self
4360 }
4361
4362 pub fn set_new_network_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4366 self.0.request.new_network_id = v.into();
4367 self
4368 }
4369 }
4370
4371 #[doc(hidden)]
4372 impl crate::RequestBuilder for RenameNetwork {
4373 fn request_options(&mut self) -> &mut crate::RequestOptions {
4374 &mut self.0.options
4375 }
4376 }
4377
4378 #[derive(Clone, Debug)]
4399 pub struct ListOSImages(RequestBuilder<crate::model::ListOSImagesRequest>);
4400
4401 impl ListOSImages {
4402 pub(crate) fn new(
4403 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4404 ) -> Self {
4405 Self(RequestBuilder::new(stub))
4406 }
4407
4408 pub fn with_request<V: Into<crate::model::ListOSImagesRequest>>(mut self, v: V) -> Self {
4410 self.0.request = v.into();
4411 self
4412 }
4413
4414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4416 self.0.options = v.into();
4417 self
4418 }
4419
4420 pub async fn send(self) -> Result<crate::model::ListOSImagesResponse> {
4422 (*self.0.stub)
4423 .list_os_images(self.0.request, self.0.options)
4424 .await
4425 .map(crate::Response::into_body)
4426 }
4427
4428 pub fn by_page(
4430 self,
4431 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListOSImagesResponse, crate::Error>
4432 {
4433 use std::clone::Clone;
4434 let token = self.0.request.page_token.clone();
4435 let execute = move |token: String| {
4436 let mut builder = self.clone();
4437 builder.0.request = builder.0.request.set_page_token(token);
4438 builder.send()
4439 };
4440 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4441 }
4442
4443 pub fn by_item(
4445 self,
4446 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4447 crate::model::ListOSImagesResponse,
4448 crate::Error,
4449 > {
4450 use google_cloud_gax::paginator::Paginator;
4451 self.by_page().items()
4452 }
4453
4454 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4458 self.0.request.parent = v.into();
4459 self
4460 }
4461
4462 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4464 self.0.request.page_size = v.into();
4465 self
4466 }
4467
4468 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4470 self.0.request.page_token = v.into();
4471 self
4472 }
4473 }
4474
4475 #[doc(hidden)]
4476 impl crate::RequestBuilder for ListOSImages {
4477 fn request_options(&mut self) -> &mut crate::RequestOptions {
4478 &mut self.0.options
4479 }
4480 }
4481
4482 #[derive(Clone, Debug)]
4503 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4504
4505 impl ListLocations {
4506 pub(crate) fn new(
4507 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4508 ) -> Self {
4509 Self(RequestBuilder::new(stub))
4510 }
4511
4512 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4514 mut self,
4515 v: V,
4516 ) -> Self {
4517 self.0.request = v.into();
4518 self
4519 }
4520
4521 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4523 self.0.options = v.into();
4524 self
4525 }
4526
4527 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4529 (*self.0.stub)
4530 .list_locations(self.0.request, self.0.options)
4531 .await
4532 .map(crate::Response::into_body)
4533 }
4534
4535 pub fn by_page(
4537 self,
4538 ) -> impl google_cloud_gax::paginator::Paginator<
4539 google_cloud_location::model::ListLocationsResponse,
4540 crate::Error,
4541 > {
4542 use std::clone::Clone;
4543 let token = self.0.request.page_token.clone();
4544 let execute = move |token: String| {
4545 let mut builder = self.clone();
4546 builder.0.request = builder.0.request.set_page_token(token);
4547 builder.send()
4548 };
4549 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4550 }
4551
4552 pub fn by_item(
4554 self,
4555 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4556 google_cloud_location::model::ListLocationsResponse,
4557 crate::Error,
4558 > {
4559 use google_cloud_gax::paginator::Paginator;
4560 self.by_page().items()
4561 }
4562
4563 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4565 self.0.request.name = v.into();
4566 self
4567 }
4568
4569 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4571 self.0.request.filter = v.into();
4572 self
4573 }
4574
4575 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4577 self.0.request.page_size = v.into();
4578 self
4579 }
4580
4581 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4583 self.0.request.page_token = v.into();
4584 self
4585 }
4586 }
4587
4588 #[doc(hidden)]
4589 impl crate::RequestBuilder for ListLocations {
4590 fn request_options(&mut self) -> &mut crate::RequestOptions {
4591 &mut self.0.options
4592 }
4593 }
4594
4595 #[derive(Clone, Debug)]
4612 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4613
4614 impl GetLocation {
4615 pub(crate) fn new(
4616 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4617 ) -> Self {
4618 Self(RequestBuilder::new(stub))
4619 }
4620
4621 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4623 mut self,
4624 v: V,
4625 ) -> Self {
4626 self.0.request = v.into();
4627 self
4628 }
4629
4630 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4632 self.0.options = v.into();
4633 self
4634 }
4635
4636 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4638 (*self.0.stub)
4639 .get_location(self.0.request, self.0.options)
4640 .await
4641 .map(crate::Response::into_body)
4642 }
4643
4644 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4646 self.0.request.name = v.into();
4647 self
4648 }
4649 }
4650
4651 #[doc(hidden)]
4652 impl crate::RequestBuilder for GetLocation {
4653 fn request_options(&mut self) -> &mut crate::RequestOptions {
4654 &mut self.0.options
4655 }
4656 }
4657
4658 #[derive(Clone, Debug)]
4675 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4676
4677 impl GetOperation {
4678 pub(crate) fn new(
4679 stub: std::sync::Arc<dyn super::super::stub::dynamic::BareMetalSolution>,
4680 ) -> Self {
4681 Self(RequestBuilder::new(stub))
4682 }
4683
4684 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4686 mut self,
4687 v: V,
4688 ) -> Self {
4689 self.0.request = v.into();
4690 self
4691 }
4692
4693 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4695 self.0.options = v.into();
4696 self
4697 }
4698
4699 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4701 (*self.0.stub)
4702 .get_operation(self.0.request, self.0.options)
4703 .await
4704 .map(crate::Response::into_body)
4705 }
4706
4707 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4709 self.0.request.name = v.into();
4710 self
4711 }
4712 }
4713
4714 #[doc(hidden)]
4715 impl crate::RequestBuilder for GetOperation {
4716 fn request_options(&mut self) -> &mut crate::RequestOptions {
4717 &mut self.0.options
4718 }
4719 }
4720}