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)]
1567 pub struct ListSnapshots(RequestBuilder<crate::model::ListSnapshotsRequest>);
1568
1569 impl ListSnapshots {
1570 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1571 Self(RequestBuilder::new(stub))
1572 }
1573
1574 pub fn with_request<V: Into<crate::model::ListSnapshotsRequest>>(mut self, v: V) -> 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<crate::model::ListSnapshotsResponse> {
1588 (*self.0.stub)
1589 .list_snapshots(self.0.request, self.0.options)
1590 .await
1591 .map(crate::Response::into_body)
1592 }
1593
1594 pub fn by_page(
1596 self,
1597 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSnapshotsResponse, crate::Error>
1598 {
1599 use std::clone::Clone;
1600 let token = self.0.request.page_token.clone();
1601 let execute = move |token: String| {
1602 let mut builder = self.clone();
1603 builder.0.request = builder.0.request.set_page_token(token);
1604 builder.send()
1605 };
1606 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1607 }
1608
1609 pub fn by_item(
1611 self,
1612 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1613 crate::model::ListSnapshotsResponse,
1614 crate::Error,
1615 > {
1616 use google_cloud_gax::paginator::Paginator;
1617 self.by_page().items()
1618 }
1619
1620 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1624 self.0.request.parent = v.into();
1625 self
1626 }
1627
1628 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1630 self.0.request.page_size = v.into();
1631 self
1632 }
1633
1634 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1636 self.0.request.page_token = v.into();
1637 self
1638 }
1639
1640 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1642 self.0.request.order_by = v.into();
1643 self
1644 }
1645
1646 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1648 self.0.request.filter = v.into();
1649 self
1650 }
1651 }
1652
1653 #[doc(hidden)]
1654 impl crate::RequestBuilder for ListSnapshots {
1655 fn request_options(&mut self) -> &mut crate::RequestOptions {
1656 &mut self.0.options
1657 }
1658 }
1659
1660 #[derive(Clone, Debug)]
1677 pub struct GetSnapshot(RequestBuilder<crate::model::GetSnapshotRequest>);
1678
1679 impl GetSnapshot {
1680 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1681 Self(RequestBuilder::new(stub))
1682 }
1683
1684 pub fn with_request<V: Into<crate::model::GetSnapshotRequest>>(mut self, v: V) -> Self {
1686 self.0.request = v.into();
1687 self
1688 }
1689
1690 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1692 self.0.options = v.into();
1693 self
1694 }
1695
1696 pub async fn send(self) -> Result<crate::model::Snapshot> {
1698 (*self.0.stub)
1699 .get_snapshot(self.0.request, self.0.options)
1700 .await
1701 .map(crate::Response::into_body)
1702 }
1703
1704 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1708 self.0.request.name = v.into();
1709 self
1710 }
1711 }
1712
1713 #[doc(hidden)]
1714 impl crate::RequestBuilder for GetSnapshot {
1715 fn request_options(&mut self) -> &mut crate::RequestOptions {
1716 &mut self.0.options
1717 }
1718 }
1719
1720 #[derive(Clone, Debug)]
1738 pub struct CreateSnapshot(RequestBuilder<crate::model::CreateSnapshotRequest>);
1739
1740 impl CreateSnapshot {
1741 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1742 Self(RequestBuilder::new(stub))
1743 }
1744
1745 pub fn with_request<V: Into<crate::model::CreateSnapshotRequest>>(mut self, v: V) -> Self {
1747 self.0.request = v.into();
1748 self
1749 }
1750
1751 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1753 self.0.options = v.into();
1754 self
1755 }
1756
1757 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1764 (*self.0.stub)
1765 .create_snapshot(self.0.request, self.0.options)
1766 .await
1767 .map(crate::Response::into_body)
1768 }
1769
1770 pub fn poller(
1772 self,
1773 ) -> impl google_cloud_lro::Poller<crate::model::Snapshot, crate::model::OperationMetadata>
1774 {
1775 type Operation = google_cloud_lro::internal::Operation<
1776 crate::model::Snapshot,
1777 crate::model::OperationMetadata,
1778 >;
1779 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1780 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1781
1782 let stub = self.0.stub.clone();
1783 let mut options = self.0.options.clone();
1784 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1785 let query = move |name| {
1786 let stub = stub.clone();
1787 let options = options.clone();
1788 async {
1789 let op = GetOperation::new(stub)
1790 .set_name(name)
1791 .with_options(options)
1792 .send()
1793 .await?;
1794 Ok(Operation::new(op))
1795 }
1796 };
1797
1798 let start = move || async {
1799 let op = self.send().await?;
1800 Ok(Operation::new(op))
1801 };
1802
1803 google_cloud_lro::internal::new_poller(
1804 polling_error_policy,
1805 polling_backoff_policy,
1806 start,
1807 query,
1808 )
1809 }
1810
1811 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1815 self.0.request.parent = v.into();
1816 self
1817 }
1818
1819 pub fn set_snapshot<T>(mut self, v: T) -> Self
1823 where
1824 T: std::convert::Into<crate::model::Snapshot>,
1825 {
1826 self.0.request.snapshot = std::option::Option::Some(v.into());
1827 self
1828 }
1829
1830 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1834 where
1835 T: std::convert::Into<crate::model::Snapshot>,
1836 {
1837 self.0.request.snapshot = v.map(|x| x.into());
1838 self
1839 }
1840
1841 pub fn set_snapshot_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1845 self.0.request.snapshot_id = v.into();
1846 self
1847 }
1848 }
1849
1850 #[doc(hidden)]
1851 impl crate::RequestBuilder for CreateSnapshot {
1852 fn request_options(&mut self) -> &mut crate::RequestOptions {
1853 &mut self.0.options
1854 }
1855 }
1856
1857 #[derive(Clone, Debug)]
1875 pub struct DeleteSnapshot(RequestBuilder<crate::model::DeleteSnapshotRequest>);
1876
1877 impl DeleteSnapshot {
1878 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1879 Self(RequestBuilder::new(stub))
1880 }
1881
1882 pub fn with_request<V: Into<crate::model::DeleteSnapshotRequest>>(mut self, v: V) -> Self {
1884 self.0.request = v.into();
1885 self
1886 }
1887
1888 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1890 self.0.options = v.into();
1891 self
1892 }
1893
1894 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1901 (*self.0.stub)
1902 .delete_snapshot(self.0.request, self.0.options)
1903 .await
1904 .map(crate::Response::into_body)
1905 }
1906
1907 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1909 type Operation =
1910 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1911 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1912 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1913
1914 let stub = self.0.stub.clone();
1915 let mut options = self.0.options.clone();
1916 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1917 let query = move |name| {
1918 let stub = stub.clone();
1919 let options = options.clone();
1920 async {
1921 let op = GetOperation::new(stub)
1922 .set_name(name)
1923 .with_options(options)
1924 .send()
1925 .await?;
1926 Ok(Operation::new(op))
1927 }
1928 };
1929
1930 let start = move || async {
1931 let op = self.send().await?;
1932 Ok(Operation::new(op))
1933 };
1934
1935 google_cloud_lro::internal::new_unit_response_poller(
1936 polling_error_policy,
1937 polling_backoff_policy,
1938 start,
1939 query,
1940 )
1941 }
1942
1943 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1947 self.0.request.name = v.into();
1948 self
1949 }
1950 }
1951
1952 #[doc(hidden)]
1953 impl crate::RequestBuilder for DeleteSnapshot {
1954 fn request_options(&mut self) -> &mut crate::RequestOptions {
1955 &mut self.0.options
1956 }
1957 }
1958
1959 #[derive(Clone, Debug)]
1977 pub struct UpdateSnapshot(RequestBuilder<crate::model::UpdateSnapshotRequest>);
1978
1979 impl UpdateSnapshot {
1980 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
1981 Self(RequestBuilder::new(stub))
1982 }
1983
1984 pub fn with_request<V: Into<crate::model::UpdateSnapshotRequest>>(mut self, v: V) -> Self {
1986 self.0.request = v.into();
1987 self
1988 }
1989
1990 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1992 self.0.options = v.into();
1993 self
1994 }
1995
1996 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2003 (*self.0.stub)
2004 .update_snapshot(self.0.request, self.0.options)
2005 .await
2006 .map(crate::Response::into_body)
2007 }
2008
2009 pub fn poller(
2011 self,
2012 ) -> impl google_cloud_lro::Poller<crate::model::Snapshot, crate::model::OperationMetadata>
2013 {
2014 type Operation = google_cloud_lro::internal::Operation<
2015 crate::model::Snapshot,
2016 crate::model::OperationMetadata,
2017 >;
2018 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2019 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2020
2021 let stub = self.0.stub.clone();
2022 let mut options = self.0.options.clone();
2023 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2024 let query = move |name| {
2025 let stub = stub.clone();
2026 let options = options.clone();
2027 async {
2028 let op = GetOperation::new(stub)
2029 .set_name(name)
2030 .with_options(options)
2031 .send()
2032 .await?;
2033 Ok(Operation::new(op))
2034 }
2035 };
2036
2037 let start = move || async {
2038 let op = self.send().await?;
2039 Ok(Operation::new(op))
2040 };
2041
2042 google_cloud_lro::internal::new_poller(
2043 polling_error_policy,
2044 polling_backoff_policy,
2045 start,
2046 query,
2047 )
2048 }
2049
2050 pub fn set_update_mask<T>(mut self, v: T) -> Self
2054 where
2055 T: std::convert::Into<wkt::FieldMask>,
2056 {
2057 self.0.request.update_mask = std::option::Option::Some(v.into());
2058 self
2059 }
2060
2061 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2065 where
2066 T: std::convert::Into<wkt::FieldMask>,
2067 {
2068 self.0.request.update_mask = v.map(|x| x.into());
2069 self
2070 }
2071
2072 pub fn set_snapshot<T>(mut self, v: T) -> Self
2076 where
2077 T: std::convert::Into<crate::model::Snapshot>,
2078 {
2079 self.0.request.snapshot = std::option::Option::Some(v.into());
2080 self
2081 }
2082
2083 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
2087 where
2088 T: std::convert::Into<crate::model::Snapshot>,
2089 {
2090 self.0.request.snapshot = v.map(|x| x.into());
2091 self
2092 }
2093 }
2094
2095 #[doc(hidden)]
2096 impl crate::RequestBuilder for UpdateSnapshot {
2097 fn request_options(&mut self) -> &mut crate::RequestOptions {
2098 &mut self.0.options
2099 }
2100 }
2101
2102 #[derive(Clone, Debug)]
2123 pub struct ListActiveDirectories(RequestBuilder<crate::model::ListActiveDirectoriesRequest>);
2124
2125 impl ListActiveDirectories {
2126 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2127 Self(RequestBuilder::new(stub))
2128 }
2129
2130 pub fn with_request<V: Into<crate::model::ListActiveDirectoriesRequest>>(
2132 mut self,
2133 v: V,
2134 ) -> Self {
2135 self.0.request = v.into();
2136 self
2137 }
2138
2139 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2141 self.0.options = v.into();
2142 self
2143 }
2144
2145 pub async fn send(self) -> Result<crate::model::ListActiveDirectoriesResponse> {
2147 (*self.0.stub)
2148 .list_active_directories(self.0.request, self.0.options)
2149 .await
2150 .map(crate::Response::into_body)
2151 }
2152
2153 pub fn by_page(
2155 self,
2156 ) -> impl google_cloud_gax::paginator::Paginator<
2157 crate::model::ListActiveDirectoriesResponse,
2158 crate::Error,
2159 > {
2160 use std::clone::Clone;
2161 let token = self.0.request.page_token.clone();
2162 let execute = move |token: String| {
2163 let mut builder = self.clone();
2164 builder.0.request = builder.0.request.set_page_token(token);
2165 builder.send()
2166 };
2167 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2168 }
2169
2170 pub fn by_item(
2172 self,
2173 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2174 crate::model::ListActiveDirectoriesResponse,
2175 crate::Error,
2176 > {
2177 use google_cloud_gax::paginator::Paginator;
2178 self.by_page().items()
2179 }
2180
2181 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2185 self.0.request.parent = v.into();
2186 self
2187 }
2188
2189 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2191 self.0.request.page_size = v.into();
2192 self
2193 }
2194
2195 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2197 self.0.request.page_token = v.into();
2198 self
2199 }
2200
2201 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2203 self.0.request.filter = v.into();
2204 self
2205 }
2206
2207 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2209 self.0.request.order_by = v.into();
2210 self
2211 }
2212 }
2213
2214 #[doc(hidden)]
2215 impl crate::RequestBuilder for ListActiveDirectories {
2216 fn request_options(&mut self) -> &mut crate::RequestOptions {
2217 &mut self.0.options
2218 }
2219 }
2220
2221 #[derive(Clone, Debug)]
2238 pub struct GetActiveDirectory(RequestBuilder<crate::model::GetActiveDirectoryRequest>);
2239
2240 impl GetActiveDirectory {
2241 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2242 Self(RequestBuilder::new(stub))
2243 }
2244
2245 pub fn with_request<V: Into<crate::model::GetActiveDirectoryRequest>>(
2247 mut self,
2248 v: V,
2249 ) -> Self {
2250 self.0.request = v.into();
2251 self
2252 }
2253
2254 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2256 self.0.options = v.into();
2257 self
2258 }
2259
2260 pub async fn send(self) -> Result<crate::model::ActiveDirectory> {
2262 (*self.0.stub)
2263 .get_active_directory(self.0.request, self.0.options)
2264 .await
2265 .map(crate::Response::into_body)
2266 }
2267
2268 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2272 self.0.request.name = v.into();
2273 self
2274 }
2275 }
2276
2277 #[doc(hidden)]
2278 impl crate::RequestBuilder for GetActiveDirectory {
2279 fn request_options(&mut self) -> &mut crate::RequestOptions {
2280 &mut self.0.options
2281 }
2282 }
2283
2284 #[derive(Clone, Debug)]
2302 pub struct CreateActiveDirectory(RequestBuilder<crate::model::CreateActiveDirectoryRequest>);
2303
2304 impl CreateActiveDirectory {
2305 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2306 Self(RequestBuilder::new(stub))
2307 }
2308
2309 pub fn with_request<V: Into<crate::model::CreateActiveDirectoryRequest>>(
2311 mut self,
2312 v: V,
2313 ) -> Self {
2314 self.0.request = v.into();
2315 self
2316 }
2317
2318 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2320 self.0.options = v.into();
2321 self
2322 }
2323
2324 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2331 (*self.0.stub)
2332 .create_active_directory(self.0.request, self.0.options)
2333 .await
2334 .map(crate::Response::into_body)
2335 }
2336
2337 pub fn poller(
2339 self,
2340 ) -> impl google_cloud_lro::Poller<crate::model::ActiveDirectory, crate::model::OperationMetadata>
2341 {
2342 type Operation = google_cloud_lro::internal::Operation<
2343 crate::model::ActiveDirectory,
2344 crate::model::OperationMetadata,
2345 >;
2346 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2347 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2348
2349 let stub = self.0.stub.clone();
2350 let mut options = self.0.options.clone();
2351 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2352 let query = move |name| {
2353 let stub = stub.clone();
2354 let options = options.clone();
2355 async {
2356 let op = GetOperation::new(stub)
2357 .set_name(name)
2358 .with_options(options)
2359 .send()
2360 .await?;
2361 Ok(Operation::new(op))
2362 }
2363 };
2364
2365 let start = move || async {
2366 let op = self.send().await?;
2367 Ok(Operation::new(op))
2368 };
2369
2370 google_cloud_lro::internal::new_poller(
2371 polling_error_policy,
2372 polling_backoff_policy,
2373 start,
2374 query,
2375 )
2376 }
2377
2378 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2382 self.0.request.parent = v.into();
2383 self
2384 }
2385
2386 pub fn set_active_directory<T>(mut self, v: T) -> Self
2390 where
2391 T: std::convert::Into<crate::model::ActiveDirectory>,
2392 {
2393 self.0.request.active_directory = std::option::Option::Some(v.into());
2394 self
2395 }
2396
2397 pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
2401 where
2402 T: std::convert::Into<crate::model::ActiveDirectory>,
2403 {
2404 self.0.request.active_directory = v.map(|x| x.into());
2405 self
2406 }
2407
2408 pub fn set_active_directory_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2412 self.0.request.active_directory_id = v.into();
2413 self
2414 }
2415 }
2416
2417 #[doc(hidden)]
2418 impl crate::RequestBuilder for CreateActiveDirectory {
2419 fn request_options(&mut self) -> &mut crate::RequestOptions {
2420 &mut self.0.options
2421 }
2422 }
2423
2424 #[derive(Clone, Debug)]
2442 pub struct UpdateActiveDirectory(RequestBuilder<crate::model::UpdateActiveDirectoryRequest>);
2443
2444 impl UpdateActiveDirectory {
2445 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2446 Self(RequestBuilder::new(stub))
2447 }
2448
2449 pub fn with_request<V: Into<crate::model::UpdateActiveDirectoryRequest>>(
2451 mut self,
2452 v: V,
2453 ) -> Self {
2454 self.0.request = v.into();
2455 self
2456 }
2457
2458 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2460 self.0.options = v.into();
2461 self
2462 }
2463
2464 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2471 (*self.0.stub)
2472 .update_active_directory(self.0.request, self.0.options)
2473 .await
2474 .map(crate::Response::into_body)
2475 }
2476
2477 pub fn poller(
2479 self,
2480 ) -> impl google_cloud_lro::Poller<crate::model::ActiveDirectory, crate::model::OperationMetadata>
2481 {
2482 type Operation = google_cloud_lro::internal::Operation<
2483 crate::model::ActiveDirectory,
2484 crate::model::OperationMetadata,
2485 >;
2486 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2487 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2488
2489 let stub = self.0.stub.clone();
2490 let mut options = self.0.options.clone();
2491 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2492 let query = move |name| {
2493 let stub = stub.clone();
2494 let options = options.clone();
2495 async {
2496 let op = GetOperation::new(stub)
2497 .set_name(name)
2498 .with_options(options)
2499 .send()
2500 .await?;
2501 Ok(Operation::new(op))
2502 }
2503 };
2504
2505 let start = move || async {
2506 let op = self.send().await?;
2507 Ok(Operation::new(op))
2508 };
2509
2510 google_cloud_lro::internal::new_poller(
2511 polling_error_policy,
2512 polling_backoff_policy,
2513 start,
2514 query,
2515 )
2516 }
2517
2518 pub fn set_update_mask<T>(mut self, v: T) -> Self
2522 where
2523 T: std::convert::Into<wkt::FieldMask>,
2524 {
2525 self.0.request.update_mask = std::option::Option::Some(v.into());
2526 self
2527 }
2528
2529 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2533 where
2534 T: std::convert::Into<wkt::FieldMask>,
2535 {
2536 self.0.request.update_mask = v.map(|x| x.into());
2537 self
2538 }
2539
2540 pub fn set_active_directory<T>(mut self, v: T) -> Self
2544 where
2545 T: std::convert::Into<crate::model::ActiveDirectory>,
2546 {
2547 self.0.request.active_directory = std::option::Option::Some(v.into());
2548 self
2549 }
2550
2551 pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
2555 where
2556 T: std::convert::Into<crate::model::ActiveDirectory>,
2557 {
2558 self.0.request.active_directory = v.map(|x| x.into());
2559 self
2560 }
2561 }
2562
2563 #[doc(hidden)]
2564 impl crate::RequestBuilder for UpdateActiveDirectory {
2565 fn request_options(&mut self) -> &mut crate::RequestOptions {
2566 &mut self.0.options
2567 }
2568 }
2569
2570 #[derive(Clone, Debug)]
2588 pub struct DeleteActiveDirectory(RequestBuilder<crate::model::DeleteActiveDirectoryRequest>);
2589
2590 impl DeleteActiveDirectory {
2591 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2592 Self(RequestBuilder::new(stub))
2593 }
2594
2595 pub fn with_request<V: Into<crate::model::DeleteActiveDirectoryRequest>>(
2597 mut self,
2598 v: V,
2599 ) -> Self {
2600 self.0.request = v.into();
2601 self
2602 }
2603
2604 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2606 self.0.options = v.into();
2607 self
2608 }
2609
2610 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2617 (*self.0.stub)
2618 .delete_active_directory(self.0.request, self.0.options)
2619 .await
2620 .map(crate::Response::into_body)
2621 }
2622
2623 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2625 type Operation =
2626 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2627 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2628 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2629
2630 let stub = self.0.stub.clone();
2631 let mut options = self.0.options.clone();
2632 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2633 let query = move |name| {
2634 let stub = stub.clone();
2635 let options = options.clone();
2636 async {
2637 let op = GetOperation::new(stub)
2638 .set_name(name)
2639 .with_options(options)
2640 .send()
2641 .await?;
2642 Ok(Operation::new(op))
2643 }
2644 };
2645
2646 let start = move || async {
2647 let op = self.send().await?;
2648 Ok(Operation::new(op))
2649 };
2650
2651 google_cloud_lro::internal::new_unit_response_poller(
2652 polling_error_policy,
2653 polling_backoff_policy,
2654 start,
2655 query,
2656 )
2657 }
2658
2659 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2663 self.0.request.name = v.into();
2664 self
2665 }
2666 }
2667
2668 #[doc(hidden)]
2669 impl crate::RequestBuilder for DeleteActiveDirectory {
2670 fn request_options(&mut self) -> &mut crate::RequestOptions {
2671 &mut self.0.options
2672 }
2673 }
2674
2675 #[derive(Clone, Debug)]
2696 pub struct ListKmsConfigs(RequestBuilder<crate::model::ListKmsConfigsRequest>);
2697
2698 impl ListKmsConfigs {
2699 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2700 Self(RequestBuilder::new(stub))
2701 }
2702
2703 pub fn with_request<V: Into<crate::model::ListKmsConfigsRequest>>(mut self, v: V) -> Self {
2705 self.0.request = v.into();
2706 self
2707 }
2708
2709 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2711 self.0.options = v.into();
2712 self
2713 }
2714
2715 pub async fn send(self) -> Result<crate::model::ListKmsConfigsResponse> {
2717 (*self.0.stub)
2718 .list_kms_configs(self.0.request, self.0.options)
2719 .await
2720 .map(crate::Response::into_body)
2721 }
2722
2723 pub fn by_page(
2725 self,
2726 ) -> impl google_cloud_gax::paginator::Paginator<
2727 crate::model::ListKmsConfigsResponse,
2728 crate::Error,
2729 > {
2730 use std::clone::Clone;
2731 let token = self.0.request.page_token.clone();
2732 let execute = move |token: String| {
2733 let mut builder = self.clone();
2734 builder.0.request = builder.0.request.set_page_token(token);
2735 builder.send()
2736 };
2737 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2738 }
2739
2740 pub fn by_item(
2742 self,
2743 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2744 crate::model::ListKmsConfigsResponse,
2745 crate::Error,
2746 > {
2747 use google_cloud_gax::paginator::Paginator;
2748 self.by_page().items()
2749 }
2750
2751 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2755 self.0.request.parent = v.into();
2756 self
2757 }
2758
2759 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2761 self.0.request.page_size = v.into();
2762 self
2763 }
2764
2765 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2767 self.0.request.page_token = v.into();
2768 self
2769 }
2770
2771 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2773 self.0.request.order_by = v.into();
2774 self
2775 }
2776
2777 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2779 self.0.request.filter = v.into();
2780 self
2781 }
2782 }
2783
2784 #[doc(hidden)]
2785 impl crate::RequestBuilder for ListKmsConfigs {
2786 fn request_options(&mut self) -> &mut crate::RequestOptions {
2787 &mut self.0.options
2788 }
2789 }
2790
2791 #[derive(Clone, Debug)]
2809 pub struct CreateKmsConfig(RequestBuilder<crate::model::CreateKmsConfigRequest>);
2810
2811 impl CreateKmsConfig {
2812 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2813 Self(RequestBuilder::new(stub))
2814 }
2815
2816 pub fn with_request<V: Into<crate::model::CreateKmsConfigRequest>>(mut self, v: V) -> Self {
2818 self.0.request = v.into();
2819 self
2820 }
2821
2822 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2824 self.0.options = v.into();
2825 self
2826 }
2827
2828 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2835 (*self.0.stub)
2836 .create_kms_config(self.0.request, self.0.options)
2837 .await
2838 .map(crate::Response::into_body)
2839 }
2840
2841 pub fn poller(
2843 self,
2844 ) -> impl google_cloud_lro::Poller<crate::model::KmsConfig, crate::model::OperationMetadata>
2845 {
2846 type Operation = google_cloud_lro::internal::Operation<
2847 crate::model::KmsConfig,
2848 crate::model::OperationMetadata,
2849 >;
2850 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2851 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2852
2853 let stub = self.0.stub.clone();
2854 let mut options = self.0.options.clone();
2855 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2856 let query = move |name| {
2857 let stub = stub.clone();
2858 let options = options.clone();
2859 async {
2860 let op = GetOperation::new(stub)
2861 .set_name(name)
2862 .with_options(options)
2863 .send()
2864 .await?;
2865 Ok(Operation::new(op))
2866 }
2867 };
2868
2869 let start = move || async {
2870 let op = self.send().await?;
2871 Ok(Operation::new(op))
2872 };
2873
2874 google_cloud_lro::internal::new_poller(
2875 polling_error_policy,
2876 polling_backoff_policy,
2877 start,
2878 query,
2879 )
2880 }
2881
2882 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2886 self.0.request.parent = v.into();
2887 self
2888 }
2889
2890 pub fn set_kms_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2894 self.0.request.kms_config_id = v.into();
2895 self
2896 }
2897
2898 pub fn set_kms_config<T>(mut self, v: T) -> Self
2902 where
2903 T: std::convert::Into<crate::model::KmsConfig>,
2904 {
2905 self.0.request.kms_config = std::option::Option::Some(v.into());
2906 self
2907 }
2908
2909 pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
2913 where
2914 T: std::convert::Into<crate::model::KmsConfig>,
2915 {
2916 self.0.request.kms_config = v.map(|x| x.into());
2917 self
2918 }
2919 }
2920
2921 #[doc(hidden)]
2922 impl crate::RequestBuilder for CreateKmsConfig {
2923 fn request_options(&mut self) -> &mut crate::RequestOptions {
2924 &mut self.0.options
2925 }
2926 }
2927
2928 #[derive(Clone, Debug)]
2945 pub struct GetKmsConfig(RequestBuilder<crate::model::GetKmsConfigRequest>);
2946
2947 impl GetKmsConfig {
2948 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
2949 Self(RequestBuilder::new(stub))
2950 }
2951
2952 pub fn with_request<V: Into<crate::model::GetKmsConfigRequest>>(mut self, v: V) -> Self {
2954 self.0.request = v.into();
2955 self
2956 }
2957
2958 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2960 self.0.options = v.into();
2961 self
2962 }
2963
2964 pub async fn send(self) -> Result<crate::model::KmsConfig> {
2966 (*self.0.stub)
2967 .get_kms_config(self.0.request, self.0.options)
2968 .await
2969 .map(crate::Response::into_body)
2970 }
2971
2972 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2976 self.0.request.name = v.into();
2977 self
2978 }
2979 }
2980
2981 #[doc(hidden)]
2982 impl crate::RequestBuilder for GetKmsConfig {
2983 fn request_options(&mut self) -> &mut crate::RequestOptions {
2984 &mut self.0.options
2985 }
2986 }
2987
2988 #[derive(Clone, Debug)]
3006 pub struct UpdateKmsConfig(RequestBuilder<crate::model::UpdateKmsConfigRequest>);
3007
3008 impl UpdateKmsConfig {
3009 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3010 Self(RequestBuilder::new(stub))
3011 }
3012
3013 pub fn with_request<V: Into<crate::model::UpdateKmsConfigRequest>>(mut self, v: V) -> Self {
3015 self.0.request = v.into();
3016 self
3017 }
3018
3019 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3021 self.0.options = v.into();
3022 self
3023 }
3024
3025 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3032 (*self.0.stub)
3033 .update_kms_config(self.0.request, self.0.options)
3034 .await
3035 .map(crate::Response::into_body)
3036 }
3037
3038 pub fn poller(
3040 self,
3041 ) -> impl google_cloud_lro::Poller<crate::model::KmsConfig, crate::model::OperationMetadata>
3042 {
3043 type Operation = google_cloud_lro::internal::Operation<
3044 crate::model::KmsConfig,
3045 crate::model::OperationMetadata,
3046 >;
3047 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3048 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3049
3050 let stub = self.0.stub.clone();
3051 let mut options = self.0.options.clone();
3052 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3053 let query = move |name| {
3054 let stub = stub.clone();
3055 let options = options.clone();
3056 async {
3057 let op = GetOperation::new(stub)
3058 .set_name(name)
3059 .with_options(options)
3060 .send()
3061 .await?;
3062 Ok(Operation::new(op))
3063 }
3064 };
3065
3066 let start = move || async {
3067 let op = self.send().await?;
3068 Ok(Operation::new(op))
3069 };
3070
3071 google_cloud_lro::internal::new_poller(
3072 polling_error_policy,
3073 polling_backoff_policy,
3074 start,
3075 query,
3076 )
3077 }
3078
3079 pub fn set_update_mask<T>(mut self, v: T) -> Self
3083 where
3084 T: std::convert::Into<wkt::FieldMask>,
3085 {
3086 self.0.request.update_mask = std::option::Option::Some(v.into());
3087 self
3088 }
3089
3090 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3094 where
3095 T: std::convert::Into<wkt::FieldMask>,
3096 {
3097 self.0.request.update_mask = v.map(|x| x.into());
3098 self
3099 }
3100
3101 pub fn set_kms_config<T>(mut self, v: T) -> Self
3105 where
3106 T: std::convert::Into<crate::model::KmsConfig>,
3107 {
3108 self.0.request.kms_config = std::option::Option::Some(v.into());
3109 self
3110 }
3111
3112 pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
3116 where
3117 T: std::convert::Into<crate::model::KmsConfig>,
3118 {
3119 self.0.request.kms_config = v.map(|x| x.into());
3120 self
3121 }
3122 }
3123
3124 #[doc(hidden)]
3125 impl crate::RequestBuilder for UpdateKmsConfig {
3126 fn request_options(&mut self) -> &mut crate::RequestOptions {
3127 &mut self.0.options
3128 }
3129 }
3130
3131 #[derive(Clone, Debug)]
3149 pub struct EncryptVolumes(RequestBuilder<crate::model::EncryptVolumesRequest>);
3150
3151 impl EncryptVolumes {
3152 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3153 Self(RequestBuilder::new(stub))
3154 }
3155
3156 pub fn with_request<V: Into<crate::model::EncryptVolumesRequest>>(mut self, v: V) -> Self {
3158 self.0.request = v.into();
3159 self
3160 }
3161
3162 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3164 self.0.options = v.into();
3165 self
3166 }
3167
3168 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3175 (*self.0.stub)
3176 .encrypt_volumes(self.0.request, self.0.options)
3177 .await
3178 .map(crate::Response::into_body)
3179 }
3180
3181 pub fn poller(
3183 self,
3184 ) -> impl google_cloud_lro::Poller<crate::model::KmsConfig, crate::model::OperationMetadata>
3185 {
3186 type Operation = google_cloud_lro::internal::Operation<
3187 crate::model::KmsConfig,
3188 crate::model::OperationMetadata,
3189 >;
3190 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3191 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3192
3193 let stub = self.0.stub.clone();
3194 let mut options = self.0.options.clone();
3195 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3196 let query = move |name| {
3197 let stub = stub.clone();
3198 let options = options.clone();
3199 async {
3200 let op = GetOperation::new(stub)
3201 .set_name(name)
3202 .with_options(options)
3203 .send()
3204 .await?;
3205 Ok(Operation::new(op))
3206 }
3207 };
3208
3209 let start = move || async {
3210 let op = self.send().await?;
3211 Ok(Operation::new(op))
3212 };
3213
3214 google_cloud_lro::internal::new_poller(
3215 polling_error_policy,
3216 polling_backoff_policy,
3217 start,
3218 query,
3219 )
3220 }
3221
3222 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3226 self.0.request.name = v.into();
3227 self
3228 }
3229 }
3230
3231 #[doc(hidden)]
3232 impl crate::RequestBuilder for EncryptVolumes {
3233 fn request_options(&mut self) -> &mut crate::RequestOptions {
3234 &mut self.0.options
3235 }
3236 }
3237
3238 #[derive(Clone, Debug)]
3255 pub struct VerifyKmsConfig(RequestBuilder<crate::model::VerifyKmsConfigRequest>);
3256
3257 impl VerifyKmsConfig {
3258 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3259 Self(RequestBuilder::new(stub))
3260 }
3261
3262 pub fn with_request<V: Into<crate::model::VerifyKmsConfigRequest>>(mut self, v: V) -> Self {
3264 self.0.request = v.into();
3265 self
3266 }
3267
3268 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3270 self.0.options = v.into();
3271 self
3272 }
3273
3274 pub async fn send(self) -> Result<crate::model::VerifyKmsConfigResponse> {
3276 (*self.0.stub)
3277 .verify_kms_config(self.0.request, self.0.options)
3278 .await
3279 .map(crate::Response::into_body)
3280 }
3281
3282 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3286 self.0.request.name = v.into();
3287 self
3288 }
3289 }
3290
3291 #[doc(hidden)]
3292 impl crate::RequestBuilder for VerifyKmsConfig {
3293 fn request_options(&mut self) -> &mut crate::RequestOptions {
3294 &mut self.0.options
3295 }
3296 }
3297
3298 #[derive(Clone, Debug)]
3316 pub struct DeleteKmsConfig(RequestBuilder<crate::model::DeleteKmsConfigRequest>);
3317
3318 impl DeleteKmsConfig {
3319 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3320 Self(RequestBuilder::new(stub))
3321 }
3322
3323 pub fn with_request<V: Into<crate::model::DeleteKmsConfigRequest>>(mut self, v: V) -> Self {
3325 self.0.request = v.into();
3326 self
3327 }
3328
3329 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3331 self.0.options = v.into();
3332 self
3333 }
3334
3335 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3342 (*self.0.stub)
3343 .delete_kms_config(self.0.request, self.0.options)
3344 .await
3345 .map(crate::Response::into_body)
3346 }
3347
3348 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3350 type Operation =
3351 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3352 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3353 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3354
3355 let stub = self.0.stub.clone();
3356 let mut options = self.0.options.clone();
3357 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3358 let query = move |name| {
3359 let stub = stub.clone();
3360 let options = options.clone();
3361 async {
3362 let op = GetOperation::new(stub)
3363 .set_name(name)
3364 .with_options(options)
3365 .send()
3366 .await?;
3367 Ok(Operation::new(op))
3368 }
3369 };
3370
3371 let start = move || async {
3372 let op = self.send().await?;
3373 Ok(Operation::new(op))
3374 };
3375
3376 google_cloud_lro::internal::new_unit_response_poller(
3377 polling_error_policy,
3378 polling_backoff_policy,
3379 start,
3380 query,
3381 )
3382 }
3383
3384 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3388 self.0.request.name = v.into();
3389 self
3390 }
3391 }
3392
3393 #[doc(hidden)]
3394 impl crate::RequestBuilder for DeleteKmsConfig {
3395 fn request_options(&mut self) -> &mut crate::RequestOptions {
3396 &mut self.0.options
3397 }
3398 }
3399
3400 #[derive(Clone, Debug)]
3421 pub struct ListReplications(RequestBuilder<crate::model::ListReplicationsRequest>);
3422
3423 impl ListReplications {
3424 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3425 Self(RequestBuilder::new(stub))
3426 }
3427
3428 pub fn with_request<V: Into<crate::model::ListReplicationsRequest>>(
3430 mut self,
3431 v: V,
3432 ) -> Self {
3433 self.0.request = v.into();
3434 self
3435 }
3436
3437 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3439 self.0.options = v.into();
3440 self
3441 }
3442
3443 pub async fn send(self) -> Result<crate::model::ListReplicationsResponse> {
3445 (*self.0.stub)
3446 .list_replications(self.0.request, self.0.options)
3447 .await
3448 .map(crate::Response::into_body)
3449 }
3450
3451 pub fn by_page(
3453 self,
3454 ) -> impl google_cloud_gax::paginator::Paginator<
3455 crate::model::ListReplicationsResponse,
3456 crate::Error,
3457 > {
3458 use std::clone::Clone;
3459 let token = self.0.request.page_token.clone();
3460 let execute = move |token: String| {
3461 let mut builder = self.clone();
3462 builder.0.request = builder.0.request.set_page_token(token);
3463 builder.send()
3464 };
3465 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3466 }
3467
3468 pub fn by_item(
3470 self,
3471 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3472 crate::model::ListReplicationsResponse,
3473 crate::Error,
3474 > {
3475 use google_cloud_gax::paginator::Paginator;
3476 self.by_page().items()
3477 }
3478
3479 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3483 self.0.request.parent = v.into();
3484 self
3485 }
3486
3487 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3489 self.0.request.page_size = v.into();
3490 self
3491 }
3492
3493 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3495 self.0.request.page_token = v.into();
3496 self
3497 }
3498
3499 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3501 self.0.request.order_by = v.into();
3502 self
3503 }
3504
3505 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3507 self.0.request.filter = v.into();
3508 self
3509 }
3510 }
3511
3512 #[doc(hidden)]
3513 impl crate::RequestBuilder for ListReplications {
3514 fn request_options(&mut self) -> &mut crate::RequestOptions {
3515 &mut self.0.options
3516 }
3517 }
3518
3519 #[derive(Clone, Debug)]
3536 pub struct GetReplication(RequestBuilder<crate::model::GetReplicationRequest>);
3537
3538 impl GetReplication {
3539 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3540 Self(RequestBuilder::new(stub))
3541 }
3542
3543 pub fn with_request<V: Into<crate::model::GetReplicationRequest>>(mut self, v: V) -> Self {
3545 self.0.request = v.into();
3546 self
3547 }
3548
3549 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3551 self.0.options = v.into();
3552 self
3553 }
3554
3555 pub async fn send(self) -> Result<crate::model::Replication> {
3557 (*self.0.stub)
3558 .get_replication(self.0.request, self.0.options)
3559 .await
3560 .map(crate::Response::into_body)
3561 }
3562
3563 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3567 self.0.request.name = v.into();
3568 self
3569 }
3570 }
3571
3572 #[doc(hidden)]
3573 impl crate::RequestBuilder for GetReplication {
3574 fn request_options(&mut self) -> &mut crate::RequestOptions {
3575 &mut self.0.options
3576 }
3577 }
3578
3579 #[derive(Clone, Debug)]
3597 pub struct CreateReplication(RequestBuilder<crate::model::CreateReplicationRequest>);
3598
3599 impl CreateReplication {
3600 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3601 Self(RequestBuilder::new(stub))
3602 }
3603
3604 pub fn with_request<V: Into<crate::model::CreateReplicationRequest>>(
3606 mut self,
3607 v: V,
3608 ) -> Self {
3609 self.0.request = v.into();
3610 self
3611 }
3612
3613 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3615 self.0.options = v.into();
3616 self
3617 }
3618
3619 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3626 (*self.0.stub)
3627 .create_replication(self.0.request, self.0.options)
3628 .await
3629 .map(crate::Response::into_body)
3630 }
3631
3632 pub fn poller(
3634 self,
3635 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
3636 {
3637 type Operation = google_cloud_lro::internal::Operation<
3638 crate::model::Replication,
3639 crate::model::OperationMetadata,
3640 >;
3641 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3642 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3643
3644 let stub = self.0.stub.clone();
3645 let mut options = self.0.options.clone();
3646 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3647 let query = move |name| {
3648 let stub = stub.clone();
3649 let options = options.clone();
3650 async {
3651 let op = GetOperation::new(stub)
3652 .set_name(name)
3653 .with_options(options)
3654 .send()
3655 .await?;
3656 Ok(Operation::new(op))
3657 }
3658 };
3659
3660 let start = move || async {
3661 let op = self.send().await?;
3662 Ok(Operation::new(op))
3663 };
3664
3665 google_cloud_lro::internal::new_poller(
3666 polling_error_policy,
3667 polling_backoff_policy,
3668 start,
3669 query,
3670 )
3671 }
3672
3673 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3677 self.0.request.parent = v.into();
3678 self
3679 }
3680
3681 pub fn set_replication<T>(mut self, v: T) -> Self
3685 where
3686 T: std::convert::Into<crate::model::Replication>,
3687 {
3688 self.0.request.replication = std::option::Option::Some(v.into());
3689 self
3690 }
3691
3692 pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
3696 where
3697 T: std::convert::Into<crate::model::Replication>,
3698 {
3699 self.0.request.replication = v.map(|x| x.into());
3700 self
3701 }
3702
3703 pub fn set_replication_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3707 self.0.request.replication_id = v.into();
3708 self
3709 }
3710 }
3711
3712 #[doc(hidden)]
3713 impl crate::RequestBuilder for CreateReplication {
3714 fn request_options(&mut self) -> &mut crate::RequestOptions {
3715 &mut self.0.options
3716 }
3717 }
3718
3719 #[derive(Clone, Debug)]
3737 pub struct DeleteReplication(RequestBuilder<crate::model::DeleteReplicationRequest>);
3738
3739 impl DeleteReplication {
3740 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3741 Self(RequestBuilder::new(stub))
3742 }
3743
3744 pub fn with_request<V: Into<crate::model::DeleteReplicationRequest>>(
3746 mut self,
3747 v: V,
3748 ) -> Self {
3749 self.0.request = v.into();
3750 self
3751 }
3752
3753 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3755 self.0.options = v.into();
3756 self
3757 }
3758
3759 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3766 (*self.0.stub)
3767 .delete_replication(self.0.request, self.0.options)
3768 .await
3769 .map(crate::Response::into_body)
3770 }
3771
3772 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3774 type Operation =
3775 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3776 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3777 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3778
3779 let stub = self.0.stub.clone();
3780 let mut options = self.0.options.clone();
3781 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3782 let query = move |name| {
3783 let stub = stub.clone();
3784 let options = options.clone();
3785 async {
3786 let op = GetOperation::new(stub)
3787 .set_name(name)
3788 .with_options(options)
3789 .send()
3790 .await?;
3791 Ok(Operation::new(op))
3792 }
3793 };
3794
3795 let start = move || async {
3796 let op = self.send().await?;
3797 Ok(Operation::new(op))
3798 };
3799
3800 google_cloud_lro::internal::new_unit_response_poller(
3801 polling_error_policy,
3802 polling_backoff_policy,
3803 start,
3804 query,
3805 )
3806 }
3807
3808 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3812 self.0.request.name = v.into();
3813 self
3814 }
3815 }
3816
3817 #[doc(hidden)]
3818 impl crate::RequestBuilder for DeleteReplication {
3819 fn request_options(&mut self) -> &mut crate::RequestOptions {
3820 &mut self.0.options
3821 }
3822 }
3823
3824 #[derive(Clone, Debug)]
3842 pub struct UpdateReplication(RequestBuilder<crate::model::UpdateReplicationRequest>);
3843
3844 impl UpdateReplication {
3845 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3846 Self(RequestBuilder::new(stub))
3847 }
3848
3849 pub fn with_request<V: Into<crate::model::UpdateReplicationRequest>>(
3851 mut self,
3852 v: V,
3853 ) -> Self {
3854 self.0.request = v.into();
3855 self
3856 }
3857
3858 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3860 self.0.options = v.into();
3861 self
3862 }
3863
3864 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3871 (*self.0.stub)
3872 .update_replication(self.0.request, self.0.options)
3873 .await
3874 .map(crate::Response::into_body)
3875 }
3876
3877 pub fn poller(
3879 self,
3880 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
3881 {
3882 type Operation = google_cloud_lro::internal::Operation<
3883 crate::model::Replication,
3884 crate::model::OperationMetadata,
3885 >;
3886 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3887 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3888
3889 let stub = self.0.stub.clone();
3890 let mut options = self.0.options.clone();
3891 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3892 let query = move |name| {
3893 let stub = stub.clone();
3894 let options = options.clone();
3895 async {
3896 let op = GetOperation::new(stub)
3897 .set_name(name)
3898 .with_options(options)
3899 .send()
3900 .await?;
3901 Ok(Operation::new(op))
3902 }
3903 };
3904
3905 let start = move || async {
3906 let op = self.send().await?;
3907 Ok(Operation::new(op))
3908 };
3909
3910 google_cloud_lro::internal::new_poller(
3911 polling_error_policy,
3912 polling_backoff_policy,
3913 start,
3914 query,
3915 )
3916 }
3917
3918 pub fn set_update_mask<T>(mut self, v: T) -> Self
3922 where
3923 T: std::convert::Into<wkt::FieldMask>,
3924 {
3925 self.0.request.update_mask = std::option::Option::Some(v.into());
3926 self
3927 }
3928
3929 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3933 where
3934 T: std::convert::Into<wkt::FieldMask>,
3935 {
3936 self.0.request.update_mask = v.map(|x| x.into());
3937 self
3938 }
3939
3940 pub fn set_replication<T>(mut self, v: T) -> Self
3944 where
3945 T: std::convert::Into<crate::model::Replication>,
3946 {
3947 self.0.request.replication = std::option::Option::Some(v.into());
3948 self
3949 }
3950
3951 pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
3955 where
3956 T: std::convert::Into<crate::model::Replication>,
3957 {
3958 self.0.request.replication = v.map(|x| x.into());
3959 self
3960 }
3961 }
3962
3963 #[doc(hidden)]
3964 impl crate::RequestBuilder for UpdateReplication {
3965 fn request_options(&mut self) -> &mut crate::RequestOptions {
3966 &mut self.0.options
3967 }
3968 }
3969
3970 #[derive(Clone, Debug)]
3988 pub struct StopReplication(RequestBuilder<crate::model::StopReplicationRequest>);
3989
3990 impl StopReplication {
3991 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
3992 Self(RequestBuilder::new(stub))
3993 }
3994
3995 pub fn with_request<V: Into<crate::model::StopReplicationRequest>>(mut self, v: V) -> Self {
3997 self.0.request = v.into();
3998 self
3999 }
4000
4001 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4003 self.0.options = v.into();
4004 self
4005 }
4006
4007 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4014 (*self.0.stub)
4015 .stop_replication(self.0.request, self.0.options)
4016 .await
4017 .map(crate::Response::into_body)
4018 }
4019
4020 pub fn poller(
4022 self,
4023 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4024 {
4025 type Operation = google_cloud_lro::internal::Operation<
4026 crate::model::Replication,
4027 crate::model::OperationMetadata,
4028 >;
4029 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4030 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4031
4032 let stub = self.0.stub.clone();
4033 let mut options = self.0.options.clone();
4034 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4035 let query = move |name| {
4036 let stub = stub.clone();
4037 let options = options.clone();
4038 async {
4039 let op = GetOperation::new(stub)
4040 .set_name(name)
4041 .with_options(options)
4042 .send()
4043 .await?;
4044 Ok(Operation::new(op))
4045 }
4046 };
4047
4048 let start = move || async {
4049 let op = self.send().await?;
4050 Ok(Operation::new(op))
4051 };
4052
4053 google_cloud_lro::internal::new_poller(
4054 polling_error_policy,
4055 polling_backoff_policy,
4056 start,
4057 query,
4058 )
4059 }
4060
4061 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4065 self.0.request.name = v.into();
4066 self
4067 }
4068
4069 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
4071 self.0.request.force = v.into();
4072 self
4073 }
4074 }
4075
4076 #[doc(hidden)]
4077 impl crate::RequestBuilder for StopReplication {
4078 fn request_options(&mut self) -> &mut crate::RequestOptions {
4079 &mut self.0.options
4080 }
4081 }
4082
4083 #[derive(Clone, Debug)]
4101 pub struct ResumeReplication(RequestBuilder<crate::model::ResumeReplicationRequest>);
4102
4103 impl ResumeReplication {
4104 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4105 Self(RequestBuilder::new(stub))
4106 }
4107
4108 pub fn with_request<V: Into<crate::model::ResumeReplicationRequest>>(
4110 mut self,
4111 v: V,
4112 ) -> Self {
4113 self.0.request = v.into();
4114 self
4115 }
4116
4117 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4119 self.0.options = v.into();
4120 self
4121 }
4122
4123 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4130 (*self.0.stub)
4131 .resume_replication(self.0.request, self.0.options)
4132 .await
4133 .map(crate::Response::into_body)
4134 }
4135
4136 pub fn poller(
4138 self,
4139 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4140 {
4141 type Operation = google_cloud_lro::internal::Operation<
4142 crate::model::Replication,
4143 crate::model::OperationMetadata,
4144 >;
4145 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4146 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4147
4148 let stub = self.0.stub.clone();
4149 let mut options = self.0.options.clone();
4150 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4151 let query = move |name| {
4152 let stub = stub.clone();
4153 let options = options.clone();
4154 async {
4155 let op = GetOperation::new(stub)
4156 .set_name(name)
4157 .with_options(options)
4158 .send()
4159 .await?;
4160 Ok(Operation::new(op))
4161 }
4162 };
4163
4164 let start = move || async {
4165 let op = self.send().await?;
4166 Ok(Operation::new(op))
4167 };
4168
4169 google_cloud_lro::internal::new_poller(
4170 polling_error_policy,
4171 polling_backoff_policy,
4172 start,
4173 query,
4174 )
4175 }
4176
4177 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4181 self.0.request.name = v.into();
4182 self
4183 }
4184 }
4185
4186 #[doc(hidden)]
4187 impl crate::RequestBuilder for ResumeReplication {
4188 fn request_options(&mut self) -> &mut crate::RequestOptions {
4189 &mut self.0.options
4190 }
4191 }
4192
4193 #[derive(Clone, Debug)]
4211 pub struct ReverseReplicationDirection(
4212 RequestBuilder<crate::model::ReverseReplicationDirectionRequest>,
4213 );
4214
4215 impl ReverseReplicationDirection {
4216 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4217 Self(RequestBuilder::new(stub))
4218 }
4219
4220 pub fn with_request<V: Into<crate::model::ReverseReplicationDirectionRequest>>(
4222 mut self,
4223 v: V,
4224 ) -> Self {
4225 self.0.request = v.into();
4226 self
4227 }
4228
4229 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4231 self.0.options = v.into();
4232 self
4233 }
4234
4235 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4242 (*self.0.stub)
4243 .reverse_replication_direction(self.0.request, self.0.options)
4244 .await
4245 .map(crate::Response::into_body)
4246 }
4247
4248 pub fn poller(
4250 self,
4251 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4252 {
4253 type Operation = google_cloud_lro::internal::Operation<
4254 crate::model::Replication,
4255 crate::model::OperationMetadata,
4256 >;
4257 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4258 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4259
4260 let stub = self.0.stub.clone();
4261 let mut options = self.0.options.clone();
4262 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4263 let query = move |name| {
4264 let stub = stub.clone();
4265 let options = options.clone();
4266 async {
4267 let op = GetOperation::new(stub)
4268 .set_name(name)
4269 .with_options(options)
4270 .send()
4271 .await?;
4272 Ok(Operation::new(op))
4273 }
4274 };
4275
4276 let start = move || async {
4277 let op = self.send().await?;
4278 Ok(Operation::new(op))
4279 };
4280
4281 google_cloud_lro::internal::new_poller(
4282 polling_error_policy,
4283 polling_backoff_policy,
4284 start,
4285 query,
4286 )
4287 }
4288
4289 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4293 self.0.request.name = v.into();
4294 self
4295 }
4296 }
4297
4298 #[doc(hidden)]
4299 impl crate::RequestBuilder for ReverseReplicationDirection {
4300 fn request_options(&mut self) -> &mut crate::RequestOptions {
4301 &mut self.0.options
4302 }
4303 }
4304
4305 #[derive(Clone, Debug)]
4323 pub struct EstablishPeering(RequestBuilder<crate::model::EstablishPeeringRequest>);
4324
4325 impl EstablishPeering {
4326 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4327 Self(RequestBuilder::new(stub))
4328 }
4329
4330 pub fn with_request<V: Into<crate::model::EstablishPeeringRequest>>(
4332 mut self,
4333 v: V,
4334 ) -> Self {
4335 self.0.request = v.into();
4336 self
4337 }
4338
4339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4341 self.0.options = v.into();
4342 self
4343 }
4344
4345 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4352 (*self.0.stub)
4353 .establish_peering(self.0.request, self.0.options)
4354 .await
4355 .map(crate::Response::into_body)
4356 }
4357
4358 pub fn poller(
4360 self,
4361 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4362 {
4363 type Operation = google_cloud_lro::internal::Operation<
4364 crate::model::Replication,
4365 crate::model::OperationMetadata,
4366 >;
4367 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4368 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4369
4370 let stub = self.0.stub.clone();
4371 let mut options = self.0.options.clone();
4372 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4373 let query = move |name| {
4374 let stub = stub.clone();
4375 let options = options.clone();
4376 async {
4377 let op = GetOperation::new(stub)
4378 .set_name(name)
4379 .with_options(options)
4380 .send()
4381 .await?;
4382 Ok(Operation::new(op))
4383 }
4384 };
4385
4386 let start = move || async {
4387 let op = self.send().await?;
4388 Ok(Operation::new(op))
4389 };
4390
4391 google_cloud_lro::internal::new_poller(
4392 polling_error_policy,
4393 polling_backoff_policy,
4394 start,
4395 query,
4396 )
4397 }
4398
4399 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4403 self.0.request.name = v.into();
4404 self
4405 }
4406
4407 pub fn set_peer_cluster_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4411 self.0.request.peer_cluster_name = v.into();
4412 self
4413 }
4414
4415 pub fn set_peer_svm_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4419 self.0.request.peer_svm_name = v.into();
4420 self
4421 }
4422
4423 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
4425 where
4426 T: std::iter::IntoIterator<Item = V>,
4427 V: std::convert::Into<std::string::String>,
4428 {
4429 use std::iter::Iterator;
4430 self.0.request.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
4431 self
4432 }
4433
4434 pub fn set_peer_volume_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4438 self.0.request.peer_volume_name = v.into();
4439 self
4440 }
4441 }
4442
4443 #[doc(hidden)]
4444 impl crate::RequestBuilder for EstablishPeering {
4445 fn request_options(&mut self) -> &mut crate::RequestOptions {
4446 &mut self.0.options
4447 }
4448 }
4449
4450 #[derive(Clone, Debug)]
4468 pub struct SyncReplication(RequestBuilder<crate::model::SyncReplicationRequest>);
4469
4470 impl SyncReplication {
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::SyncReplicationRequest>>(mut self, v: V) -> Self {
4477 self.0.request = v.into();
4478 self
4479 }
4480
4481 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4483 self.0.options = v.into();
4484 self
4485 }
4486
4487 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4494 (*self.0.stub)
4495 .sync_replication(self.0.request, self.0.options)
4496 .await
4497 .map(crate::Response::into_body)
4498 }
4499
4500 pub fn poller(
4502 self,
4503 ) -> impl google_cloud_lro::Poller<crate::model::Replication, crate::model::OperationMetadata>
4504 {
4505 type Operation = google_cloud_lro::internal::Operation<
4506 crate::model::Replication,
4507 crate::model::OperationMetadata,
4508 >;
4509 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4510 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4511
4512 let stub = self.0.stub.clone();
4513 let mut options = self.0.options.clone();
4514 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4515 let query = move |name| {
4516 let stub = stub.clone();
4517 let options = options.clone();
4518 async {
4519 let op = GetOperation::new(stub)
4520 .set_name(name)
4521 .with_options(options)
4522 .send()
4523 .await?;
4524 Ok(Operation::new(op))
4525 }
4526 };
4527
4528 let start = move || async {
4529 let op = self.send().await?;
4530 Ok(Operation::new(op))
4531 };
4532
4533 google_cloud_lro::internal::new_poller(
4534 polling_error_policy,
4535 polling_backoff_policy,
4536 start,
4537 query,
4538 )
4539 }
4540
4541 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4545 self.0.request.name = v.into();
4546 self
4547 }
4548 }
4549
4550 #[doc(hidden)]
4551 impl crate::RequestBuilder for SyncReplication {
4552 fn request_options(&mut self) -> &mut crate::RequestOptions {
4553 &mut self.0.options
4554 }
4555 }
4556
4557 #[derive(Clone, Debug)]
4575 pub struct CreateBackupVault(RequestBuilder<crate::model::CreateBackupVaultRequest>);
4576
4577 impl CreateBackupVault {
4578 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4579 Self(RequestBuilder::new(stub))
4580 }
4581
4582 pub fn with_request<V: Into<crate::model::CreateBackupVaultRequest>>(
4584 mut self,
4585 v: V,
4586 ) -> Self {
4587 self.0.request = v.into();
4588 self
4589 }
4590
4591 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4593 self.0.options = v.into();
4594 self
4595 }
4596
4597 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4604 (*self.0.stub)
4605 .create_backup_vault(self.0.request, self.0.options)
4606 .await
4607 .map(crate::Response::into_body)
4608 }
4609
4610 pub fn poller(
4612 self,
4613 ) -> impl google_cloud_lro::Poller<crate::model::BackupVault, crate::model::OperationMetadata>
4614 {
4615 type Operation = google_cloud_lro::internal::Operation<
4616 crate::model::BackupVault,
4617 crate::model::OperationMetadata,
4618 >;
4619 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4620 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4621
4622 let stub = self.0.stub.clone();
4623 let mut options = self.0.options.clone();
4624 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4625 let query = move |name| {
4626 let stub = stub.clone();
4627 let options = options.clone();
4628 async {
4629 let op = GetOperation::new(stub)
4630 .set_name(name)
4631 .with_options(options)
4632 .send()
4633 .await?;
4634 Ok(Operation::new(op))
4635 }
4636 };
4637
4638 let start = move || async {
4639 let op = self.send().await?;
4640 Ok(Operation::new(op))
4641 };
4642
4643 google_cloud_lro::internal::new_poller(
4644 polling_error_policy,
4645 polling_backoff_policy,
4646 start,
4647 query,
4648 )
4649 }
4650
4651 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4655 self.0.request.parent = v.into();
4656 self
4657 }
4658
4659 pub fn set_backup_vault_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4663 self.0.request.backup_vault_id = v.into();
4664 self
4665 }
4666
4667 pub fn set_backup_vault<T>(mut self, v: T) -> Self
4671 where
4672 T: std::convert::Into<crate::model::BackupVault>,
4673 {
4674 self.0.request.backup_vault = std::option::Option::Some(v.into());
4675 self
4676 }
4677
4678 pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4682 where
4683 T: std::convert::Into<crate::model::BackupVault>,
4684 {
4685 self.0.request.backup_vault = v.map(|x| x.into());
4686 self
4687 }
4688 }
4689
4690 #[doc(hidden)]
4691 impl crate::RequestBuilder for CreateBackupVault {
4692 fn request_options(&mut self) -> &mut crate::RequestOptions {
4693 &mut self.0.options
4694 }
4695 }
4696
4697 #[derive(Clone, Debug)]
4714 pub struct GetBackupVault(RequestBuilder<crate::model::GetBackupVaultRequest>);
4715
4716 impl GetBackupVault {
4717 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4718 Self(RequestBuilder::new(stub))
4719 }
4720
4721 pub fn with_request<V: Into<crate::model::GetBackupVaultRequest>>(mut self, v: V) -> Self {
4723 self.0.request = v.into();
4724 self
4725 }
4726
4727 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4729 self.0.options = v.into();
4730 self
4731 }
4732
4733 pub async fn send(self) -> Result<crate::model::BackupVault> {
4735 (*self.0.stub)
4736 .get_backup_vault(self.0.request, self.0.options)
4737 .await
4738 .map(crate::Response::into_body)
4739 }
4740
4741 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4745 self.0.request.name = v.into();
4746 self
4747 }
4748 }
4749
4750 #[doc(hidden)]
4751 impl crate::RequestBuilder for GetBackupVault {
4752 fn request_options(&mut self) -> &mut crate::RequestOptions {
4753 &mut self.0.options
4754 }
4755 }
4756
4757 #[derive(Clone, Debug)]
4778 pub struct ListBackupVaults(RequestBuilder<crate::model::ListBackupVaultsRequest>);
4779
4780 impl ListBackupVaults {
4781 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4782 Self(RequestBuilder::new(stub))
4783 }
4784
4785 pub fn with_request<V: Into<crate::model::ListBackupVaultsRequest>>(
4787 mut self,
4788 v: V,
4789 ) -> Self {
4790 self.0.request = v.into();
4791 self
4792 }
4793
4794 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4796 self.0.options = v.into();
4797 self
4798 }
4799
4800 pub async fn send(self) -> Result<crate::model::ListBackupVaultsResponse> {
4802 (*self.0.stub)
4803 .list_backup_vaults(self.0.request, self.0.options)
4804 .await
4805 .map(crate::Response::into_body)
4806 }
4807
4808 pub fn by_page(
4810 self,
4811 ) -> impl google_cloud_gax::paginator::Paginator<
4812 crate::model::ListBackupVaultsResponse,
4813 crate::Error,
4814 > {
4815 use std::clone::Clone;
4816 let token = self.0.request.page_token.clone();
4817 let execute = move |token: String| {
4818 let mut builder = self.clone();
4819 builder.0.request = builder.0.request.set_page_token(token);
4820 builder.send()
4821 };
4822 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4823 }
4824
4825 pub fn by_item(
4827 self,
4828 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4829 crate::model::ListBackupVaultsResponse,
4830 crate::Error,
4831 > {
4832 use google_cloud_gax::paginator::Paginator;
4833 self.by_page().items()
4834 }
4835
4836 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4840 self.0.request.parent = v.into();
4841 self
4842 }
4843
4844 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4846 self.0.request.page_size = v.into();
4847 self
4848 }
4849
4850 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4852 self.0.request.page_token = v.into();
4853 self
4854 }
4855
4856 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4858 self.0.request.order_by = v.into();
4859 self
4860 }
4861
4862 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4864 self.0.request.filter = v.into();
4865 self
4866 }
4867 }
4868
4869 #[doc(hidden)]
4870 impl crate::RequestBuilder for ListBackupVaults {
4871 fn request_options(&mut self) -> &mut crate::RequestOptions {
4872 &mut self.0.options
4873 }
4874 }
4875
4876 #[derive(Clone, Debug)]
4894 pub struct UpdateBackupVault(RequestBuilder<crate::model::UpdateBackupVaultRequest>);
4895
4896 impl UpdateBackupVault {
4897 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
4898 Self(RequestBuilder::new(stub))
4899 }
4900
4901 pub fn with_request<V: Into<crate::model::UpdateBackupVaultRequest>>(
4903 mut self,
4904 v: V,
4905 ) -> Self {
4906 self.0.request = v.into();
4907 self
4908 }
4909
4910 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4912 self.0.options = v.into();
4913 self
4914 }
4915
4916 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4923 (*self.0.stub)
4924 .update_backup_vault(self.0.request, self.0.options)
4925 .await
4926 .map(crate::Response::into_body)
4927 }
4928
4929 pub fn poller(
4931 self,
4932 ) -> impl google_cloud_lro::Poller<crate::model::BackupVault, crate::model::OperationMetadata>
4933 {
4934 type Operation = google_cloud_lro::internal::Operation<
4935 crate::model::BackupVault,
4936 crate::model::OperationMetadata,
4937 >;
4938 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4939 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4940
4941 let stub = self.0.stub.clone();
4942 let mut options = self.0.options.clone();
4943 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4944 let query = move |name| {
4945 let stub = stub.clone();
4946 let options = options.clone();
4947 async {
4948 let op = GetOperation::new(stub)
4949 .set_name(name)
4950 .with_options(options)
4951 .send()
4952 .await?;
4953 Ok(Operation::new(op))
4954 }
4955 };
4956
4957 let start = move || async {
4958 let op = self.send().await?;
4959 Ok(Operation::new(op))
4960 };
4961
4962 google_cloud_lro::internal::new_poller(
4963 polling_error_policy,
4964 polling_backoff_policy,
4965 start,
4966 query,
4967 )
4968 }
4969
4970 pub fn set_update_mask<T>(mut self, v: T) -> Self
4974 where
4975 T: std::convert::Into<wkt::FieldMask>,
4976 {
4977 self.0.request.update_mask = std::option::Option::Some(v.into());
4978 self
4979 }
4980
4981 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4985 where
4986 T: std::convert::Into<wkt::FieldMask>,
4987 {
4988 self.0.request.update_mask = v.map(|x| x.into());
4989 self
4990 }
4991
4992 pub fn set_backup_vault<T>(mut self, v: T) -> Self
4996 where
4997 T: std::convert::Into<crate::model::BackupVault>,
4998 {
4999 self.0.request.backup_vault = std::option::Option::Some(v.into());
5000 self
5001 }
5002
5003 pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
5007 where
5008 T: std::convert::Into<crate::model::BackupVault>,
5009 {
5010 self.0.request.backup_vault = v.map(|x| x.into());
5011 self
5012 }
5013 }
5014
5015 #[doc(hidden)]
5016 impl crate::RequestBuilder for UpdateBackupVault {
5017 fn request_options(&mut self) -> &mut crate::RequestOptions {
5018 &mut self.0.options
5019 }
5020 }
5021
5022 #[derive(Clone, Debug)]
5040 pub struct DeleteBackupVault(RequestBuilder<crate::model::DeleteBackupVaultRequest>);
5041
5042 impl DeleteBackupVault {
5043 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5044 Self(RequestBuilder::new(stub))
5045 }
5046
5047 pub fn with_request<V: Into<crate::model::DeleteBackupVaultRequest>>(
5049 mut self,
5050 v: V,
5051 ) -> Self {
5052 self.0.request = v.into();
5053 self
5054 }
5055
5056 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5058 self.0.options = v.into();
5059 self
5060 }
5061
5062 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5069 (*self.0.stub)
5070 .delete_backup_vault(self.0.request, self.0.options)
5071 .await
5072 .map(crate::Response::into_body)
5073 }
5074
5075 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5077 type Operation =
5078 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5079 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5080 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5081
5082 let stub = self.0.stub.clone();
5083 let mut options = self.0.options.clone();
5084 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5085 let query = move |name| {
5086 let stub = stub.clone();
5087 let options = options.clone();
5088 async {
5089 let op = GetOperation::new(stub)
5090 .set_name(name)
5091 .with_options(options)
5092 .send()
5093 .await?;
5094 Ok(Operation::new(op))
5095 }
5096 };
5097
5098 let start = move || async {
5099 let op = self.send().await?;
5100 Ok(Operation::new(op))
5101 };
5102
5103 google_cloud_lro::internal::new_unit_response_poller(
5104 polling_error_policy,
5105 polling_backoff_policy,
5106 start,
5107 query,
5108 )
5109 }
5110
5111 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5115 self.0.request.name = v.into();
5116 self
5117 }
5118 }
5119
5120 #[doc(hidden)]
5121 impl crate::RequestBuilder for DeleteBackupVault {
5122 fn request_options(&mut self) -> &mut crate::RequestOptions {
5123 &mut self.0.options
5124 }
5125 }
5126
5127 #[derive(Clone, Debug)]
5145 pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
5146
5147 impl CreateBackup {
5148 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5149 Self(RequestBuilder::new(stub))
5150 }
5151
5152 pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
5154 self.0.request = v.into();
5155 self
5156 }
5157
5158 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5160 self.0.options = v.into();
5161 self
5162 }
5163
5164 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5171 (*self.0.stub)
5172 .create_backup(self.0.request, self.0.options)
5173 .await
5174 .map(crate::Response::into_body)
5175 }
5176
5177 pub fn poller(
5179 self,
5180 ) -> impl google_cloud_lro::Poller<crate::model::Backup, crate::model::OperationMetadata>
5181 {
5182 type Operation = google_cloud_lro::internal::Operation<
5183 crate::model::Backup,
5184 crate::model::OperationMetadata,
5185 >;
5186 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5187 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5188
5189 let stub = self.0.stub.clone();
5190 let mut options = self.0.options.clone();
5191 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5192 let query = move |name| {
5193 let stub = stub.clone();
5194 let options = options.clone();
5195 async {
5196 let op = GetOperation::new(stub)
5197 .set_name(name)
5198 .with_options(options)
5199 .send()
5200 .await?;
5201 Ok(Operation::new(op))
5202 }
5203 };
5204
5205 let start = move || async {
5206 let op = self.send().await?;
5207 Ok(Operation::new(op))
5208 };
5209
5210 google_cloud_lro::internal::new_poller(
5211 polling_error_policy,
5212 polling_backoff_policy,
5213 start,
5214 query,
5215 )
5216 }
5217
5218 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5222 self.0.request.parent = v.into();
5223 self
5224 }
5225
5226 pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5230 self.0.request.backup_id = v.into();
5231 self
5232 }
5233
5234 pub fn set_backup<T>(mut self, v: T) -> Self
5238 where
5239 T: std::convert::Into<crate::model::Backup>,
5240 {
5241 self.0.request.backup = std::option::Option::Some(v.into());
5242 self
5243 }
5244
5245 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
5249 where
5250 T: std::convert::Into<crate::model::Backup>,
5251 {
5252 self.0.request.backup = v.map(|x| x.into());
5253 self
5254 }
5255 }
5256
5257 #[doc(hidden)]
5258 impl crate::RequestBuilder for CreateBackup {
5259 fn request_options(&mut self) -> &mut crate::RequestOptions {
5260 &mut self.0.options
5261 }
5262 }
5263
5264 #[derive(Clone, Debug)]
5281 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
5282
5283 impl GetBackup {
5284 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5285 Self(RequestBuilder::new(stub))
5286 }
5287
5288 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
5290 self.0.request = v.into();
5291 self
5292 }
5293
5294 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5296 self.0.options = v.into();
5297 self
5298 }
5299
5300 pub async fn send(self) -> Result<crate::model::Backup> {
5302 (*self.0.stub)
5303 .get_backup(self.0.request, self.0.options)
5304 .await
5305 .map(crate::Response::into_body)
5306 }
5307
5308 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5312 self.0.request.name = v.into();
5313 self
5314 }
5315 }
5316
5317 #[doc(hidden)]
5318 impl crate::RequestBuilder for GetBackup {
5319 fn request_options(&mut self) -> &mut crate::RequestOptions {
5320 &mut self.0.options
5321 }
5322 }
5323
5324 #[derive(Clone, Debug)]
5345 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
5346
5347 impl ListBackups {
5348 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5349 Self(RequestBuilder::new(stub))
5350 }
5351
5352 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
5354 self.0.request = v.into();
5355 self
5356 }
5357
5358 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5360 self.0.options = v.into();
5361 self
5362 }
5363
5364 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
5366 (*self.0.stub)
5367 .list_backups(self.0.request, self.0.options)
5368 .await
5369 .map(crate::Response::into_body)
5370 }
5371
5372 pub fn by_page(
5374 self,
5375 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBackupsResponse, crate::Error>
5376 {
5377 use std::clone::Clone;
5378 let token = self.0.request.page_token.clone();
5379 let execute = move |token: String| {
5380 let mut builder = self.clone();
5381 builder.0.request = builder.0.request.set_page_token(token);
5382 builder.send()
5383 };
5384 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5385 }
5386
5387 pub fn by_item(
5389 self,
5390 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5391 crate::model::ListBackupsResponse,
5392 crate::Error,
5393 > {
5394 use google_cloud_gax::paginator::Paginator;
5395 self.by_page().items()
5396 }
5397
5398 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5402 self.0.request.parent = v.into();
5403 self
5404 }
5405
5406 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5408 self.0.request.page_size = v.into();
5409 self
5410 }
5411
5412 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5414 self.0.request.page_token = v.into();
5415 self
5416 }
5417
5418 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5420 self.0.request.order_by = v.into();
5421 self
5422 }
5423
5424 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5426 self.0.request.filter = v.into();
5427 self
5428 }
5429 }
5430
5431 #[doc(hidden)]
5432 impl crate::RequestBuilder for ListBackups {
5433 fn request_options(&mut self) -> &mut crate::RequestOptions {
5434 &mut self.0.options
5435 }
5436 }
5437
5438 #[derive(Clone, Debug)]
5456 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
5457
5458 impl DeleteBackup {
5459 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5460 Self(RequestBuilder::new(stub))
5461 }
5462
5463 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
5465 self.0.request = v.into();
5466 self
5467 }
5468
5469 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5471 self.0.options = v.into();
5472 self
5473 }
5474
5475 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5482 (*self.0.stub)
5483 .delete_backup(self.0.request, self.0.options)
5484 .await
5485 .map(crate::Response::into_body)
5486 }
5487
5488 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5490 type Operation =
5491 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5492 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5493 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5494
5495 let stub = self.0.stub.clone();
5496 let mut options = self.0.options.clone();
5497 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5498 let query = move |name| {
5499 let stub = stub.clone();
5500 let options = options.clone();
5501 async {
5502 let op = GetOperation::new(stub)
5503 .set_name(name)
5504 .with_options(options)
5505 .send()
5506 .await?;
5507 Ok(Operation::new(op))
5508 }
5509 };
5510
5511 let start = move || async {
5512 let op = self.send().await?;
5513 Ok(Operation::new(op))
5514 };
5515
5516 google_cloud_lro::internal::new_unit_response_poller(
5517 polling_error_policy,
5518 polling_backoff_policy,
5519 start,
5520 query,
5521 )
5522 }
5523
5524 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5528 self.0.request.name = v.into();
5529 self
5530 }
5531 }
5532
5533 #[doc(hidden)]
5534 impl crate::RequestBuilder for DeleteBackup {
5535 fn request_options(&mut self) -> &mut crate::RequestOptions {
5536 &mut self.0.options
5537 }
5538 }
5539
5540 #[derive(Clone, Debug)]
5558 pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
5559
5560 impl UpdateBackup {
5561 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5562 Self(RequestBuilder::new(stub))
5563 }
5564
5565 pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
5567 self.0.request = v.into();
5568 self
5569 }
5570
5571 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5573 self.0.options = v.into();
5574 self
5575 }
5576
5577 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5584 (*self.0.stub)
5585 .update_backup(self.0.request, self.0.options)
5586 .await
5587 .map(crate::Response::into_body)
5588 }
5589
5590 pub fn poller(
5592 self,
5593 ) -> impl google_cloud_lro::Poller<crate::model::Backup, crate::model::OperationMetadata>
5594 {
5595 type Operation = google_cloud_lro::internal::Operation<
5596 crate::model::Backup,
5597 crate::model::OperationMetadata,
5598 >;
5599 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5600 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5601
5602 let stub = self.0.stub.clone();
5603 let mut options = self.0.options.clone();
5604 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5605 let query = move |name| {
5606 let stub = stub.clone();
5607 let options = options.clone();
5608 async {
5609 let op = GetOperation::new(stub)
5610 .set_name(name)
5611 .with_options(options)
5612 .send()
5613 .await?;
5614 Ok(Operation::new(op))
5615 }
5616 };
5617
5618 let start = move || async {
5619 let op = self.send().await?;
5620 Ok(Operation::new(op))
5621 };
5622
5623 google_cloud_lro::internal::new_poller(
5624 polling_error_policy,
5625 polling_backoff_policy,
5626 start,
5627 query,
5628 )
5629 }
5630
5631 pub fn set_update_mask<T>(mut self, v: T) -> Self
5635 where
5636 T: std::convert::Into<wkt::FieldMask>,
5637 {
5638 self.0.request.update_mask = std::option::Option::Some(v.into());
5639 self
5640 }
5641
5642 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5646 where
5647 T: std::convert::Into<wkt::FieldMask>,
5648 {
5649 self.0.request.update_mask = v.map(|x| x.into());
5650 self
5651 }
5652
5653 pub fn set_backup<T>(mut self, v: T) -> Self
5657 where
5658 T: std::convert::Into<crate::model::Backup>,
5659 {
5660 self.0.request.backup = std::option::Option::Some(v.into());
5661 self
5662 }
5663
5664 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
5668 where
5669 T: std::convert::Into<crate::model::Backup>,
5670 {
5671 self.0.request.backup = v.map(|x| x.into());
5672 self
5673 }
5674 }
5675
5676 #[doc(hidden)]
5677 impl crate::RequestBuilder for UpdateBackup {
5678 fn request_options(&mut self) -> &mut crate::RequestOptions {
5679 &mut self.0.options
5680 }
5681 }
5682
5683 #[derive(Clone, Debug)]
5701 pub struct CreateBackupPolicy(RequestBuilder<crate::model::CreateBackupPolicyRequest>);
5702
5703 impl CreateBackupPolicy {
5704 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5705 Self(RequestBuilder::new(stub))
5706 }
5707
5708 pub fn with_request<V: Into<crate::model::CreateBackupPolicyRequest>>(
5710 mut self,
5711 v: V,
5712 ) -> Self {
5713 self.0.request = v.into();
5714 self
5715 }
5716
5717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5719 self.0.options = v.into();
5720 self
5721 }
5722
5723 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5730 (*self.0.stub)
5731 .create_backup_policy(self.0.request, self.0.options)
5732 .await
5733 .map(crate::Response::into_body)
5734 }
5735
5736 pub fn poller(
5738 self,
5739 ) -> impl google_cloud_lro::Poller<crate::model::BackupPolicy, crate::model::OperationMetadata>
5740 {
5741 type Operation = google_cloud_lro::internal::Operation<
5742 crate::model::BackupPolicy,
5743 crate::model::OperationMetadata,
5744 >;
5745 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5746 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5747
5748 let stub = self.0.stub.clone();
5749 let mut options = self.0.options.clone();
5750 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5751 let query = move |name| {
5752 let stub = stub.clone();
5753 let options = options.clone();
5754 async {
5755 let op = GetOperation::new(stub)
5756 .set_name(name)
5757 .with_options(options)
5758 .send()
5759 .await?;
5760 Ok(Operation::new(op))
5761 }
5762 };
5763
5764 let start = move || async {
5765 let op = self.send().await?;
5766 Ok(Operation::new(op))
5767 };
5768
5769 google_cloud_lro::internal::new_poller(
5770 polling_error_policy,
5771 polling_backoff_policy,
5772 start,
5773 query,
5774 )
5775 }
5776
5777 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5781 self.0.request.parent = v.into();
5782 self
5783 }
5784
5785 pub fn set_backup_policy<T>(mut self, v: T) -> Self
5789 where
5790 T: std::convert::Into<crate::model::BackupPolicy>,
5791 {
5792 self.0.request.backup_policy = std::option::Option::Some(v.into());
5793 self
5794 }
5795
5796 pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
5800 where
5801 T: std::convert::Into<crate::model::BackupPolicy>,
5802 {
5803 self.0.request.backup_policy = v.map(|x| x.into());
5804 self
5805 }
5806
5807 pub fn set_backup_policy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5811 self.0.request.backup_policy_id = v.into();
5812 self
5813 }
5814 }
5815
5816 #[doc(hidden)]
5817 impl crate::RequestBuilder for CreateBackupPolicy {
5818 fn request_options(&mut self) -> &mut crate::RequestOptions {
5819 &mut self.0.options
5820 }
5821 }
5822
5823 #[derive(Clone, Debug)]
5840 pub struct GetBackupPolicy(RequestBuilder<crate::model::GetBackupPolicyRequest>);
5841
5842 impl GetBackupPolicy {
5843 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5844 Self(RequestBuilder::new(stub))
5845 }
5846
5847 pub fn with_request<V: Into<crate::model::GetBackupPolicyRequest>>(mut self, v: V) -> Self {
5849 self.0.request = v.into();
5850 self
5851 }
5852
5853 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5855 self.0.options = v.into();
5856 self
5857 }
5858
5859 pub async fn send(self) -> Result<crate::model::BackupPolicy> {
5861 (*self.0.stub)
5862 .get_backup_policy(self.0.request, self.0.options)
5863 .await
5864 .map(crate::Response::into_body)
5865 }
5866
5867 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5871 self.0.request.name = v.into();
5872 self
5873 }
5874 }
5875
5876 #[doc(hidden)]
5877 impl crate::RequestBuilder for GetBackupPolicy {
5878 fn request_options(&mut self) -> &mut crate::RequestOptions {
5879 &mut self.0.options
5880 }
5881 }
5882
5883 #[derive(Clone, Debug)]
5904 pub struct ListBackupPolicies(RequestBuilder<crate::model::ListBackupPoliciesRequest>);
5905
5906 impl ListBackupPolicies {
5907 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
5908 Self(RequestBuilder::new(stub))
5909 }
5910
5911 pub fn with_request<V: Into<crate::model::ListBackupPoliciesRequest>>(
5913 mut self,
5914 v: V,
5915 ) -> Self {
5916 self.0.request = v.into();
5917 self
5918 }
5919
5920 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5922 self.0.options = v.into();
5923 self
5924 }
5925
5926 pub async fn send(self) -> Result<crate::model::ListBackupPoliciesResponse> {
5928 (*self.0.stub)
5929 .list_backup_policies(self.0.request, self.0.options)
5930 .await
5931 .map(crate::Response::into_body)
5932 }
5933
5934 pub fn by_page(
5936 self,
5937 ) -> impl google_cloud_gax::paginator::Paginator<
5938 crate::model::ListBackupPoliciesResponse,
5939 crate::Error,
5940 > {
5941 use std::clone::Clone;
5942 let token = self.0.request.page_token.clone();
5943 let execute = move |token: String| {
5944 let mut builder = self.clone();
5945 builder.0.request = builder.0.request.set_page_token(token);
5946 builder.send()
5947 };
5948 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5949 }
5950
5951 pub fn by_item(
5953 self,
5954 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5955 crate::model::ListBackupPoliciesResponse,
5956 crate::Error,
5957 > {
5958 use google_cloud_gax::paginator::Paginator;
5959 self.by_page().items()
5960 }
5961
5962 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5966 self.0.request.parent = v.into();
5967 self
5968 }
5969
5970 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5972 self.0.request.page_size = v.into();
5973 self
5974 }
5975
5976 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5978 self.0.request.page_token = v.into();
5979 self
5980 }
5981
5982 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5984 self.0.request.filter = v.into();
5985 self
5986 }
5987
5988 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5990 self.0.request.order_by = v.into();
5991 self
5992 }
5993 }
5994
5995 #[doc(hidden)]
5996 impl crate::RequestBuilder for ListBackupPolicies {
5997 fn request_options(&mut self) -> &mut crate::RequestOptions {
5998 &mut self.0.options
5999 }
6000 }
6001
6002 #[derive(Clone, Debug)]
6020 pub struct UpdateBackupPolicy(RequestBuilder<crate::model::UpdateBackupPolicyRequest>);
6021
6022 impl UpdateBackupPolicy {
6023 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6024 Self(RequestBuilder::new(stub))
6025 }
6026
6027 pub fn with_request<V: Into<crate::model::UpdateBackupPolicyRequest>>(
6029 mut self,
6030 v: V,
6031 ) -> Self {
6032 self.0.request = v.into();
6033 self
6034 }
6035
6036 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6038 self.0.options = v.into();
6039 self
6040 }
6041
6042 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6049 (*self.0.stub)
6050 .update_backup_policy(self.0.request, self.0.options)
6051 .await
6052 .map(crate::Response::into_body)
6053 }
6054
6055 pub fn poller(
6057 self,
6058 ) -> impl google_cloud_lro::Poller<crate::model::BackupPolicy, crate::model::OperationMetadata>
6059 {
6060 type Operation = google_cloud_lro::internal::Operation<
6061 crate::model::BackupPolicy,
6062 crate::model::OperationMetadata,
6063 >;
6064 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6065 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6066
6067 let stub = self.0.stub.clone();
6068 let mut options = self.0.options.clone();
6069 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6070 let query = move |name| {
6071 let stub = stub.clone();
6072 let options = options.clone();
6073 async {
6074 let op = GetOperation::new(stub)
6075 .set_name(name)
6076 .with_options(options)
6077 .send()
6078 .await?;
6079 Ok(Operation::new(op))
6080 }
6081 };
6082
6083 let start = move || async {
6084 let op = self.send().await?;
6085 Ok(Operation::new(op))
6086 };
6087
6088 google_cloud_lro::internal::new_poller(
6089 polling_error_policy,
6090 polling_backoff_policy,
6091 start,
6092 query,
6093 )
6094 }
6095
6096 pub fn set_update_mask<T>(mut self, v: T) -> Self
6100 where
6101 T: std::convert::Into<wkt::FieldMask>,
6102 {
6103 self.0.request.update_mask = std::option::Option::Some(v.into());
6104 self
6105 }
6106
6107 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6111 where
6112 T: std::convert::Into<wkt::FieldMask>,
6113 {
6114 self.0.request.update_mask = v.map(|x| x.into());
6115 self
6116 }
6117
6118 pub fn set_backup_policy<T>(mut self, v: T) -> Self
6122 where
6123 T: std::convert::Into<crate::model::BackupPolicy>,
6124 {
6125 self.0.request.backup_policy = std::option::Option::Some(v.into());
6126 self
6127 }
6128
6129 pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
6133 where
6134 T: std::convert::Into<crate::model::BackupPolicy>,
6135 {
6136 self.0.request.backup_policy = v.map(|x| x.into());
6137 self
6138 }
6139 }
6140
6141 #[doc(hidden)]
6142 impl crate::RequestBuilder for UpdateBackupPolicy {
6143 fn request_options(&mut self) -> &mut crate::RequestOptions {
6144 &mut self.0.options
6145 }
6146 }
6147
6148 #[derive(Clone, Debug)]
6166 pub struct DeleteBackupPolicy(RequestBuilder<crate::model::DeleteBackupPolicyRequest>);
6167
6168 impl DeleteBackupPolicy {
6169 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6170 Self(RequestBuilder::new(stub))
6171 }
6172
6173 pub fn with_request<V: Into<crate::model::DeleteBackupPolicyRequest>>(
6175 mut self,
6176 v: V,
6177 ) -> Self {
6178 self.0.request = v.into();
6179 self
6180 }
6181
6182 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6184 self.0.options = v.into();
6185 self
6186 }
6187
6188 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6195 (*self.0.stub)
6196 .delete_backup_policy(self.0.request, self.0.options)
6197 .await
6198 .map(crate::Response::into_body)
6199 }
6200
6201 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6203 type Operation =
6204 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6205 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6206 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6207
6208 let stub = self.0.stub.clone();
6209 let mut options = self.0.options.clone();
6210 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6211 let query = move |name| {
6212 let stub = stub.clone();
6213 let options = options.clone();
6214 async {
6215 let op = GetOperation::new(stub)
6216 .set_name(name)
6217 .with_options(options)
6218 .send()
6219 .await?;
6220 Ok(Operation::new(op))
6221 }
6222 };
6223
6224 let start = move || async {
6225 let op = self.send().await?;
6226 Ok(Operation::new(op))
6227 };
6228
6229 google_cloud_lro::internal::new_unit_response_poller(
6230 polling_error_policy,
6231 polling_backoff_policy,
6232 start,
6233 query,
6234 )
6235 }
6236
6237 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6241 self.0.request.name = v.into();
6242 self
6243 }
6244 }
6245
6246 #[doc(hidden)]
6247 impl crate::RequestBuilder for DeleteBackupPolicy {
6248 fn request_options(&mut self) -> &mut crate::RequestOptions {
6249 &mut self.0.options
6250 }
6251 }
6252
6253 #[derive(Clone, Debug)]
6274 pub struct ListQuotaRules(RequestBuilder<crate::model::ListQuotaRulesRequest>);
6275
6276 impl ListQuotaRules {
6277 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6278 Self(RequestBuilder::new(stub))
6279 }
6280
6281 pub fn with_request<V: Into<crate::model::ListQuotaRulesRequest>>(mut self, v: V) -> Self {
6283 self.0.request = v.into();
6284 self
6285 }
6286
6287 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6289 self.0.options = v.into();
6290 self
6291 }
6292
6293 pub async fn send(self) -> Result<crate::model::ListQuotaRulesResponse> {
6295 (*self.0.stub)
6296 .list_quota_rules(self.0.request, self.0.options)
6297 .await
6298 .map(crate::Response::into_body)
6299 }
6300
6301 pub fn by_page(
6303 self,
6304 ) -> impl google_cloud_gax::paginator::Paginator<
6305 crate::model::ListQuotaRulesResponse,
6306 crate::Error,
6307 > {
6308 use std::clone::Clone;
6309 let token = self.0.request.page_token.clone();
6310 let execute = move |token: String| {
6311 let mut builder = self.clone();
6312 builder.0.request = builder.0.request.set_page_token(token);
6313 builder.send()
6314 };
6315 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6316 }
6317
6318 pub fn by_item(
6320 self,
6321 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6322 crate::model::ListQuotaRulesResponse,
6323 crate::Error,
6324 > {
6325 use google_cloud_gax::paginator::Paginator;
6326 self.by_page().items()
6327 }
6328
6329 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6333 self.0.request.parent = v.into();
6334 self
6335 }
6336
6337 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6339 self.0.request.page_size = v.into();
6340 self
6341 }
6342
6343 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6345 self.0.request.page_token = v.into();
6346 self
6347 }
6348
6349 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6351 self.0.request.filter = v.into();
6352 self
6353 }
6354
6355 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6357 self.0.request.order_by = v.into();
6358 self
6359 }
6360 }
6361
6362 #[doc(hidden)]
6363 impl crate::RequestBuilder for ListQuotaRules {
6364 fn request_options(&mut self) -> &mut crate::RequestOptions {
6365 &mut self.0.options
6366 }
6367 }
6368
6369 #[derive(Clone, Debug)]
6386 pub struct GetQuotaRule(RequestBuilder<crate::model::GetQuotaRuleRequest>);
6387
6388 impl GetQuotaRule {
6389 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6390 Self(RequestBuilder::new(stub))
6391 }
6392
6393 pub fn with_request<V: Into<crate::model::GetQuotaRuleRequest>>(mut self, v: V) -> Self {
6395 self.0.request = v.into();
6396 self
6397 }
6398
6399 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6401 self.0.options = v.into();
6402 self
6403 }
6404
6405 pub async fn send(self) -> Result<crate::model::QuotaRule> {
6407 (*self.0.stub)
6408 .get_quota_rule(self.0.request, self.0.options)
6409 .await
6410 .map(crate::Response::into_body)
6411 }
6412
6413 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6417 self.0.request.name = v.into();
6418 self
6419 }
6420 }
6421
6422 #[doc(hidden)]
6423 impl crate::RequestBuilder for GetQuotaRule {
6424 fn request_options(&mut self) -> &mut crate::RequestOptions {
6425 &mut self.0.options
6426 }
6427 }
6428
6429 #[derive(Clone, Debug)]
6447 pub struct CreateQuotaRule(RequestBuilder<crate::model::CreateQuotaRuleRequest>);
6448
6449 impl CreateQuotaRule {
6450 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6451 Self(RequestBuilder::new(stub))
6452 }
6453
6454 pub fn with_request<V: Into<crate::model::CreateQuotaRuleRequest>>(mut self, v: V) -> Self {
6456 self.0.request = v.into();
6457 self
6458 }
6459
6460 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6462 self.0.options = v.into();
6463 self
6464 }
6465
6466 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6473 (*self.0.stub)
6474 .create_quota_rule(self.0.request, self.0.options)
6475 .await
6476 .map(crate::Response::into_body)
6477 }
6478
6479 pub fn poller(
6481 self,
6482 ) -> impl google_cloud_lro::Poller<crate::model::QuotaRule, crate::model::OperationMetadata>
6483 {
6484 type Operation = google_cloud_lro::internal::Operation<
6485 crate::model::QuotaRule,
6486 crate::model::OperationMetadata,
6487 >;
6488 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6489 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6490
6491 let stub = self.0.stub.clone();
6492 let mut options = self.0.options.clone();
6493 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6494 let query = move |name| {
6495 let stub = stub.clone();
6496 let options = options.clone();
6497 async {
6498 let op = GetOperation::new(stub)
6499 .set_name(name)
6500 .with_options(options)
6501 .send()
6502 .await?;
6503 Ok(Operation::new(op))
6504 }
6505 };
6506
6507 let start = move || async {
6508 let op = self.send().await?;
6509 Ok(Operation::new(op))
6510 };
6511
6512 google_cloud_lro::internal::new_poller(
6513 polling_error_policy,
6514 polling_backoff_policy,
6515 start,
6516 query,
6517 )
6518 }
6519
6520 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6524 self.0.request.parent = v.into();
6525 self
6526 }
6527
6528 pub fn set_quota_rule<T>(mut self, v: T) -> Self
6532 where
6533 T: std::convert::Into<crate::model::QuotaRule>,
6534 {
6535 self.0.request.quota_rule = std::option::Option::Some(v.into());
6536 self
6537 }
6538
6539 pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
6543 where
6544 T: std::convert::Into<crate::model::QuotaRule>,
6545 {
6546 self.0.request.quota_rule = v.map(|x| x.into());
6547 self
6548 }
6549
6550 pub fn set_quota_rule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6554 self.0.request.quota_rule_id = v.into();
6555 self
6556 }
6557 }
6558
6559 #[doc(hidden)]
6560 impl crate::RequestBuilder for CreateQuotaRule {
6561 fn request_options(&mut self) -> &mut crate::RequestOptions {
6562 &mut self.0.options
6563 }
6564 }
6565
6566 #[derive(Clone, Debug)]
6584 pub struct UpdateQuotaRule(RequestBuilder<crate::model::UpdateQuotaRuleRequest>);
6585
6586 impl UpdateQuotaRule {
6587 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6588 Self(RequestBuilder::new(stub))
6589 }
6590
6591 pub fn with_request<V: Into<crate::model::UpdateQuotaRuleRequest>>(mut self, v: V) -> Self {
6593 self.0.request = v.into();
6594 self
6595 }
6596
6597 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6599 self.0.options = v.into();
6600 self
6601 }
6602
6603 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6610 (*self.0.stub)
6611 .update_quota_rule(self.0.request, self.0.options)
6612 .await
6613 .map(crate::Response::into_body)
6614 }
6615
6616 pub fn poller(
6618 self,
6619 ) -> impl google_cloud_lro::Poller<crate::model::QuotaRule, crate::model::OperationMetadata>
6620 {
6621 type Operation = google_cloud_lro::internal::Operation<
6622 crate::model::QuotaRule,
6623 crate::model::OperationMetadata,
6624 >;
6625 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6626 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6627
6628 let stub = self.0.stub.clone();
6629 let mut options = self.0.options.clone();
6630 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6631 let query = move |name| {
6632 let stub = stub.clone();
6633 let options = options.clone();
6634 async {
6635 let op = GetOperation::new(stub)
6636 .set_name(name)
6637 .with_options(options)
6638 .send()
6639 .await?;
6640 Ok(Operation::new(op))
6641 }
6642 };
6643
6644 let start = move || async {
6645 let op = self.send().await?;
6646 Ok(Operation::new(op))
6647 };
6648
6649 google_cloud_lro::internal::new_poller(
6650 polling_error_policy,
6651 polling_backoff_policy,
6652 start,
6653 query,
6654 )
6655 }
6656
6657 pub fn set_update_mask<T>(mut self, v: T) -> Self
6659 where
6660 T: std::convert::Into<wkt::FieldMask>,
6661 {
6662 self.0.request.update_mask = std::option::Option::Some(v.into());
6663 self
6664 }
6665
6666 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6668 where
6669 T: std::convert::Into<wkt::FieldMask>,
6670 {
6671 self.0.request.update_mask = v.map(|x| x.into());
6672 self
6673 }
6674
6675 pub fn set_quota_rule<T>(mut self, v: T) -> Self
6679 where
6680 T: std::convert::Into<crate::model::QuotaRule>,
6681 {
6682 self.0.request.quota_rule = std::option::Option::Some(v.into());
6683 self
6684 }
6685
6686 pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
6690 where
6691 T: std::convert::Into<crate::model::QuotaRule>,
6692 {
6693 self.0.request.quota_rule = v.map(|x| x.into());
6694 self
6695 }
6696 }
6697
6698 #[doc(hidden)]
6699 impl crate::RequestBuilder for UpdateQuotaRule {
6700 fn request_options(&mut self) -> &mut crate::RequestOptions {
6701 &mut self.0.options
6702 }
6703 }
6704
6705 #[derive(Clone, Debug)]
6723 pub struct DeleteQuotaRule(RequestBuilder<crate::model::DeleteQuotaRuleRequest>);
6724
6725 impl DeleteQuotaRule {
6726 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6727 Self(RequestBuilder::new(stub))
6728 }
6729
6730 pub fn with_request<V: Into<crate::model::DeleteQuotaRuleRequest>>(mut self, v: V) -> Self {
6732 self.0.request = v.into();
6733 self
6734 }
6735
6736 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6738 self.0.options = v.into();
6739 self
6740 }
6741
6742 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6749 (*self.0.stub)
6750 .delete_quota_rule(self.0.request, self.0.options)
6751 .await
6752 .map(crate::Response::into_body)
6753 }
6754
6755 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
6757 type Operation =
6758 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6759 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6760 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6761
6762 let stub = self.0.stub.clone();
6763 let mut options = self.0.options.clone();
6764 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6765 let query = move |name| {
6766 let stub = stub.clone();
6767 let options = options.clone();
6768 async {
6769 let op = GetOperation::new(stub)
6770 .set_name(name)
6771 .with_options(options)
6772 .send()
6773 .await?;
6774 Ok(Operation::new(op))
6775 }
6776 };
6777
6778 let start = move || async {
6779 let op = self.send().await?;
6780 Ok(Operation::new(op))
6781 };
6782
6783 google_cloud_lro::internal::new_unit_response_poller(
6784 polling_error_policy,
6785 polling_backoff_policy,
6786 start,
6787 query,
6788 )
6789 }
6790
6791 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6795 self.0.request.name = v.into();
6796 self
6797 }
6798 }
6799
6800 #[doc(hidden)]
6801 impl crate::RequestBuilder for DeleteQuotaRule {
6802 fn request_options(&mut self) -> &mut crate::RequestOptions {
6803 &mut self.0.options
6804 }
6805 }
6806
6807 #[derive(Clone, Debug)]
6825 pub struct RestoreBackupFiles(RequestBuilder<crate::model::RestoreBackupFilesRequest>);
6826
6827 impl RestoreBackupFiles {
6828 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6829 Self(RequestBuilder::new(stub))
6830 }
6831
6832 pub fn with_request<V: Into<crate::model::RestoreBackupFilesRequest>>(
6834 mut self,
6835 v: V,
6836 ) -> Self {
6837 self.0.request = v.into();
6838 self
6839 }
6840
6841 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6843 self.0.options = v.into();
6844 self
6845 }
6846
6847 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6854 (*self.0.stub)
6855 .restore_backup_files(self.0.request, self.0.options)
6856 .await
6857 .map(crate::Response::into_body)
6858 }
6859
6860 pub fn poller(
6862 self,
6863 ) -> impl google_cloud_lro::Poller<
6864 crate::model::RestoreBackupFilesResponse,
6865 crate::model::OperationMetadata,
6866 > {
6867 type Operation = google_cloud_lro::internal::Operation<
6868 crate::model::RestoreBackupFilesResponse,
6869 crate::model::OperationMetadata,
6870 >;
6871 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6872 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6873
6874 let stub = self.0.stub.clone();
6875 let mut options = self.0.options.clone();
6876 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6877 let query = move |name| {
6878 let stub = stub.clone();
6879 let options = options.clone();
6880 async {
6881 let op = GetOperation::new(stub)
6882 .set_name(name)
6883 .with_options(options)
6884 .send()
6885 .await?;
6886 Ok(Operation::new(op))
6887 }
6888 };
6889
6890 let start = move || async {
6891 let op = self.send().await?;
6892 Ok(Operation::new(op))
6893 };
6894
6895 google_cloud_lro::internal::new_poller(
6896 polling_error_policy,
6897 polling_backoff_policy,
6898 start,
6899 query,
6900 )
6901 }
6902
6903 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6907 self.0.request.name = v.into();
6908 self
6909 }
6910
6911 pub fn set_backup<T: Into<std::string::String>>(mut self, v: T) -> Self {
6915 self.0.request.backup = v.into();
6916 self
6917 }
6918
6919 pub fn set_file_list<T, V>(mut self, v: T) -> Self
6923 where
6924 T: std::iter::IntoIterator<Item = V>,
6925 V: std::convert::Into<std::string::String>,
6926 {
6927 use std::iter::Iterator;
6928 self.0.request.file_list = v.into_iter().map(|i| i.into()).collect();
6929 self
6930 }
6931
6932 pub fn set_restore_destination_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
6934 self.0.request.restore_destination_path = v.into();
6935 self
6936 }
6937 }
6938
6939 #[doc(hidden)]
6940 impl crate::RequestBuilder for RestoreBackupFiles {
6941 fn request_options(&mut self) -> &mut crate::RequestOptions {
6942 &mut self.0.options
6943 }
6944 }
6945
6946 #[derive(Clone, Debug)]
6967 pub struct ListHostGroups(RequestBuilder<crate::model::ListHostGroupsRequest>);
6968
6969 impl ListHostGroups {
6970 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
6971 Self(RequestBuilder::new(stub))
6972 }
6973
6974 pub fn with_request<V: Into<crate::model::ListHostGroupsRequest>>(mut self, v: V) -> Self {
6976 self.0.request = v.into();
6977 self
6978 }
6979
6980 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6982 self.0.options = v.into();
6983 self
6984 }
6985
6986 pub async fn send(self) -> Result<crate::model::ListHostGroupsResponse> {
6988 (*self.0.stub)
6989 .list_host_groups(self.0.request, self.0.options)
6990 .await
6991 .map(crate::Response::into_body)
6992 }
6993
6994 pub fn by_page(
6996 self,
6997 ) -> impl google_cloud_gax::paginator::Paginator<
6998 crate::model::ListHostGroupsResponse,
6999 crate::Error,
7000 > {
7001 use std::clone::Clone;
7002 let token = self.0.request.page_token.clone();
7003 let execute = move |token: String| {
7004 let mut builder = self.clone();
7005 builder.0.request = builder.0.request.set_page_token(token);
7006 builder.send()
7007 };
7008 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7009 }
7010
7011 pub fn by_item(
7013 self,
7014 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7015 crate::model::ListHostGroupsResponse,
7016 crate::Error,
7017 > {
7018 use google_cloud_gax::paginator::Paginator;
7019 self.by_page().items()
7020 }
7021
7022 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7026 self.0.request.parent = v.into();
7027 self
7028 }
7029
7030 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7032 self.0.request.page_size = v.into();
7033 self
7034 }
7035
7036 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7038 self.0.request.page_token = v.into();
7039 self
7040 }
7041
7042 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7044 self.0.request.filter = v.into();
7045 self
7046 }
7047
7048 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7050 self.0.request.order_by = v.into();
7051 self
7052 }
7053 }
7054
7055 #[doc(hidden)]
7056 impl crate::RequestBuilder for ListHostGroups {
7057 fn request_options(&mut self) -> &mut crate::RequestOptions {
7058 &mut self.0.options
7059 }
7060 }
7061
7062 #[derive(Clone, Debug)]
7079 pub struct GetHostGroup(RequestBuilder<crate::model::GetHostGroupRequest>);
7080
7081 impl GetHostGroup {
7082 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7083 Self(RequestBuilder::new(stub))
7084 }
7085
7086 pub fn with_request<V: Into<crate::model::GetHostGroupRequest>>(mut self, v: V) -> Self {
7088 self.0.request = v.into();
7089 self
7090 }
7091
7092 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7094 self.0.options = v.into();
7095 self
7096 }
7097
7098 pub async fn send(self) -> Result<crate::model::HostGroup> {
7100 (*self.0.stub)
7101 .get_host_group(self.0.request, self.0.options)
7102 .await
7103 .map(crate::Response::into_body)
7104 }
7105
7106 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7110 self.0.request.name = v.into();
7111 self
7112 }
7113 }
7114
7115 #[doc(hidden)]
7116 impl crate::RequestBuilder for GetHostGroup {
7117 fn request_options(&mut self) -> &mut crate::RequestOptions {
7118 &mut self.0.options
7119 }
7120 }
7121
7122 #[derive(Clone, Debug)]
7140 pub struct CreateHostGroup(RequestBuilder<crate::model::CreateHostGroupRequest>);
7141
7142 impl CreateHostGroup {
7143 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7144 Self(RequestBuilder::new(stub))
7145 }
7146
7147 pub fn with_request<V: Into<crate::model::CreateHostGroupRequest>>(mut self, v: V) -> Self {
7149 self.0.request = v.into();
7150 self
7151 }
7152
7153 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7155 self.0.options = v.into();
7156 self
7157 }
7158
7159 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7166 (*self.0.stub)
7167 .create_host_group(self.0.request, self.0.options)
7168 .await
7169 .map(crate::Response::into_body)
7170 }
7171
7172 pub fn poller(
7174 self,
7175 ) -> impl google_cloud_lro::Poller<crate::model::HostGroup, crate::model::OperationMetadata>
7176 {
7177 type Operation = google_cloud_lro::internal::Operation<
7178 crate::model::HostGroup,
7179 crate::model::OperationMetadata,
7180 >;
7181 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7182 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7183
7184 let stub = self.0.stub.clone();
7185 let mut options = self.0.options.clone();
7186 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7187 let query = move |name| {
7188 let stub = stub.clone();
7189 let options = options.clone();
7190 async {
7191 let op = GetOperation::new(stub)
7192 .set_name(name)
7193 .with_options(options)
7194 .send()
7195 .await?;
7196 Ok(Operation::new(op))
7197 }
7198 };
7199
7200 let start = move || async {
7201 let op = self.send().await?;
7202 Ok(Operation::new(op))
7203 };
7204
7205 google_cloud_lro::internal::new_poller(
7206 polling_error_policy,
7207 polling_backoff_policy,
7208 start,
7209 query,
7210 )
7211 }
7212
7213 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7217 self.0.request.parent = v.into();
7218 self
7219 }
7220
7221 pub fn set_host_group<T>(mut self, v: T) -> Self
7225 where
7226 T: std::convert::Into<crate::model::HostGroup>,
7227 {
7228 self.0.request.host_group = std::option::Option::Some(v.into());
7229 self
7230 }
7231
7232 pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
7236 where
7237 T: std::convert::Into<crate::model::HostGroup>,
7238 {
7239 self.0.request.host_group = v.map(|x| x.into());
7240 self
7241 }
7242
7243 pub fn set_host_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7247 self.0.request.host_group_id = v.into();
7248 self
7249 }
7250 }
7251
7252 #[doc(hidden)]
7253 impl crate::RequestBuilder for CreateHostGroup {
7254 fn request_options(&mut self) -> &mut crate::RequestOptions {
7255 &mut self.0.options
7256 }
7257 }
7258
7259 #[derive(Clone, Debug)]
7277 pub struct UpdateHostGroup(RequestBuilder<crate::model::UpdateHostGroupRequest>);
7278
7279 impl UpdateHostGroup {
7280 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7281 Self(RequestBuilder::new(stub))
7282 }
7283
7284 pub fn with_request<V: Into<crate::model::UpdateHostGroupRequest>>(mut self, v: V) -> Self {
7286 self.0.request = v.into();
7287 self
7288 }
7289
7290 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7292 self.0.options = v.into();
7293 self
7294 }
7295
7296 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7303 (*self.0.stub)
7304 .update_host_group(self.0.request, self.0.options)
7305 .await
7306 .map(crate::Response::into_body)
7307 }
7308
7309 pub fn poller(
7311 self,
7312 ) -> impl google_cloud_lro::Poller<crate::model::HostGroup, crate::model::OperationMetadata>
7313 {
7314 type Operation = google_cloud_lro::internal::Operation<
7315 crate::model::HostGroup,
7316 crate::model::OperationMetadata,
7317 >;
7318 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7319 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7320
7321 let stub = self.0.stub.clone();
7322 let mut options = self.0.options.clone();
7323 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7324 let query = move |name| {
7325 let stub = stub.clone();
7326 let options = options.clone();
7327 async {
7328 let op = GetOperation::new(stub)
7329 .set_name(name)
7330 .with_options(options)
7331 .send()
7332 .await?;
7333 Ok(Operation::new(op))
7334 }
7335 };
7336
7337 let start = move || async {
7338 let op = self.send().await?;
7339 Ok(Operation::new(op))
7340 };
7341
7342 google_cloud_lro::internal::new_poller(
7343 polling_error_policy,
7344 polling_backoff_policy,
7345 start,
7346 query,
7347 )
7348 }
7349
7350 pub fn set_host_group<T>(mut self, v: T) -> Self
7354 where
7355 T: std::convert::Into<crate::model::HostGroup>,
7356 {
7357 self.0.request.host_group = std::option::Option::Some(v.into());
7358 self
7359 }
7360
7361 pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
7365 where
7366 T: std::convert::Into<crate::model::HostGroup>,
7367 {
7368 self.0.request.host_group = v.map(|x| x.into());
7369 self
7370 }
7371
7372 pub fn set_update_mask<T>(mut self, v: T) -> Self
7374 where
7375 T: std::convert::Into<wkt::FieldMask>,
7376 {
7377 self.0.request.update_mask = std::option::Option::Some(v.into());
7378 self
7379 }
7380
7381 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7383 where
7384 T: std::convert::Into<wkt::FieldMask>,
7385 {
7386 self.0.request.update_mask = v.map(|x| x.into());
7387 self
7388 }
7389 }
7390
7391 #[doc(hidden)]
7392 impl crate::RequestBuilder for UpdateHostGroup {
7393 fn request_options(&mut self) -> &mut crate::RequestOptions {
7394 &mut self.0.options
7395 }
7396 }
7397
7398 #[derive(Clone, Debug)]
7416 pub struct DeleteHostGroup(RequestBuilder<crate::model::DeleteHostGroupRequest>);
7417
7418 impl DeleteHostGroup {
7419 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7420 Self(RequestBuilder::new(stub))
7421 }
7422
7423 pub fn with_request<V: Into<crate::model::DeleteHostGroupRequest>>(mut self, v: V) -> Self {
7425 self.0.request = v.into();
7426 self
7427 }
7428
7429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7431 self.0.options = v.into();
7432 self
7433 }
7434
7435 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7442 (*self.0.stub)
7443 .delete_host_group(self.0.request, self.0.options)
7444 .await
7445 .map(crate::Response::into_body)
7446 }
7447
7448 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7450 type Operation =
7451 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7452 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7453 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7454
7455 let stub = self.0.stub.clone();
7456 let mut options = self.0.options.clone();
7457 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7458 let query = move |name| {
7459 let stub = stub.clone();
7460 let options = options.clone();
7461 async {
7462 let op = GetOperation::new(stub)
7463 .set_name(name)
7464 .with_options(options)
7465 .send()
7466 .await?;
7467 Ok(Operation::new(op))
7468 }
7469 };
7470
7471 let start = move || async {
7472 let op = self.send().await?;
7473 Ok(Operation::new(op))
7474 };
7475
7476 google_cloud_lro::internal::new_unit_response_poller(
7477 polling_error_policy,
7478 polling_backoff_policy,
7479 start,
7480 query,
7481 )
7482 }
7483
7484 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7488 self.0.request.name = v.into();
7489 self
7490 }
7491 }
7492
7493 #[doc(hidden)]
7494 impl crate::RequestBuilder for DeleteHostGroup {
7495 fn request_options(&mut self) -> &mut crate::RequestOptions {
7496 &mut self.0.options
7497 }
7498 }
7499
7500 #[derive(Clone, Debug)]
7521 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7522
7523 impl ListLocations {
7524 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7525 Self(RequestBuilder::new(stub))
7526 }
7527
7528 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7530 mut self,
7531 v: V,
7532 ) -> Self {
7533 self.0.request = v.into();
7534 self
7535 }
7536
7537 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7539 self.0.options = v.into();
7540 self
7541 }
7542
7543 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7545 (*self.0.stub)
7546 .list_locations(self.0.request, self.0.options)
7547 .await
7548 .map(crate::Response::into_body)
7549 }
7550
7551 pub fn by_page(
7553 self,
7554 ) -> impl google_cloud_gax::paginator::Paginator<
7555 google_cloud_location::model::ListLocationsResponse,
7556 crate::Error,
7557 > {
7558 use std::clone::Clone;
7559 let token = self.0.request.page_token.clone();
7560 let execute = move |token: String| {
7561 let mut builder = self.clone();
7562 builder.0.request = builder.0.request.set_page_token(token);
7563 builder.send()
7564 };
7565 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7566 }
7567
7568 pub fn by_item(
7570 self,
7571 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7572 google_cloud_location::model::ListLocationsResponse,
7573 crate::Error,
7574 > {
7575 use google_cloud_gax::paginator::Paginator;
7576 self.by_page().items()
7577 }
7578
7579 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7581 self.0.request.name = v.into();
7582 self
7583 }
7584
7585 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7587 self.0.request.filter = v.into();
7588 self
7589 }
7590
7591 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7593 self.0.request.page_size = v.into();
7594 self
7595 }
7596
7597 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7599 self.0.request.page_token = v.into();
7600 self
7601 }
7602 }
7603
7604 #[doc(hidden)]
7605 impl crate::RequestBuilder for ListLocations {
7606 fn request_options(&mut self) -> &mut crate::RequestOptions {
7607 &mut self.0.options
7608 }
7609 }
7610
7611 #[derive(Clone, Debug)]
7628 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7629
7630 impl GetLocation {
7631 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7632 Self(RequestBuilder::new(stub))
7633 }
7634
7635 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7637 mut self,
7638 v: V,
7639 ) -> Self {
7640 self.0.request = v.into();
7641 self
7642 }
7643
7644 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7646 self.0.options = v.into();
7647 self
7648 }
7649
7650 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7652 (*self.0.stub)
7653 .get_location(self.0.request, self.0.options)
7654 .await
7655 .map(crate::Response::into_body)
7656 }
7657
7658 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7660 self.0.request.name = v.into();
7661 self
7662 }
7663 }
7664
7665 #[doc(hidden)]
7666 impl crate::RequestBuilder for GetLocation {
7667 fn request_options(&mut self) -> &mut crate::RequestOptions {
7668 &mut self.0.options
7669 }
7670 }
7671
7672 #[derive(Clone, Debug)]
7693 pub struct ListOperations(
7694 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7695 );
7696
7697 impl ListOperations {
7698 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7699 Self(RequestBuilder::new(stub))
7700 }
7701
7702 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7704 mut self,
7705 v: V,
7706 ) -> Self {
7707 self.0.request = v.into();
7708 self
7709 }
7710
7711 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7713 self.0.options = v.into();
7714 self
7715 }
7716
7717 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7719 (*self.0.stub)
7720 .list_operations(self.0.request, self.0.options)
7721 .await
7722 .map(crate::Response::into_body)
7723 }
7724
7725 pub fn by_page(
7727 self,
7728 ) -> impl google_cloud_gax::paginator::Paginator<
7729 google_cloud_longrunning::model::ListOperationsResponse,
7730 crate::Error,
7731 > {
7732 use std::clone::Clone;
7733 let token = self.0.request.page_token.clone();
7734 let execute = move |token: String| {
7735 let mut builder = self.clone();
7736 builder.0.request = builder.0.request.set_page_token(token);
7737 builder.send()
7738 };
7739 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7740 }
7741
7742 pub fn by_item(
7744 self,
7745 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7746 google_cloud_longrunning::model::ListOperationsResponse,
7747 crate::Error,
7748 > {
7749 use google_cloud_gax::paginator::Paginator;
7750 self.by_page().items()
7751 }
7752
7753 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7755 self.0.request.name = v.into();
7756 self
7757 }
7758
7759 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7761 self.0.request.filter = v.into();
7762 self
7763 }
7764
7765 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7767 self.0.request.page_size = v.into();
7768 self
7769 }
7770
7771 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7773 self.0.request.page_token = v.into();
7774 self
7775 }
7776
7777 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7779 self.0.request.return_partial_success = v.into();
7780 self
7781 }
7782 }
7783
7784 #[doc(hidden)]
7785 impl crate::RequestBuilder for ListOperations {
7786 fn request_options(&mut self) -> &mut crate::RequestOptions {
7787 &mut self.0.options
7788 }
7789 }
7790
7791 #[derive(Clone, Debug)]
7808 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7809
7810 impl GetOperation {
7811 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7812 Self(RequestBuilder::new(stub))
7813 }
7814
7815 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7817 mut self,
7818 v: V,
7819 ) -> Self {
7820 self.0.request = v.into();
7821 self
7822 }
7823
7824 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7826 self.0.options = v.into();
7827 self
7828 }
7829
7830 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7832 (*self.0.stub)
7833 .get_operation(self.0.request, self.0.options)
7834 .await
7835 .map(crate::Response::into_body)
7836 }
7837
7838 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7840 self.0.request.name = v.into();
7841 self
7842 }
7843 }
7844
7845 #[doc(hidden)]
7846 impl crate::RequestBuilder for GetOperation {
7847 fn request_options(&mut self) -> &mut crate::RequestOptions {
7848 &mut self.0.options
7849 }
7850 }
7851
7852 #[derive(Clone, Debug)]
7869 pub struct DeleteOperation(
7870 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7871 );
7872
7873 impl DeleteOperation {
7874 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7875 Self(RequestBuilder::new(stub))
7876 }
7877
7878 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7880 mut self,
7881 v: V,
7882 ) -> Self {
7883 self.0.request = v.into();
7884 self
7885 }
7886
7887 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7889 self.0.options = v.into();
7890 self
7891 }
7892
7893 pub async fn send(self) -> Result<()> {
7895 (*self.0.stub)
7896 .delete_operation(self.0.request, self.0.options)
7897 .await
7898 .map(crate::Response::into_body)
7899 }
7900
7901 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7903 self.0.request.name = v.into();
7904 self
7905 }
7906 }
7907
7908 #[doc(hidden)]
7909 impl crate::RequestBuilder for DeleteOperation {
7910 fn request_options(&mut self) -> &mut crate::RequestOptions {
7911 &mut self.0.options
7912 }
7913 }
7914
7915 #[derive(Clone, Debug)]
7932 pub struct CancelOperation(
7933 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7934 );
7935
7936 impl CancelOperation {
7937 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::NetApp>) -> Self {
7938 Self(RequestBuilder::new(stub))
7939 }
7940
7941 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7943 mut self,
7944 v: V,
7945 ) -> Self {
7946 self.0.request = v.into();
7947 self
7948 }
7949
7950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7952 self.0.options = v.into();
7953 self
7954 }
7955
7956 pub async fn send(self) -> Result<()> {
7958 (*self.0.stub)
7959 .cancel_operation(self.0.request, self.0.options)
7960 .await
7961 .map(crate::Response::into_body)
7962 }
7963
7964 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7966 self.0.request.name = v.into();
7967 self
7968 }
7969 }
7970
7971 #[doc(hidden)]
7972 impl crate::RequestBuilder for CancelOperation {
7973 fn request_options(&mut self) -> &mut crate::RequestOptions {
7974 &mut self.0.options
7975 }
7976 }
7977}