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