1pub mod parallelstore {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::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 gax::client_builder::internal::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 ) -> gax::client_builder::Result<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: gax::options::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: gax::options::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<gax::options::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(gax::response::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::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 gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
143 {
144 use gax::paginator::Paginator;
145 self.by_page().items()
146 }
147
148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152 self.0.request.parent = v.into();
153 self
154 }
155
156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158 self.0.request.page_size = v.into();
159 self
160 }
161
162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.page_token = v.into();
165 self
166 }
167
168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.filter = v.into();
171 self
172 }
173
174 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.order_by = v.into();
177 self
178 }
179 }
180
181 #[doc(hidden)]
182 impl gax::options::internal::RequestBuilder for ListInstances {
183 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
184 &mut self.0.options
185 }
186 }
187
188 #[derive(Clone, Debug)]
205 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
206
207 impl GetInstance {
208 pub(crate) fn new(
209 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
210 ) -> Self {
211 Self(RequestBuilder::new(stub))
212 }
213
214 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
216 self.0.request = v.into();
217 self
218 }
219
220 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
222 self.0.options = v.into();
223 self
224 }
225
226 pub async fn send(self) -> Result<crate::model::Instance> {
228 (*self.0.stub)
229 .get_instance(self.0.request, self.0.options)
230 .await
231 .map(gax::response::Response::into_body)
232 }
233
234 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238 self.0.request.name = v.into();
239 self
240 }
241 }
242
243 #[doc(hidden)]
244 impl gax::options::internal::RequestBuilder for GetInstance {
245 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
246 &mut self.0.options
247 }
248 }
249
250 #[derive(Clone, Debug)]
268 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
269
270 impl CreateInstance {
271 pub(crate) fn new(
272 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
273 ) -> Self {
274 Self(RequestBuilder::new(stub))
275 }
276
277 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
279 self.0.request = v.into();
280 self
281 }
282
283 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
285 self.0.options = v.into();
286 self
287 }
288
289 pub async fn send(self) -> Result<longrunning::model::Operation> {
296 (*self.0.stub)
297 .create_instance(self.0.request, self.0.options)
298 .await
299 .map(gax::response::Response::into_body)
300 }
301
302 pub fn poller(
304 self,
305 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
306 type Operation =
307 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
308 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
309 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
310
311 let stub = self.0.stub.clone();
312 let mut options = self.0.options.clone();
313 options.set_retry_policy(gax::retry_policy::NeverRetry);
314 let query = move |name| {
315 let stub = stub.clone();
316 let options = options.clone();
317 async {
318 let op = GetOperation::new(stub)
319 .set_name(name)
320 .with_options(options)
321 .send()
322 .await?;
323 Ok(Operation::new(op))
324 }
325 };
326
327 let start = move || async {
328 let op = self.send().await?;
329 Ok(Operation::new(op))
330 };
331
332 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
333 }
334
335 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
339 self.0.request.parent = v.into();
340 self
341 }
342
343 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
347 self.0.request.instance_id = v.into();
348 self
349 }
350
351 pub fn set_instance<T>(mut self, v: T) -> Self
355 where
356 T: std::convert::Into<crate::model::Instance>,
357 {
358 self.0.request.instance = std::option::Option::Some(v.into());
359 self
360 }
361
362 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
366 where
367 T: std::convert::Into<crate::model::Instance>,
368 {
369 self.0.request.instance = v.map(|x| x.into());
370 self
371 }
372
373 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
375 self.0.request.request_id = v.into();
376 self
377 }
378 }
379
380 #[doc(hidden)]
381 impl gax::options::internal::RequestBuilder for CreateInstance {
382 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
383 &mut self.0.options
384 }
385 }
386
387 #[derive(Clone, Debug)]
405 pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
406
407 impl UpdateInstance {
408 pub(crate) fn new(
409 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
410 ) -> Self {
411 Self(RequestBuilder::new(stub))
412 }
413
414 pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
416 self.0.request = v.into();
417 self
418 }
419
420 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
422 self.0.options = v.into();
423 self
424 }
425
426 pub async fn send(self) -> Result<longrunning::model::Operation> {
433 (*self.0.stub)
434 .update_instance(self.0.request, self.0.options)
435 .await
436 .map(gax::response::Response::into_body)
437 }
438
439 pub fn poller(
441 self,
442 ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
443 type Operation =
444 lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
445 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
446 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
447
448 let stub = self.0.stub.clone();
449 let mut options = self.0.options.clone();
450 options.set_retry_policy(gax::retry_policy::NeverRetry);
451 let query = move |name| {
452 let stub = stub.clone();
453 let options = options.clone();
454 async {
455 let op = GetOperation::new(stub)
456 .set_name(name)
457 .with_options(options)
458 .send()
459 .await?;
460 Ok(Operation::new(op))
461 }
462 };
463
464 let start = move || async {
465 let op = self.send().await?;
466 Ok(Operation::new(op))
467 };
468
469 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
470 }
471
472 pub fn set_update_mask<T>(mut self, v: T) -> Self
476 where
477 T: std::convert::Into<wkt::FieldMask>,
478 {
479 self.0.request.update_mask = std::option::Option::Some(v.into());
480 self
481 }
482
483 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
487 where
488 T: std::convert::Into<wkt::FieldMask>,
489 {
490 self.0.request.update_mask = v.map(|x| x.into());
491 self
492 }
493
494 pub fn set_instance<T>(mut self, v: T) -> Self
498 where
499 T: std::convert::Into<crate::model::Instance>,
500 {
501 self.0.request.instance = std::option::Option::Some(v.into());
502 self
503 }
504
505 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
509 where
510 T: std::convert::Into<crate::model::Instance>,
511 {
512 self.0.request.instance = v.map(|x| x.into());
513 self
514 }
515
516 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
518 self.0.request.request_id = v.into();
519 self
520 }
521 }
522
523 #[doc(hidden)]
524 impl gax::options::internal::RequestBuilder for UpdateInstance {
525 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
526 &mut self.0.options
527 }
528 }
529
530 #[derive(Clone, Debug)]
548 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
549
550 impl DeleteInstance {
551 pub(crate) fn new(
552 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
553 ) -> Self {
554 Self(RequestBuilder::new(stub))
555 }
556
557 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
559 self.0.request = v.into();
560 self
561 }
562
563 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
565 self.0.options = v.into();
566 self
567 }
568
569 pub async fn send(self) -> Result<longrunning::model::Operation> {
576 (*self.0.stub)
577 .delete_instance(self.0.request, self.0.options)
578 .await
579 .map(gax::response::Response::into_body)
580 }
581
582 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
584 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
585 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
586 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
587
588 let stub = self.0.stub.clone();
589 let mut options = self.0.options.clone();
590 options.set_retry_policy(gax::retry_policy::NeverRetry);
591 let query = move |name| {
592 let stub = stub.clone();
593 let options = options.clone();
594 async {
595 let op = GetOperation::new(stub)
596 .set_name(name)
597 .with_options(options)
598 .send()
599 .await?;
600 Ok(Operation::new(op))
601 }
602 };
603
604 let start = move || async {
605 let op = self.send().await?;
606 Ok(Operation::new(op))
607 };
608
609 lro::internal::new_unit_response_poller(
610 polling_error_policy,
611 polling_backoff_policy,
612 start,
613 query,
614 )
615 }
616
617 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
621 self.0.request.name = v.into();
622 self
623 }
624
625 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
627 self.0.request.request_id = v.into();
628 self
629 }
630 }
631
632 #[doc(hidden)]
633 impl gax::options::internal::RequestBuilder for DeleteInstance {
634 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
635 &mut self.0.options
636 }
637 }
638
639 #[derive(Clone, Debug)]
657 pub struct ImportData(RequestBuilder<crate::model::ImportDataRequest>);
658
659 impl ImportData {
660 pub(crate) fn new(
661 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
662 ) -> Self {
663 Self(RequestBuilder::new(stub))
664 }
665
666 pub fn with_request<V: Into<crate::model::ImportDataRequest>>(mut self, v: V) -> Self {
668 self.0.request = v.into();
669 self
670 }
671
672 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
674 self.0.options = v.into();
675 self
676 }
677
678 pub async fn send(self) -> Result<longrunning::model::Operation> {
685 (*self.0.stub)
686 .import_data(self.0.request, self.0.options)
687 .await
688 .map(gax::response::Response::into_body)
689 }
690
691 pub fn poller(
693 self,
694 ) -> impl lro::Poller<crate::model::ImportDataResponse, crate::model::ImportDataMetadata>
695 {
696 type Operation = lro::internal::Operation<
697 crate::model::ImportDataResponse,
698 crate::model::ImportDataMetadata,
699 >;
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(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 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
725 }
726
727 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
731 self.0.request.name = v.into();
732 self
733 }
734
735 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
737 self.0.request.request_id = v.into();
738 self
739 }
740
741 pub fn set_service_account<T: Into<std::string::String>>(mut self, v: T) -> Self {
743 self.0.request.service_account = v.into();
744 self
745 }
746
747 pub fn set_metadata_options<T>(mut self, v: T) -> Self
749 where
750 T: std::convert::Into<crate::model::TransferMetadataOptions>,
751 {
752 self.0.request.metadata_options = std::option::Option::Some(v.into());
753 self
754 }
755
756 pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
758 where
759 T: std::convert::Into<crate::model::TransferMetadataOptions>,
760 {
761 self.0.request.metadata_options = v.map(|x| x.into());
762 self
763 }
764
765 pub fn set_source<T: Into<Option<crate::model::import_data_request::Source>>>(
770 mut self,
771 v: T,
772 ) -> Self {
773 self.0.request.source = v.into();
774 self
775 }
776
777 pub fn set_source_gcs_bucket<
783 T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
784 >(
785 mut self,
786 v: T,
787 ) -> Self {
788 self.0.request = self.0.request.set_source_gcs_bucket(v);
789 self
790 }
791
792 pub fn set_destination<T: Into<Option<crate::model::import_data_request::Destination>>>(
797 mut self,
798 v: T,
799 ) -> Self {
800 self.0.request.destination = v.into();
801 self
802 }
803
804 pub fn set_destination_parallelstore<
810 T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
811 >(
812 mut self,
813 v: T,
814 ) -> Self {
815 self.0.request = self.0.request.set_destination_parallelstore(v);
816 self
817 }
818 }
819
820 #[doc(hidden)]
821 impl gax::options::internal::RequestBuilder for ImportData {
822 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
823 &mut self.0.options
824 }
825 }
826
827 #[derive(Clone, Debug)]
845 pub struct ExportData(RequestBuilder<crate::model::ExportDataRequest>);
846
847 impl ExportData {
848 pub(crate) fn new(
849 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
850 ) -> Self {
851 Self(RequestBuilder::new(stub))
852 }
853
854 pub fn with_request<V: Into<crate::model::ExportDataRequest>>(mut self, v: V) -> Self {
856 self.0.request = v.into();
857 self
858 }
859
860 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
862 self.0.options = v.into();
863 self
864 }
865
866 pub async fn send(self) -> Result<longrunning::model::Operation> {
873 (*self.0.stub)
874 .export_data(self.0.request, self.0.options)
875 .await
876 .map(gax::response::Response::into_body)
877 }
878
879 pub fn poller(
881 self,
882 ) -> impl lro::Poller<crate::model::ExportDataResponse, crate::model::ExportDataMetadata>
883 {
884 type Operation = lro::internal::Operation<
885 crate::model::ExportDataResponse,
886 crate::model::ExportDataMetadata,
887 >;
888 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
889 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
890
891 let stub = self.0.stub.clone();
892 let mut options = self.0.options.clone();
893 options.set_retry_policy(gax::retry_policy::NeverRetry);
894 let query = move |name| {
895 let stub = stub.clone();
896 let options = options.clone();
897 async {
898 let op = GetOperation::new(stub)
899 .set_name(name)
900 .with_options(options)
901 .send()
902 .await?;
903 Ok(Operation::new(op))
904 }
905 };
906
907 let start = move || async {
908 let op = self.send().await?;
909 Ok(Operation::new(op))
910 };
911
912 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
913 }
914
915 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
919 self.0.request.name = v.into();
920 self
921 }
922
923 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
925 self.0.request.request_id = v.into();
926 self
927 }
928
929 pub fn set_service_account<T: Into<std::string::String>>(mut self, v: T) -> Self {
931 self.0.request.service_account = v.into();
932 self
933 }
934
935 pub fn set_metadata_options<T>(mut self, v: T) -> Self
937 where
938 T: std::convert::Into<crate::model::TransferMetadataOptions>,
939 {
940 self.0.request.metadata_options = std::option::Option::Some(v.into());
941 self
942 }
943
944 pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
946 where
947 T: std::convert::Into<crate::model::TransferMetadataOptions>,
948 {
949 self.0.request.metadata_options = v.map(|x| x.into());
950 self
951 }
952
953 pub fn set_source<T: Into<Option<crate::model::export_data_request::Source>>>(
958 mut self,
959 v: T,
960 ) -> Self {
961 self.0.request.source = v.into();
962 self
963 }
964
965 pub fn set_source_parallelstore<
971 T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
972 >(
973 mut self,
974 v: T,
975 ) -> Self {
976 self.0.request = self.0.request.set_source_parallelstore(v);
977 self
978 }
979
980 pub fn set_destination<T: Into<Option<crate::model::export_data_request::Destination>>>(
985 mut self,
986 v: T,
987 ) -> Self {
988 self.0.request.destination = v.into();
989 self
990 }
991
992 pub fn set_destination_gcs_bucket<
998 T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
999 >(
1000 mut self,
1001 v: T,
1002 ) -> Self {
1003 self.0.request = self.0.request.set_destination_gcs_bucket(v);
1004 self
1005 }
1006 }
1007
1008 #[doc(hidden)]
1009 impl gax::options::internal::RequestBuilder for ExportData {
1010 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1011 &mut self.0.options
1012 }
1013 }
1014
1015 #[derive(Clone, Debug)]
1036 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1037
1038 impl ListLocations {
1039 pub(crate) fn new(
1040 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1041 ) -> Self {
1042 Self(RequestBuilder::new(stub))
1043 }
1044
1045 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1047 mut self,
1048 v: V,
1049 ) -> Self {
1050 self.0.request = v.into();
1051 self
1052 }
1053
1054 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1056 self.0.options = v.into();
1057 self
1058 }
1059
1060 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1062 (*self.0.stub)
1063 .list_locations(self.0.request, self.0.options)
1064 .await
1065 .map(gax::response::Response::into_body)
1066 }
1067
1068 pub fn by_page(
1070 self,
1071 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1072 {
1073 use std::clone::Clone;
1074 let token = self.0.request.page_token.clone();
1075 let execute = move |token: String| {
1076 let mut builder = self.clone();
1077 builder.0.request = builder.0.request.set_page_token(token);
1078 builder.send()
1079 };
1080 gax::paginator::internal::new_paginator(token, execute)
1081 }
1082
1083 pub fn by_item(
1085 self,
1086 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1087 {
1088 use gax::paginator::Paginator;
1089 self.by_page().items()
1090 }
1091
1092 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1094 self.0.request.name = v.into();
1095 self
1096 }
1097
1098 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1100 self.0.request.filter = v.into();
1101 self
1102 }
1103
1104 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1106 self.0.request.page_size = v.into();
1107 self
1108 }
1109
1110 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1112 self.0.request.page_token = v.into();
1113 self
1114 }
1115 }
1116
1117 #[doc(hidden)]
1118 impl gax::options::internal::RequestBuilder for ListLocations {
1119 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1120 &mut self.0.options
1121 }
1122 }
1123
1124 #[derive(Clone, Debug)]
1141 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1142
1143 impl GetLocation {
1144 pub(crate) fn new(
1145 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1146 ) -> Self {
1147 Self(RequestBuilder::new(stub))
1148 }
1149
1150 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1152 self.0.request = v.into();
1153 self
1154 }
1155
1156 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1158 self.0.options = v.into();
1159 self
1160 }
1161
1162 pub async fn send(self) -> Result<location::model::Location> {
1164 (*self.0.stub)
1165 .get_location(self.0.request, self.0.options)
1166 .await
1167 .map(gax::response::Response::into_body)
1168 }
1169
1170 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1172 self.0.request.name = v.into();
1173 self
1174 }
1175 }
1176
1177 #[doc(hidden)]
1178 impl gax::options::internal::RequestBuilder for GetLocation {
1179 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1180 &mut self.0.options
1181 }
1182 }
1183
1184 #[derive(Clone, Debug)]
1205 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1206
1207 impl ListOperations {
1208 pub(crate) fn new(
1209 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1210 ) -> Self {
1211 Self(RequestBuilder::new(stub))
1212 }
1213
1214 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1216 mut self,
1217 v: V,
1218 ) -> Self {
1219 self.0.request = v.into();
1220 self
1221 }
1222
1223 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1225 self.0.options = v.into();
1226 self
1227 }
1228
1229 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1231 (*self.0.stub)
1232 .list_operations(self.0.request, self.0.options)
1233 .await
1234 .map(gax::response::Response::into_body)
1235 }
1236
1237 pub fn by_page(
1239 self,
1240 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1241 {
1242 use std::clone::Clone;
1243 let token = self.0.request.page_token.clone();
1244 let execute = move |token: String| {
1245 let mut builder = self.clone();
1246 builder.0.request = builder.0.request.set_page_token(token);
1247 builder.send()
1248 };
1249 gax::paginator::internal::new_paginator(token, execute)
1250 }
1251
1252 pub fn by_item(
1254 self,
1255 ) -> impl gax::paginator::ItemPaginator<
1256 longrunning::model::ListOperationsResponse,
1257 gax::error::Error,
1258 > {
1259 use gax::paginator::Paginator;
1260 self.by_page().items()
1261 }
1262
1263 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1265 self.0.request.name = v.into();
1266 self
1267 }
1268
1269 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1271 self.0.request.filter = v.into();
1272 self
1273 }
1274
1275 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1277 self.0.request.page_size = v.into();
1278 self
1279 }
1280
1281 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1283 self.0.request.page_token = v.into();
1284 self
1285 }
1286
1287 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1289 self.0.request.return_partial_success = v.into();
1290 self
1291 }
1292 }
1293
1294 #[doc(hidden)]
1295 impl gax::options::internal::RequestBuilder for ListOperations {
1296 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1297 &mut self.0.options
1298 }
1299 }
1300
1301 #[derive(Clone, Debug)]
1318 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1319
1320 impl GetOperation {
1321 pub(crate) fn new(
1322 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1323 ) -> Self {
1324 Self(RequestBuilder::new(stub))
1325 }
1326
1327 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1329 mut self,
1330 v: V,
1331 ) -> Self {
1332 self.0.request = v.into();
1333 self
1334 }
1335
1336 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1338 self.0.options = v.into();
1339 self
1340 }
1341
1342 pub async fn send(self) -> Result<longrunning::model::Operation> {
1344 (*self.0.stub)
1345 .get_operation(self.0.request, self.0.options)
1346 .await
1347 .map(gax::response::Response::into_body)
1348 }
1349
1350 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1352 self.0.request.name = v.into();
1353 self
1354 }
1355 }
1356
1357 #[doc(hidden)]
1358 impl gax::options::internal::RequestBuilder for GetOperation {
1359 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1360 &mut self.0.options
1361 }
1362 }
1363
1364 #[derive(Clone, Debug)]
1381 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1382
1383 impl DeleteOperation {
1384 pub(crate) fn new(
1385 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1386 ) -> Self {
1387 Self(RequestBuilder::new(stub))
1388 }
1389
1390 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1392 mut self,
1393 v: V,
1394 ) -> Self {
1395 self.0.request = v.into();
1396 self
1397 }
1398
1399 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1401 self.0.options = v.into();
1402 self
1403 }
1404
1405 pub async fn send(self) -> Result<()> {
1407 (*self.0.stub)
1408 .delete_operation(self.0.request, self.0.options)
1409 .await
1410 .map(gax::response::Response::into_body)
1411 }
1412
1413 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1415 self.0.request.name = v.into();
1416 self
1417 }
1418 }
1419
1420 #[doc(hidden)]
1421 impl gax::options::internal::RequestBuilder for DeleteOperation {
1422 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1423 &mut self.0.options
1424 }
1425 }
1426
1427 #[derive(Clone, Debug)]
1444 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1445
1446 impl CancelOperation {
1447 pub(crate) fn new(
1448 stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1449 ) -> Self {
1450 Self(RequestBuilder::new(stub))
1451 }
1452
1453 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1455 mut self,
1456 v: V,
1457 ) -> Self {
1458 self.0.request = v.into();
1459 self
1460 }
1461
1462 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1464 self.0.options = v.into();
1465 self
1466 }
1467
1468 pub async fn send(self) -> Result<()> {
1470 (*self.0.stub)
1471 .cancel_operation(self.0.request, self.0.options)
1472 .await
1473 .map(gax::response::Response::into_body)
1474 }
1475
1476 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1478 self.0.request.name = v.into();
1479 self
1480 }
1481 }
1482
1483 #[doc(hidden)]
1484 impl gax::options::internal::RequestBuilder for CancelOperation {
1485 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1486 &mut self.0.options
1487 }
1488 }
1489}