1pub mod parallelstore {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Parallelstore;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = Parallelstore;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
96
97 impl ListInstances {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
118 (*self.0.stub)
119 .list_instances(self.0.request, self.0.options)
120 .await
121 .map(crate::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 google_cloud_gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl google_cloud_gax::paginator::ItemPaginator<
143 crate::model::ListInstancesResponse,
144 crate::Error,
145 > {
146 use google_cloud_gax::paginator::Paginator;
147 self.by_page().items()
148 }
149
150 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154 self.0.request.parent = v.into();
155 self
156 }
157
158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160 self.0.request.page_size = v.into();
161 self
162 }
163
164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
166 self.0.request.page_token = v.into();
167 self
168 }
169
170 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.filter = v.into();
173 self
174 }
175
176 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
178 self.0.request.order_by = v.into();
179 self
180 }
181 }
182
183 #[doc(hidden)]
184 impl crate::RequestBuilder for ListInstances {
185 fn request_options(&mut self) -> &mut crate::RequestOptions {
186 &mut self.0.options
187 }
188 }
189
190 #[derive(Clone, Debug)]
207 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
208
209 impl GetInstance {
210 pub(crate) fn new(
211 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
212 ) -> Self {
213 Self(RequestBuilder::new(stub))
214 }
215
216 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
218 self.0.request = v.into();
219 self
220 }
221
222 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
224 self.0.options = v.into();
225 self
226 }
227
228 pub async fn send(self) -> Result<crate::model::Instance> {
230 (*self.0.stub)
231 .get_instance(self.0.request, self.0.options)
232 .await
233 .map(crate::Response::into_body)
234 }
235
236 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240 self.0.request.name = v.into();
241 self
242 }
243 }
244
245 #[doc(hidden)]
246 impl crate::RequestBuilder for GetInstance {
247 fn request_options(&mut self) -> &mut crate::RequestOptions {
248 &mut self.0.options
249 }
250 }
251
252 #[derive(Clone, Debug)]
270 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
271
272 impl CreateInstance {
273 pub(crate) fn new(
274 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
275 ) -> Self {
276 Self(RequestBuilder::new(stub))
277 }
278
279 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
281 self.0.request = v.into();
282 self
283 }
284
285 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
287 self.0.options = v.into();
288 self
289 }
290
291 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
298 (*self.0.stub)
299 .create_instance(self.0.request, self.0.options)
300 .await
301 .map(crate::Response::into_body)
302 }
303
304 pub fn poller(
306 self,
307 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
308 {
309 type Operation = google_cloud_lro::internal::Operation<
310 crate::model::Instance,
311 crate::model::OperationMetadata,
312 >;
313 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
314 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
315 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
316 if let Some(ref mut details) = poller_options.tracing {
317 details.method_name = "google_cloud_parallelstore_v1::client::Parallelstore::create_instance::until_done";
318 }
319
320 let stub = self.0.stub.clone();
321 let mut options = self.0.options.clone();
322 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
323 let query = move |name| {
324 let stub = stub.clone();
325 let options = options.clone();
326 async {
327 let op = GetOperation::new(stub)
328 .set_name(name)
329 .with_options(options)
330 .send()
331 .await?;
332 Ok(Operation::new(op))
333 }
334 };
335
336 let start = move || async {
337 let op = self.send().await?;
338 Ok(Operation::new(op))
339 };
340
341 use google_cloud_lro::internal::PollerExt;
342 {
343 google_cloud_lro::internal::new_poller(
344 polling_error_policy,
345 polling_backoff_policy,
346 start,
347 query,
348 )
349 }
350 .with_options(poller_options)
351 }
352
353 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
357 self.0.request.parent = v.into();
358 self
359 }
360
361 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
365 self.0.request.instance_id = v.into();
366 self
367 }
368
369 pub fn set_instance<T>(mut self, v: T) -> Self
373 where
374 T: std::convert::Into<crate::model::Instance>,
375 {
376 self.0.request.instance = std::option::Option::Some(v.into());
377 self
378 }
379
380 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
384 where
385 T: std::convert::Into<crate::model::Instance>,
386 {
387 self.0.request.instance = v.map(|x| x.into());
388 self
389 }
390
391 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
393 self.0.request.request_id = v.into();
394 self
395 }
396 }
397
398 #[doc(hidden)]
399 impl crate::RequestBuilder for CreateInstance {
400 fn request_options(&mut self) -> &mut crate::RequestOptions {
401 &mut self.0.options
402 }
403 }
404
405 #[derive(Clone, Debug)]
423 pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
424
425 impl UpdateInstance {
426 pub(crate) fn new(
427 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
428 ) -> Self {
429 Self(RequestBuilder::new(stub))
430 }
431
432 pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
434 self.0.request = v.into();
435 self
436 }
437
438 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
440 self.0.options = v.into();
441 self
442 }
443
444 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
451 (*self.0.stub)
452 .update_instance(self.0.request, self.0.options)
453 .await
454 .map(crate::Response::into_body)
455 }
456
457 pub fn poller(
459 self,
460 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
461 {
462 type Operation = google_cloud_lro::internal::Operation<
463 crate::model::Instance,
464 crate::model::OperationMetadata,
465 >;
466 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
467 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
468 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
469 if let Some(ref mut details) = poller_options.tracing {
470 details.method_name = "google_cloud_parallelstore_v1::client::Parallelstore::update_instance::until_done";
471 }
472
473 let stub = self.0.stub.clone();
474 let mut options = self.0.options.clone();
475 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
476 let query = move |name| {
477 let stub = stub.clone();
478 let options = options.clone();
479 async {
480 let op = GetOperation::new(stub)
481 .set_name(name)
482 .with_options(options)
483 .send()
484 .await?;
485 Ok(Operation::new(op))
486 }
487 };
488
489 let start = move || async {
490 let op = self.send().await?;
491 Ok(Operation::new(op))
492 };
493
494 use google_cloud_lro::internal::PollerExt;
495 {
496 google_cloud_lro::internal::new_poller(
497 polling_error_policy,
498 polling_backoff_policy,
499 start,
500 query,
501 )
502 }
503 .with_options(poller_options)
504 }
505
506 pub fn set_update_mask<T>(mut self, v: T) -> Self
510 where
511 T: std::convert::Into<wkt::FieldMask>,
512 {
513 self.0.request.update_mask = std::option::Option::Some(v.into());
514 self
515 }
516
517 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
521 where
522 T: std::convert::Into<wkt::FieldMask>,
523 {
524 self.0.request.update_mask = v.map(|x| x.into());
525 self
526 }
527
528 pub fn set_instance<T>(mut self, v: T) -> Self
532 where
533 T: std::convert::Into<crate::model::Instance>,
534 {
535 self.0.request.instance = std::option::Option::Some(v.into());
536 self
537 }
538
539 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
543 where
544 T: std::convert::Into<crate::model::Instance>,
545 {
546 self.0.request.instance = v.map(|x| x.into());
547 self
548 }
549
550 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
552 self.0.request.request_id = v.into();
553 self
554 }
555 }
556
557 #[doc(hidden)]
558 impl crate::RequestBuilder for UpdateInstance {
559 fn request_options(&mut self) -> &mut crate::RequestOptions {
560 &mut self.0.options
561 }
562 }
563
564 #[derive(Clone, Debug)]
582 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
583
584 impl DeleteInstance {
585 pub(crate) fn new(
586 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
587 ) -> Self {
588 Self(RequestBuilder::new(stub))
589 }
590
591 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
593 self.0.request = v.into();
594 self
595 }
596
597 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
599 self.0.options = v.into();
600 self
601 }
602
603 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
610 (*self.0.stub)
611 .delete_instance(self.0.request, self.0.options)
612 .await
613 .map(crate::Response::into_body)
614 }
615
616 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
618 type Operation =
619 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
620 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
621 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
622 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
623 if let Some(ref mut details) = poller_options.tracing {
624 details.method_name = "google_cloud_parallelstore_v1::client::Parallelstore::delete_instance::until_done";
625 }
626
627 let stub = self.0.stub.clone();
628 let mut options = self.0.options.clone();
629 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
630 let query = move |name| {
631 let stub = stub.clone();
632 let options = options.clone();
633 async {
634 let op = GetOperation::new(stub)
635 .set_name(name)
636 .with_options(options)
637 .send()
638 .await?;
639 Ok(Operation::new(op))
640 }
641 };
642
643 let start = move || async {
644 let op = self.send().await?;
645 Ok(Operation::new(op))
646 };
647
648 use google_cloud_lro::internal::PollerExt;
649 {
650 google_cloud_lro::internal::new_unit_response_poller(
651 polling_error_policy,
652 polling_backoff_policy,
653 start,
654 query,
655 )
656 }
657 .with_options(poller_options)
658 }
659
660 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
664 self.0.request.name = v.into();
665 self
666 }
667
668 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
670 self.0.request.request_id = v.into();
671 self
672 }
673 }
674
675 #[doc(hidden)]
676 impl crate::RequestBuilder for DeleteInstance {
677 fn request_options(&mut self) -> &mut crate::RequestOptions {
678 &mut self.0.options
679 }
680 }
681
682 #[derive(Clone, Debug)]
700 pub struct ImportData(RequestBuilder<crate::model::ImportDataRequest>);
701
702 impl ImportData {
703 pub(crate) fn new(
704 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
705 ) -> Self {
706 Self(RequestBuilder::new(stub))
707 }
708
709 pub fn with_request<V: Into<crate::model::ImportDataRequest>>(mut self, v: V) -> Self {
711 self.0.request = v.into();
712 self
713 }
714
715 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
717 self.0.options = v.into();
718 self
719 }
720
721 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
728 (*self.0.stub)
729 .import_data(self.0.request, self.0.options)
730 .await
731 .map(crate::Response::into_body)
732 }
733
734 pub fn poller(
736 self,
737 ) -> impl google_cloud_lro::Poller<
738 crate::model::ImportDataResponse,
739 crate::model::ImportDataMetadata,
740 > {
741 type Operation = google_cloud_lro::internal::Operation<
742 crate::model::ImportDataResponse,
743 crate::model::ImportDataMetadata,
744 >;
745 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
746 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
747 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
748 if let Some(ref mut details) = poller_options.tracing {
749 details.method_name =
750 "google_cloud_parallelstore_v1::client::Parallelstore::import_data::until_done";
751 }
752
753 let stub = self.0.stub.clone();
754 let mut options = self.0.options.clone();
755 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
756 let query = move |name| {
757 let stub = stub.clone();
758 let options = options.clone();
759 async {
760 let op = GetOperation::new(stub)
761 .set_name(name)
762 .with_options(options)
763 .send()
764 .await?;
765 Ok(Operation::new(op))
766 }
767 };
768
769 let start = move || async {
770 let op = self.send().await?;
771 Ok(Operation::new(op))
772 };
773
774 use google_cloud_lro::internal::PollerExt;
775 {
776 google_cloud_lro::internal::new_poller(
777 polling_error_policy,
778 polling_backoff_policy,
779 start,
780 query,
781 )
782 }
783 .with_options(poller_options)
784 }
785
786 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
790 self.0.request.name = v.into();
791 self
792 }
793
794 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
796 self.0.request.request_id = v.into();
797 self
798 }
799
800 pub fn set_service_account<T: Into<std::string::String>>(mut self, v: T) -> Self {
802 self.0.request.service_account = v.into();
803 self
804 }
805
806 pub fn set_metadata_options<T>(mut self, v: T) -> Self
808 where
809 T: std::convert::Into<crate::model::TransferMetadataOptions>,
810 {
811 self.0.request.metadata_options = std::option::Option::Some(v.into());
812 self
813 }
814
815 pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
817 where
818 T: std::convert::Into<crate::model::TransferMetadataOptions>,
819 {
820 self.0.request.metadata_options = v.map(|x| x.into());
821 self
822 }
823
824 pub fn set_source<T: Into<Option<crate::model::import_data_request::Source>>>(
829 mut self,
830 v: T,
831 ) -> Self {
832 self.0.request.source = v.into();
833 self
834 }
835
836 pub fn set_source_gcs_bucket<
842 T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
843 >(
844 mut self,
845 v: T,
846 ) -> Self {
847 self.0.request = self.0.request.set_source_gcs_bucket(v);
848 self
849 }
850
851 pub fn set_destination<T: Into<Option<crate::model::import_data_request::Destination>>>(
856 mut self,
857 v: T,
858 ) -> Self {
859 self.0.request.destination = v.into();
860 self
861 }
862
863 pub fn set_destination_parallelstore<
869 T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
870 >(
871 mut self,
872 v: T,
873 ) -> Self {
874 self.0.request = self.0.request.set_destination_parallelstore(v);
875 self
876 }
877 }
878
879 #[doc(hidden)]
880 impl crate::RequestBuilder for ImportData {
881 fn request_options(&mut self) -> &mut crate::RequestOptions {
882 &mut self.0.options
883 }
884 }
885
886 #[derive(Clone, Debug)]
904 pub struct ExportData(RequestBuilder<crate::model::ExportDataRequest>);
905
906 impl ExportData {
907 pub(crate) fn new(
908 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
909 ) -> Self {
910 Self(RequestBuilder::new(stub))
911 }
912
913 pub fn with_request<V: Into<crate::model::ExportDataRequest>>(mut self, v: V) -> Self {
915 self.0.request = v.into();
916 self
917 }
918
919 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
921 self.0.options = v.into();
922 self
923 }
924
925 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
932 (*self.0.stub)
933 .export_data(self.0.request, self.0.options)
934 .await
935 .map(crate::Response::into_body)
936 }
937
938 pub fn poller(
940 self,
941 ) -> impl google_cloud_lro::Poller<
942 crate::model::ExportDataResponse,
943 crate::model::ExportDataMetadata,
944 > {
945 type Operation = google_cloud_lro::internal::Operation<
946 crate::model::ExportDataResponse,
947 crate::model::ExportDataMetadata,
948 >;
949 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
950 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
951 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
952 if let Some(ref mut details) = poller_options.tracing {
953 details.method_name =
954 "google_cloud_parallelstore_v1::client::Parallelstore::export_data::until_done";
955 }
956
957 let stub = self.0.stub.clone();
958 let mut options = self.0.options.clone();
959 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
960 let query = move |name| {
961 let stub = stub.clone();
962 let options = options.clone();
963 async {
964 let op = GetOperation::new(stub)
965 .set_name(name)
966 .with_options(options)
967 .send()
968 .await?;
969 Ok(Operation::new(op))
970 }
971 };
972
973 let start = move || async {
974 let op = self.send().await?;
975 Ok(Operation::new(op))
976 };
977
978 use google_cloud_lro::internal::PollerExt;
979 {
980 google_cloud_lro::internal::new_poller(
981 polling_error_policy,
982 polling_backoff_policy,
983 start,
984 query,
985 )
986 }
987 .with_options(poller_options)
988 }
989
990 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
994 self.0.request.name = v.into();
995 self
996 }
997
998 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1000 self.0.request.request_id = v.into();
1001 self
1002 }
1003
1004 pub fn set_service_account<T: Into<std::string::String>>(mut self, v: T) -> Self {
1006 self.0.request.service_account = v.into();
1007 self
1008 }
1009
1010 pub fn set_metadata_options<T>(mut self, v: T) -> Self
1012 where
1013 T: std::convert::Into<crate::model::TransferMetadataOptions>,
1014 {
1015 self.0.request.metadata_options = std::option::Option::Some(v.into());
1016 self
1017 }
1018
1019 pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
1021 where
1022 T: std::convert::Into<crate::model::TransferMetadataOptions>,
1023 {
1024 self.0.request.metadata_options = v.map(|x| x.into());
1025 self
1026 }
1027
1028 pub fn set_source<T: Into<Option<crate::model::export_data_request::Source>>>(
1033 mut self,
1034 v: T,
1035 ) -> Self {
1036 self.0.request.source = v.into();
1037 self
1038 }
1039
1040 pub fn set_source_parallelstore<
1046 T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
1047 >(
1048 mut self,
1049 v: T,
1050 ) -> Self {
1051 self.0.request = self.0.request.set_source_parallelstore(v);
1052 self
1053 }
1054
1055 pub fn set_destination<T: Into<Option<crate::model::export_data_request::Destination>>>(
1060 mut self,
1061 v: T,
1062 ) -> Self {
1063 self.0.request.destination = v.into();
1064 self
1065 }
1066
1067 pub fn set_destination_gcs_bucket<
1073 T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
1074 >(
1075 mut self,
1076 v: T,
1077 ) -> Self {
1078 self.0.request = self.0.request.set_destination_gcs_bucket(v);
1079 self
1080 }
1081 }
1082
1083 #[doc(hidden)]
1084 impl crate::RequestBuilder for ExportData {
1085 fn request_options(&mut self) -> &mut crate::RequestOptions {
1086 &mut self.0.options
1087 }
1088 }
1089
1090 #[derive(Clone, Debug)]
1111 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1112
1113 impl ListLocations {
1114 pub(crate) fn new(
1115 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1116 ) -> Self {
1117 Self(RequestBuilder::new(stub))
1118 }
1119
1120 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1122 mut self,
1123 v: V,
1124 ) -> Self {
1125 self.0.request = v.into();
1126 self
1127 }
1128
1129 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1131 self.0.options = v.into();
1132 self
1133 }
1134
1135 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1137 (*self.0.stub)
1138 .list_locations(self.0.request, self.0.options)
1139 .await
1140 .map(crate::Response::into_body)
1141 }
1142
1143 pub fn by_page(
1145 self,
1146 ) -> impl google_cloud_gax::paginator::Paginator<
1147 google_cloud_location::model::ListLocationsResponse,
1148 crate::Error,
1149 > {
1150 use std::clone::Clone;
1151 let token = self.0.request.page_token.clone();
1152 let execute = move |token: String| {
1153 let mut builder = self.clone();
1154 builder.0.request = builder.0.request.set_page_token(token);
1155 builder.send()
1156 };
1157 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1158 }
1159
1160 pub fn by_item(
1162 self,
1163 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1164 google_cloud_location::model::ListLocationsResponse,
1165 crate::Error,
1166 > {
1167 use google_cloud_gax::paginator::Paginator;
1168 self.by_page().items()
1169 }
1170
1171 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1173 self.0.request.name = v.into();
1174 self
1175 }
1176
1177 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1179 self.0.request.filter = v.into();
1180 self
1181 }
1182
1183 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1185 self.0.request.page_size = v.into();
1186 self
1187 }
1188
1189 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1191 self.0.request.page_token = v.into();
1192 self
1193 }
1194 }
1195
1196 #[doc(hidden)]
1197 impl crate::RequestBuilder for ListLocations {
1198 fn request_options(&mut self) -> &mut crate::RequestOptions {
1199 &mut self.0.options
1200 }
1201 }
1202
1203 #[derive(Clone, Debug)]
1220 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1221
1222 impl GetLocation {
1223 pub(crate) fn new(
1224 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1225 ) -> Self {
1226 Self(RequestBuilder::new(stub))
1227 }
1228
1229 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1231 mut self,
1232 v: V,
1233 ) -> Self {
1234 self.0.request = v.into();
1235 self
1236 }
1237
1238 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1240 self.0.options = v.into();
1241 self
1242 }
1243
1244 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1246 (*self.0.stub)
1247 .get_location(self.0.request, self.0.options)
1248 .await
1249 .map(crate::Response::into_body)
1250 }
1251
1252 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1254 self.0.request.name = v.into();
1255 self
1256 }
1257 }
1258
1259 #[doc(hidden)]
1260 impl crate::RequestBuilder for GetLocation {
1261 fn request_options(&mut self) -> &mut crate::RequestOptions {
1262 &mut self.0.options
1263 }
1264 }
1265
1266 #[derive(Clone, Debug)]
1287 pub struct ListOperations(
1288 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1289 );
1290
1291 impl ListOperations {
1292 pub(crate) fn new(
1293 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1294 ) -> Self {
1295 Self(RequestBuilder::new(stub))
1296 }
1297
1298 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1300 mut self,
1301 v: V,
1302 ) -> Self {
1303 self.0.request = v.into();
1304 self
1305 }
1306
1307 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1309 self.0.options = v.into();
1310 self
1311 }
1312
1313 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1315 (*self.0.stub)
1316 .list_operations(self.0.request, self.0.options)
1317 .await
1318 .map(crate::Response::into_body)
1319 }
1320
1321 pub fn by_page(
1323 self,
1324 ) -> impl google_cloud_gax::paginator::Paginator<
1325 google_cloud_longrunning::model::ListOperationsResponse,
1326 crate::Error,
1327 > {
1328 use std::clone::Clone;
1329 let token = self.0.request.page_token.clone();
1330 let execute = move |token: String| {
1331 let mut builder = self.clone();
1332 builder.0.request = builder.0.request.set_page_token(token);
1333 builder.send()
1334 };
1335 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1336 }
1337
1338 pub fn by_item(
1340 self,
1341 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1342 google_cloud_longrunning::model::ListOperationsResponse,
1343 crate::Error,
1344 > {
1345 use google_cloud_gax::paginator::Paginator;
1346 self.by_page().items()
1347 }
1348
1349 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1351 self.0.request.name = v.into();
1352 self
1353 }
1354
1355 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1357 self.0.request.filter = v.into();
1358 self
1359 }
1360
1361 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1363 self.0.request.page_size = v.into();
1364 self
1365 }
1366
1367 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1369 self.0.request.page_token = v.into();
1370 self
1371 }
1372
1373 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1375 self.0.request.return_partial_success = v.into();
1376 self
1377 }
1378 }
1379
1380 #[doc(hidden)]
1381 impl crate::RequestBuilder for ListOperations {
1382 fn request_options(&mut self) -> &mut crate::RequestOptions {
1383 &mut self.0.options
1384 }
1385 }
1386
1387 #[derive(Clone, Debug)]
1404 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1405
1406 impl GetOperation {
1407 pub(crate) fn new(
1408 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1409 ) -> Self {
1410 Self(RequestBuilder::new(stub))
1411 }
1412
1413 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1415 mut self,
1416 v: V,
1417 ) -> Self {
1418 self.0.request = v.into();
1419 self
1420 }
1421
1422 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1424 self.0.options = v.into();
1425 self
1426 }
1427
1428 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1430 (*self.0.stub)
1431 .get_operation(self.0.request, self.0.options)
1432 .await
1433 .map(crate::Response::into_body)
1434 }
1435
1436 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1438 self.0.request.name = v.into();
1439 self
1440 }
1441 }
1442
1443 #[doc(hidden)]
1444 impl crate::RequestBuilder for GetOperation {
1445 fn request_options(&mut self) -> &mut crate::RequestOptions {
1446 &mut self.0.options
1447 }
1448 }
1449
1450 #[derive(Clone, Debug)]
1467 pub struct DeleteOperation(
1468 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1469 );
1470
1471 impl DeleteOperation {
1472 pub(crate) fn new(
1473 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1474 ) -> Self {
1475 Self(RequestBuilder::new(stub))
1476 }
1477
1478 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1480 mut self,
1481 v: V,
1482 ) -> Self {
1483 self.0.request = v.into();
1484 self
1485 }
1486
1487 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1489 self.0.options = v.into();
1490 self
1491 }
1492
1493 pub async fn send(self) -> Result<()> {
1495 (*self.0.stub)
1496 .delete_operation(self.0.request, self.0.options)
1497 .await
1498 .map(crate::Response::into_body)
1499 }
1500
1501 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1503 self.0.request.name = v.into();
1504 self
1505 }
1506 }
1507
1508 #[doc(hidden)]
1509 impl crate::RequestBuilder for DeleteOperation {
1510 fn request_options(&mut self) -> &mut crate::RequestOptions {
1511 &mut self.0.options
1512 }
1513 }
1514
1515 #[derive(Clone, Debug)]
1532 pub struct CancelOperation(
1533 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1534 );
1535
1536 impl CancelOperation {
1537 pub(crate) fn new(
1538 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1539 ) -> Self {
1540 Self(RequestBuilder::new(stub))
1541 }
1542
1543 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1545 mut self,
1546 v: V,
1547 ) -> Self {
1548 self.0.request = v.into();
1549 self
1550 }
1551
1552 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1554 self.0.options = v.into();
1555 self
1556 }
1557
1558 pub async fn send(self) -> Result<()> {
1560 (*self.0.stub)
1561 .cancel_operation(self.0.request, self.0.options)
1562 .await
1563 .map(crate::Response::into_body)
1564 }
1565
1566 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1568 self.0.request.name = v.into();
1569 self
1570 }
1571 }
1572
1573 #[doc(hidden)]
1574 impl crate::RequestBuilder for CancelOperation {
1575 fn request_options(&mut self) -> &mut crate::RequestOptions {
1576 &mut self.0.options
1577 }
1578 }
1579}