1pub mod net_app {
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::NetApp;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = NetApp;
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::NetApp>,
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(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: crate::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
93 pub struct ListStoragePools(RequestBuilder<crate::model::ListStoragePoolsRequest>);
94
95 impl ListStoragePools {
96 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::ListStoragePoolsRequest>>(
102 mut self,
103 v: V,
104 ) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::ListStoragePoolsResponse> {
117 (*self.0.stub)
118 .list_storage_pools(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 pub fn by_page(
125 self,
126 ) -> impl google_cloud_gax::paginator::Paginator<
127 crate::model::ListStoragePoolsResponse,
128 crate::Error,
129 > {
130 use std::clone::Clone;
131 let token = self.0.request.page_token.clone();
132 let execute = move |token: String| {
133 let mut builder = self.clone();
134 builder.0.request = builder.0.request.set_page_token(token);
135 builder.send()
136 };
137 google_cloud_gax::paginator::internal::new_paginator(token, execute)
138 }
139
140 pub fn by_item(
142 self,
143 ) -> impl google_cloud_gax::paginator::ItemPaginator<
144 crate::model::ListStoragePoolsResponse,
145 crate::Error,
146 > {
147 use google_cloud_gax::paginator::Paginator;
148 self.by_page().items()
149 }
150
151 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
155 self.0.request.parent = v.into();
156 self
157 }
158
159 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
161 self.0.request.page_size = v.into();
162 self
163 }
164
165 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
167 self.0.request.page_token = v.into();
168 self
169 }
170
171 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
173 self.0.request.order_by = v.into();
174 self
175 }
176
177 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
179 self.0.request.filter = v.into();
180 self
181 }
182 }
183
184 #[doc(hidden)]
185 impl crate::RequestBuilder for ListStoragePools {
186 fn request_options(&mut self) -> &mut crate::RequestOptions {
187 &mut self.0.options
188 }
189 }
190
191 #[derive(Clone, Debug)]
209 pub struct CreateStoragePool(RequestBuilder<crate::model::CreateStoragePoolRequest>);
210
211 impl CreateStoragePool {
212 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
213 Self(RequestBuilder::new(stub))
214 }
215
216 pub fn with_request<V: Into<crate::model::CreateStoragePoolRequest>>(
218 mut self,
219 v: V,
220 ) -> Self {
221 self.0.request = v.into();
222 self
223 }
224
225 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
227 self.0.options = v.into();
228 self
229 }
230
231 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
238 (*self.0.stub)
239 .create_storage_pool(self.0.request, self.0.options)
240 .await
241 .map(crate::Response::into_body)
242 }
243
244 pub fn poller(
246 self,
247 ) -> impl google_cloud_lro::Poller<crate::model::StoragePool, crate::model::OperationMetadata>
248 {
249 type Operation = google_cloud_lro::internal::Operation<
250 crate::model::StoragePool,
251 crate::model::OperationMetadata,
252 >;
253 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
254 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
255
256 let stub = self.0.stub.clone();
257 let mut options = self.0.options.clone();
258 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
259 let query = move |name| {
260 let stub = stub.clone();
261 let options = options.clone();
262 async {
263 let op = GetOperation::new(stub)
264 .set_name(name)
265 .with_options(options)
266 .send()
267 .await?;
268 Ok(Operation::new(op))
269 }
270 };
271
272 let start = move || async {
273 let op = self.send().await?;
274 Ok(Operation::new(op))
275 };
276
277 google_cloud_lro::internal::new_poller(
278 polling_error_policy,
279 polling_backoff_policy,
280 start,
281 query,
282 )
283 }
284
285 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
289 self.0.request.parent = v.into();
290 self
291 }
292
293 pub fn set_storage_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
297 self.0.request.storage_pool_id = v.into();
298 self
299 }
300
301 pub fn set_storage_pool<T>(mut self, v: T) -> Self
305 where
306 T: std::convert::Into<crate::model::StoragePool>,
307 {
308 self.0.request.storage_pool = std::option::Option::Some(v.into());
309 self
310 }
311
312 pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
316 where
317 T: std::convert::Into<crate::model::StoragePool>,
318 {
319 self.0.request.storage_pool = v.map(|x| x.into());
320 self
321 }
322 }
323
324 #[doc(hidden)]
325 impl crate::RequestBuilder for CreateStoragePool {
326 fn request_options(&mut self) -> &mut crate::RequestOptions {
327 &mut self.0.options
328 }
329 }
330
331 #[derive(Clone, Debug)]
348 pub struct GetStoragePool(RequestBuilder<crate::model::GetStoragePoolRequest>);
349
350 impl GetStoragePool {
351 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
352 Self(RequestBuilder::new(stub))
353 }
354
355 pub fn with_request<V: Into<crate::model::GetStoragePoolRequest>>(mut self, v: V) -> Self {
357 self.0.request = v.into();
358 self
359 }
360
361 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
363 self.0.options = v.into();
364 self
365 }
366
367 pub async fn send(self) -> Result<crate::model::StoragePool> {
369 (*self.0.stub)
370 .get_storage_pool(self.0.request, self.0.options)
371 .await
372 .map(crate::Response::into_body)
373 }
374
375 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
379 self.0.request.name = v.into();
380 self
381 }
382 }
383
384 #[doc(hidden)]
385 impl crate::RequestBuilder for GetStoragePool {
386 fn request_options(&mut self) -> &mut crate::RequestOptions {
387 &mut self.0.options
388 }
389 }
390
391 #[derive(Clone, Debug)]
409 pub struct UpdateStoragePool(RequestBuilder<crate::model::UpdateStoragePoolRequest>);
410
411 impl UpdateStoragePool {
412 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
413 Self(RequestBuilder::new(stub))
414 }
415
416 pub fn with_request<V: Into<crate::model::UpdateStoragePoolRequest>>(
418 mut self,
419 v: V,
420 ) -> Self {
421 self.0.request = v.into();
422 self
423 }
424
425 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
427 self.0.options = v.into();
428 self
429 }
430
431 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
438 (*self.0.stub)
439 .update_storage_pool(self.0.request, self.0.options)
440 .await
441 .map(crate::Response::into_body)
442 }
443
444 pub fn poller(
446 self,
447 ) -> impl google_cloud_lro::Poller<crate::model::StoragePool, crate::model::OperationMetadata>
448 {
449 type Operation = google_cloud_lro::internal::Operation<
450 crate::model::StoragePool,
451 crate::model::OperationMetadata,
452 >;
453 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
454 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
455
456 let stub = self.0.stub.clone();
457 let mut options = self.0.options.clone();
458 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
459 let query = move |name| {
460 let stub = stub.clone();
461 let options = options.clone();
462 async {
463 let op = GetOperation::new(stub)
464 .set_name(name)
465 .with_options(options)
466 .send()
467 .await?;
468 Ok(Operation::new(op))
469 }
470 };
471
472 let start = move || async {
473 let op = self.send().await?;
474 Ok(Operation::new(op))
475 };
476
477 google_cloud_lro::internal::new_poller(
478 polling_error_policy,
479 polling_backoff_policy,
480 start,
481 query,
482 )
483 }
484
485 pub fn set_update_mask<T>(mut self, v: T) -> Self
489 where
490 T: std::convert::Into<wkt::FieldMask>,
491 {
492 self.0.request.update_mask = std::option::Option::Some(v.into());
493 self
494 }
495
496 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
500 where
501 T: std::convert::Into<wkt::FieldMask>,
502 {
503 self.0.request.update_mask = v.map(|x| x.into());
504 self
505 }
506
507 pub fn set_storage_pool<T>(mut self, v: T) -> Self
511 where
512 T: std::convert::Into<crate::model::StoragePool>,
513 {
514 self.0.request.storage_pool = std::option::Option::Some(v.into());
515 self
516 }
517
518 pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
522 where
523 T: std::convert::Into<crate::model::StoragePool>,
524 {
525 self.0.request.storage_pool = v.map(|x| x.into());
526 self
527 }
528 }
529
530 #[doc(hidden)]
531 impl crate::RequestBuilder for UpdateStoragePool {
532 fn request_options(&mut self) -> &mut crate::RequestOptions {
533 &mut self.0.options
534 }
535 }
536
537 #[derive(Clone, Debug)]
555 pub struct DeleteStoragePool(RequestBuilder<crate::model::DeleteStoragePoolRequest>);
556
557 impl DeleteStoragePool {
558 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
559 Self(RequestBuilder::new(stub))
560 }
561
562 pub fn with_request<V: Into<crate::model::DeleteStoragePoolRequest>>(
564 mut self,
565 v: V,
566 ) -> Self {
567 self.0.request = v.into();
568 self
569 }
570
571 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
573 self.0.options = v.into();
574 self
575 }
576
577 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
584 (*self.0.stub)
585 .delete_storage_pool(self.0.request, self.0.options)
586 .await
587 .map(crate::Response::into_body)
588 }
589
590 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
592 type Operation =
593 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
594 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
595 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
596
597 let stub = self.0.stub.clone();
598 let mut options = self.0.options.clone();
599 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
600 let query = move |name| {
601 let stub = stub.clone();
602 let options = options.clone();
603 async {
604 let op = GetOperation::new(stub)
605 .set_name(name)
606 .with_options(options)
607 .send()
608 .await?;
609 Ok(Operation::new(op))
610 }
611 };
612
613 let start = move || async {
614 let op = self.send().await?;
615 Ok(Operation::new(op))
616 };
617
618 google_cloud_lro::internal::new_unit_response_poller(
619 polling_error_policy,
620 polling_backoff_policy,
621 start,
622 query,
623 )
624 }
625
626 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
630 self.0.request.name = v.into();
631 self
632 }
633 }
634
635 #[doc(hidden)]
636 impl crate::RequestBuilder for DeleteStoragePool {
637 fn request_options(&mut self) -> &mut crate::RequestOptions {
638 &mut self.0.options
639 }
640 }
641
642 #[derive(Clone, Debug)]
660 pub struct ValidateDirectoryService(
661 RequestBuilder<crate::model::ValidateDirectoryServiceRequest>,
662 );
663
664 impl ValidateDirectoryService {
665 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
666 Self(RequestBuilder::new(stub))
667 }
668
669 pub fn with_request<V: Into<crate::model::ValidateDirectoryServiceRequest>>(
671 mut self,
672 v: V,
673 ) -> Self {
674 self.0.request = v.into();
675 self
676 }
677
678 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
680 self.0.options = v.into();
681 self
682 }
683
684 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
691 (*self.0.stub)
692 .validate_directory_service(self.0.request, self.0.options)
693 .await
694 .map(crate::Response::into_body)
695 }
696
697 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
699 type Operation =
700 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
701 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
702 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
703
704 let stub = self.0.stub.clone();
705 let mut options = self.0.options.clone();
706 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
707 let query = move |name| {
708 let stub = stub.clone();
709 let options = options.clone();
710 async {
711 let op = GetOperation::new(stub)
712 .set_name(name)
713 .with_options(options)
714 .send()
715 .await?;
716 Ok(Operation::new(op))
717 }
718 };
719
720 let start = move || async {
721 let op = self.send().await?;
722 Ok(Operation::new(op))
723 };
724
725 google_cloud_lro::internal::new_unit_response_poller(
726 polling_error_policy,
727 polling_backoff_policy,
728 start,
729 query,
730 )
731 }
732
733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
737 self.0.request.name = v.into();
738 self
739 }
740
741 pub fn set_directory_service_type<T: Into<crate::model::DirectoryServiceType>>(
743 mut self,
744 v: T,
745 ) -> Self {
746 self.0.request.directory_service_type = v.into();
747 self
748 }
749 }
750
751 #[doc(hidden)]
752 impl crate::RequestBuilder for ValidateDirectoryService {
753 fn request_options(&mut self) -> &mut crate::RequestOptions {
754 &mut self.0.options
755 }
756 }
757
758 #[derive(Clone, Debug)]
776 pub struct SwitchActiveReplicaZone(
777 RequestBuilder<crate::model::SwitchActiveReplicaZoneRequest>,
778 );
779
780 impl SwitchActiveReplicaZone {
781 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
782 Self(RequestBuilder::new(stub))
783 }
784
785 pub fn with_request<V: Into<crate::model::SwitchActiveReplicaZoneRequest>>(
787 mut self,
788 v: V,
789 ) -> Self {
790 self.0.request = v.into();
791 self
792 }
793
794 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
796 self.0.options = v.into();
797 self
798 }
799
800 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
807 (*self.0.stub)
808 .switch_active_replica_zone(self.0.request, self.0.options)
809 .await
810 .map(crate::Response::into_body)
811 }
812
813 pub fn poller(
815 self,
816 ) -> impl google_cloud_lro::Poller<crate::model::StoragePool, crate::model::OperationMetadata>
817 {
818 type Operation = google_cloud_lro::internal::Operation<
819 crate::model::StoragePool,
820 crate::model::OperationMetadata,
821 >;
822 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
823 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
824
825 let stub = self.0.stub.clone();
826 let mut options = self.0.options.clone();
827 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
828 let query = move |name| {
829 let stub = stub.clone();
830 let options = options.clone();
831 async {
832 let op = GetOperation::new(stub)
833 .set_name(name)
834 .with_options(options)
835 .send()
836 .await?;
837 Ok(Operation::new(op))
838 }
839 };
840
841 let start = move || async {
842 let op = self.send().await?;
843 Ok(Operation::new(op))
844 };
845
846 google_cloud_lro::internal::new_poller(
847 polling_error_policy,
848 polling_backoff_policy,
849 start,
850 query,
851 )
852 }
853
854 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
858 self.0.request.name = v.into();
859 self
860 }
861 }
862
863 #[doc(hidden)]
864 impl crate::RequestBuilder for SwitchActiveReplicaZone {
865 fn request_options(&mut self) -> &mut crate::RequestOptions {
866 &mut self.0.options
867 }
868 }
869
870 #[derive(Clone, Debug)]
891 pub struct ListVolumes(RequestBuilder<crate::model::ListVolumesRequest>);
892
893 impl ListVolumes {
894 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
895 Self(RequestBuilder::new(stub))
896 }
897
898 pub fn with_request<V: Into<crate::model::ListVolumesRequest>>(mut self, v: V) -> Self {
900 self.0.request = v.into();
901 self
902 }
903
904 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
906 self.0.options = v.into();
907 self
908 }
909
910 pub async fn send(self) -> Result<crate::model::ListVolumesResponse> {
912 (*self.0.stub)
913 .list_volumes(self.0.request, self.0.options)
914 .await
915 .map(crate::Response::into_body)
916 }
917
918 pub fn by_page(
920 self,
921 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVolumesResponse, crate::Error>
922 {
923 use std::clone::Clone;
924 let token = self.0.request.page_token.clone();
925 let execute = move |token: String| {
926 let mut builder = self.clone();
927 builder.0.request = builder.0.request.set_page_token(token);
928 builder.send()
929 };
930 google_cloud_gax::paginator::internal::new_paginator(token, execute)
931 }
932
933 pub fn by_item(
935 self,
936 ) -> impl google_cloud_gax::paginator::ItemPaginator<
937 crate::model::ListVolumesResponse,
938 crate::Error,
939 > {
940 use google_cloud_gax::paginator::Paginator;
941 self.by_page().items()
942 }
943
944 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
948 self.0.request.parent = v.into();
949 self
950 }
951
952 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
954 self.0.request.page_size = v.into();
955 self
956 }
957
958 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
960 self.0.request.page_token = v.into();
961 self
962 }
963
964 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
966 self.0.request.filter = v.into();
967 self
968 }
969
970 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
972 self.0.request.order_by = v.into();
973 self
974 }
975 }
976
977 #[doc(hidden)]
978 impl crate::RequestBuilder for ListVolumes {
979 fn request_options(&mut self) -> &mut crate::RequestOptions {
980 &mut self.0.options
981 }
982 }
983
984 #[derive(Clone, Debug)]
1001 pub struct GetVolume(RequestBuilder<crate::model::GetVolumeRequest>);
1002
1003 impl GetVolume {
1004 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1005 Self(RequestBuilder::new(stub))
1006 }
1007
1008 pub fn with_request<V: Into<crate::model::GetVolumeRequest>>(mut self, v: V) -> Self {
1010 self.0.request = v.into();
1011 self
1012 }
1013
1014 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1016 self.0.options = v.into();
1017 self
1018 }
1019
1020 pub async fn send(self) -> Result<crate::model::Volume> {
1022 (*self.0.stub)
1023 .get_volume(self.0.request, self.0.options)
1024 .await
1025 .map(crate::Response::into_body)
1026 }
1027
1028 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1032 self.0.request.name = v.into();
1033 self
1034 }
1035 }
1036
1037 #[doc(hidden)]
1038 impl crate::RequestBuilder for GetVolume {
1039 fn request_options(&mut self) -> &mut crate::RequestOptions {
1040 &mut self.0.options
1041 }
1042 }
1043
1044 #[derive(Clone, Debug)]
1062 pub struct CreateVolume(RequestBuilder<crate::model::CreateVolumeRequest>);
1063
1064 impl CreateVolume {
1065 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1066 Self(RequestBuilder::new(stub))
1067 }
1068
1069 pub fn with_request<V: Into<crate::model::CreateVolumeRequest>>(mut self, v: V) -> Self {
1071 self.0.request = v.into();
1072 self
1073 }
1074
1075 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1077 self.0.options = v.into();
1078 self
1079 }
1080
1081 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1088 (*self.0.stub)
1089 .create_volume(self.0.request, self.0.options)
1090 .await
1091 .map(crate::Response::into_body)
1092 }
1093
1094 pub fn poller(
1096 self,
1097 ) -> impl google_cloud_lro::Poller<crate::model::Volume, crate::model::OperationMetadata>
1098 {
1099 type Operation = google_cloud_lro::internal::Operation<
1100 crate::model::Volume,
1101 crate::model::OperationMetadata,
1102 >;
1103 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1104 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1105
1106 let stub = self.0.stub.clone();
1107 let mut options = self.0.options.clone();
1108 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1109 let query = move |name| {
1110 let stub = stub.clone();
1111 let options = options.clone();
1112 async {
1113 let op = GetOperation::new(stub)
1114 .set_name(name)
1115 .with_options(options)
1116 .send()
1117 .await?;
1118 Ok(Operation::new(op))
1119 }
1120 };
1121
1122 let start = move || async {
1123 let op = self.send().await?;
1124 Ok(Operation::new(op))
1125 };
1126
1127 google_cloud_lro::internal::new_poller(
1128 polling_error_policy,
1129 polling_backoff_policy,
1130 start,
1131 query,
1132 )
1133 }
1134
1135 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139 self.0.request.parent = v.into();
1140 self
1141 }
1142
1143 pub fn set_volume_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1147 self.0.request.volume_id = v.into();
1148 self
1149 }
1150
1151 pub fn set_volume<T>(mut self, v: T) -> Self
1155 where
1156 T: std::convert::Into<crate::model::Volume>,
1157 {
1158 self.0.request.volume = std::option::Option::Some(v.into());
1159 self
1160 }
1161
1162 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
1166 where
1167 T: std::convert::Into<crate::model::Volume>,
1168 {
1169 self.0.request.volume = v.map(|x| x.into());
1170 self
1171 }
1172 }
1173
1174 #[doc(hidden)]
1175 impl crate::RequestBuilder for CreateVolume {
1176 fn request_options(&mut self) -> &mut crate::RequestOptions {
1177 &mut self.0.options
1178 }
1179 }
1180
1181 #[derive(Clone, Debug)]
1199 pub struct UpdateVolume(RequestBuilder<crate::model::UpdateVolumeRequest>);
1200
1201 impl UpdateVolume {
1202 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1203 Self(RequestBuilder::new(stub))
1204 }
1205
1206 pub fn with_request<V: Into<crate::model::UpdateVolumeRequest>>(mut self, v: V) -> Self {
1208 self.0.request = v.into();
1209 self
1210 }
1211
1212 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1214 self.0.options = v.into();
1215 self
1216 }
1217
1218 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1225 (*self.0.stub)
1226 .update_volume(self.0.request, self.0.options)
1227 .await
1228 .map(crate::Response::into_body)
1229 }
1230
1231 pub fn poller(
1233 self,
1234 ) -> impl google_cloud_lro::Poller<crate::model::Volume, crate::model::OperationMetadata>
1235 {
1236 type Operation = google_cloud_lro::internal::Operation<
1237 crate::model::Volume,
1238 crate::model::OperationMetadata,
1239 >;
1240 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1241 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1242
1243 let stub = self.0.stub.clone();
1244 let mut options = self.0.options.clone();
1245 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1246 let query = move |name| {
1247 let stub = stub.clone();
1248 let options = options.clone();
1249 async {
1250 let op = GetOperation::new(stub)
1251 .set_name(name)
1252 .with_options(options)
1253 .send()
1254 .await?;
1255 Ok(Operation::new(op))
1256 }
1257 };
1258
1259 let start = move || async {
1260 let op = self.send().await?;
1261 Ok(Operation::new(op))
1262 };
1263
1264 google_cloud_lro::internal::new_poller(
1265 polling_error_policy,
1266 polling_backoff_policy,
1267 start,
1268 query,
1269 )
1270 }
1271
1272 pub fn set_update_mask<T>(mut self, v: T) -> Self
1276 where
1277 T: std::convert::Into<wkt::FieldMask>,
1278 {
1279 self.0.request.update_mask = std::option::Option::Some(v.into());
1280 self
1281 }
1282
1283 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1287 where
1288 T: std::convert::Into<wkt::FieldMask>,
1289 {
1290 self.0.request.update_mask = v.map(|x| x.into());
1291 self
1292 }
1293
1294 pub fn set_volume<T>(mut self, v: T) -> Self
1298 where
1299 T: std::convert::Into<crate::model::Volume>,
1300 {
1301 self.0.request.volume = std::option::Option::Some(v.into());
1302 self
1303 }
1304
1305 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
1309 where
1310 T: std::convert::Into<crate::model::Volume>,
1311 {
1312 self.0.request.volume = v.map(|x| x.into());
1313 self
1314 }
1315 }
1316
1317 #[doc(hidden)]
1318 impl crate::RequestBuilder for UpdateVolume {
1319 fn request_options(&mut self) -> &mut crate::RequestOptions {
1320 &mut self.0.options
1321 }
1322 }
1323
1324 #[derive(Clone, Debug)]
1342 pub struct DeleteVolume(RequestBuilder<crate::model::DeleteVolumeRequest>);
1343
1344 impl DeleteVolume {
1345 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1346 Self(RequestBuilder::new(stub))
1347 }
1348
1349 pub fn with_request<V: Into<crate::model::DeleteVolumeRequest>>(mut self, v: V) -> Self {
1351 self.0.request = v.into();
1352 self
1353 }
1354
1355 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1357 self.0.options = v.into();
1358 self
1359 }
1360
1361 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1368 (*self.0.stub)
1369 .delete_volume(self.0.request, self.0.options)
1370 .await
1371 .map(crate::Response::into_body)
1372 }
1373
1374 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1376 type Operation =
1377 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1378 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1379 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1380
1381 let stub = self.0.stub.clone();
1382 let mut options = self.0.options.clone();
1383 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1384 let query = move |name| {
1385 let stub = stub.clone();
1386 let options = options.clone();
1387 async {
1388 let op = GetOperation::new(stub)
1389 .set_name(name)
1390 .with_options(options)
1391 .send()
1392 .await?;
1393 Ok(Operation::new(op))
1394 }
1395 };
1396
1397 let start = move || async {
1398 let op = self.send().await?;
1399 Ok(Operation::new(op))
1400 };
1401
1402 google_cloud_lro::internal::new_unit_response_poller(
1403 polling_error_policy,
1404 polling_backoff_policy,
1405 start,
1406 query,
1407 )
1408 }
1409
1410 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1414 self.0.request.name = v.into();
1415 self
1416 }
1417
1418 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1420 self.0.request.force = v.into();
1421 self
1422 }
1423 }
1424
1425 #[doc(hidden)]
1426 impl crate::RequestBuilder for DeleteVolume {
1427 fn request_options(&mut self) -> &mut crate::RequestOptions {
1428 &mut self.0.options
1429 }
1430 }
1431
1432 #[derive(Clone, Debug)]
1450 pub struct RevertVolume(RequestBuilder<crate::model::RevertVolumeRequest>);
1451
1452 impl RevertVolume {
1453 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1454 Self(RequestBuilder::new(stub))
1455 }
1456
1457 pub fn with_request<V: Into<crate::model::RevertVolumeRequest>>(mut self, v: V) -> Self {
1459 self.0.request = v.into();
1460 self
1461 }
1462
1463 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1465 self.0.options = v.into();
1466 self
1467 }
1468
1469 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1476 (*self.0.stub)
1477 .revert_volume(self.0.request, self.0.options)
1478 .await
1479 .map(crate::Response::into_body)
1480 }
1481
1482 pub fn poller(
1484 self,
1485 ) -> impl google_cloud_lro::Poller<crate::model::Volume, crate::model::OperationMetadata>
1486 {
1487 type Operation = google_cloud_lro::internal::Operation<
1488 crate::model::Volume,
1489 crate::model::OperationMetadata,
1490 >;
1491 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1492 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1493
1494 let stub = self.0.stub.clone();
1495 let mut options = self.0.options.clone();
1496 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1497 let query = move |name| {
1498 let stub = stub.clone();
1499 let options = options.clone();
1500 async {
1501 let op = GetOperation::new(stub)
1502 .set_name(name)
1503 .with_options(options)
1504 .send()
1505 .await?;
1506 Ok(Operation::new(op))
1507 }
1508 };
1509
1510 let start = move || async {
1511 let op = self.send().await?;
1512 Ok(Operation::new(op))
1513 };
1514
1515 google_cloud_lro::internal::new_poller(
1516 polling_error_policy,
1517 polling_backoff_policy,
1518 start,
1519 query,
1520 )
1521 }
1522
1523 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1527 self.0.request.name = v.into();
1528 self
1529 }
1530
1531 pub fn set_snapshot_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1535 self.0.request.snapshot_id = v.into();
1536 self
1537 }
1538 }
1539
1540 #[doc(hidden)]
1541 impl crate::RequestBuilder for RevertVolume {
1542 fn request_options(&mut self) -> &mut crate::RequestOptions {
1543 &mut self.0.options
1544 }
1545 }
1546
1547 #[derive(Clone, Debug)]
1565 pub struct EstablishVolumePeering(RequestBuilder<crate::model::EstablishVolumePeeringRequest>);
1566
1567 impl EstablishVolumePeering {
1568 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1569 Self(RequestBuilder::new(stub))
1570 }
1571
1572 pub fn with_request<V: Into<crate::model::EstablishVolumePeeringRequest>>(
1574 mut self,
1575 v: V,
1576 ) -> Self {
1577 self.0.request = v.into();
1578 self
1579 }
1580
1581 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1583 self.0.options = v.into();
1584 self
1585 }
1586
1587 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1594 (*self.0.stub)
1595 .establish_volume_peering(self.0.request, self.0.options)
1596 .await
1597 .map(crate::Response::into_body)
1598 }
1599
1600 pub fn poller(
1602 self,
1603 ) -> impl google_cloud_lro::Poller<crate::model::Volume, crate::model::OperationMetadata>
1604 {
1605 type Operation = google_cloud_lro::internal::Operation<
1606 crate::model::Volume,
1607 crate::model::OperationMetadata,
1608 >;
1609 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1610 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1611
1612 let stub = self.0.stub.clone();
1613 let mut options = self.0.options.clone();
1614 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1615 let query = move |name| {
1616 let stub = stub.clone();
1617 let options = options.clone();
1618 async {
1619 let op = GetOperation::new(stub)
1620 .set_name(name)
1621 .with_options(options)
1622 .send()
1623 .await?;
1624 Ok(Operation::new(op))
1625 }
1626 };
1627
1628 let start = move || async {
1629 let op = self.send().await?;
1630 Ok(Operation::new(op))
1631 };
1632
1633 google_cloud_lro::internal::new_poller(
1634 polling_error_policy,
1635 polling_backoff_policy,
1636 start,
1637 query,
1638 )
1639 }
1640
1641 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1645 self.0.request.name = v.into();
1646 self
1647 }
1648
1649 pub fn set_peer_cluster_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1653 self.0.request.peer_cluster_name = v.into();
1654 self
1655 }
1656
1657 pub fn set_peer_svm_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1661 self.0.request.peer_svm_name = v.into();
1662 self
1663 }
1664
1665 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
1667 where
1668 T: std::iter::IntoIterator<Item = V>,
1669 V: std::convert::Into<std::string::String>,
1670 {
1671 use std::iter::Iterator;
1672 self.0.request.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
1673 self
1674 }
1675
1676 pub fn set_peer_volume_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1680 self.0.request.peer_volume_name = v.into();
1681 self
1682 }
1683 }
1684
1685 #[doc(hidden)]
1686 impl crate::RequestBuilder for EstablishVolumePeering {
1687 fn request_options(&mut self) -> &mut crate::RequestOptions {
1688 &mut self.0.options
1689 }
1690 }
1691
1692 #[derive(Clone, Debug)]
1713 pub struct ListSnapshots(RequestBuilder<crate::model::ListSnapshotsRequest>);
1714
1715 impl ListSnapshots {
1716 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1717 Self(RequestBuilder::new(stub))
1718 }
1719
1720 pub fn with_request<V: Into<crate::model::ListSnapshotsRequest>>(mut self, v: V) -> Self {
1722 self.0.request = v.into();
1723 self
1724 }
1725
1726 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1728 self.0.options = v.into();
1729 self
1730 }
1731
1732 pub async fn send(self) -> Result<crate::model::ListSnapshotsResponse> {
1734 (*self.0.stub)
1735 .list_snapshots(self.0.request, self.0.options)
1736 .await
1737 .map(crate::Response::into_body)
1738 }
1739
1740 pub fn by_page(
1742 self,
1743 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSnapshotsResponse, crate::Error>
1744 {
1745 use std::clone::Clone;
1746 let token = self.0.request.page_token.clone();
1747 let execute = move |token: String| {
1748 let mut builder = self.clone();
1749 builder.0.request = builder.0.request.set_page_token(token);
1750 builder.send()
1751 };
1752 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1753 }
1754
1755 pub fn by_item(
1757 self,
1758 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1759 crate::model::ListSnapshotsResponse,
1760 crate::Error,
1761 > {
1762 use google_cloud_gax::paginator::Paginator;
1763 self.by_page().items()
1764 }
1765
1766 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1770 self.0.request.parent = v.into();
1771 self
1772 }
1773
1774 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1776 self.0.request.page_size = v.into();
1777 self
1778 }
1779
1780 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1782 self.0.request.page_token = v.into();
1783 self
1784 }
1785
1786 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1788 self.0.request.order_by = v.into();
1789 self
1790 }
1791
1792 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1794 self.0.request.filter = v.into();
1795 self
1796 }
1797 }
1798
1799 #[doc(hidden)]
1800 impl crate::RequestBuilder for ListSnapshots {
1801 fn request_options(&mut self) -> &mut crate::RequestOptions {
1802 &mut self.0.options
1803 }
1804 }
1805
1806 #[derive(Clone, Debug)]
1823 pub struct GetSnapshot(RequestBuilder<crate::model::GetSnapshotRequest>);
1824
1825 impl GetSnapshot {
1826 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1827 Self(RequestBuilder::new(stub))
1828 }
1829
1830 pub fn with_request<V: Into<crate::model::GetSnapshotRequest>>(mut self, v: V) -> Self {
1832 self.0.request = v.into();
1833 self
1834 }
1835
1836 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1838 self.0.options = v.into();
1839 self
1840 }
1841
1842 pub async fn send(self) -> Result<crate::model::Snapshot> {
1844 (*self.0.stub)
1845 .get_snapshot(self.0.request, self.0.options)
1846 .await
1847 .map(crate::Response::into_body)
1848 }
1849
1850 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1854 self.0.request.name = v.into();
1855 self
1856 }
1857 }
1858
1859 #[doc(hidden)]
1860 impl crate::RequestBuilder for GetSnapshot {
1861 fn request_options(&mut self) -> &mut crate::RequestOptions {
1862 &mut self.0.options
1863 }
1864 }
1865
1866 #[derive(Clone, Debug)]
1884 pub struct CreateSnapshot(RequestBuilder<crate::model::CreateSnapshotRequest>);
1885
1886 impl CreateSnapshot {
1887 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1888 Self(RequestBuilder::new(stub))
1889 }
1890
1891 pub fn with_request<V: Into<crate::model::CreateSnapshotRequest>>(mut self, v: V) -> Self {
1893 self.0.request = v.into();
1894 self
1895 }
1896
1897 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1899 self.0.options = v.into();
1900 self
1901 }
1902
1903 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1910 (*self.0.stub)
1911 .create_snapshot(self.0.request, self.0.options)
1912 .await
1913 .map(crate::Response::into_body)
1914 }
1915
1916 pub fn poller(
1918 self,
1919 ) -> impl google_cloud_lro::Poller<crate::model::Snapshot, crate::model::OperationMetadata>
1920 {
1921 type Operation = google_cloud_lro::internal::Operation<
1922 crate::model::Snapshot,
1923 crate::model::OperationMetadata,
1924 >;
1925 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1926 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1927
1928 let stub = self.0.stub.clone();
1929 let mut options = self.0.options.clone();
1930 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1931 let query = move |name| {
1932 let stub = stub.clone();
1933 let options = options.clone();
1934 async {
1935 let op = GetOperation::new(stub)
1936 .set_name(name)
1937 .with_options(options)
1938 .send()
1939 .await?;
1940 Ok(Operation::new(op))
1941 }
1942 };
1943
1944 let start = move || async {
1945 let op = self.send().await?;
1946 Ok(Operation::new(op))
1947 };
1948
1949 google_cloud_lro::internal::new_poller(
1950 polling_error_policy,
1951 polling_backoff_policy,
1952 start,
1953 query,
1954 )
1955 }
1956
1957 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1961 self.0.request.parent = v.into();
1962 self
1963 }
1964
1965 pub fn set_snapshot<T>(mut self, v: T) -> Self
1969 where
1970 T: std::convert::Into<crate::model::Snapshot>,
1971 {
1972 self.0.request.snapshot = std::option::Option::Some(v.into());
1973 self
1974 }
1975
1976 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1980 where
1981 T: std::convert::Into<crate::model::Snapshot>,
1982 {
1983 self.0.request.snapshot = v.map(|x| x.into());
1984 self
1985 }
1986
1987 pub fn set_snapshot_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1991 self.0.request.snapshot_id = v.into();
1992 self
1993 }
1994 }
1995
1996 #[doc(hidden)]
1997 impl crate::RequestBuilder for CreateSnapshot {
1998 fn request_options(&mut self) -> &mut crate::RequestOptions {
1999 &mut self.0.options
2000 }
2001 }
2002
2003 #[derive(Clone, Debug)]
2021 pub struct DeleteSnapshot(RequestBuilder<crate::model::DeleteSnapshotRequest>);
2022
2023 impl DeleteSnapshot {
2024 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2025 Self(RequestBuilder::new(stub))
2026 }
2027
2028 pub fn with_request<V: Into<crate::model::DeleteSnapshotRequest>>(mut self, v: V) -> Self {
2030 self.0.request = v.into();
2031 self
2032 }
2033
2034 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2036 self.0.options = v.into();
2037 self
2038 }
2039
2040 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2047 (*self.0.stub)
2048 .delete_snapshot(self.0.request, self.0.options)
2049 .await
2050 .map(crate::Response::into_body)
2051 }
2052
2053 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2055 type Operation =
2056 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2057 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2058 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2059
2060 let stub = self.0.stub.clone();
2061 let mut options = self.0.options.clone();
2062 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2063 let query = move |name| {
2064 let stub = stub.clone();
2065 let options = options.clone();
2066 async {
2067 let op = GetOperation::new(stub)
2068 .set_name(name)
2069 .with_options(options)
2070 .send()
2071 .await?;
2072 Ok(Operation::new(op))
2073 }
2074 };
2075
2076 let start = move || async {
2077 let op = self.send().await?;
2078 Ok(Operation::new(op))
2079 };
2080
2081 google_cloud_lro::internal::new_unit_response_poller(
2082 polling_error_policy,
2083 polling_backoff_policy,
2084 start,
2085 query,
2086 )
2087 }
2088
2089 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2093 self.0.request.name = v.into();
2094 self
2095 }
2096 }
2097
2098 #[doc(hidden)]
2099 impl crate::RequestBuilder for DeleteSnapshot {
2100 fn request_options(&mut self) -> &mut crate::RequestOptions {
2101 &mut self.0.options
2102 }
2103 }
2104
2105 #[derive(Clone, Debug)]
2123 pub struct UpdateSnapshot(RequestBuilder<crate::model::UpdateSnapshotRequest>);
2124
2125 impl UpdateSnapshot {
2126 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2127 Self(RequestBuilder::new(stub))
2128 }
2129
2130 pub fn with_request<V: Into<crate::model::UpdateSnapshotRequest>>(mut self, v: V) -> Self {
2132 self.0.request = v.into();
2133 self
2134 }
2135
2136 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2138 self.0.options = v.into();
2139 self
2140 }
2141
2142 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2149 (*self.0.stub)
2150 .update_snapshot(self.0.request, self.0.options)
2151 .await
2152 .map(crate::Response::into_body)
2153 }
2154
2155 pub fn poller(
2157 self,
2158 ) -> impl google_cloud_lro::Poller<crate::model::Snapshot, crate::model::OperationMetadata>
2159 {
2160 type Operation = google_cloud_lro::internal::Operation<
2161 crate::model::Snapshot,
2162 crate::model::OperationMetadata,
2163 >;
2164 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2165 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2166
2167 let stub = self.0.stub.clone();
2168 let mut options = self.0.options.clone();
2169 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2170 let query = move |name| {
2171 let stub = stub.clone();
2172 let options = options.clone();
2173 async {
2174 let op = GetOperation::new(stub)
2175 .set_name(name)
2176 .with_options(options)
2177 .send()
2178 .await?;
2179 Ok(Operation::new(op))
2180 }
2181 };
2182
2183 let start = move || async {
2184 let op = self.send().await?;
2185 Ok(Operation::new(op))
2186 };
2187
2188 google_cloud_lro::internal::new_poller(
2189 polling_error_policy,
2190 polling_backoff_policy,
2191 start,
2192 query,
2193 )
2194 }
2195
2196 pub fn set_update_mask<T>(mut self, v: T) -> Self
2200 where
2201 T: std::convert::Into<wkt::FieldMask>,
2202 {
2203 self.0.request.update_mask = std::option::Option::Some(v.into());
2204 self
2205 }
2206
2207 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2211 where
2212 T: std::convert::Into<wkt::FieldMask>,
2213 {
2214 self.0.request.update_mask = v.map(|x| x.into());
2215 self
2216 }
2217
2218 pub fn set_snapshot<T>(mut self, v: T) -> Self
2222 where
2223 T: std::convert::Into<crate::model::Snapshot>,
2224 {
2225 self.0.request.snapshot = std::option::Option::Some(v.into());
2226 self
2227 }
2228
2229 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
2233 where
2234 T: std::convert::Into<crate::model::Snapshot>,
2235 {
2236 self.0.request.snapshot = v.map(|x| x.into());
2237 self
2238 }
2239 }
2240
2241 #[doc(hidden)]
2242 impl crate::RequestBuilder for UpdateSnapshot {
2243 fn request_options(&mut self) -> &mut crate::RequestOptions {
2244 &mut self.0.options
2245 }
2246 }
2247
2248 #[derive(Clone, Debug)]
2269 pub struct ListActiveDirectories(RequestBuilder<crate::model::ListActiveDirectoriesRequest>);
2270
2271 impl ListActiveDirectories {
2272 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2273 Self(RequestBuilder::new(stub))
2274 }
2275
2276 pub fn with_request<V: Into<crate::model::ListActiveDirectoriesRequest>>(
2278 mut self,
2279 v: V,
2280 ) -> Self {
2281 self.0.request = v.into();
2282 self
2283 }
2284
2285 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2287 self.0.options = v.into();
2288 self
2289 }
2290
2291 pub async fn send(self) -> Result<crate::model::ListActiveDirectoriesResponse> {
2293 (*self.0.stub)
2294 .list_active_directories(self.0.request, self.0.options)
2295 .await
2296 .map(crate::Response::into_body)
2297 }
2298
2299 pub fn by_page(
2301 self,
2302 ) -> impl google_cloud_gax::paginator::Paginator<
2303 crate::model::ListActiveDirectoriesResponse,
2304 crate::Error,
2305 > {
2306 use std::clone::Clone;
2307 let token = self.0.request.page_token.clone();
2308 let execute = move |token: String| {
2309 let mut builder = self.clone();
2310 builder.0.request = builder.0.request.set_page_token(token);
2311 builder.send()
2312 };
2313 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2314 }
2315
2316 pub fn by_item(
2318 self,
2319 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2320 crate::model::ListActiveDirectoriesResponse,
2321 crate::Error,
2322 > {
2323 use google_cloud_gax::paginator::Paginator;
2324 self.by_page().items()
2325 }
2326
2327 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2331 self.0.request.parent = v.into();
2332 self
2333 }
2334
2335 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2337 self.0.request.page_size = v.into();
2338 self
2339 }
2340
2341 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2343 self.0.request.page_token = v.into();
2344 self
2345 }
2346
2347 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2349 self.0.request.filter = v.into();
2350 self
2351 }
2352
2353 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2355 self.0.request.order_by = v.into();
2356 self
2357 }
2358 }
2359
2360 #[doc(hidden)]
2361 impl crate::RequestBuilder for ListActiveDirectories {
2362 fn request_options(&mut self) -> &mut crate::RequestOptions {
2363 &mut self.0.options
2364 }
2365 }
2366
2367 #[derive(Clone, Debug)]
2384 pub struct GetActiveDirectory(RequestBuilder<crate::model::GetActiveDirectoryRequest>);
2385
2386 impl GetActiveDirectory {
2387 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2388 Self(RequestBuilder::new(stub))
2389 }
2390
2391 pub fn with_request<V: Into<crate::model::GetActiveDirectoryRequest>>(
2393 mut self,
2394 v: V,
2395 ) -> Self {
2396 self.0.request = v.into();
2397 self
2398 }
2399
2400 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2402 self.0.options = v.into();
2403 self
2404 }
2405
2406 pub async fn send(self) -> Result<crate::model::ActiveDirectory> {
2408 (*self.0.stub)
2409 .get_active_directory(self.0.request, self.0.options)
2410 .await
2411 .map(crate::Response::into_body)
2412 }
2413
2414 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2418 self.0.request.name = v.into();
2419 self
2420 }
2421 }
2422
2423 #[doc(hidden)]
2424 impl crate::RequestBuilder for GetActiveDirectory {
2425 fn request_options(&mut self) -> &mut crate::RequestOptions {
2426 &mut self.0.options
2427 }
2428 }
2429
2430 #[derive(Clone, Debug)]
2448 pub struct CreateActiveDirectory(RequestBuilder<crate::model::CreateActiveDirectoryRequest>);
2449
2450 impl CreateActiveDirectory {
2451 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2452 Self(RequestBuilder::new(stub))
2453 }
2454
2455 pub fn with_request<V: Into<crate::model::CreateActiveDirectoryRequest>>(
2457 mut self,
2458 v: V,
2459 ) -> Self {
2460 self.0.request = v.into();
2461 self
2462 }
2463
2464 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2466 self.0.options = v.into();
2467 self
2468 }
2469
2470 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2477 (*self.0.stub)
2478 .create_active_directory(self.0.request, self.0.options)
2479 .await
2480 .map(crate::Response::into_body)
2481 }
2482
2483 pub fn poller(
2485 self,
2486 ) -> impl google_cloud_lro::Poller<crate::model::ActiveDirectory, crate::model::OperationMetadata>
2487 {
2488 type Operation = google_cloud_lro::internal::Operation<
2489 crate::model::ActiveDirectory,
2490 crate::model::OperationMetadata,
2491 >;
2492 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2493 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2494
2495 let stub = self.0.stub.clone();
2496 let mut options = self.0.options.clone();
2497 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2498 let query = move |name| {
2499 let stub = stub.clone();
2500 let options = options.clone();
2501 async {
2502 let op = GetOperation::new(stub)
2503 .set_name(name)
2504 .with_options(options)
2505 .send()
2506 .await?;
2507 Ok(Operation::new(op))
2508 }
2509 };
2510
2511 let start = move || async {
2512 let op = self.send().await?;
2513 Ok(Operation::new(op))
2514 };
2515
2516 google_cloud_lro::internal::new_poller(
2517 polling_error_policy,
2518 polling_backoff_policy,
2519 start,
2520 query,
2521 )
2522 }
2523
2524 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2528 self.0.request.parent = v.into();
2529 self
2530 }
2531
2532 pub fn set_active_directory<T>(mut self, v: T) -> Self
2536 where
2537 T: std::convert::Into<crate::model::ActiveDirectory>,
2538 {
2539 self.0.request.active_directory = std::option::Option::Some(v.into());
2540 self
2541 }
2542
2543 pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
2547 where
2548 T: std::convert::Into<crate::model::ActiveDirectory>,
2549 {
2550 self.0.request.active_directory = v.map(|x| x.into());
2551 self
2552 }
2553
2554 pub fn set_active_directory_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2558 self.0.request.active_directory_id = v.into();
2559 self
2560 }
2561 }
2562
2563 #[doc(hidden)]
2564 impl crate::RequestBuilder for CreateActiveDirectory {
2565 fn request_options(&mut self) -> &mut crate::RequestOptions {
2566 &mut self.0.options
2567 }
2568 }
2569
2570 #[derive(Clone, Debug)]
2588 pub struct UpdateActiveDirectory(RequestBuilder<crate::model::UpdateActiveDirectoryRequest>);
2589
2590 impl UpdateActiveDirectory {
2591 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2592 Self(RequestBuilder::new(stub))
2593 }
2594
2595 pub fn with_request<V: Into<crate::model::UpdateActiveDirectoryRequest>>(
2597 mut self,
2598 v: V,
2599 ) -> Self {
2600 self.0.request = v.into();
2601 self
2602 }
2603
2604 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2606 self.0.options = v.into();
2607 self
2608 }
2609
2610 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2617 (*self.0.stub)
2618 .update_active_directory(self.0.request, self.0.options)
2619 .await
2620 .map(crate::Response::into_body)
2621 }
2622
2623 pub fn poller(
2625 self,
2626 ) -> impl google_cloud_lro::Poller<crate::model::ActiveDirectory, crate::model::OperationMetadata>
2627 {
2628 type Operation = google_cloud_lro::internal::Operation<
2629 crate::model::ActiveDirectory,
2630 crate::model::OperationMetadata,
2631 >;
2632 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2633 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2634
2635 let stub = self.0.stub.clone();
2636 let mut options = self.0.options.clone();
2637 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2638 let query = move |name| {
2639 let stub = stub.clone();
2640 let options = options.clone();
2641 async {
2642 let op = GetOperation::new(stub)
2643 .set_name(name)
2644 .with_options(options)
2645 .send()
2646 .await?;
2647 Ok(Operation::new(op))
2648 }
2649 };
2650
2651 let start = move || async {
2652 let op = self.send().await?;
2653 Ok(Operation::new(op))
2654 };
2655
2656 google_cloud_lro::internal::new_poller(
2657 polling_error_policy,
2658 polling_backoff_policy,
2659 start,
2660 query,
2661 )
2662 }
2663
2664 pub fn set_update_mask<T>(mut self, v: T) -> Self
2668 where
2669 T: std::convert::Into<wkt::FieldMask>,
2670 {
2671 self.0.request.update_mask = std::option::Option::Some(v.into());
2672 self
2673 }
2674
2675 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2679 where
2680 T: std::convert::Into<wkt::FieldMask>,
2681 {
2682 self.0.request.update_mask = v.map(|x| x.into());
2683 self
2684 }
2685
2686 pub fn set_active_directory<T>(mut self, v: T) -> Self
2690 where
2691 T: std::convert::Into<crate::model::ActiveDirectory>,
2692 {
2693 self.0.request.active_directory = std::option::Option::Some(v.into());
2694 self
2695 }
2696
2697 pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
2701 where
2702 T: std::convert::Into<crate::model::ActiveDirectory>,
2703 {
2704 self.0.request.active_directory = v.map(|x| x.into());
2705 self
2706 }
2707 }
2708
2709 #[doc(hidden)]
2710 impl crate::RequestBuilder for UpdateActiveDirectory {
2711 fn request_options(&mut self) -> &mut crate::RequestOptions {
2712 &mut self.0.options
2713 }
2714 }
2715
2716 #[derive(Clone, Debug)]
2734 pub struct DeleteActiveDirectory(RequestBuilder<crate::model::DeleteActiveDirectoryRequest>);
2735
2736 impl DeleteActiveDirectory {
2737 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2738 Self(RequestBuilder::new(stub))
2739 }
2740
2741 pub fn with_request<V: Into<crate::model::DeleteActiveDirectoryRequest>>(
2743 mut self,
2744 v: V,
2745 ) -> Self {
2746 self.0.request = v.into();
2747 self
2748 }
2749
2750 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2752 self.0.options = v.into();
2753 self
2754 }
2755
2756 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2763 (*self.0.stub)
2764 .delete_active_directory(self.0.request, self.0.options)
2765 .await
2766 .map(crate::Response::into_body)
2767 }
2768
2769 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2771 type Operation =
2772 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2773 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2774 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2775
2776 let stub = self.0.stub.clone();
2777 let mut options = self.0.options.clone();
2778 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2779 let query = move |name| {
2780 let stub = stub.clone();
2781 let options = options.clone();
2782 async {
2783 let op = GetOperation::new(stub)
2784 .set_name(name)
2785 .with_options(options)
2786 .send()
2787 .await?;
2788 Ok(Operation::new(op))
2789 }
2790 };
2791
2792 let start = move || async {
2793 let op = self.send().await?;
2794 Ok(Operation::new(op))
2795 };
2796
2797 google_cloud_lro::internal::new_unit_response_poller(
2798 polling_error_policy,
2799 polling_backoff_policy,
2800 start,
2801 query,
2802 )
2803 }
2804
2805 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2809 self.0.request.name = v.into();
2810 self
2811 }
2812 }
2813
2814 #[doc(hidden)]
2815 impl crate::RequestBuilder for DeleteActiveDirectory {
2816 fn request_options(&mut self) -> &mut crate::RequestOptions {
2817 &mut self.0.options
2818 }
2819 }
2820
2821 #[derive(Clone, Debug)]
2842 pub struct ListKmsConfigs(RequestBuilder<crate::model::ListKmsConfigsRequest>);
2843
2844 impl ListKmsConfigs {
2845 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2846 Self(RequestBuilder::new(stub))
2847 }
2848
2849 pub fn with_request<V: Into<crate::model::ListKmsConfigsRequest>>(mut self, v: V) -> Self {
2851 self.0.request = v.into();
2852 self
2853 }
2854
2855 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2857 self.0.options = v.into();
2858 self
2859 }
2860
2861 pub async fn send(self) -> Result<crate::model::ListKmsConfigsResponse> {
2863 (*self.0.stub)
2864 .list_kms_configs(self.0.request, self.0.options)
2865 .await
2866 .map(crate::Response::into_body)
2867 }
2868
2869 pub fn by_page(
2871 self,
2872 ) -> impl google_cloud_gax::paginator::Paginator<
2873 crate::model::ListKmsConfigsResponse,
2874 crate::Error,
2875 > {
2876 use std::clone::Clone;
2877 let token = self.0.request.page_token.clone();
2878 let execute = move |token: String| {
2879 let mut builder = self.clone();
2880 builder.0.request = builder.0.request.set_page_token(token);
2881 builder.send()
2882 };
2883 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2884 }
2885
2886 pub fn by_item(
2888 self,
2889 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2890 crate::model::ListKmsConfigsResponse,
2891 crate::Error,
2892 > {
2893 use google_cloud_gax::paginator::Paginator;
2894 self.by_page().items()
2895 }
2896
2897 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2901 self.0.request.parent = v.into();
2902 self
2903 }
2904
2905 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2907 self.0.request.page_size = v.into();
2908 self
2909 }
2910
2911 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2913 self.0.request.page_token = v.into();
2914 self
2915 }
2916
2917 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2919 self.0.request.order_by = v.into();
2920 self
2921 }
2922
2923 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2925 self.0.request.filter = v.into();
2926 self
2927 }
2928 }
2929
2930 #[doc(hidden)]
2931 impl crate::RequestBuilder for ListKmsConfigs {
2932 fn request_options(&mut self) -> &mut crate::RequestOptions {
2933 &mut self.0.options
2934 }
2935 }
2936
2937 #[derive(Clone, Debug)]
2955 pub struct CreateKmsConfig(RequestBuilder<crate::model::CreateKmsConfigRequest>);
2956
2957 impl CreateKmsConfig {
2958 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2959 Self(RequestBuilder::new(stub))
2960 }
2961
2962 pub fn with_request<V: Into<crate::model::CreateKmsConfigRequest>>(mut self, v: V) -> Self {
2964 self.0.request = v.into();
2965 self
2966 }
2967
2968 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2970 self.0.options = v.into();
2971 self
2972 }
2973
2974 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2981 (*self.0.stub)
2982 .create_kms_config(self.0.request, self.0.options)
2983 .await
2984 .map(crate::Response::into_body)
2985 }
2986
2987 pub fn poller(
2989 self,
2990 ) -> impl google_cloud_lro::Poller<crate::model::KmsConfig, crate::model::OperationMetadata>
2991 {
2992 type Operation = google_cloud_lro::internal::Operation<
2993 crate::model::KmsConfig,
2994 crate::model::OperationMetadata,
2995 >;
2996 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2997 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2998
2999 let stub = self.0.stub.clone();
3000 let mut options = self.0.options.clone();
3001 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3002 let query = move |name| {
3003 let stub = stub.clone();
3004 let options = options.clone();
3005 async {
3006 let op = GetOperation::new(stub)
3007 .set_name(name)
3008 .with_options(options)
3009 .send()
3010 .await?;
3011 Ok(Operation::new(op))
3012 }
3013 };
3014
3015 let start = move || async {
3016 let op = self.send().await?;
3017 Ok(Operation::new(op))
3018 };
3019
3020 google_cloud_lro::internal::new_poller(
3021 polling_error_policy,
3022 polling_backoff_policy,
3023 start,
3024 query,
3025 )
3026 }
3027
3028 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3032 self.0.request.parent = v.into();
3033 self
3034 }
3035
3036 pub fn set_kms_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3040 self.0.request.kms_config_id = v.into();
3041 self
3042 }
3043
3044 pub fn set_kms_config<T>(mut self, v: T) -> Self
3048 where
3049 T: std::convert::Into<crate::model::KmsConfig>,
3050 {
3051 self.0.request.kms_config = std::option::Option::Some(v.into());
3052 self
3053 }
3054
3055 pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
3059 where
3060 T: std::convert::Into<crate::model::KmsConfig>,
3061 {
3062 self.0.request.kms_config = v.map(|x| x.into());
3063 self
3064 }
3065 }
3066
3067 #[doc(hidden)]
3068 impl crate::RequestBuilder for CreateKmsConfig {
3069 fn request_options(&mut self) -> &mut crate::RequestOptions {
3070 &mut self.0.options
3071 }
3072 }
3073
3074 #[derive(Clone, Debug)]
3091 pub struct GetKmsConfig(RequestBuilder<crate::model::GetKmsConfigRequest>);
3092
3093 impl GetKmsConfig {
3094 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3095 Self(RequestBuilder::new(stub))
3096 }
3097
3098 pub fn with_request<V: Into<crate::model::GetKmsConfigRequest>>(mut self, v: V) -> Self {
3100 self.0.request = v.into();
3101 self
3102 }
3103
3104 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3106 self.0.options = v.into();
3107 self
3108 }
3109
3110 pub async fn send(self) -> Result<crate::model::KmsConfig> {
3112 (*self.0.stub)
3113 .get_kms_config(self.0.request, self.0.options)
3114 .await
3115 .map(crate::Response::into_body)
3116 }
3117
3118 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3122 self.0.request.name = v.into();
3123 self
3124 }
3125 }
3126
3127 #[doc(hidden)]
3128 impl crate::RequestBuilder for GetKmsConfig {
3129 fn request_options(&mut self) -> &mut crate::RequestOptions {
3130 &mut self.0.options
3131 }
3132 }
3133
3134 #[derive(Clone, Debug)]
3152 pub struct UpdateKmsConfig(RequestBuilder<crate::model::UpdateKmsConfigRequest>);
3153
3154 impl UpdateKmsConfig {
3155 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3156 Self(RequestBuilder::new(stub))
3157 }
3158
3159 pub fn with_request<V: Into<crate::model::UpdateKmsConfigRequest>>(mut self, v: V) -> Self {
3161 self.0.request = v.into();
3162 self
3163 }
3164
3165 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3167 self.0.options = v.into();
3168 self
3169 }
3170
3171 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3178 (*self.0.stub)
3179 .update_kms_config(self.0.request, self.0.options)
3180 .await
3181 .map(crate::Response::into_body)
3182 }
3183
3184 pub fn poller(
3186 self,
3187 ) -> impl google_cloud_lro::Poller<crate::model::KmsConfig, crate::model::OperationMetadata>
3188 {
3189 type Operation = google_cloud_lro::internal::Operation<
3190 crate::model::KmsConfig,
3191 crate::model::OperationMetadata,
3192 >;
3193 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3194 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3195
3196 let stub = self.0.stub.clone();
3197 let mut options = self.0.options.clone();
3198 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3199 let query = move |name| {
3200 let stub = stub.clone();
3201 let options = options.clone();
3202 async {
3203 let op = GetOperation::new(stub)
3204 .set_name(name)
3205 .with_options(options)
3206 .send()
3207 .await?;
3208 Ok(Operation::new(op))
3209 }
3210 };
3211
3212 let start = move || async {
3213 let op = self.send().await?;
3214 Ok(Operation::new(op))
3215 };
3216
3217 google_cloud_lro::internal::new_poller(
3218 polling_error_policy,
3219 polling_backoff_policy,
3220 start,
3221 query,
3222 )
3223 }
3224
3225 pub fn set_update_mask<T>(mut self, v: T) -> Self
3229 where
3230 T: std::convert::Into<wkt::FieldMask>,
3231 {
3232 self.0.request.update_mask = std::option::Option::Some(v.into());
3233 self
3234 }
3235
3236 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3240 where
3241 T: std::convert::Into<wkt::FieldMask>,
3242 {
3243 self.0.request.update_mask = v.map(|x| x.into());
3244 self
3245 }
3246
3247 pub fn set_kms_config<T>(mut self, v: T) -> Self
3251 where
3252 T: std::convert::Into<crate::model::KmsConfig>,
3253 {
3254 self.0.request.kms_config = std::option::Option::Some(v.into());
3255 self
3256 }
3257
3258 pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
3262 where
3263 T: std::convert::Into<crate::model::KmsConfig>,
3264 {
3265 self.0.request.kms_config = v.map(|x| x.into());
3266 self
3267 }
3268 }
3269
3270 #[doc(hidden)]
3271 impl crate::RequestBuilder for UpdateKmsConfig {
3272 fn request_options(&mut self) -> &mut crate::RequestOptions {
3273 &mut self.0.options
3274 }
3275 }
3276
3277 #[derive(Clone, Debug)]
3295 pub struct EncryptVolumes(RequestBuilder<crate::model::EncryptVolumesRequest>);
3296
3297 impl EncryptVolumes {
3298 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3299 Self(RequestBuilder::new(stub))
3300 }
3301
3302 pub fn with_request<V: Into<crate::model::EncryptVolumesRequest>>(mut self, v: V) -> Self {
3304 self.0.request = v.into();
3305 self
3306 }
3307
3308 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3310 self.0.options = v.into();
3311 self
3312 }
3313
3314 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3321 (*self.0.stub)
3322 .encrypt_volumes(self.0.request, self.0.options)
3323 .await
3324 .map(crate::Response::into_body)
3325 }
3326
3327 pub fn poller(
3329 self,
3330 ) -> impl google_cloud_lro::Poller<crate::model::KmsConfig, crate::model::OperationMetadata>
3331 {
3332 type Operation = google_cloud_lro::internal::Operation<
3333 crate::model::KmsConfig,
3334 crate::model::OperationMetadata,
3335 >;
3336 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3337 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3338
3339 let stub = self.0.stub.clone();
3340 let mut options = self.0.options.clone();
3341 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3342 let query = move |name| {
3343 let stub = stub.clone();
3344 let options = options.clone();
3345 async {
3346 let op = GetOperation::new(stub)
3347 .set_name(name)
3348 .with_options(options)
3349 .send()
3350 .await?;
3351 Ok(Operation::new(op))
3352 }
3353 };
3354
3355 let start = move || async {
3356 let op = self.send().await?;
3357 Ok(Operation::new(op))
3358 };
3359
3360 google_cloud_lro::internal::new_poller(
3361 polling_error_policy,
3362 polling_backoff_policy,
3363 start,
3364 query,
3365 )
3366 }
3367
3368 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3372 self.0.request.name = v.into();
3373 self
3374 }
3375 }
3376
3377 #[doc(hidden)]
3378 impl crate::RequestBuilder for EncryptVolumes {
3379 fn request_options(&mut self) -> &mut crate::RequestOptions {
3380 &mut self.0.options
3381 }
3382 }
3383
3384 #[derive(Clone, Debug)]
3401 pub struct VerifyKmsConfig(RequestBuilder<crate::model::VerifyKmsConfigRequest>);
3402
3403 impl VerifyKmsConfig {
3404 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3405 Self(RequestBuilder::new(stub))
3406 }
3407
3408 pub fn with_request<V: Into<crate::model::VerifyKmsConfigRequest>>(mut self, v: V) -> Self {
3410 self.0.request = v.into();
3411 self
3412 }
3413
3414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3416 self.0.options = v.into();
3417 self
3418 }
3419
3420 pub async fn send(self) -> Result<crate::model::VerifyKmsConfigResponse> {
3422 (*self.0.stub)
3423 .verify_kms_config(self.0.request, self.0.options)
3424 .await
3425 .map(crate::Response::into_body)
3426 }
3427
3428 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3432 self.0.request.name = v.into();
3433 self
3434 }
3435 }
3436
3437 #[doc(hidden)]
3438 impl crate::RequestBuilder for VerifyKmsConfig {
3439 fn request_options(&mut self) -> &mut crate::RequestOptions {
3440 &mut self.0.options
3441 }
3442 }
3443
3444 #[derive(Clone, Debug)]
3462 pub struct DeleteKmsConfig(RequestBuilder<crate::model::DeleteKmsConfigRequest>);
3463
3464 impl DeleteKmsConfig {
3465 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3466 Self(RequestBuilder::new(stub))
3467 }
3468
3469 pub fn with_request<V: Into<crate::model::DeleteKmsConfigRequest>>(mut self, v: V) -> Self {
3471 self.0.request = v.into();
3472 self
3473 }
3474
3475 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3477 self.0.options = v.into();
3478 self
3479 }
3480
3481 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3488 (*self.0.stub)
3489 .delete_kms_config(self.0.request, self.0.options)
3490 .await
3491 .map(crate::Response::into_body)
3492 }
3493
3494 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3496 type Operation =
3497 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3498 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3499 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3500
3501 let stub = self.0.stub.clone();
3502 let mut options = self.0.options.clone();
3503 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3504 let query = move |name| {
3505 let stub = stub.clone();
3506 let options = options.clone();
3507 async {
3508 let op = GetOperation::new(stub)
3509 .set_name(name)
3510 .with_options(options)
3511 .send()
3512 .await?;
3513 Ok(Operation::new(op))
3514 }
3515 };
3516
3517 let start = move || async {
3518 let op = self.send().await?;
3519 Ok(Operation::new(op))
3520 };
3521
3522 google_cloud_lro::internal::new_unit_response_poller(
3523 polling_error_policy,
3524 polling_backoff_policy,
3525 start,
3526 query,
3527 )
3528 }
3529
3530 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3534 self.0.request.name = v.into();
3535 self
3536 }
3537 }
3538
3539 #[doc(hidden)]
3540 impl crate::RequestBuilder for DeleteKmsConfig {
3541 fn request_options(&mut self) -> &mut crate::RequestOptions {
3542 &mut self.0.options
3543 }
3544 }
3545
3546 #[derive(Clone, Debug)]
3567 pub struct ListReplications(RequestBuilder<crate::model::ListReplicationsRequest>);
3568
3569 impl ListReplications {
3570 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3571 Self(RequestBuilder::new(stub))
3572 }
3573
3574 pub fn with_request<V: Into<crate::model::ListReplicationsRequest>>(
3576 mut self,
3577 v: V,
3578 ) -> Self {
3579 self.0.request = v.into();
3580 self
3581 }
3582
3583 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3585 self.0.options = v.into();
3586 self
3587 }
3588
3589 pub async fn send(self) -> Result<crate::model::ListReplicationsResponse> {
3591 (*self.0.stub)
3592 .list_replications(self.0.request, self.0.options)
3593 .await
3594 .map(crate::Response::into_body)
3595 }
3596
3597 pub fn by_page(
3599 self,
3600 ) -> impl google_cloud_gax::paginator::Paginator<
3601 crate::model::ListReplicationsResponse,
3602 crate::Error,
3603 > {
3604 use std::clone::Clone;
3605 let token = self.0.request.page_token.clone();
3606 let execute = move |token: String| {
3607 let mut builder = self.clone();
3608 builder.0.request = builder.0.request.set_page_token(token);
3609 builder.send()
3610 };
3611 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3612 }
3613
3614 pub fn by_item(
3616 self,
3617 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3618 crate::model::ListReplicationsResponse,
3619 crate::Error,
3620 > {
3621 use google_cloud_gax::paginator::Paginator;
3622 self.by_page().items()
3623 }
3624
3625 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3629 self.0.request.parent = v.into();
3630 self
3631 }
3632
3633 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3635 self.0.request.page_size = v.into();
3636 self
3637 }
3638
3639 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3641 self.0.request.page_token = v.into();
3642 self
3643 }
3644
3645 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3647 self.0.request.order_by = v.into();
3648 self
3649 }
3650
3651 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3653 self.0.request.filter = v.into();
3654 self
3655 }
3656 }
3657
3658 #[doc(hidden)]
3659 impl crate::RequestBuilder for ListReplications {
3660 fn request_options(&mut self) -> &mut crate::RequestOptions {
3661 &mut self.0.options
3662 }
3663 }
3664
3665 #[derive(Clone, Debug)]
3682 pub struct GetReplication(RequestBuilder<crate::model::GetReplicationRequest>);
3683
3684 impl GetReplication {
3685 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3686 Self(RequestBuilder::new(stub))
3687 }
3688
3689 pub fn with_request<V: Into<crate::model::GetReplicationRequest>>(mut self, v: V) -> Self {
3691 self.0.request = v.into();
3692 self
3693 }
3694
3695 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3697 self.0.options = v.into();
3698 self
3699 }
3700
3701 pub async fn send(self) -> Result<crate::model::Replication> {
3703 (*self.0.stub)
3704 .get_replication(self.0.request, self.0.options)
3705 .await
3706 .map(crate::Response::into_body)
3707 }
3708
3709 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3713 self.0.request.name = v.into();
3714 self
3715 }
3716 }
3717
3718 #[doc(hidden)]
3719 impl crate::RequestBuilder for GetReplication {
3720 fn request_options(&mut self) -> &mut crate::RequestOptions {
3721 &mut self.0.options
3722 }
3723 }
3724
3725 #[derive(Clone, Debug)]
3743 pub struct CreateReplication(RequestBuilder<crate::model::CreateReplicationRequest>);
3744
3745 impl CreateReplication {
3746 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3747 Self(RequestBuilder::new(stub))
3748 }
3749
3750 pub fn with_request<V: Into<crate::model::CreateReplicationRequest>>(
3752 mut self,
3753 v: V,
3754 ) -> Self {
3755 self.0.request = v.into();
3756 self
3757 }
3758
3759 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3761 self.0.options = v.into();
3762 self
3763 }
3764
3765 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3772 (*self.0.stub)
3773 .create_replication(self.0.request, self.0.options)
3774 .await
3775 .map(crate::Response::into_body)
3776 }
3777
3778 pub fn poller(
3780 self,
3781 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
3782 {
3783 type Operation = google_cloud_lro::internal::Operation<
3784 crate::model::Replication,
3785 crate::model::OperationMetadata,
3786 >;
3787 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3788 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3789
3790 let stub = self.0.stub.clone();
3791 let mut options = self.0.options.clone();
3792 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3793 let query = move |name| {
3794 let stub = stub.clone();
3795 let options = options.clone();
3796 async {
3797 let op = GetOperation::new(stub)
3798 .set_name(name)
3799 .with_options(options)
3800 .send()
3801 .await?;
3802 Ok(Operation::new(op))
3803 }
3804 };
3805
3806 let start = move || async {
3807 let op = self.send().await?;
3808 Ok(Operation::new(op))
3809 };
3810
3811 google_cloud_lro::internal::new_poller(
3812 polling_error_policy,
3813 polling_backoff_policy,
3814 start,
3815 query,
3816 )
3817 }
3818
3819 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3823 self.0.request.parent = v.into();
3824 self
3825 }
3826
3827 pub fn set_replication<T>(mut self, v: T) -> Self
3831 where
3832 T: std::convert::Into<crate::model::Replication>,
3833 {
3834 self.0.request.replication = std::option::Option::Some(v.into());
3835 self
3836 }
3837
3838 pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
3842 where
3843 T: std::convert::Into<crate::model::Replication>,
3844 {
3845 self.0.request.replication = v.map(|x| x.into());
3846 self
3847 }
3848
3849 pub fn set_replication_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3853 self.0.request.replication_id = v.into();
3854 self
3855 }
3856 }
3857
3858 #[doc(hidden)]
3859 impl crate::RequestBuilder for CreateReplication {
3860 fn request_options(&mut self) -> &mut crate::RequestOptions {
3861 &mut self.0.options
3862 }
3863 }
3864
3865 #[derive(Clone, Debug)]
3883 pub struct DeleteReplication(RequestBuilder<crate::model::DeleteReplicationRequest>);
3884
3885 impl DeleteReplication {
3886 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3887 Self(RequestBuilder::new(stub))
3888 }
3889
3890 pub fn with_request<V: Into<crate::model::DeleteReplicationRequest>>(
3892 mut self,
3893 v: V,
3894 ) -> Self {
3895 self.0.request = v.into();
3896 self
3897 }
3898
3899 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3901 self.0.options = v.into();
3902 self
3903 }
3904
3905 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3912 (*self.0.stub)
3913 .delete_replication(self.0.request, self.0.options)
3914 .await
3915 .map(crate::Response::into_body)
3916 }
3917
3918 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3920 type Operation =
3921 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3922 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3923 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3924
3925 let stub = self.0.stub.clone();
3926 let mut options = self.0.options.clone();
3927 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3928 let query = move |name| {
3929 let stub = stub.clone();
3930 let options = options.clone();
3931 async {
3932 let op = GetOperation::new(stub)
3933 .set_name(name)
3934 .with_options(options)
3935 .send()
3936 .await?;
3937 Ok(Operation::new(op))
3938 }
3939 };
3940
3941 let start = move || async {
3942 let op = self.send().await?;
3943 Ok(Operation::new(op))
3944 };
3945
3946 google_cloud_lro::internal::new_unit_response_poller(
3947 polling_error_policy,
3948 polling_backoff_policy,
3949 start,
3950 query,
3951 )
3952 }
3953
3954 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3958 self.0.request.name = v.into();
3959 self
3960 }
3961 }
3962
3963 #[doc(hidden)]
3964 impl crate::RequestBuilder for DeleteReplication {
3965 fn request_options(&mut self) -> &mut crate::RequestOptions {
3966 &mut self.0.options
3967 }
3968 }
3969
3970 #[derive(Clone, Debug)]
3988 pub struct UpdateReplication(RequestBuilder<crate::model::UpdateReplicationRequest>);
3989
3990 impl UpdateReplication {
3991 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3992 Self(RequestBuilder::new(stub))
3993 }
3994
3995 pub fn with_request<V: Into<crate::model::UpdateReplicationRequest>>(
3997 mut self,
3998 v: V,
3999 ) -> Self {
4000 self.0.request = v.into();
4001 self
4002 }
4003
4004 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4006 self.0.options = v.into();
4007 self
4008 }
4009
4010 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4017 (*self.0.stub)
4018 .update_replication(self.0.request, self.0.options)
4019 .await
4020 .map(crate::Response::into_body)
4021 }
4022
4023 pub fn poller(
4025 self,
4026 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4027 {
4028 type Operation = google_cloud_lro::internal::Operation<
4029 crate::model::Replication,
4030 crate::model::OperationMetadata,
4031 >;
4032 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4033 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4034
4035 let stub = self.0.stub.clone();
4036 let mut options = self.0.options.clone();
4037 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4038 let query = move |name| {
4039 let stub = stub.clone();
4040 let options = options.clone();
4041 async {
4042 let op = GetOperation::new(stub)
4043 .set_name(name)
4044 .with_options(options)
4045 .send()
4046 .await?;
4047 Ok(Operation::new(op))
4048 }
4049 };
4050
4051 let start = move || async {
4052 let op = self.send().await?;
4053 Ok(Operation::new(op))
4054 };
4055
4056 google_cloud_lro::internal::new_poller(
4057 polling_error_policy,
4058 polling_backoff_policy,
4059 start,
4060 query,
4061 )
4062 }
4063
4064 pub fn set_update_mask<T>(mut self, v: T) -> Self
4068 where
4069 T: std::convert::Into<wkt::FieldMask>,
4070 {
4071 self.0.request.update_mask = std::option::Option::Some(v.into());
4072 self
4073 }
4074
4075 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4079 where
4080 T: std::convert::Into<wkt::FieldMask>,
4081 {
4082 self.0.request.update_mask = v.map(|x| x.into());
4083 self
4084 }
4085
4086 pub fn set_replication<T>(mut self, v: T) -> Self
4090 where
4091 T: std::convert::Into<crate::model::Replication>,
4092 {
4093 self.0.request.replication = std::option::Option::Some(v.into());
4094 self
4095 }
4096
4097 pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
4101 where
4102 T: std::convert::Into<crate::model::Replication>,
4103 {
4104 self.0.request.replication = v.map(|x| x.into());
4105 self
4106 }
4107 }
4108
4109 #[doc(hidden)]
4110 impl crate::RequestBuilder for UpdateReplication {
4111 fn request_options(&mut self) -> &mut crate::RequestOptions {
4112 &mut self.0.options
4113 }
4114 }
4115
4116 #[derive(Clone, Debug)]
4134 pub struct StopReplication(RequestBuilder<crate::model::StopReplicationRequest>);
4135
4136 impl StopReplication {
4137 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4138 Self(RequestBuilder::new(stub))
4139 }
4140
4141 pub fn with_request<V: Into<crate::model::StopReplicationRequest>>(mut self, v: V) -> Self {
4143 self.0.request = v.into();
4144 self
4145 }
4146
4147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4149 self.0.options = v.into();
4150 self
4151 }
4152
4153 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4160 (*self.0.stub)
4161 .stop_replication(self.0.request, self.0.options)
4162 .await
4163 .map(crate::Response::into_body)
4164 }
4165
4166 pub fn poller(
4168 self,
4169 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4170 {
4171 type Operation = google_cloud_lro::internal::Operation<
4172 crate::model::Replication,
4173 crate::model::OperationMetadata,
4174 >;
4175 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4176 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4177
4178 let stub = self.0.stub.clone();
4179 let mut options = self.0.options.clone();
4180 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4181 let query = move |name| {
4182 let stub = stub.clone();
4183 let options = options.clone();
4184 async {
4185 let op = GetOperation::new(stub)
4186 .set_name(name)
4187 .with_options(options)
4188 .send()
4189 .await?;
4190 Ok(Operation::new(op))
4191 }
4192 };
4193
4194 let start = move || async {
4195 let op = self.send().await?;
4196 Ok(Operation::new(op))
4197 };
4198
4199 google_cloud_lro::internal::new_poller(
4200 polling_error_policy,
4201 polling_backoff_policy,
4202 start,
4203 query,
4204 )
4205 }
4206
4207 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4211 self.0.request.name = v.into();
4212 self
4213 }
4214
4215 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
4217 self.0.request.force = v.into();
4218 self
4219 }
4220 }
4221
4222 #[doc(hidden)]
4223 impl crate::RequestBuilder for StopReplication {
4224 fn request_options(&mut self) -> &mut crate::RequestOptions {
4225 &mut self.0.options
4226 }
4227 }
4228
4229 #[derive(Clone, Debug)]
4247 pub struct ResumeReplication(RequestBuilder<crate::model::ResumeReplicationRequest>);
4248
4249 impl ResumeReplication {
4250 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4251 Self(RequestBuilder::new(stub))
4252 }
4253
4254 pub fn with_request<V: Into<crate::model::ResumeReplicationRequest>>(
4256 mut self,
4257 v: V,
4258 ) -> Self {
4259 self.0.request = v.into();
4260 self
4261 }
4262
4263 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4265 self.0.options = v.into();
4266 self
4267 }
4268
4269 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4276 (*self.0.stub)
4277 .resume_replication(self.0.request, self.0.options)
4278 .await
4279 .map(crate::Response::into_body)
4280 }
4281
4282 pub fn poller(
4284 self,
4285 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4286 {
4287 type Operation = google_cloud_lro::internal::Operation<
4288 crate::model::Replication,
4289 crate::model::OperationMetadata,
4290 >;
4291 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4292 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4293
4294 let stub = self.0.stub.clone();
4295 let mut options = self.0.options.clone();
4296 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4297 let query = move |name| {
4298 let stub = stub.clone();
4299 let options = options.clone();
4300 async {
4301 let op = GetOperation::new(stub)
4302 .set_name(name)
4303 .with_options(options)
4304 .send()
4305 .await?;
4306 Ok(Operation::new(op))
4307 }
4308 };
4309
4310 let start = move || async {
4311 let op = self.send().await?;
4312 Ok(Operation::new(op))
4313 };
4314
4315 google_cloud_lro::internal::new_poller(
4316 polling_error_policy,
4317 polling_backoff_policy,
4318 start,
4319 query,
4320 )
4321 }
4322
4323 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4327 self.0.request.name = v.into();
4328 self
4329 }
4330 }
4331
4332 #[doc(hidden)]
4333 impl crate::RequestBuilder for ResumeReplication {
4334 fn request_options(&mut self) -> &mut crate::RequestOptions {
4335 &mut self.0.options
4336 }
4337 }
4338
4339 #[derive(Clone, Debug)]
4357 pub struct ReverseReplicationDirection(
4358 RequestBuilder<crate::model::ReverseReplicationDirectionRequest>,
4359 );
4360
4361 impl ReverseReplicationDirection {
4362 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4363 Self(RequestBuilder::new(stub))
4364 }
4365
4366 pub fn with_request<V: Into<crate::model::ReverseReplicationDirectionRequest>>(
4368 mut self,
4369 v: V,
4370 ) -> Self {
4371 self.0.request = v.into();
4372 self
4373 }
4374
4375 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4377 self.0.options = v.into();
4378 self
4379 }
4380
4381 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4388 (*self.0.stub)
4389 .reverse_replication_direction(self.0.request, self.0.options)
4390 .await
4391 .map(crate::Response::into_body)
4392 }
4393
4394 pub fn poller(
4396 self,
4397 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4398 {
4399 type Operation = google_cloud_lro::internal::Operation<
4400 crate::model::Replication,
4401 crate::model::OperationMetadata,
4402 >;
4403 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4404 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4405
4406 let stub = self.0.stub.clone();
4407 let mut options = self.0.options.clone();
4408 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4409 let query = move |name| {
4410 let stub = stub.clone();
4411 let options = options.clone();
4412 async {
4413 let op = GetOperation::new(stub)
4414 .set_name(name)
4415 .with_options(options)
4416 .send()
4417 .await?;
4418 Ok(Operation::new(op))
4419 }
4420 };
4421
4422 let start = move || async {
4423 let op = self.send().await?;
4424 Ok(Operation::new(op))
4425 };
4426
4427 google_cloud_lro::internal::new_poller(
4428 polling_error_policy,
4429 polling_backoff_policy,
4430 start,
4431 query,
4432 )
4433 }
4434
4435 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4439 self.0.request.name = v.into();
4440 self
4441 }
4442 }
4443
4444 #[doc(hidden)]
4445 impl crate::RequestBuilder for ReverseReplicationDirection {
4446 fn request_options(&mut self) -> &mut crate::RequestOptions {
4447 &mut self.0.options
4448 }
4449 }
4450
4451 #[derive(Clone, Debug)]
4469 pub struct EstablishPeering(RequestBuilder<crate::model::EstablishPeeringRequest>);
4470
4471 impl EstablishPeering {
4472 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4473 Self(RequestBuilder::new(stub))
4474 }
4475
4476 pub fn with_request<V: Into<crate::model::EstablishPeeringRequest>>(
4478 mut self,
4479 v: V,
4480 ) -> Self {
4481 self.0.request = v.into();
4482 self
4483 }
4484
4485 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4487 self.0.options = v.into();
4488 self
4489 }
4490
4491 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4498 (*self.0.stub)
4499 .establish_peering(self.0.request, self.0.options)
4500 .await
4501 .map(crate::Response::into_body)
4502 }
4503
4504 pub fn poller(
4506 self,
4507 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4508 {
4509 type Operation = google_cloud_lro::internal::Operation<
4510 crate::model::Replication,
4511 crate::model::OperationMetadata,
4512 >;
4513 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4514 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4515
4516 let stub = self.0.stub.clone();
4517 let mut options = self.0.options.clone();
4518 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4519 let query = move |name| {
4520 let stub = stub.clone();
4521 let options = options.clone();
4522 async {
4523 let op = GetOperation::new(stub)
4524 .set_name(name)
4525 .with_options(options)
4526 .send()
4527 .await?;
4528 Ok(Operation::new(op))
4529 }
4530 };
4531
4532 let start = move || async {
4533 let op = self.send().await?;
4534 Ok(Operation::new(op))
4535 };
4536
4537 google_cloud_lro::internal::new_poller(
4538 polling_error_policy,
4539 polling_backoff_policy,
4540 start,
4541 query,
4542 )
4543 }
4544
4545 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4549 self.0.request.name = v.into();
4550 self
4551 }
4552
4553 pub fn set_peer_cluster_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4557 self.0.request.peer_cluster_name = v.into();
4558 self
4559 }
4560
4561 pub fn set_peer_svm_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4565 self.0.request.peer_svm_name = v.into();
4566 self
4567 }
4568
4569 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
4571 where
4572 T: std::iter::IntoIterator<Item = V>,
4573 V: std::convert::Into<std::string::String>,
4574 {
4575 use std::iter::Iterator;
4576 self.0.request.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
4577 self
4578 }
4579
4580 pub fn set_peer_volume_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4584 self.0.request.peer_volume_name = v.into();
4585 self
4586 }
4587 }
4588
4589 #[doc(hidden)]
4590 impl crate::RequestBuilder for EstablishPeering {
4591 fn request_options(&mut self) -> &mut crate::RequestOptions {
4592 &mut self.0.options
4593 }
4594 }
4595
4596 #[derive(Clone, Debug)]
4614 pub struct SyncReplication(RequestBuilder<crate::model::SyncReplicationRequest>);
4615
4616 impl SyncReplication {
4617 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4618 Self(RequestBuilder::new(stub))
4619 }
4620
4621 pub fn with_request<V: Into<crate::model::SyncReplicationRequest>>(mut self, v: V) -> Self {
4623 self.0.request = v.into();
4624 self
4625 }
4626
4627 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4629 self.0.options = v.into();
4630 self
4631 }
4632
4633 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4640 (*self.0.stub)
4641 .sync_replication(self.0.request, self.0.options)
4642 .await
4643 .map(crate::Response::into_body)
4644 }
4645
4646 pub fn poller(
4648 self,
4649 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4650 {
4651 type Operation = google_cloud_lro::internal::Operation<
4652 crate::model::Replication,
4653 crate::model::OperationMetadata,
4654 >;
4655 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4656 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4657
4658 let stub = self.0.stub.clone();
4659 let mut options = self.0.options.clone();
4660 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4661 let query = move |name| {
4662 let stub = stub.clone();
4663 let options = options.clone();
4664 async {
4665 let op = GetOperation::new(stub)
4666 .set_name(name)
4667 .with_options(options)
4668 .send()
4669 .await?;
4670 Ok(Operation::new(op))
4671 }
4672 };
4673
4674 let start = move || async {
4675 let op = self.send().await?;
4676 Ok(Operation::new(op))
4677 };
4678
4679 google_cloud_lro::internal::new_poller(
4680 polling_error_policy,
4681 polling_backoff_policy,
4682 start,
4683 query,
4684 )
4685 }
4686
4687 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4691 self.0.request.name = v.into();
4692 self
4693 }
4694 }
4695
4696 #[doc(hidden)]
4697 impl crate::RequestBuilder for SyncReplication {
4698 fn request_options(&mut self) -> &mut crate::RequestOptions {
4699 &mut self.0.options
4700 }
4701 }
4702
4703 #[derive(Clone, Debug)]
4721 pub struct CreateBackupVault(RequestBuilder<crate::model::CreateBackupVaultRequest>);
4722
4723 impl CreateBackupVault {
4724 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4725 Self(RequestBuilder::new(stub))
4726 }
4727
4728 pub fn with_request<V: Into<crate::model::CreateBackupVaultRequest>>(
4730 mut self,
4731 v: V,
4732 ) -> Self {
4733 self.0.request = v.into();
4734 self
4735 }
4736
4737 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4739 self.0.options = v.into();
4740 self
4741 }
4742
4743 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4750 (*self.0.stub)
4751 .create_backup_vault(self.0.request, self.0.options)
4752 .await
4753 .map(crate::Response::into_body)
4754 }
4755
4756 pub fn poller(
4758 self,
4759 ) -> impl google_cloud_lro::Poller<crate::model::BackupVault, crate::model::OperationMetadata>
4760 {
4761 type Operation = google_cloud_lro::internal::Operation<
4762 crate::model::BackupVault,
4763 crate::model::OperationMetadata,
4764 >;
4765 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4766 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4767
4768 let stub = self.0.stub.clone();
4769 let mut options = self.0.options.clone();
4770 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4771 let query = move |name| {
4772 let stub = stub.clone();
4773 let options = options.clone();
4774 async {
4775 let op = GetOperation::new(stub)
4776 .set_name(name)
4777 .with_options(options)
4778 .send()
4779 .await?;
4780 Ok(Operation::new(op))
4781 }
4782 };
4783
4784 let start = move || async {
4785 let op = self.send().await?;
4786 Ok(Operation::new(op))
4787 };
4788
4789 google_cloud_lro::internal::new_poller(
4790 polling_error_policy,
4791 polling_backoff_policy,
4792 start,
4793 query,
4794 )
4795 }
4796
4797 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4801 self.0.request.parent = v.into();
4802 self
4803 }
4804
4805 pub fn set_backup_vault_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4809 self.0.request.backup_vault_id = v.into();
4810 self
4811 }
4812
4813 pub fn set_backup_vault<T>(mut self, v: T) -> Self
4817 where
4818 T: std::convert::Into<crate::model::BackupVault>,
4819 {
4820 self.0.request.backup_vault = std::option::Option::Some(v.into());
4821 self
4822 }
4823
4824 pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4828 where
4829 T: std::convert::Into<crate::model::BackupVault>,
4830 {
4831 self.0.request.backup_vault = v.map(|x| x.into());
4832 self
4833 }
4834 }
4835
4836 #[doc(hidden)]
4837 impl crate::RequestBuilder for CreateBackupVault {
4838 fn request_options(&mut self) -> &mut crate::RequestOptions {
4839 &mut self.0.options
4840 }
4841 }
4842
4843 #[derive(Clone, Debug)]
4860 pub struct GetBackupVault(RequestBuilder<crate::model::GetBackupVaultRequest>);
4861
4862 impl GetBackupVault {
4863 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4864 Self(RequestBuilder::new(stub))
4865 }
4866
4867 pub fn with_request<V: Into<crate::model::GetBackupVaultRequest>>(mut self, v: V) -> Self {
4869 self.0.request = v.into();
4870 self
4871 }
4872
4873 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4875 self.0.options = v.into();
4876 self
4877 }
4878
4879 pub async fn send(self) -> Result<crate::model::BackupVault> {
4881 (*self.0.stub)
4882 .get_backup_vault(self.0.request, self.0.options)
4883 .await
4884 .map(crate::Response::into_body)
4885 }
4886
4887 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4891 self.0.request.name = v.into();
4892 self
4893 }
4894 }
4895
4896 #[doc(hidden)]
4897 impl crate::RequestBuilder for GetBackupVault {
4898 fn request_options(&mut self) -> &mut crate::RequestOptions {
4899 &mut self.0.options
4900 }
4901 }
4902
4903 #[derive(Clone, Debug)]
4924 pub struct ListBackupVaults(RequestBuilder<crate::model::ListBackupVaultsRequest>);
4925
4926 impl ListBackupVaults {
4927 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4928 Self(RequestBuilder::new(stub))
4929 }
4930
4931 pub fn with_request<V: Into<crate::model::ListBackupVaultsRequest>>(
4933 mut self,
4934 v: V,
4935 ) -> Self {
4936 self.0.request = v.into();
4937 self
4938 }
4939
4940 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4942 self.0.options = v.into();
4943 self
4944 }
4945
4946 pub async fn send(self) -> Result<crate::model::ListBackupVaultsResponse> {
4948 (*self.0.stub)
4949 .list_backup_vaults(self.0.request, self.0.options)
4950 .await
4951 .map(crate::Response::into_body)
4952 }
4953
4954 pub fn by_page(
4956 self,
4957 ) -> impl google_cloud_gax::paginator::Paginator<
4958 crate::model::ListBackupVaultsResponse,
4959 crate::Error,
4960 > {
4961 use std::clone::Clone;
4962 let token = self.0.request.page_token.clone();
4963 let execute = move |token: String| {
4964 let mut builder = self.clone();
4965 builder.0.request = builder.0.request.set_page_token(token);
4966 builder.send()
4967 };
4968 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4969 }
4970
4971 pub fn by_item(
4973 self,
4974 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4975 crate::model::ListBackupVaultsResponse,
4976 crate::Error,
4977 > {
4978 use google_cloud_gax::paginator::Paginator;
4979 self.by_page().items()
4980 }
4981
4982 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4986 self.0.request.parent = v.into();
4987 self
4988 }
4989
4990 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4992 self.0.request.page_size = v.into();
4993 self
4994 }
4995
4996 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4998 self.0.request.page_token = v.into();
4999 self
5000 }
5001
5002 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5004 self.0.request.order_by = v.into();
5005 self
5006 }
5007
5008 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5010 self.0.request.filter = v.into();
5011 self
5012 }
5013 }
5014
5015 #[doc(hidden)]
5016 impl crate::RequestBuilder for ListBackupVaults {
5017 fn request_options(&mut self) -> &mut crate::RequestOptions {
5018 &mut self.0.options
5019 }
5020 }
5021
5022 #[derive(Clone, Debug)]
5040 pub struct UpdateBackupVault(RequestBuilder<crate::model::UpdateBackupVaultRequest>);
5041
5042 impl UpdateBackupVault {
5043 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5044 Self(RequestBuilder::new(stub))
5045 }
5046
5047 pub fn with_request<V: Into<crate::model::UpdateBackupVaultRequest>>(
5049 mut self,
5050 v: V,
5051 ) -> Self {
5052 self.0.request = v.into();
5053 self
5054 }
5055
5056 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5058 self.0.options = v.into();
5059 self
5060 }
5061
5062 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5069 (*self.0.stub)
5070 .update_backup_vault(self.0.request, self.0.options)
5071 .await
5072 .map(crate::Response::into_body)
5073 }
5074
5075 pub fn poller(
5077 self,
5078 ) -> impl google_cloud_lro::Poller<crate::model::BackupVault, crate::model::OperationMetadata>
5079 {
5080 type Operation = google_cloud_lro::internal::Operation<
5081 crate::model::BackupVault,
5082 crate::model::OperationMetadata,
5083 >;
5084 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5085 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5086
5087 let stub = self.0.stub.clone();
5088 let mut options = self.0.options.clone();
5089 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5090 let query = move |name| {
5091 let stub = stub.clone();
5092 let options = options.clone();
5093 async {
5094 let op = GetOperation::new(stub)
5095 .set_name(name)
5096 .with_options(options)
5097 .send()
5098 .await?;
5099 Ok(Operation::new(op))
5100 }
5101 };
5102
5103 let start = move || async {
5104 let op = self.send().await?;
5105 Ok(Operation::new(op))
5106 };
5107
5108 google_cloud_lro::internal::new_poller(
5109 polling_error_policy,
5110 polling_backoff_policy,
5111 start,
5112 query,
5113 )
5114 }
5115
5116 pub fn set_update_mask<T>(mut self, v: T) -> Self
5120 where
5121 T: std::convert::Into<wkt::FieldMask>,
5122 {
5123 self.0.request.update_mask = std::option::Option::Some(v.into());
5124 self
5125 }
5126
5127 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5131 where
5132 T: std::convert::Into<wkt::FieldMask>,
5133 {
5134 self.0.request.update_mask = v.map(|x| x.into());
5135 self
5136 }
5137
5138 pub fn set_backup_vault<T>(mut self, v: T) -> Self
5142 where
5143 T: std::convert::Into<crate::model::BackupVault>,
5144 {
5145 self.0.request.backup_vault = std::option::Option::Some(v.into());
5146 self
5147 }
5148
5149 pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
5153 where
5154 T: std::convert::Into<crate::model::BackupVault>,
5155 {
5156 self.0.request.backup_vault = v.map(|x| x.into());
5157 self
5158 }
5159 }
5160
5161 #[doc(hidden)]
5162 impl crate::RequestBuilder for UpdateBackupVault {
5163 fn request_options(&mut self) -> &mut crate::RequestOptions {
5164 &mut self.0.options
5165 }
5166 }
5167
5168 #[derive(Clone, Debug)]
5186 pub struct DeleteBackupVault(RequestBuilder<crate::model::DeleteBackupVaultRequest>);
5187
5188 impl DeleteBackupVault {
5189 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5190 Self(RequestBuilder::new(stub))
5191 }
5192
5193 pub fn with_request<V: Into<crate::model::DeleteBackupVaultRequest>>(
5195 mut self,
5196 v: V,
5197 ) -> Self {
5198 self.0.request = v.into();
5199 self
5200 }
5201
5202 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5204 self.0.options = v.into();
5205 self
5206 }
5207
5208 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5215 (*self.0.stub)
5216 .delete_backup_vault(self.0.request, self.0.options)
5217 .await
5218 .map(crate::Response::into_body)
5219 }
5220
5221 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5223 type Operation =
5224 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5225 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5226 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5227
5228 let stub = self.0.stub.clone();
5229 let mut options = self.0.options.clone();
5230 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5231 let query = move |name| {
5232 let stub = stub.clone();
5233 let options = options.clone();
5234 async {
5235 let op = GetOperation::new(stub)
5236 .set_name(name)
5237 .with_options(options)
5238 .send()
5239 .await?;
5240 Ok(Operation::new(op))
5241 }
5242 };
5243
5244 let start = move || async {
5245 let op = self.send().await?;
5246 Ok(Operation::new(op))
5247 };
5248
5249 google_cloud_lro::internal::new_unit_response_poller(
5250 polling_error_policy,
5251 polling_backoff_policy,
5252 start,
5253 query,
5254 )
5255 }
5256
5257 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5261 self.0.request.name = v.into();
5262 self
5263 }
5264 }
5265
5266 #[doc(hidden)]
5267 impl crate::RequestBuilder for DeleteBackupVault {
5268 fn request_options(&mut self) -> &mut crate::RequestOptions {
5269 &mut self.0.options
5270 }
5271 }
5272
5273 #[derive(Clone, Debug)]
5291 pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
5292
5293 impl CreateBackup {
5294 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5295 Self(RequestBuilder::new(stub))
5296 }
5297
5298 pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
5300 self.0.request = v.into();
5301 self
5302 }
5303
5304 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5306 self.0.options = v.into();
5307 self
5308 }
5309
5310 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5317 (*self.0.stub)
5318 .create_backup(self.0.request, self.0.options)
5319 .await
5320 .map(crate::Response::into_body)
5321 }
5322
5323 pub fn poller(
5325 self,
5326 ) -> impl google_cloud_lro::Poller<crate::model::Backup, crate::model::OperationMetadata>
5327 {
5328 type Operation = google_cloud_lro::internal::Operation<
5329 crate::model::Backup,
5330 crate::model::OperationMetadata,
5331 >;
5332 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5333 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5334
5335 let stub = self.0.stub.clone();
5336 let mut options = self.0.options.clone();
5337 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5338 let query = move |name| {
5339 let stub = stub.clone();
5340 let options = options.clone();
5341 async {
5342 let op = GetOperation::new(stub)
5343 .set_name(name)
5344 .with_options(options)
5345 .send()
5346 .await?;
5347 Ok(Operation::new(op))
5348 }
5349 };
5350
5351 let start = move || async {
5352 let op = self.send().await?;
5353 Ok(Operation::new(op))
5354 };
5355
5356 google_cloud_lro::internal::new_poller(
5357 polling_error_policy,
5358 polling_backoff_policy,
5359 start,
5360 query,
5361 )
5362 }
5363
5364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5368 self.0.request.parent = v.into();
5369 self
5370 }
5371
5372 pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5376 self.0.request.backup_id = v.into();
5377 self
5378 }
5379
5380 pub fn set_backup<T>(mut self, v: T) -> Self
5384 where
5385 T: std::convert::Into<crate::model::Backup>,
5386 {
5387 self.0.request.backup = std::option::Option::Some(v.into());
5388 self
5389 }
5390
5391 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
5395 where
5396 T: std::convert::Into<crate::model::Backup>,
5397 {
5398 self.0.request.backup = v.map(|x| x.into());
5399 self
5400 }
5401 }
5402
5403 #[doc(hidden)]
5404 impl crate::RequestBuilder for CreateBackup {
5405 fn request_options(&mut self) -> &mut crate::RequestOptions {
5406 &mut self.0.options
5407 }
5408 }
5409
5410 #[derive(Clone, Debug)]
5427 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
5428
5429 impl GetBackup {
5430 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5431 Self(RequestBuilder::new(stub))
5432 }
5433
5434 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
5436 self.0.request = v.into();
5437 self
5438 }
5439
5440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5442 self.0.options = v.into();
5443 self
5444 }
5445
5446 pub async fn send(self) -> Result<crate::model::Backup> {
5448 (*self.0.stub)
5449 .get_backup(self.0.request, self.0.options)
5450 .await
5451 .map(crate::Response::into_body)
5452 }
5453
5454 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5458 self.0.request.name = v.into();
5459 self
5460 }
5461 }
5462
5463 #[doc(hidden)]
5464 impl crate::RequestBuilder for GetBackup {
5465 fn request_options(&mut self) -> &mut crate::RequestOptions {
5466 &mut self.0.options
5467 }
5468 }
5469
5470 #[derive(Clone, Debug)]
5491 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
5492
5493 impl ListBackups {
5494 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5495 Self(RequestBuilder::new(stub))
5496 }
5497
5498 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
5500 self.0.request = v.into();
5501 self
5502 }
5503
5504 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5506 self.0.options = v.into();
5507 self
5508 }
5509
5510 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
5512 (*self.0.stub)
5513 .list_backups(self.0.request, self.0.options)
5514 .await
5515 .map(crate::Response::into_body)
5516 }
5517
5518 pub fn by_page(
5520 self,
5521 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBackupsResponse, crate::Error>
5522 {
5523 use std::clone::Clone;
5524 let token = self.0.request.page_token.clone();
5525 let execute = move |token: String| {
5526 let mut builder = self.clone();
5527 builder.0.request = builder.0.request.set_page_token(token);
5528 builder.send()
5529 };
5530 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5531 }
5532
5533 pub fn by_item(
5535 self,
5536 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5537 crate::model::ListBackupsResponse,
5538 crate::Error,
5539 > {
5540 use google_cloud_gax::paginator::Paginator;
5541 self.by_page().items()
5542 }
5543
5544 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5548 self.0.request.parent = v.into();
5549 self
5550 }
5551
5552 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5554 self.0.request.page_size = v.into();
5555 self
5556 }
5557
5558 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5560 self.0.request.page_token = v.into();
5561 self
5562 }
5563
5564 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5566 self.0.request.order_by = v.into();
5567 self
5568 }
5569
5570 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5572 self.0.request.filter = v.into();
5573 self
5574 }
5575 }
5576
5577 #[doc(hidden)]
5578 impl crate::RequestBuilder for ListBackups {
5579 fn request_options(&mut self) -> &mut crate::RequestOptions {
5580 &mut self.0.options
5581 }
5582 }
5583
5584 #[derive(Clone, Debug)]
5602 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
5603
5604 impl DeleteBackup {
5605 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5606 Self(RequestBuilder::new(stub))
5607 }
5608
5609 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
5611 self.0.request = v.into();
5612 self
5613 }
5614
5615 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5617 self.0.options = v.into();
5618 self
5619 }
5620
5621 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5628 (*self.0.stub)
5629 .delete_backup(self.0.request, self.0.options)
5630 .await
5631 .map(crate::Response::into_body)
5632 }
5633
5634 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5636 type Operation =
5637 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5638 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5639 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5640
5641 let stub = self.0.stub.clone();
5642 let mut options = self.0.options.clone();
5643 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5644 let query = move |name| {
5645 let stub = stub.clone();
5646 let options = options.clone();
5647 async {
5648 let op = GetOperation::new(stub)
5649 .set_name(name)
5650 .with_options(options)
5651 .send()
5652 .await?;
5653 Ok(Operation::new(op))
5654 }
5655 };
5656
5657 let start = move || async {
5658 let op = self.send().await?;
5659 Ok(Operation::new(op))
5660 };
5661
5662 google_cloud_lro::internal::new_unit_response_poller(
5663 polling_error_policy,
5664 polling_backoff_policy,
5665 start,
5666 query,
5667 )
5668 }
5669
5670 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5674 self.0.request.name = v.into();
5675 self
5676 }
5677 }
5678
5679 #[doc(hidden)]
5680 impl crate::RequestBuilder for DeleteBackup {
5681 fn request_options(&mut self) -> &mut crate::RequestOptions {
5682 &mut self.0.options
5683 }
5684 }
5685
5686 #[derive(Clone, Debug)]
5704 pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
5705
5706 impl UpdateBackup {
5707 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5708 Self(RequestBuilder::new(stub))
5709 }
5710
5711 pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
5713 self.0.request = v.into();
5714 self
5715 }
5716
5717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5719 self.0.options = v.into();
5720 self
5721 }
5722
5723 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5730 (*self.0.stub)
5731 .update_backup(self.0.request, self.0.options)
5732 .await
5733 .map(crate::Response::into_body)
5734 }
5735
5736 pub fn poller(
5738 self,
5739 ) -> impl google_cloud_lro::Poller<crate::model::Backup, crate::model::OperationMetadata>
5740 {
5741 type Operation = google_cloud_lro::internal::Operation<
5742 crate::model::Backup,
5743 crate::model::OperationMetadata,
5744 >;
5745 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5746 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5747
5748 let stub = self.0.stub.clone();
5749 let mut options = self.0.options.clone();
5750 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5751 let query = move |name| {
5752 let stub = stub.clone();
5753 let options = options.clone();
5754 async {
5755 let op = GetOperation::new(stub)
5756 .set_name(name)
5757 .with_options(options)
5758 .send()
5759 .await?;
5760 Ok(Operation::new(op))
5761 }
5762 };
5763
5764 let start = move || async {
5765 let op = self.send().await?;
5766 Ok(Operation::new(op))
5767 };
5768
5769 google_cloud_lro::internal::new_poller(
5770 polling_error_policy,
5771 polling_backoff_policy,
5772 start,
5773 query,
5774 )
5775 }
5776
5777 pub fn set_update_mask<T>(mut self, v: T) -> Self
5781 where
5782 T: std::convert::Into<wkt::FieldMask>,
5783 {
5784 self.0.request.update_mask = std::option::Option::Some(v.into());
5785 self
5786 }
5787
5788 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5792 where
5793 T: std::convert::Into<wkt::FieldMask>,
5794 {
5795 self.0.request.update_mask = v.map(|x| x.into());
5796 self
5797 }
5798
5799 pub fn set_backup<T>(mut self, v: T) -> Self
5803 where
5804 T: std::convert::Into<crate::model::Backup>,
5805 {
5806 self.0.request.backup = std::option::Option::Some(v.into());
5807 self
5808 }
5809
5810 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
5814 where
5815 T: std::convert::Into<crate::model::Backup>,
5816 {
5817 self.0.request.backup = v.map(|x| x.into());
5818 self
5819 }
5820 }
5821
5822 #[doc(hidden)]
5823 impl crate::RequestBuilder for UpdateBackup {
5824 fn request_options(&mut self) -> &mut crate::RequestOptions {
5825 &mut self.0.options
5826 }
5827 }
5828
5829 #[derive(Clone, Debug)]
5847 pub struct CreateBackupPolicy(RequestBuilder<crate::model::CreateBackupPolicyRequest>);
5848
5849 impl CreateBackupPolicy {
5850 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5851 Self(RequestBuilder::new(stub))
5852 }
5853
5854 pub fn with_request<V: Into<crate::model::CreateBackupPolicyRequest>>(
5856 mut self,
5857 v: V,
5858 ) -> Self {
5859 self.0.request = v.into();
5860 self
5861 }
5862
5863 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5865 self.0.options = v.into();
5866 self
5867 }
5868
5869 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5876 (*self.0.stub)
5877 .create_backup_policy(self.0.request, self.0.options)
5878 .await
5879 .map(crate::Response::into_body)
5880 }
5881
5882 pub fn poller(
5884 self,
5885 ) -> impl google_cloud_lro::Poller<crate::model::BackupPolicy, crate::model::OperationMetadata>
5886 {
5887 type Operation = google_cloud_lro::internal::Operation<
5888 crate::model::BackupPolicy,
5889 crate::model::OperationMetadata,
5890 >;
5891 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5892 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5893
5894 let stub = self.0.stub.clone();
5895 let mut options = self.0.options.clone();
5896 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5897 let query = move |name| {
5898 let stub = stub.clone();
5899 let options = options.clone();
5900 async {
5901 let op = GetOperation::new(stub)
5902 .set_name(name)
5903 .with_options(options)
5904 .send()
5905 .await?;
5906 Ok(Operation::new(op))
5907 }
5908 };
5909
5910 let start = move || async {
5911 let op = self.send().await?;
5912 Ok(Operation::new(op))
5913 };
5914
5915 google_cloud_lro::internal::new_poller(
5916 polling_error_policy,
5917 polling_backoff_policy,
5918 start,
5919 query,
5920 )
5921 }
5922
5923 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5927 self.0.request.parent = v.into();
5928 self
5929 }
5930
5931 pub fn set_backup_policy<T>(mut self, v: T) -> Self
5935 where
5936 T: std::convert::Into<crate::model::BackupPolicy>,
5937 {
5938 self.0.request.backup_policy = std::option::Option::Some(v.into());
5939 self
5940 }
5941
5942 pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
5946 where
5947 T: std::convert::Into<crate::model::BackupPolicy>,
5948 {
5949 self.0.request.backup_policy = v.map(|x| x.into());
5950 self
5951 }
5952
5953 pub fn set_backup_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5957 self.0.request.backup_policy_id = v.into();
5958 self
5959 }
5960 }
5961
5962 #[doc(hidden)]
5963 impl crate::RequestBuilder for CreateBackupPolicy {
5964 fn request_options(&mut self) -> &mut crate::RequestOptions {
5965 &mut self.0.options
5966 }
5967 }
5968
5969 #[derive(Clone, Debug)]
5986 pub struct GetBackupPolicy(RequestBuilder<crate::model::GetBackupPolicyRequest>);
5987
5988 impl GetBackupPolicy {
5989 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5990 Self(RequestBuilder::new(stub))
5991 }
5992
5993 pub fn with_request<V: Into<crate::model::GetBackupPolicyRequest>>(mut self, v: V) -> Self {
5995 self.0.request = v.into();
5996 self
5997 }
5998
5999 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6001 self.0.options = v.into();
6002 self
6003 }
6004
6005 pub async fn send(self) -> Result<crate::model::BackupPolicy> {
6007 (*self.0.stub)
6008 .get_backup_policy(self.0.request, self.0.options)
6009 .await
6010 .map(crate::Response::into_body)
6011 }
6012
6013 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6017 self.0.request.name = v.into();
6018 self
6019 }
6020 }
6021
6022 #[doc(hidden)]
6023 impl crate::RequestBuilder for GetBackupPolicy {
6024 fn request_options(&mut self) -> &mut crate::RequestOptions {
6025 &mut self.0.options
6026 }
6027 }
6028
6029 #[derive(Clone, Debug)]
6050 pub struct ListBackupPolicies(RequestBuilder<crate::model::ListBackupPoliciesRequest>);
6051
6052 impl ListBackupPolicies {
6053 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6054 Self(RequestBuilder::new(stub))
6055 }
6056
6057 pub fn with_request<V: Into<crate::model::ListBackupPoliciesRequest>>(
6059 mut self,
6060 v: V,
6061 ) -> Self {
6062 self.0.request = v.into();
6063 self
6064 }
6065
6066 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6068 self.0.options = v.into();
6069 self
6070 }
6071
6072 pub async fn send(self) -> Result<crate::model::ListBackupPoliciesResponse> {
6074 (*self.0.stub)
6075 .list_backup_policies(self.0.request, self.0.options)
6076 .await
6077 .map(crate::Response::into_body)
6078 }
6079
6080 pub fn by_page(
6082 self,
6083 ) -> impl google_cloud_gax::paginator::Paginator<
6084 crate::model::ListBackupPoliciesResponse,
6085 crate::Error,
6086 > {
6087 use std::clone::Clone;
6088 let token = self.0.request.page_token.clone();
6089 let execute = move |token: String| {
6090 let mut builder = self.clone();
6091 builder.0.request = builder.0.request.set_page_token(token);
6092 builder.send()
6093 };
6094 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6095 }
6096
6097 pub fn by_item(
6099 self,
6100 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6101 crate::model::ListBackupPoliciesResponse,
6102 crate::Error,
6103 > {
6104 use google_cloud_gax::paginator::Paginator;
6105 self.by_page().items()
6106 }
6107
6108 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6112 self.0.request.parent = v.into();
6113 self
6114 }
6115
6116 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6118 self.0.request.page_size = v.into();
6119 self
6120 }
6121
6122 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6124 self.0.request.page_token = v.into();
6125 self
6126 }
6127
6128 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6130 self.0.request.filter = v.into();
6131 self
6132 }
6133
6134 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6136 self.0.request.order_by = v.into();
6137 self
6138 }
6139 }
6140
6141 #[doc(hidden)]
6142 impl crate::RequestBuilder for ListBackupPolicies {
6143 fn request_options(&mut self) -> &mut crate::RequestOptions {
6144 &mut self.0.options
6145 }
6146 }
6147
6148 #[derive(Clone, Debug)]
6166 pub struct UpdateBackupPolicy(RequestBuilder<crate::model::UpdateBackupPolicyRequest>);
6167
6168 impl UpdateBackupPolicy {
6169 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6170 Self(RequestBuilder::new(stub))
6171 }
6172
6173 pub fn with_request<V: Into<crate::model::UpdateBackupPolicyRequest>>(
6175 mut self,
6176 v: V,
6177 ) -> Self {
6178 self.0.request = v.into();
6179 self
6180 }
6181
6182 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6184 self.0.options = v.into();
6185 self
6186 }
6187
6188 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6195 (*self.0.stub)
6196 .update_backup_policy(self.0.request, self.0.options)
6197 .await
6198 .map(crate::Response::into_body)
6199 }
6200
6201 pub fn poller(
6203 self,
6204 ) -> impl google_cloud_lro::Poller<crate::model::BackupPolicy, crate::model::OperationMetadata>
6205 {
6206 type Operation = google_cloud_lro::internal::Operation<
6207 crate::model::BackupPolicy,
6208 crate::model::OperationMetadata,
6209 >;
6210 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6211 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6212
6213 let stub = self.0.stub.clone();
6214 let mut options = self.0.options.clone();
6215 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6216 let query = move |name| {
6217 let stub = stub.clone();
6218 let options = options.clone();
6219 async {
6220 let op = GetOperation::new(stub)
6221 .set_name(name)
6222 .with_options(options)
6223 .send()
6224 .await?;
6225 Ok(Operation::new(op))
6226 }
6227 };
6228
6229 let start = move || async {
6230 let op = self.send().await?;
6231 Ok(Operation::new(op))
6232 };
6233
6234 google_cloud_lro::internal::new_poller(
6235 polling_error_policy,
6236 polling_backoff_policy,
6237 start,
6238 query,
6239 )
6240 }
6241
6242 pub fn set_update_mask<T>(mut self, v: T) -> Self
6246 where
6247 T: std::convert::Into<wkt::FieldMask>,
6248 {
6249 self.0.request.update_mask = std::option::Option::Some(v.into());
6250 self
6251 }
6252
6253 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6257 where
6258 T: std::convert::Into<wkt::FieldMask>,
6259 {
6260 self.0.request.update_mask = v.map(|x| x.into());
6261 self
6262 }
6263
6264 pub fn set_backup_policy<T>(mut self, v: T) -> Self
6268 where
6269 T: std::convert::Into<crate::model::BackupPolicy>,
6270 {
6271 self.0.request.backup_policy = std::option::Option::Some(v.into());
6272 self
6273 }
6274
6275 pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
6279 where
6280 T: std::convert::Into<crate::model::BackupPolicy>,
6281 {
6282 self.0.request.backup_policy = v.map(|x| x.into());
6283 self
6284 }
6285 }
6286
6287 #[doc(hidden)]
6288 impl crate::RequestBuilder for UpdateBackupPolicy {
6289 fn request_options(&mut self) -> &mut crate::RequestOptions {
6290 &mut self.0.options
6291 }
6292 }
6293
6294 #[derive(Clone, Debug)]
6312 pub struct DeleteBackupPolicy(RequestBuilder<crate::model::DeleteBackupPolicyRequest>);
6313
6314 impl DeleteBackupPolicy {
6315 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6316 Self(RequestBuilder::new(stub))
6317 }
6318
6319 pub fn with_request<V: Into<crate::model::DeleteBackupPolicyRequest>>(
6321 mut self,
6322 v: V,
6323 ) -> Self {
6324 self.0.request = v.into();
6325 self
6326 }
6327
6328 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6330 self.0.options = v.into();
6331 self
6332 }
6333
6334 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6341 (*self.0.stub)
6342 .delete_backup_policy(self.0.request, self.0.options)
6343 .await
6344 .map(crate::Response::into_body)
6345 }
6346
6347 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6349 type Operation =
6350 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6351 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6352 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6353
6354 let stub = self.0.stub.clone();
6355 let mut options = self.0.options.clone();
6356 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6357 let query = move |name| {
6358 let stub = stub.clone();
6359 let options = options.clone();
6360 async {
6361 let op = GetOperation::new(stub)
6362 .set_name(name)
6363 .with_options(options)
6364 .send()
6365 .await?;
6366 Ok(Operation::new(op))
6367 }
6368 };
6369
6370 let start = move || async {
6371 let op = self.send().await?;
6372 Ok(Operation::new(op))
6373 };
6374
6375 google_cloud_lro::internal::new_unit_response_poller(
6376 polling_error_policy,
6377 polling_backoff_policy,
6378 start,
6379 query,
6380 )
6381 }
6382
6383 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6387 self.0.request.name = v.into();
6388 self
6389 }
6390 }
6391
6392 #[doc(hidden)]
6393 impl crate::RequestBuilder for DeleteBackupPolicy {
6394 fn request_options(&mut self) -> &mut crate::RequestOptions {
6395 &mut self.0.options
6396 }
6397 }
6398
6399 #[derive(Clone, Debug)]
6420 pub struct ListQuotaRules(RequestBuilder<crate::model::ListQuotaRulesRequest>);
6421
6422 impl ListQuotaRules {
6423 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6424 Self(RequestBuilder::new(stub))
6425 }
6426
6427 pub fn with_request<V: Into<crate::model::ListQuotaRulesRequest>>(mut self, v: V) -> Self {
6429 self.0.request = v.into();
6430 self
6431 }
6432
6433 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6435 self.0.options = v.into();
6436 self
6437 }
6438
6439 pub async fn send(self) -> Result<crate::model::ListQuotaRulesResponse> {
6441 (*self.0.stub)
6442 .list_quota_rules(self.0.request, self.0.options)
6443 .await
6444 .map(crate::Response::into_body)
6445 }
6446
6447 pub fn by_page(
6449 self,
6450 ) -> impl google_cloud_gax::paginator::Paginator<
6451 crate::model::ListQuotaRulesResponse,
6452 crate::Error,
6453 > {
6454 use std::clone::Clone;
6455 let token = self.0.request.page_token.clone();
6456 let execute = move |token: String| {
6457 let mut builder = self.clone();
6458 builder.0.request = builder.0.request.set_page_token(token);
6459 builder.send()
6460 };
6461 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6462 }
6463
6464 pub fn by_item(
6466 self,
6467 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6468 crate::model::ListQuotaRulesResponse,
6469 crate::Error,
6470 > {
6471 use google_cloud_gax::paginator::Paginator;
6472 self.by_page().items()
6473 }
6474
6475 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6479 self.0.request.parent = v.into();
6480 self
6481 }
6482
6483 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6485 self.0.request.page_size = v.into();
6486 self
6487 }
6488
6489 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6491 self.0.request.page_token = v.into();
6492 self
6493 }
6494
6495 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6497 self.0.request.filter = v.into();
6498 self
6499 }
6500
6501 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6503 self.0.request.order_by = v.into();
6504 self
6505 }
6506 }
6507
6508 #[doc(hidden)]
6509 impl crate::RequestBuilder for ListQuotaRules {
6510 fn request_options(&mut self) -> &mut crate::RequestOptions {
6511 &mut self.0.options
6512 }
6513 }
6514
6515 #[derive(Clone, Debug)]
6532 pub struct GetQuotaRule(RequestBuilder<crate::model::GetQuotaRuleRequest>);
6533
6534 impl GetQuotaRule {
6535 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6536 Self(RequestBuilder::new(stub))
6537 }
6538
6539 pub fn with_request<V: Into<crate::model::GetQuotaRuleRequest>>(mut self, v: V) -> Self {
6541 self.0.request = v.into();
6542 self
6543 }
6544
6545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6547 self.0.options = v.into();
6548 self
6549 }
6550
6551 pub async fn send(self) -> Result<crate::model::QuotaRule> {
6553 (*self.0.stub)
6554 .get_quota_rule(self.0.request, self.0.options)
6555 .await
6556 .map(crate::Response::into_body)
6557 }
6558
6559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6563 self.0.request.name = v.into();
6564 self
6565 }
6566 }
6567
6568 #[doc(hidden)]
6569 impl crate::RequestBuilder for GetQuotaRule {
6570 fn request_options(&mut self) -> &mut crate::RequestOptions {
6571 &mut self.0.options
6572 }
6573 }
6574
6575 #[derive(Clone, Debug)]
6593 pub struct CreateQuotaRule(RequestBuilder<crate::model::CreateQuotaRuleRequest>);
6594
6595 impl CreateQuotaRule {
6596 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6597 Self(RequestBuilder::new(stub))
6598 }
6599
6600 pub fn with_request<V: Into<crate::model::CreateQuotaRuleRequest>>(mut self, v: V) -> Self {
6602 self.0.request = v.into();
6603 self
6604 }
6605
6606 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6608 self.0.options = v.into();
6609 self
6610 }
6611
6612 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6619 (*self.0.stub)
6620 .create_quota_rule(self.0.request, self.0.options)
6621 .await
6622 .map(crate::Response::into_body)
6623 }
6624
6625 pub fn poller(
6627 self,
6628 ) -> impl google_cloud_lro::Poller<crate::model::QuotaRule, crate::model::OperationMetadata>
6629 {
6630 type Operation = google_cloud_lro::internal::Operation<
6631 crate::model::QuotaRule,
6632 crate::model::OperationMetadata,
6633 >;
6634 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6635 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6636
6637 let stub = self.0.stub.clone();
6638 let mut options = self.0.options.clone();
6639 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6640 let query = move |name| {
6641 let stub = stub.clone();
6642 let options = options.clone();
6643 async {
6644 let op = GetOperation::new(stub)
6645 .set_name(name)
6646 .with_options(options)
6647 .send()
6648 .await?;
6649 Ok(Operation::new(op))
6650 }
6651 };
6652
6653 let start = move || async {
6654 let op = self.send().await?;
6655 Ok(Operation::new(op))
6656 };
6657
6658 google_cloud_lro::internal::new_poller(
6659 polling_error_policy,
6660 polling_backoff_policy,
6661 start,
6662 query,
6663 )
6664 }
6665
6666 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6670 self.0.request.parent = v.into();
6671 self
6672 }
6673
6674 pub fn set_quota_rule<T>(mut self, v: T) -> Self
6678 where
6679 T: std::convert::Into<crate::model::QuotaRule>,
6680 {
6681 self.0.request.quota_rule = std::option::Option::Some(v.into());
6682 self
6683 }
6684
6685 pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
6689 where
6690 T: std::convert::Into<crate::model::QuotaRule>,
6691 {
6692 self.0.request.quota_rule = v.map(|x| x.into());
6693 self
6694 }
6695
6696 pub fn set_quota_rule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6700 self.0.request.quota_rule_id = v.into();
6701 self
6702 }
6703 }
6704
6705 #[doc(hidden)]
6706 impl crate::RequestBuilder for CreateQuotaRule {
6707 fn request_options(&mut self) -> &mut crate::RequestOptions {
6708 &mut self.0.options
6709 }
6710 }
6711
6712 #[derive(Clone, Debug)]
6730 pub struct UpdateQuotaRule(RequestBuilder<crate::model::UpdateQuotaRuleRequest>);
6731
6732 impl UpdateQuotaRule {
6733 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6734 Self(RequestBuilder::new(stub))
6735 }
6736
6737 pub fn with_request<V: Into<crate::model::UpdateQuotaRuleRequest>>(mut self, v: V) -> Self {
6739 self.0.request = v.into();
6740 self
6741 }
6742
6743 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6745 self.0.options = v.into();
6746 self
6747 }
6748
6749 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6756 (*self.0.stub)
6757 .update_quota_rule(self.0.request, self.0.options)
6758 .await
6759 .map(crate::Response::into_body)
6760 }
6761
6762 pub fn poller(
6764 self,
6765 ) -> impl google_cloud_lro::Poller<crate::model::QuotaRule, crate::model::OperationMetadata>
6766 {
6767 type Operation = google_cloud_lro::internal::Operation<
6768 crate::model::QuotaRule,
6769 crate::model::OperationMetadata,
6770 >;
6771 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6772 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6773
6774 let stub = self.0.stub.clone();
6775 let mut options = self.0.options.clone();
6776 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6777 let query = move |name| {
6778 let stub = stub.clone();
6779 let options = options.clone();
6780 async {
6781 let op = GetOperation::new(stub)
6782 .set_name(name)
6783 .with_options(options)
6784 .send()
6785 .await?;
6786 Ok(Operation::new(op))
6787 }
6788 };
6789
6790 let start = move || async {
6791 let op = self.send().await?;
6792 Ok(Operation::new(op))
6793 };
6794
6795 google_cloud_lro::internal::new_poller(
6796 polling_error_policy,
6797 polling_backoff_policy,
6798 start,
6799 query,
6800 )
6801 }
6802
6803 pub fn set_update_mask<T>(mut self, v: T) -> Self
6805 where
6806 T: std::convert::Into<wkt::FieldMask>,
6807 {
6808 self.0.request.update_mask = std::option::Option::Some(v.into());
6809 self
6810 }
6811
6812 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6814 where
6815 T: std::convert::Into<wkt::FieldMask>,
6816 {
6817 self.0.request.update_mask = v.map(|x| x.into());
6818 self
6819 }
6820
6821 pub fn set_quota_rule<T>(mut self, v: T) -> Self
6825 where
6826 T: std::convert::Into<crate::model::QuotaRule>,
6827 {
6828 self.0.request.quota_rule = std::option::Option::Some(v.into());
6829 self
6830 }
6831
6832 pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
6836 where
6837 T: std::convert::Into<crate::model::QuotaRule>,
6838 {
6839 self.0.request.quota_rule = v.map(|x| x.into());
6840 self
6841 }
6842 }
6843
6844 #[doc(hidden)]
6845 impl crate::RequestBuilder for UpdateQuotaRule {
6846 fn request_options(&mut self) -> &mut crate::RequestOptions {
6847 &mut self.0.options
6848 }
6849 }
6850
6851 #[derive(Clone, Debug)]
6869 pub struct DeleteQuotaRule(RequestBuilder<crate::model::DeleteQuotaRuleRequest>);
6870
6871 impl DeleteQuotaRule {
6872 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6873 Self(RequestBuilder::new(stub))
6874 }
6875
6876 pub fn with_request<V: Into<crate::model::DeleteQuotaRuleRequest>>(mut self, v: V) -> Self {
6878 self.0.request = v.into();
6879 self
6880 }
6881
6882 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6884 self.0.options = v.into();
6885 self
6886 }
6887
6888 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6895 (*self.0.stub)
6896 .delete_quota_rule(self.0.request, self.0.options)
6897 .await
6898 .map(crate::Response::into_body)
6899 }
6900
6901 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6903 type Operation =
6904 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6905 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6906 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6907
6908 let stub = self.0.stub.clone();
6909 let mut options = self.0.options.clone();
6910 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6911 let query = move |name| {
6912 let stub = stub.clone();
6913 let options = options.clone();
6914 async {
6915 let op = GetOperation::new(stub)
6916 .set_name(name)
6917 .with_options(options)
6918 .send()
6919 .await?;
6920 Ok(Operation::new(op))
6921 }
6922 };
6923
6924 let start = move || async {
6925 let op = self.send().await?;
6926 Ok(Operation::new(op))
6927 };
6928
6929 google_cloud_lro::internal::new_unit_response_poller(
6930 polling_error_policy,
6931 polling_backoff_policy,
6932 start,
6933 query,
6934 )
6935 }
6936
6937 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6941 self.0.request.name = v.into();
6942 self
6943 }
6944 }
6945
6946 #[doc(hidden)]
6947 impl crate::RequestBuilder for DeleteQuotaRule {
6948 fn request_options(&mut self) -> &mut crate::RequestOptions {
6949 &mut self.0.options
6950 }
6951 }
6952
6953 #[derive(Clone, Debug)]
6971 pub struct RestoreBackupFiles(RequestBuilder<crate::model::RestoreBackupFilesRequest>);
6972
6973 impl RestoreBackupFiles {
6974 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6975 Self(RequestBuilder::new(stub))
6976 }
6977
6978 pub fn with_request<V: Into<crate::model::RestoreBackupFilesRequest>>(
6980 mut self,
6981 v: V,
6982 ) -> Self {
6983 self.0.request = v.into();
6984 self
6985 }
6986
6987 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6989 self.0.options = v.into();
6990 self
6991 }
6992
6993 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7000 (*self.0.stub)
7001 .restore_backup_files(self.0.request, self.0.options)
7002 .await
7003 .map(crate::Response::into_body)
7004 }
7005
7006 pub fn poller(
7008 self,
7009 ) -> impl google_cloud_lro::Poller<
7010 crate::model::RestoreBackupFilesResponse,
7011 crate::model::OperationMetadata,
7012 > {
7013 type Operation = google_cloud_lro::internal::Operation<
7014 crate::model::RestoreBackupFilesResponse,
7015 crate::model::OperationMetadata,
7016 >;
7017 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7018 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7019
7020 let stub = self.0.stub.clone();
7021 let mut options = self.0.options.clone();
7022 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7023 let query = move |name| {
7024 let stub = stub.clone();
7025 let options = options.clone();
7026 async {
7027 let op = GetOperation::new(stub)
7028 .set_name(name)
7029 .with_options(options)
7030 .send()
7031 .await?;
7032 Ok(Operation::new(op))
7033 }
7034 };
7035
7036 let start = move || async {
7037 let op = self.send().await?;
7038 Ok(Operation::new(op))
7039 };
7040
7041 google_cloud_lro::internal::new_poller(
7042 polling_error_policy,
7043 polling_backoff_policy,
7044 start,
7045 query,
7046 )
7047 }
7048
7049 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7053 self.0.request.name = v.into();
7054 self
7055 }
7056
7057 pub fn set_backup<T: Into<std::string::String>>(mut self, v: T) -> Self {
7061 self.0.request.backup = v.into();
7062 self
7063 }
7064
7065 pub fn set_file_list<T, V>(mut self, v: T) -> Self
7069 where
7070 T: std::iter::IntoIterator<Item = V>,
7071 V: std::convert::Into<std::string::String>,
7072 {
7073 use std::iter::Iterator;
7074 self.0.request.file_list = v.into_iter().map(|i| i.into()).collect();
7075 self
7076 }
7077
7078 pub fn set_restore_destination_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
7080 self.0.request.restore_destination_path = v.into();
7081 self
7082 }
7083 }
7084
7085 #[doc(hidden)]
7086 impl crate::RequestBuilder for RestoreBackupFiles {
7087 fn request_options(&mut self) -> &mut crate::RequestOptions {
7088 &mut self.0.options
7089 }
7090 }
7091
7092 #[derive(Clone, Debug)]
7113 pub struct ListHostGroups(RequestBuilder<crate::model::ListHostGroupsRequest>);
7114
7115 impl ListHostGroups {
7116 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7117 Self(RequestBuilder::new(stub))
7118 }
7119
7120 pub fn with_request<V: Into<crate::model::ListHostGroupsRequest>>(mut self, v: V) -> Self {
7122 self.0.request = v.into();
7123 self
7124 }
7125
7126 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7128 self.0.options = v.into();
7129 self
7130 }
7131
7132 pub async fn send(self) -> Result<crate::model::ListHostGroupsResponse> {
7134 (*self.0.stub)
7135 .list_host_groups(self.0.request, self.0.options)
7136 .await
7137 .map(crate::Response::into_body)
7138 }
7139
7140 pub fn by_page(
7142 self,
7143 ) -> impl google_cloud_gax::paginator::Paginator<
7144 crate::model::ListHostGroupsResponse,
7145 crate::Error,
7146 > {
7147 use std::clone::Clone;
7148 let token = self.0.request.page_token.clone();
7149 let execute = move |token: String| {
7150 let mut builder = self.clone();
7151 builder.0.request = builder.0.request.set_page_token(token);
7152 builder.send()
7153 };
7154 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7155 }
7156
7157 pub fn by_item(
7159 self,
7160 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7161 crate::model::ListHostGroupsResponse,
7162 crate::Error,
7163 > {
7164 use google_cloud_gax::paginator::Paginator;
7165 self.by_page().items()
7166 }
7167
7168 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7172 self.0.request.parent = v.into();
7173 self
7174 }
7175
7176 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7178 self.0.request.page_size = v.into();
7179 self
7180 }
7181
7182 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7184 self.0.request.page_token = v.into();
7185 self
7186 }
7187
7188 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7190 self.0.request.filter = v.into();
7191 self
7192 }
7193
7194 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7196 self.0.request.order_by = v.into();
7197 self
7198 }
7199 }
7200
7201 #[doc(hidden)]
7202 impl crate::RequestBuilder for ListHostGroups {
7203 fn request_options(&mut self) -> &mut crate::RequestOptions {
7204 &mut self.0.options
7205 }
7206 }
7207
7208 #[derive(Clone, Debug)]
7225 pub struct GetHostGroup(RequestBuilder<crate::model::GetHostGroupRequest>);
7226
7227 impl GetHostGroup {
7228 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7229 Self(RequestBuilder::new(stub))
7230 }
7231
7232 pub fn with_request<V: Into<crate::model::GetHostGroupRequest>>(mut self, v: V) -> Self {
7234 self.0.request = v.into();
7235 self
7236 }
7237
7238 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7240 self.0.options = v.into();
7241 self
7242 }
7243
7244 pub async fn send(self) -> Result<crate::model::HostGroup> {
7246 (*self.0.stub)
7247 .get_host_group(self.0.request, self.0.options)
7248 .await
7249 .map(crate::Response::into_body)
7250 }
7251
7252 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7256 self.0.request.name = v.into();
7257 self
7258 }
7259 }
7260
7261 #[doc(hidden)]
7262 impl crate::RequestBuilder for GetHostGroup {
7263 fn request_options(&mut self) -> &mut crate::RequestOptions {
7264 &mut self.0.options
7265 }
7266 }
7267
7268 #[derive(Clone, Debug)]
7286 pub struct CreateHostGroup(RequestBuilder<crate::model::CreateHostGroupRequest>);
7287
7288 impl CreateHostGroup {
7289 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7290 Self(RequestBuilder::new(stub))
7291 }
7292
7293 pub fn with_request<V: Into<crate::model::CreateHostGroupRequest>>(mut self, v: V) -> Self {
7295 self.0.request = v.into();
7296 self
7297 }
7298
7299 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7301 self.0.options = v.into();
7302 self
7303 }
7304
7305 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7312 (*self.0.stub)
7313 .create_host_group(self.0.request, self.0.options)
7314 .await
7315 .map(crate::Response::into_body)
7316 }
7317
7318 pub fn poller(
7320 self,
7321 ) -> impl google_cloud_lro::Poller<crate::model::HostGroup, crate::model::OperationMetadata>
7322 {
7323 type Operation = google_cloud_lro::internal::Operation<
7324 crate::model::HostGroup,
7325 crate::model::OperationMetadata,
7326 >;
7327 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7328 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7329
7330 let stub = self.0.stub.clone();
7331 let mut options = self.0.options.clone();
7332 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7333 let query = move |name| {
7334 let stub = stub.clone();
7335 let options = options.clone();
7336 async {
7337 let op = GetOperation::new(stub)
7338 .set_name(name)
7339 .with_options(options)
7340 .send()
7341 .await?;
7342 Ok(Operation::new(op))
7343 }
7344 };
7345
7346 let start = move || async {
7347 let op = self.send().await?;
7348 Ok(Operation::new(op))
7349 };
7350
7351 google_cloud_lro::internal::new_poller(
7352 polling_error_policy,
7353 polling_backoff_policy,
7354 start,
7355 query,
7356 )
7357 }
7358
7359 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7363 self.0.request.parent = v.into();
7364 self
7365 }
7366
7367 pub fn set_host_group<T>(mut self, v: T) -> Self
7371 where
7372 T: std::convert::Into<crate::model::HostGroup>,
7373 {
7374 self.0.request.host_group = std::option::Option::Some(v.into());
7375 self
7376 }
7377
7378 pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
7382 where
7383 T: std::convert::Into<crate::model::HostGroup>,
7384 {
7385 self.0.request.host_group = v.map(|x| x.into());
7386 self
7387 }
7388
7389 pub fn set_host_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7393 self.0.request.host_group_id = v.into();
7394 self
7395 }
7396 }
7397
7398 #[doc(hidden)]
7399 impl crate::RequestBuilder for CreateHostGroup {
7400 fn request_options(&mut self) -> &mut crate::RequestOptions {
7401 &mut self.0.options
7402 }
7403 }
7404
7405 #[derive(Clone, Debug)]
7423 pub struct UpdateHostGroup(RequestBuilder<crate::model::UpdateHostGroupRequest>);
7424
7425 impl UpdateHostGroup {
7426 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7427 Self(RequestBuilder::new(stub))
7428 }
7429
7430 pub fn with_request<V: Into<crate::model::UpdateHostGroupRequest>>(mut self, v: V) -> Self {
7432 self.0.request = v.into();
7433 self
7434 }
7435
7436 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7438 self.0.options = v.into();
7439 self
7440 }
7441
7442 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7449 (*self.0.stub)
7450 .update_host_group(self.0.request, self.0.options)
7451 .await
7452 .map(crate::Response::into_body)
7453 }
7454
7455 pub fn poller(
7457 self,
7458 ) -> impl google_cloud_lro::Poller<crate::model::HostGroup, crate::model::OperationMetadata>
7459 {
7460 type Operation = google_cloud_lro::internal::Operation<
7461 crate::model::HostGroup,
7462 crate::model::OperationMetadata,
7463 >;
7464 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7465 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7466
7467 let stub = self.0.stub.clone();
7468 let mut options = self.0.options.clone();
7469 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7470 let query = move |name| {
7471 let stub = stub.clone();
7472 let options = options.clone();
7473 async {
7474 let op = GetOperation::new(stub)
7475 .set_name(name)
7476 .with_options(options)
7477 .send()
7478 .await?;
7479 Ok(Operation::new(op))
7480 }
7481 };
7482
7483 let start = move || async {
7484 let op = self.send().await?;
7485 Ok(Operation::new(op))
7486 };
7487
7488 google_cloud_lro::internal::new_poller(
7489 polling_error_policy,
7490 polling_backoff_policy,
7491 start,
7492 query,
7493 )
7494 }
7495
7496 pub fn set_host_group<T>(mut self, v: T) -> Self
7500 where
7501 T: std::convert::Into<crate::model::HostGroup>,
7502 {
7503 self.0.request.host_group = std::option::Option::Some(v.into());
7504 self
7505 }
7506
7507 pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
7511 where
7512 T: std::convert::Into<crate::model::HostGroup>,
7513 {
7514 self.0.request.host_group = v.map(|x| x.into());
7515 self
7516 }
7517
7518 pub fn set_update_mask<T>(mut self, v: T) -> Self
7520 where
7521 T: std::convert::Into<wkt::FieldMask>,
7522 {
7523 self.0.request.update_mask = std::option::Option::Some(v.into());
7524 self
7525 }
7526
7527 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7529 where
7530 T: std::convert::Into<wkt::FieldMask>,
7531 {
7532 self.0.request.update_mask = v.map(|x| x.into());
7533 self
7534 }
7535 }
7536
7537 #[doc(hidden)]
7538 impl crate::RequestBuilder for UpdateHostGroup {
7539 fn request_options(&mut self) -> &mut crate::RequestOptions {
7540 &mut self.0.options
7541 }
7542 }
7543
7544 #[derive(Clone, Debug)]
7562 pub struct DeleteHostGroup(RequestBuilder<crate::model::DeleteHostGroupRequest>);
7563
7564 impl DeleteHostGroup {
7565 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7566 Self(RequestBuilder::new(stub))
7567 }
7568
7569 pub fn with_request<V: Into<crate::model::DeleteHostGroupRequest>>(mut self, v: V) -> Self {
7571 self.0.request = v.into();
7572 self
7573 }
7574
7575 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7577 self.0.options = v.into();
7578 self
7579 }
7580
7581 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7588 (*self.0.stub)
7589 .delete_host_group(self.0.request, self.0.options)
7590 .await
7591 .map(crate::Response::into_body)
7592 }
7593
7594 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7596 type Operation =
7597 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7598 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7599 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7600
7601 let stub = self.0.stub.clone();
7602 let mut options = self.0.options.clone();
7603 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7604 let query = move |name| {
7605 let stub = stub.clone();
7606 let options = options.clone();
7607 async {
7608 let op = GetOperation::new(stub)
7609 .set_name(name)
7610 .with_options(options)
7611 .send()
7612 .await?;
7613 Ok(Operation::new(op))
7614 }
7615 };
7616
7617 let start = move || async {
7618 let op = self.send().await?;
7619 Ok(Operation::new(op))
7620 };
7621
7622 google_cloud_lro::internal::new_unit_response_poller(
7623 polling_error_policy,
7624 polling_backoff_policy,
7625 start,
7626 query,
7627 )
7628 }
7629
7630 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7634 self.0.request.name = v.into();
7635 self
7636 }
7637 }
7638
7639 #[doc(hidden)]
7640 impl crate::RequestBuilder for DeleteHostGroup {
7641 fn request_options(&mut self) -> &mut crate::RequestOptions {
7642 &mut self.0.options
7643 }
7644 }
7645
7646 #[derive(Clone, Debug)]
7663 pub struct ExecuteOntapPost(RequestBuilder<crate::model::ExecuteOntapPostRequest>);
7664
7665 impl ExecuteOntapPost {
7666 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7667 Self(RequestBuilder::new(stub))
7668 }
7669
7670 pub fn with_request<V: Into<crate::model::ExecuteOntapPostRequest>>(
7672 mut self,
7673 v: V,
7674 ) -> Self {
7675 self.0.request = v.into();
7676 self
7677 }
7678
7679 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7681 self.0.options = v.into();
7682 self
7683 }
7684
7685 pub async fn send(self) -> Result<crate::model::ExecuteOntapPostResponse> {
7687 (*self.0.stub)
7688 .execute_ontap_post(self.0.request, self.0.options)
7689 .await
7690 .map(crate::Response::into_body)
7691 }
7692
7693 pub fn set_body<T>(mut self, v: T) -> Self
7697 where
7698 T: std::convert::Into<wkt::Struct>,
7699 {
7700 self.0.request.body = std::option::Option::Some(v.into());
7701 self
7702 }
7703
7704 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7708 where
7709 T: std::convert::Into<wkt::Struct>,
7710 {
7711 self.0.request.body = v.map(|x| x.into());
7712 self
7713 }
7714
7715 pub fn set_ontap_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
7719 self.0.request.ontap_path = v.into();
7720 self
7721 }
7722 }
7723
7724 #[doc(hidden)]
7725 impl crate::RequestBuilder for ExecuteOntapPost {
7726 fn request_options(&mut self) -> &mut crate::RequestOptions {
7727 &mut self.0.options
7728 }
7729 }
7730
7731 #[derive(Clone, Debug)]
7748 pub struct ExecuteOntapGet(RequestBuilder<crate::model::ExecuteOntapGetRequest>);
7749
7750 impl ExecuteOntapGet {
7751 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7752 Self(RequestBuilder::new(stub))
7753 }
7754
7755 pub fn with_request<V: Into<crate::model::ExecuteOntapGetRequest>>(mut self, v: V) -> Self {
7757 self.0.request = v.into();
7758 self
7759 }
7760
7761 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7763 self.0.options = v.into();
7764 self
7765 }
7766
7767 pub async fn send(self) -> Result<crate::model::ExecuteOntapGetResponse> {
7769 (*self.0.stub)
7770 .execute_ontap_get(self.0.request, self.0.options)
7771 .await
7772 .map(crate::Response::into_body)
7773 }
7774
7775 pub fn set_ontap_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
7779 self.0.request.ontap_path = v.into();
7780 self
7781 }
7782 }
7783
7784 #[doc(hidden)]
7785 impl crate::RequestBuilder for ExecuteOntapGet {
7786 fn request_options(&mut self) -> &mut crate::RequestOptions {
7787 &mut self.0.options
7788 }
7789 }
7790
7791 #[derive(Clone, Debug)]
7808 pub struct ExecuteOntapDelete(RequestBuilder<crate::model::ExecuteOntapDeleteRequest>);
7809
7810 impl ExecuteOntapDelete {
7811 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7812 Self(RequestBuilder::new(stub))
7813 }
7814
7815 pub fn with_request<V: Into<crate::model::ExecuteOntapDeleteRequest>>(
7817 mut self,
7818 v: V,
7819 ) -> Self {
7820 self.0.request = v.into();
7821 self
7822 }
7823
7824 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7826 self.0.options = v.into();
7827 self
7828 }
7829
7830 pub async fn send(self) -> Result<crate::model::ExecuteOntapDeleteResponse> {
7832 (*self.0.stub)
7833 .execute_ontap_delete(self.0.request, self.0.options)
7834 .await
7835 .map(crate::Response::into_body)
7836 }
7837
7838 pub fn set_ontap_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
7842 self.0.request.ontap_path = v.into();
7843 self
7844 }
7845 }
7846
7847 #[doc(hidden)]
7848 impl crate::RequestBuilder for ExecuteOntapDelete {
7849 fn request_options(&mut self) -> &mut crate::RequestOptions {
7850 &mut self.0.options
7851 }
7852 }
7853
7854 #[derive(Clone, Debug)]
7871 pub struct ExecuteOntapPatch(RequestBuilder<crate::model::ExecuteOntapPatchRequest>);
7872
7873 impl ExecuteOntapPatch {
7874 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7875 Self(RequestBuilder::new(stub))
7876 }
7877
7878 pub fn with_request<V: Into<crate::model::ExecuteOntapPatchRequest>>(
7880 mut self,
7881 v: V,
7882 ) -> Self {
7883 self.0.request = v.into();
7884 self
7885 }
7886
7887 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7889 self.0.options = v.into();
7890 self
7891 }
7892
7893 pub async fn send(self) -> Result<crate::model::ExecuteOntapPatchResponse> {
7895 (*self.0.stub)
7896 .execute_ontap_patch(self.0.request, self.0.options)
7897 .await
7898 .map(crate::Response::into_body)
7899 }
7900
7901 pub fn set_body<T>(mut self, v: T) -> Self
7905 where
7906 T: std::convert::Into<wkt::Struct>,
7907 {
7908 self.0.request.body = std::option::Option::Some(v.into());
7909 self
7910 }
7911
7912 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7916 where
7917 T: std::convert::Into<wkt::Struct>,
7918 {
7919 self.0.request.body = v.map(|x| x.into());
7920 self
7921 }
7922
7923 pub fn set_ontap_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
7927 self.0.request.ontap_path = v.into();
7928 self
7929 }
7930 }
7931
7932 #[doc(hidden)]
7933 impl crate::RequestBuilder for ExecuteOntapPatch {
7934 fn request_options(&mut self) -> &mut crate::RequestOptions {
7935 &mut self.0.options
7936 }
7937 }
7938
7939 #[derive(Clone, Debug)]
7960 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7961
7962 impl ListLocations {
7963 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7964 Self(RequestBuilder::new(stub))
7965 }
7966
7967 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7969 mut self,
7970 v: V,
7971 ) -> Self {
7972 self.0.request = v.into();
7973 self
7974 }
7975
7976 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7978 self.0.options = v.into();
7979 self
7980 }
7981
7982 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7984 (*self.0.stub)
7985 .list_locations(self.0.request, self.0.options)
7986 .await
7987 .map(crate::Response::into_body)
7988 }
7989
7990 pub fn by_page(
7992 self,
7993 ) -> impl google_cloud_gax::paginator::Paginator<
7994 google_cloud_location::model::ListLocationsResponse,
7995 crate::Error,
7996 > {
7997 use std::clone::Clone;
7998 let token = self.0.request.page_token.clone();
7999 let execute = move |token: String| {
8000 let mut builder = self.clone();
8001 builder.0.request = builder.0.request.set_page_token(token);
8002 builder.send()
8003 };
8004 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8005 }
8006
8007 pub fn by_item(
8009 self,
8010 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8011 google_cloud_location::model::ListLocationsResponse,
8012 crate::Error,
8013 > {
8014 use google_cloud_gax::paginator::Paginator;
8015 self.by_page().items()
8016 }
8017
8018 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8020 self.0.request.name = v.into();
8021 self
8022 }
8023
8024 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8026 self.0.request.filter = v.into();
8027 self
8028 }
8029
8030 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8032 self.0.request.page_size = v.into();
8033 self
8034 }
8035
8036 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8038 self.0.request.page_token = v.into();
8039 self
8040 }
8041 }
8042
8043 #[doc(hidden)]
8044 impl crate::RequestBuilder for ListLocations {
8045 fn request_options(&mut self) -> &mut crate::RequestOptions {
8046 &mut self.0.options
8047 }
8048 }
8049
8050 #[derive(Clone, Debug)]
8067 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8068
8069 impl GetLocation {
8070 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
8071 Self(RequestBuilder::new(stub))
8072 }
8073
8074 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8076 mut self,
8077 v: V,
8078 ) -> Self {
8079 self.0.request = v.into();
8080 self
8081 }
8082
8083 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8085 self.0.options = v.into();
8086 self
8087 }
8088
8089 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8091 (*self.0.stub)
8092 .get_location(self.0.request, self.0.options)
8093 .await
8094 .map(crate::Response::into_body)
8095 }
8096
8097 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8099 self.0.request.name = v.into();
8100 self
8101 }
8102 }
8103
8104 #[doc(hidden)]
8105 impl crate::RequestBuilder for GetLocation {
8106 fn request_options(&mut self) -> &mut crate::RequestOptions {
8107 &mut self.0.options
8108 }
8109 }
8110
8111 #[derive(Clone, Debug)]
8132 pub struct ListOperations(
8133 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8134 );
8135
8136 impl ListOperations {
8137 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
8138 Self(RequestBuilder::new(stub))
8139 }
8140
8141 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8143 mut self,
8144 v: V,
8145 ) -> Self {
8146 self.0.request = v.into();
8147 self
8148 }
8149
8150 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8152 self.0.options = v.into();
8153 self
8154 }
8155
8156 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8158 (*self.0.stub)
8159 .list_operations(self.0.request, self.0.options)
8160 .await
8161 .map(crate::Response::into_body)
8162 }
8163
8164 pub fn by_page(
8166 self,
8167 ) -> impl google_cloud_gax::paginator::Paginator<
8168 google_cloud_longrunning::model::ListOperationsResponse,
8169 crate::Error,
8170 > {
8171 use std::clone::Clone;
8172 let token = self.0.request.page_token.clone();
8173 let execute = move |token: String| {
8174 let mut builder = self.clone();
8175 builder.0.request = builder.0.request.set_page_token(token);
8176 builder.send()
8177 };
8178 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8179 }
8180
8181 pub fn by_item(
8183 self,
8184 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8185 google_cloud_longrunning::model::ListOperationsResponse,
8186 crate::Error,
8187 > {
8188 use google_cloud_gax::paginator::Paginator;
8189 self.by_page().items()
8190 }
8191
8192 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8194 self.0.request.name = v.into();
8195 self
8196 }
8197
8198 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8200 self.0.request.filter = v.into();
8201 self
8202 }
8203
8204 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8206 self.0.request.page_size = v.into();
8207 self
8208 }
8209
8210 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8212 self.0.request.page_token = v.into();
8213 self
8214 }
8215
8216 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8218 self.0.request.return_partial_success = v.into();
8219 self
8220 }
8221 }
8222
8223 #[doc(hidden)]
8224 impl crate::RequestBuilder for ListOperations {
8225 fn request_options(&mut self) -> &mut crate::RequestOptions {
8226 &mut self.0.options
8227 }
8228 }
8229
8230 #[derive(Clone, Debug)]
8247 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8248
8249 impl GetOperation {
8250 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
8251 Self(RequestBuilder::new(stub))
8252 }
8253
8254 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8256 mut self,
8257 v: V,
8258 ) -> Self {
8259 self.0.request = v.into();
8260 self
8261 }
8262
8263 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8265 self.0.options = v.into();
8266 self
8267 }
8268
8269 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8271 (*self.0.stub)
8272 .get_operation(self.0.request, self.0.options)
8273 .await
8274 .map(crate::Response::into_body)
8275 }
8276
8277 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8279 self.0.request.name = v.into();
8280 self
8281 }
8282 }
8283
8284 #[doc(hidden)]
8285 impl crate::RequestBuilder for GetOperation {
8286 fn request_options(&mut self) -> &mut crate::RequestOptions {
8287 &mut self.0.options
8288 }
8289 }
8290
8291 #[derive(Clone, Debug)]
8308 pub struct DeleteOperation(
8309 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8310 );
8311
8312 impl DeleteOperation {
8313 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
8314 Self(RequestBuilder::new(stub))
8315 }
8316
8317 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8319 mut self,
8320 v: V,
8321 ) -> Self {
8322 self.0.request = v.into();
8323 self
8324 }
8325
8326 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8328 self.0.options = v.into();
8329 self
8330 }
8331
8332 pub async fn send(self) -> Result<()> {
8334 (*self.0.stub)
8335 .delete_operation(self.0.request, self.0.options)
8336 .await
8337 .map(crate::Response::into_body)
8338 }
8339
8340 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8342 self.0.request.name = v.into();
8343 self
8344 }
8345 }
8346
8347 #[doc(hidden)]
8348 impl crate::RequestBuilder for DeleteOperation {
8349 fn request_options(&mut self) -> &mut crate::RequestOptions {
8350 &mut self.0.options
8351 }
8352 }
8353
8354 #[derive(Clone, Debug)]
8371 pub struct CancelOperation(
8372 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8373 );
8374
8375 impl CancelOperation {
8376 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
8377 Self(RequestBuilder::new(stub))
8378 }
8379
8380 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8382 mut self,
8383 v: V,
8384 ) -> Self {
8385 self.0.request = v.into();
8386 self
8387 }
8388
8389 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8391 self.0.options = v.into();
8392 self
8393 }
8394
8395 pub async fn send(self) -> Result<()> {
8397 (*self.0.stub)
8398 .cancel_operation(self.0.request, self.0.options)
8399 .await
8400 .map(crate::Response::into_body)
8401 }
8402
8403 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8405 self.0.request.name = v.into();
8406 self
8407 }
8408 }
8409
8410 #[doc(hidden)]
8411 impl crate::RequestBuilder for CancelOperation {
8412 fn request_options(&mut self) -> &mut crate::RequestOptions {
8413 &mut self.0.options
8414 }
8415 }
8416}