1pub mod business_glossary_service {
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::BusinessGlossaryService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = BusinessGlossaryService;
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::BusinessGlossaryService>,
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::BusinessGlossaryService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
92 pub struct CreateGlossary(RequestBuilder<crate::model::CreateGlossaryRequest>);
93
94 impl CreateGlossary {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::CreateGlossaryRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<longrunning::model::Operation> {
120 (*self.0.stub)
121 .create_glossary(self.0.request, self.0.options)
122 .await
123 .map(gax::response::Response::into_body)
124 }
125
126 pub fn poller(
128 self,
129 ) -> impl lro::Poller<crate::model::Glossary, crate::model::OperationMetadata> {
130 type Operation =
131 lro::internal::Operation<crate::model::Glossary, crate::model::OperationMetadata>;
132 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
133 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
134
135 let stub = self.0.stub.clone();
136 let mut options = self.0.options.clone();
137 options.set_retry_policy(gax::retry_policy::NeverRetry);
138 let query = move |name| {
139 let stub = stub.clone();
140 let options = options.clone();
141 async {
142 let op = GetOperation::new(stub)
143 .set_name(name)
144 .with_options(options)
145 .send()
146 .await?;
147 Ok(Operation::new(op))
148 }
149 };
150
151 let start = move || async {
152 let op = self.send().await?;
153 Ok(Operation::new(op))
154 };
155
156 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
157 }
158
159 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
163 self.0.request.parent = v.into();
164 self
165 }
166
167 pub fn set_glossary_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.glossary_id = v.into();
172 self
173 }
174
175 pub fn set_glossary<T>(mut self, v: T) -> Self
179 where
180 T: std::convert::Into<crate::model::Glossary>,
181 {
182 self.0.request.glossary = std::option::Option::Some(v.into());
183 self
184 }
185
186 pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
190 where
191 T: std::convert::Into<crate::model::Glossary>,
192 {
193 self.0.request.glossary = v.map(|x| x.into());
194 self
195 }
196
197 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
199 self.0.request.validate_only = v.into();
200 self
201 }
202 }
203
204 #[doc(hidden)]
205 impl gax::options::internal::RequestBuilder for CreateGlossary {
206 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
207 &mut self.0.options
208 }
209 }
210
211 #[derive(Clone, Debug)]
229 pub struct UpdateGlossary(RequestBuilder<crate::model::UpdateGlossaryRequest>);
230
231 impl UpdateGlossary {
232 pub(crate) fn new(
233 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
234 ) -> Self {
235 Self(RequestBuilder::new(stub))
236 }
237
238 pub fn with_request<V: Into<crate::model::UpdateGlossaryRequest>>(mut self, v: V) -> Self {
240 self.0.request = v.into();
241 self
242 }
243
244 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
246 self.0.options = v.into();
247 self
248 }
249
250 pub async fn send(self) -> Result<longrunning::model::Operation> {
257 (*self.0.stub)
258 .update_glossary(self.0.request, self.0.options)
259 .await
260 .map(gax::response::Response::into_body)
261 }
262
263 pub fn poller(
265 self,
266 ) -> impl lro::Poller<crate::model::Glossary, crate::model::OperationMetadata> {
267 type Operation =
268 lro::internal::Operation<crate::model::Glossary, crate::model::OperationMetadata>;
269 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
270 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
271
272 let stub = self.0.stub.clone();
273 let mut options = self.0.options.clone();
274 options.set_retry_policy(gax::retry_policy::NeverRetry);
275 let query = move |name| {
276 let stub = stub.clone();
277 let options = options.clone();
278 async {
279 let op = GetOperation::new(stub)
280 .set_name(name)
281 .with_options(options)
282 .send()
283 .await?;
284 Ok(Operation::new(op))
285 }
286 };
287
288 let start = move || async {
289 let op = self.send().await?;
290 Ok(Operation::new(op))
291 };
292
293 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
294 }
295
296 pub fn set_glossary<T>(mut self, v: T) -> Self
300 where
301 T: std::convert::Into<crate::model::Glossary>,
302 {
303 self.0.request.glossary = std::option::Option::Some(v.into());
304 self
305 }
306
307 pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
311 where
312 T: std::convert::Into<crate::model::Glossary>,
313 {
314 self.0.request.glossary = v.map(|x| x.into());
315 self
316 }
317
318 pub fn set_update_mask<T>(mut self, v: T) -> Self
322 where
323 T: std::convert::Into<wkt::FieldMask>,
324 {
325 self.0.request.update_mask = std::option::Option::Some(v.into());
326 self
327 }
328
329 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
333 where
334 T: std::convert::Into<wkt::FieldMask>,
335 {
336 self.0.request.update_mask = v.map(|x| x.into());
337 self
338 }
339
340 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
342 self.0.request.validate_only = v.into();
343 self
344 }
345 }
346
347 #[doc(hidden)]
348 impl gax::options::internal::RequestBuilder for UpdateGlossary {
349 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
350 &mut self.0.options
351 }
352 }
353
354 #[derive(Clone, Debug)]
372 pub struct DeleteGlossary(RequestBuilder<crate::model::DeleteGlossaryRequest>);
373
374 impl DeleteGlossary {
375 pub(crate) fn new(
376 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
377 ) -> Self {
378 Self(RequestBuilder::new(stub))
379 }
380
381 pub fn with_request<V: Into<crate::model::DeleteGlossaryRequest>>(mut self, v: V) -> Self {
383 self.0.request = v.into();
384 self
385 }
386
387 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
389 self.0.options = v.into();
390 self
391 }
392
393 pub async fn send(self) -> Result<longrunning::model::Operation> {
400 (*self.0.stub)
401 .delete_glossary(self.0.request, self.0.options)
402 .await
403 .map(gax::response::Response::into_body)
404 }
405
406 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
408 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
409 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
410 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
411
412 let stub = self.0.stub.clone();
413 let mut options = self.0.options.clone();
414 options.set_retry_policy(gax::retry_policy::NeverRetry);
415 let query = move |name| {
416 let stub = stub.clone();
417 let options = options.clone();
418 async {
419 let op = GetOperation::new(stub)
420 .set_name(name)
421 .with_options(options)
422 .send()
423 .await?;
424 Ok(Operation::new(op))
425 }
426 };
427
428 let start = move || async {
429 let op = self.send().await?;
430 Ok(Operation::new(op))
431 };
432
433 lro::internal::new_unit_response_poller(
434 polling_error_policy,
435 polling_backoff_policy,
436 start,
437 query,
438 )
439 }
440
441 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
445 self.0.request.name = v.into();
446 self
447 }
448
449 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
451 self.0.request.etag = v.into();
452 self
453 }
454 }
455
456 #[doc(hidden)]
457 impl gax::options::internal::RequestBuilder for DeleteGlossary {
458 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
459 &mut self.0.options
460 }
461 }
462
463 #[derive(Clone, Debug)]
480 pub struct GetGlossary(RequestBuilder<crate::model::GetGlossaryRequest>);
481
482 impl GetGlossary {
483 pub(crate) fn new(
484 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
485 ) -> Self {
486 Self(RequestBuilder::new(stub))
487 }
488
489 pub fn with_request<V: Into<crate::model::GetGlossaryRequest>>(mut self, v: V) -> Self {
491 self.0.request = v.into();
492 self
493 }
494
495 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
497 self.0.options = v.into();
498 self
499 }
500
501 pub async fn send(self) -> Result<crate::model::Glossary> {
503 (*self.0.stub)
504 .get_glossary(self.0.request, self.0.options)
505 .await
506 .map(gax::response::Response::into_body)
507 }
508
509 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
513 self.0.request.name = v.into();
514 self
515 }
516 }
517
518 #[doc(hidden)]
519 impl gax::options::internal::RequestBuilder for GetGlossary {
520 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
521 &mut self.0.options
522 }
523 }
524
525 #[derive(Clone, Debug)]
546 pub struct ListGlossaries(RequestBuilder<crate::model::ListGlossariesRequest>);
547
548 impl ListGlossaries {
549 pub(crate) fn new(
550 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
551 ) -> Self {
552 Self(RequestBuilder::new(stub))
553 }
554
555 pub fn with_request<V: Into<crate::model::ListGlossariesRequest>>(mut self, v: V) -> Self {
557 self.0.request = v.into();
558 self
559 }
560
561 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
563 self.0.options = v.into();
564 self
565 }
566
567 pub async fn send(self) -> Result<crate::model::ListGlossariesResponse> {
569 (*self.0.stub)
570 .list_glossaries(self.0.request, self.0.options)
571 .await
572 .map(gax::response::Response::into_body)
573 }
574
575 pub fn by_page(
577 self,
578 ) -> impl gax::paginator::Paginator<crate::model::ListGlossariesResponse, gax::error::Error>
579 {
580 use std::clone::Clone;
581 let token = self.0.request.page_token.clone();
582 let execute = move |token: String| {
583 let mut builder = self.clone();
584 builder.0.request = builder.0.request.set_page_token(token);
585 builder.send()
586 };
587 gax::paginator::internal::new_paginator(token, execute)
588 }
589
590 pub fn by_item(
592 self,
593 ) -> impl gax::paginator::ItemPaginator<crate::model::ListGlossariesResponse, gax::error::Error>
594 {
595 use gax::paginator::Paginator;
596 self.by_page().items()
597 }
598
599 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
603 self.0.request.parent = v.into();
604 self
605 }
606
607 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
609 self.0.request.page_size = v.into();
610 self
611 }
612
613 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
615 self.0.request.page_token = v.into();
616 self
617 }
618
619 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
621 self.0.request.filter = v.into();
622 self
623 }
624
625 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
627 self.0.request.order_by = v.into();
628 self
629 }
630 }
631
632 #[doc(hidden)]
633 impl gax::options::internal::RequestBuilder for ListGlossaries {
634 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
635 &mut self.0.options
636 }
637 }
638
639 #[derive(Clone, Debug)]
656 pub struct CreateGlossaryCategory(RequestBuilder<crate::model::CreateGlossaryCategoryRequest>);
657
658 impl CreateGlossaryCategory {
659 pub(crate) fn new(
660 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
661 ) -> Self {
662 Self(RequestBuilder::new(stub))
663 }
664
665 pub fn with_request<V: Into<crate::model::CreateGlossaryCategoryRequest>>(
667 mut self,
668 v: V,
669 ) -> Self {
670 self.0.request = v.into();
671 self
672 }
673
674 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
676 self.0.options = v.into();
677 self
678 }
679
680 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
682 (*self.0.stub)
683 .create_glossary_category(self.0.request, self.0.options)
684 .await
685 .map(gax::response::Response::into_body)
686 }
687
688 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
692 self.0.request.parent = v.into();
693 self
694 }
695
696 pub fn set_category_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
700 self.0.request.category_id = v.into();
701 self
702 }
703
704 pub fn set_category<T>(mut self, v: T) -> Self
708 where
709 T: std::convert::Into<crate::model::GlossaryCategory>,
710 {
711 self.0.request.category = std::option::Option::Some(v.into());
712 self
713 }
714
715 pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
719 where
720 T: std::convert::Into<crate::model::GlossaryCategory>,
721 {
722 self.0.request.category = v.map(|x| x.into());
723 self
724 }
725 }
726
727 #[doc(hidden)]
728 impl gax::options::internal::RequestBuilder for CreateGlossaryCategory {
729 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
730 &mut self.0.options
731 }
732 }
733
734 #[derive(Clone, Debug)]
751 pub struct UpdateGlossaryCategory(RequestBuilder<crate::model::UpdateGlossaryCategoryRequest>);
752
753 impl UpdateGlossaryCategory {
754 pub(crate) fn new(
755 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
756 ) -> Self {
757 Self(RequestBuilder::new(stub))
758 }
759
760 pub fn with_request<V: Into<crate::model::UpdateGlossaryCategoryRequest>>(
762 mut self,
763 v: V,
764 ) -> Self {
765 self.0.request = v.into();
766 self
767 }
768
769 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
771 self.0.options = v.into();
772 self
773 }
774
775 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
777 (*self.0.stub)
778 .update_glossary_category(self.0.request, self.0.options)
779 .await
780 .map(gax::response::Response::into_body)
781 }
782
783 pub fn set_category<T>(mut self, v: T) -> Self
787 where
788 T: std::convert::Into<crate::model::GlossaryCategory>,
789 {
790 self.0.request.category = std::option::Option::Some(v.into());
791 self
792 }
793
794 pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
798 where
799 T: std::convert::Into<crate::model::GlossaryCategory>,
800 {
801 self.0.request.category = v.map(|x| x.into());
802 self
803 }
804
805 pub fn set_update_mask<T>(mut self, v: T) -> Self
809 where
810 T: std::convert::Into<wkt::FieldMask>,
811 {
812 self.0.request.update_mask = std::option::Option::Some(v.into());
813 self
814 }
815
816 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
820 where
821 T: std::convert::Into<wkt::FieldMask>,
822 {
823 self.0.request.update_mask = v.map(|x| x.into());
824 self
825 }
826 }
827
828 #[doc(hidden)]
829 impl gax::options::internal::RequestBuilder for UpdateGlossaryCategory {
830 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
831 &mut self.0.options
832 }
833 }
834
835 #[derive(Clone, Debug)]
852 pub struct DeleteGlossaryCategory(RequestBuilder<crate::model::DeleteGlossaryCategoryRequest>);
853
854 impl DeleteGlossaryCategory {
855 pub(crate) fn new(
856 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
857 ) -> Self {
858 Self(RequestBuilder::new(stub))
859 }
860
861 pub fn with_request<V: Into<crate::model::DeleteGlossaryCategoryRequest>>(
863 mut self,
864 v: V,
865 ) -> Self {
866 self.0.request = v.into();
867 self
868 }
869
870 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
872 self.0.options = v.into();
873 self
874 }
875
876 pub async fn send(self) -> Result<()> {
878 (*self.0.stub)
879 .delete_glossary_category(self.0.request, self.0.options)
880 .await
881 .map(gax::response::Response::into_body)
882 }
883
884 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
888 self.0.request.name = v.into();
889 self
890 }
891 }
892
893 #[doc(hidden)]
894 impl gax::options::internal::RequestBuilder for DeleteGlossaryCategory {
895 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
896 &mut self.0.options
897 }
898 }
899
900 #[derive(Clone, Debug)]
917 pub struct GetGlossaryCategory(RequestBuilder<crate::model::GetGlossaryCategoryRequest>);
918
919 impl GetGlossaryCategory {
920 pub(crate) fn new(
921 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
922 ) -> Self {
923 Self(RequestBuilder::new(stub))
924 }
925
926 pub fn with_request<V: Into<crate::model::GetGlossaryCategoryRequest>>(
928 mut self,
929 v: V,
930 ) -> Self {
931 self.0.request = v.into();
932 self
933 }
934
935 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
937 self.0.options = v.into();
938 self
939 }
940
941 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
943 (*self.0.stub)
944 .get_glossary_category(self.0.request, self.0.options)
945 .await
946 .map(gax::response::Response::into_body)
947 }
948
949 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
953 self.0.request.name = v.into();
954 self
955 }
956 }
957
958 #[doc(hidden)]
959 impl gax::options::internal::RequestBuilder for GetGlossaryCategory {
960 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
961 &mut self.0.options
962 }
963 }
964
965 #[derive(Clone, Debug)]
986 pub struct ListGlossaryCategories(RequestBuilder<crate::model::ListGlossaryCategoriesRequest>);
987
988 impl ListGlossaryCategories {
989 pub(crate) fn new(
990 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
991 ) -> Self {
992 Self(RequestBuilder::new(stub))
993 }
994
995 pub fn with_request<V: Into<crate::model::ListGlossaryCategoriesRequest>>(
997 mut self,
998 v: V,
999 ) -> Self {
1000 self.0.request = v.into();
1001 self
1002 }
1003
1004 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1006 self.0.options = v.into();
1007 self
1008 }
1009
1010 pub async fn send(self) -> Result<crate::model::ListGlossaryCategoriesResponse> {
1012 (*self.0.stub)
1013 .list_glossary_categories(self.0.request, self.0.options)
1014 .await
1015 .map(gax::response::Response::into_body)
1016 }
1017
1018 pub fn by_page(
1020 self,
1021 ) -> impl gax::paginator::Paginator<
1022 crate::model::ListGlossaryCategoriesResponse,
1023 gax::error::Error,
1024 > {
1025 use std::clone::Clone;
1026 let token = self.0.request.page_token.clone();
1027 let execute = move |token: String| {
1028 let mut builder = self.clone();
1029 builder.0.request = builder.0.request.set_page_token(token);
1030 builder.send()
1031 };
1032 gax::paginator::internal::new_paginator(token, execute)
1033 }
1034
1035 pub fn by_item(
1037 self,
1038 ) -> impl gax::paginator::ItemPaginator<
1039 crate::model::ListGlossaryCategoriesResponse,
1040 gax::error::Error,
1041 > {
1042 use gax::paginator::Paginator;
1043 self.by_page().items()
1044 }
1045
1046 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1050 self.0.request.parent = v.into();
1051 self
1052 }
1053
1054 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1056 self.0.request.page_size = v.into();
1057 self
1058 }
1059
1060 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1062 self.0.request.page_token = v.into();
1063 self
1064 }
1065
1066 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1068 self.0.request.filter = v.into();
1069 self
1070 }
1071
1072 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1074 self.0.request.order_by = v.into();
1075 self
1076 }
1077 }
1078
1079 #[doc(hidden)]
1080 impl gax::options::internal::RequestBuilder for ListGlossaryCategories {
1081 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1082 &mut self.0.options
1083 }
1084 }
1085
1086 #[derive(Clone, Debug)]
1103 pub struct CreateGlossaryTerm(RequestBuilder<crate::model::CreateGlossaryTermRequest>);
1104
1105 impl CreateGlossaryTerm {
1106 pub(crate) fn new(
1107 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1108 ) -> Self {
1109 Self(RequestBuilder::new(stub))
1110 }
1111
1112 pub fn with_request<V: Into<crate::model::CreateGlossaryTermRequest>>(
1114 mut self,
1115 v: V,
1116 ) -> Self {
1117 self.0.request = v.into();
1118 self
1119 }
1120
1121 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1123 self.0.options = v.into();
1124 self
1125 }
1126
1127 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1129 (*self.0.stub)
1130 .create_glossary_term(self.0.request, self.0.options)
1131 .await
1132 .map(gax::response::Response::into_body)
1133 }
1134
1135 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139 self.0.request.parent = v.into();
1140 self
1141 }
1142
1143 pub fn set_term_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1147 self.0.request.term_id = v.into();
1148 self
1149 }
1150
1151 pub fn set_term<T>(mut self, v: T) -> Self
1155 where
1156 T: std::convert::Into<crate::model::GlossaryTerm>,
1157 {
1158 self.0.request.term = std::option::Option::Some(v.into());
1159 self
1160 }
1161
1162 pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
1166 where
1167 T: std::convert::Into<crate::model::GlossaryTerm>,
1168 {
1169 self.0.request.term = v.map(|x| x.into());
1170 self
1171 }
1172 }
1173
1174 #[doc(hidden)]
1175 impl gax::options::internal::RequestBuilder for CreateGlossaryTerm {
1176 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1177 &mut self.0.options
1178 }
1179 }
1180
1181 #[derive(Clone, Debug)]
1198 pub struct UpdateGlossaryTerm(RequestBuilder<crate::model::UpdateGlossaryTermRequest>);
1199
1200 impl UpdateGlossaryTerm {
1201 pub(crate) fn new(
1202 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1203 ) -> Self {
1204 Self(RequestBuilder::new(stub))
1205 }
1206
1207 pub fn with_request<V: Into<crate::model::UpdateGlossaryTermRequest>>(
1209 mut self,
1210 v: V,
1211 ) -> Self {
1212 self.0.request = v.into();
1213 self
1214 }
1215
1216 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1218 self.0.options = v.into();
1219 self
1220 }
1221
1222 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1224 (*self.0.stub)
1225 .update_glossary_term(self.0.request, self.0.options)
1226 .await
1227 .map(gax::response::Response::into_body)
1228 }
1229
1230 pub fn set_term<T>(mut self, v: T) -> Self
1234 where
1235 T: std::convert::Into<crate::model::GlossaryTerm>,
1236 {
1237 self.0.request.term = std::option::Option::Some(v.into());
1238 self
1239 }
1240
1241 pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
1245 where
1246 T: std::convert::Into<crate::model::GlossaryTerm>,
1247 {
1248 self.0.request.term = v.map(|x| x.into());
1249 self
1250 }
1251
1252 pub fn set_update_mask<T>(mut self, v: T) -> Self
1256 where
1257 T: std::convert::Into<wkt::FieldMask>,
1258 {
1259 self.0.request.update_mask = std::option::Option::Some(v.into());
1260 self
1261 }
1262
1263 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1267 where
1268 T: std::convert::Into<wkt::FieldMask>,
1269 {
1270 self.0.request.update_mask = v.map(|x| x.into());
1271 self
1272 }
1273 }
1274
1275 #[doc(hidden)]
1276 impl gax::options::internal::RequestBuilder for UpdateGlossaryTerm {
1277 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1278 &mut self.0.options
1279 }
1280 }
1281
1282 #[derive(Clone, Debug)]
1299 pub struct DeleteGlossaryTerm(RequestBuilder<crate::model::DeleteGlossaryTermRequest>);
1300
1301 impl DeleteGlossaryTerm {
1302 pub(crate) fn new(
1303 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1304 ) -> Self {
1305 Self(RequestBuilder::new(stub))
1306 }
1307
1308 pub fn with_request<V: Into<crate::model::DeleteGlossaryTermRequest>>(
1310 mut self,
1311 v: V,
1312 ) -> Self {
1313 self.0.request = v.into();
1314 self
1315 }
1316
1317 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1319 self.0.options = v.into();
1320 self
1321 }
1322
1323 pub async fn send(self) -> Result<()> {
1325 (*self.0.stub)
1326 .delete_glossary_term(self.0.request, self.0.options)
1327 .await
1328 .map(gax::response::Response::into_body)
1329 }
1330
1331 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1335 self.0.request.name = v.into();
1336 self
1337 }
1338 }
1339
1340 #[doc(hidden)]
1341 impl gax::options::internal::RequestBuilder for DeleteGlossaryTerm {
1342 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1343 &mut self.0.options
1344 }
1345 }
1346
1347 #[derive(Clone, Debug)]
1364 pub struct GetGlossaryTerm(RequestBuilder<crate::model::GetGlossaryTermRequest>);
1365
1366 impl GetGlossaryTerm {
1367 pub(crate) fn new(
1368 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1369 ) -> Self {
1370 Self(RequestBuilder::new(stub))
1371 }
1372
1373 pub fn with_request<V: Into<crate::model::GetGlossaryTermRequest>>(mut self, v: V) -> Self {
1375 self.0.request = v.into();
1376 self
1377 }
1378
1379 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1381 self.0.options = v.into();
1382 self
1383 }
1384
1385 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1387 (*self.0.stub)
1388 .get_glossary_term(self.0.request, self.0.options)
1389 .await
1390 .map(gax::response::Response::into_body)
1391 }
1392
1393 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1397 self.0.request.name = v.into();
1398 self
1399 }
1400 }
1401
1402 #[doc(hidden)]
1403 impl gax::options::internal::RequestBuilder for GetGlossaryTerm {
1404 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1405 &mut self.0.options
1406 }
1407 }
1408
1409 #[derive(Clone, Debug)]
1430 pub struct ListGlossaryTerms(RequestBuilder<crate::model::ListGlossaryTermsRequest>);
1431
1432 impl ListGlossaryTerms {
1433 pub(crate) fn new(
1434 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1435 ) -> Self {
1436 Self(RequestBuilder::new(stub))
1437 }
1438
1439 pub fn with_request<V: Into<crate::model::ListGlossaryTermsRequest>>(
1441 mut self,
1442 v: V,
1443 ) -> Self {
1444 self.0.request = v.into();
1445 self
1446 }
1447
1448 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1450 self.0.options = v.into();
1451 self
1452 }
1453
1454 pub async fn send(self) -> Result<crate::model::ListGlossaryTermsResponse> {
1456 (*self.0.stub)
1457 .list_glossary_terms(self.0.request, self.0.options)
1458 .await
1459 .map(gax::response::Response::into_body)
1460 }
1461
1462 pub fn by_page(
1464 self,
1465 ) -> impl gax::paginator::Paginator<crate::model::ListGlossaryTermsResponse, gax::error::Error>
1466 {
1467 use std::clone::Clone;
1468 let token = self.0.request.page_token.clone();
1469 let execute = move |token: String| {
1470 let mut builder = self.clone();
1471 builder.0.request = builder.0.request.set_page_token(token);
1472 builder.send()
1473 };
1474 gax::paginator::internal::new_paginator(token, execute)
1475 }
1476
1477 pub fn by_item(
1479 self,
1480 ) -> impl gax::paginator::ItemPaginator<crate::model::ListGlossaryTermsResponse, gax::error::Error>
1481 {
1482 use gax::paginator::Paginator;
1483 self.by_page().items()
1484 }
1485
1486 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1490 self.0.request.parent = v.into();
1491 self
1492 }
1493
1494 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1496 self.0.request.page_size = v.into();
1497 self
1498 }
1499
1500 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1502 self.0.request.page_token = v.into();
1503 self
1504 }
1505
1506 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1508 self.0.request.filter = v.into();
1509 self
1510 }
1511
1512 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1514 self.0.request.order_by = v.into();
1515 self
1516 }
1517 }
1518
1519 #[doc(hidden)]
1520 impl gax::options::internal::RequestBuilder for ListGlossaryTerms {
1521 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1522 &mut self.0.options
1523 }
1524 }
1525
1526 #[derive(Clone, Debug)]
1547 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1548
1549 impl ListLocations {
1550 pub(crate) fn new(
1551 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1552 ) -> Self {
1553 Self(RequestBuilder::new(stub))
1554 }
1555
1556 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1558 mut self,
1559 v: V,
1560 ) -> Self {
1561 self.0.request = v.into();
1562 self
1563 }
1564
1565 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1567 self.0.options = v.into();
1568 self
1569 }
1570
1571 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1573 (*self.0.stub)
1574 .list_locations(self.0.request, self.0.options)
1575 .await
1576 .map(gax::response::Response::into_body)
1577 }
1578
1579 pub fn by_page(
1581 self,
1582 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1583 {
1584 use std::clone::Clone;
1585 let token = self.0.request.page_token.clone();
1586 let execute = move |token: String| {
1587 let mut builder = self.clone();
1588 builder.0.request = builder.0.request.set_page_token(token);
1589 builder.send()
1590 };
1591 gax::paginator::internal::new_paginator(token, execute)
1592 }
1593
1594 pub fn by_item(
1596 self,
1597 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1598 {
1599 use gax::paginator::Paginator;
1600 self.by_page().items()
1601 }
1602
1603 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1605 self.0.request.name = v.into();
1606 self
1607 }
1608
1609 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1611 self.0.request.filter = v.into();
1612 self
1613 }
1614
1615 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1617 self.0.request.page_size = v.into();
1618 self
1619 }
1620
1621 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1623 self.0.request.page_token = v.into();
1624 self
1625 }
1626 }
1627
1628 #[doc(hidden)]
1629 impl gax::options::internal::RequestBuilder for ListLocations {
1630 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1631 &mut self.0.options
1632 }
1633 }
1634
1635 #[derive(Clone, Debug)]
1652 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1653
1654 impl GetLocation {
1655 pub(crate) fn new(
1656 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1657 ) -> Self {
1658 Self(RequestBuilder::new(stub))
1659 }
1660
1661 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1663 self.0.request = v.into();
1664 self
1665 }
1666
1667 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1669 self.0.options = v.into();
1670 self
1671 }
1672
1673 pub async fn send(self) -> Result<location::model::Location> {
1675 (*self.0.stub)
1676 .get_location(self.0.request, self.0.options)
1677 .await
1678 .map(gax::response::Response::into_body)
1679 }
1680
1681 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1683 self.0.request.name = v.into();
1684 self
1685 }
1686 }
1687
1688 #[doc(hidden)]
1689 impl gax::options::internal::RequestBuilder for GetLocation {
1690 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1691 &mut self.0.options
1692 }
1693 }
1694
1695 #[derive(Clone, Debug)]
1712 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1713
1714 impl SetIamPolicy {
1715 pub(crate) fn new(
1716 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1717 ) -> Self {
1718 Self(RequestBuilder::new(stub))
1719 }
1720
1721 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1723 self.0.request = v.into();
1724 self
1725 }
1726
1727 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1729 self.0.options = v.into();
1730 self
1731 }
1732
1733 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1735 (*self.0.stub)
1736 .set_iam_policy(self.0.request, self.0.options)
1737 .await
1738 .map(gax::response::Response::into_body)
1739 }
1740
1741 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1745 self.0.request.resource = v.into();
1746 self
1747 }
1748
1749 pub fn set_policy<T>(mut self, v: T) -> Self
1753 where
1754 T: std::convert::Into<iam_v1::model::Policy>,
1755 {
1756 self.0.request.policy = std::option::Option::Some(v.into());
1757 self
1758 }
1759
1760 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1764 where
1765 T: std::convert::Into<iam_v1::model::Policy>,
1766 {
1767 self.0.request.policy = v.map(|x| x.into());
1768 self
1769 }
1770
1771 pub fn set_update_mask<T>(mut self, v: T) -> Self
1773 where
1774 T: std::convert::Into<wkt::FieldMask>,
1775 {
1776 self.0.request.update_mask = std::option::Option::Some(v.into());
1777 self
1778 }
1779
1780 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1782 where
1783 T: std::convert::Into<wkt::FieldMask>,
1784 {
1785 self.0.request.update_mask = v.map(|x| x.into());
1786 self
1787 }
1788 }
1789
1790 #[doc(hidden)]
1791 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1792 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1793 &mut self.0.options
1794 }
1795 }
1796
1797 #[derive(Clone, Debug)]
1814 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1815
1816 impl GetIamPolicy {
1817 pub(crate) fn new(
1818 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1819 ) -> Self {
1820 Self(RequestBuilder::new(stub))
1821 }
1822
1823 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1825 self.0.request = v.into();
1826 self
1827 }
1828
1829 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1831 self.0.options = v.into();
1832 self
1833 }
1834
1835 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1837 (*self.0.stub)
1838 .get_iam_policy(self.0.request, self.0.options)
1839 .await
1840 .map(gax::response::Response::into_body)
1841 }
1842
1843 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1847 self.0.request.resource = v.into();
1848 self
1849 }
1850
1851 pub fn set_options<T>(mut self, v: T) -> Self
1853 where
1854 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1855 {
1856 self.0.request.options = std::option::Option::Some(v.into());
1857 self
1858 }
1859
1860 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1862 where
1863 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1864 {
1865 self.0.request.options = v.map(|x| x.into());
1866 self
1867 }
1868 }
1869
1870 #[doc(hidden)]
1871 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1872 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1873 &mut self.0.options
1874 }
1875 }
1876
1877 #[derive(Clone, Debug)]
1894 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1895
1896 impl TestIamPermissions {
1897 pub(crate) fn new(
1898 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1899 ) -> Self {
1900 Self(RequestBuilder::new(stub))
1901 }
1902
1903 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1905 mut self,
1906 v: V,
1907 ) -> Self {
1908 self.0.request = v.into();
1909 self
1910 }
1911
1912 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1914 self.0.options = v.into();
1915 self
1916 }
1917
1918 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1920 (*self.0.stub)
1921 .test_iam_permissions(self.0.request, self.0.options)
1922 .await
1923 .map(gax::response::Response::into_body)
1924 }
1925
1926 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1930 self.0.request.resource = v.into();
1931 self
1932 }
1933
1934 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1938 where
1939 T: std::iter::IntoIterator<Item = V>,
1940 V: std::convert::Into<std::string::String>,
1941 {
1942 use std::iter::Iterator;
1943 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1944 self
1945 }
1946 }
1947
1948 #[doc(hidden)]
1949 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1950 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1951 &mut self.0.options
1952 }
1953 }
1954
1955 #[derive(Clone, Debug)]
1976 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1977
1978 impl ListOperations {
1979 pub(crate) fn new(
1980 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1981 ) -> Self {
1982 Self(RequestBuilder::new(stub))
1983 }
1984
1985 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1987 mut self,
1988 v: V,
1989 ) -> Self {
1990 self.0.request = v.into();
1991 self
1992 }
1993
1994 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1996 self.0.options = v.into();
1997 self
1998 }
1999
2000 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2002 (*self.0.stub)
2003 .list_operations(self.0.request, self.0.options)
2004 .await
2005 .map(gax::response::Response::into_body)
2006 }
2007
2008 pub fn by_page(
2010 self,
2011 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2012 {
2013 use std::clone::Clone;
2014 let token = self.0.request.page_token.clone();
2015 let execute = move |token: String| {
2016 let mut builder = self.clone();
2017 builder.0.request = builder.0.request.set_page_token(token);
2018 builder.send()
2019 };
2020 gax::paginator::internal::new_paginator(token, execute)
2021 }
2022
2023 pub fn by_item(
2025 self,
2026 ) -> impl gax::paginator::ItemPaginator<
2027 longrunning::model::ListOperationsResponse,
2028 gax::error::Error,
2029 > {
2030 use gax::paginator::Paginator;
2031 self.by_page().items()
2032 }
2033
2034 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2036 self.0.request.name = v.into();
2037 self
2038 }
2039
2040 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2042 self.0.request.filter = v.into();
2043 self
2044 }
2045
2046 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2048 self.0.request.page_size = v.into();
2049 self
2050 }
2051
2052 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2054 self.0.request.page_token = v.into();
2055 self
2056 }
2057
2058 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2060 self.0.request.return_partial_success = v.into();
2061 self
2062 }
2063 }
2064
2065 #[doc(hidden)]
2066 impl gax::options::internal::RequestBuilder for ListOperations {
2067 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2068 &mut self.0.options
2069 }
2070 }
2071
2072 #[derive(Clone, Debug)]
2089 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2090
2091 impl GetOperation {
2092 pub(crate) fn new(
2093 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2094 ) -> Self {
2095 Self(RequestBuilder::new(stub))
2096 }
2097
2098 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2100 mut self,
2101 v: V,
2102 ) -> Self {
2103 self.0.request = v.into();
2104 self
2105 }
2106
2107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2109 self.0.options = v.into();
2110 self
2111 }
2112
2113 pub async fn send(self) -> Result<longrunning::model::Operation> {
2115 (*self.0.stub)
2116 .get_operation(self.0.request, self.0.options)
2117 .await
2118 .map(gax::response::Response::into_body)
2119 }
2120
2121 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2123 self.0.request.name = v.into();
2124 self
2125 }
2126 }
2127
2128 #[doc(hidden)]
2129 impl gax::options::internal::RequestBuilder for GetOperation {
2130 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2131 &mut self.0.options
2132 }
2133 }
2134
2135 #[derive(Clone, Debug)]
2152 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2153
2154 impl DeleteOperation {
2155 pub(crate) fn new(
2156 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2157 ) -> Self {
2158 Self(RequestBuilder::new(stub))
2159 }
2160
2161 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2163 mut self,
2164 v: V,
2165 ) -> Self {
2166 self.0.request = v.into();
2167 self
2168 }
2169
2170 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2172 self.0.options = v.into();
2173 self
2174 }
2175
2176 pub async fn send(self) -> Result<()> {
2178 (*self.0.stub)
2179 .delete_operation(self.0.request, self.0.options)
2180 .await
2181 .map(gax::response::Response::into_body)
2182 }
2183
2184 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2186 self.0.request.name = v.into();
2187 self
2188 }
2189 }
2190
2191 #[doc(hidden)]
2192 impl gax::options::internal::RequestBuilder for DeleteOperation {
2193 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2194 &mut self.0.options
2195 }
2196 }
2197
2198 #[derive(Clone, Debug)]
2215 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2216
2217 impl CancelOperation {
2218 pub(crate) fn new(
2219 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2220 ) -> Self {
2221 Self(RequestBuilder::new(stub))
2222 }
2223
2224 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2226 mut self,
2227 v: V,
2228 ) -> Self {
2229 self.0.request = v.into();
2230 self
2231 }
2232
2233 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2235 self.0.options = v.into();
2236 self
2237 }
2238
2239 pub async fn send(self) -> Result<()> {
2241 (*self.0.stub)
2242 .cancel_operation(self.0.request, self.0.options)
2243 .await
2244 .map(gax::response::Response::into_body)
2245 }
2246
2247 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2249 self.0.request.name = v.into();
2250 self
2251 }
2252 }
2253
2254 #[doc(hidden)]
2255 impl gax::options::internal::RequestBuilder for CancelOperation {
2256 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2257 &mut self.0.options
2258 }
2259 }
2260}
2261
2262pub mod catalog_service {
2263 use crate::Result;
2264
2265 pub type ClientBuilder =
2279 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2280
2281 pub(crate) mod client {
2282 use super::super::super::client::CatalogService;
2283 pub struct Factory;
2284 impl gax::client_builder::internal::ClientFactory for Factory {
2285 type Client = CatalogService;
2286 type Credentials = gaxi::options::Credentials;
2287 async fn build(
2288 self,
2289 config: gaxi::options::ClientConfig,
2290 ) -> gax::client_builder::Result<Self::Client> {
2291 Self::Client::new(config).await
2292 }
2293 }
2294 }
2295
2296 #[derive(Clone, Debug)]
2298 pub(crate) struct RequestBuilder<R: std::default::Default> {
2299 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2300 request: R,
2301 options: gax::options::RequestOptions,
2302 }
2303
2304 impl<R> RequestBuilder<R>
2305 where
2306 R: std::default::Default,
2307 {
2308 pub(crate) fn new(
2309 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2310 ) -> Self {
2311 Self {
2312 stub,
2313 request: R::default(),
2314 options: gax::options::RequestOptions::default(),
2315 }
2316 }
2317 }
2318
2319 #[derive(Clone, Debug)]
2337 pub struct CreateEntryType(RequestBuilder<crate::model::CreateEntryTypeRequest>);
2338
2339 impl CreateEntryType {
2340 pub(crate) fn new(
2341 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2342 ) -> Self {
2343 Self(RequestBuilder::new(stub))
2344 }
2345
2346 pub fn with_request<V: Into<crate::model::CreateEntryTypeRequest>>(mut self, v: V) -> Self {
2348 self.0.request = v.into();
2349 self
2350 }
2351
2352 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2354 self.0.options = v.into();
2355 self
2356 }
2357
2358 pub async fn send(self) -> Result<longrunning::model::Operation> {
2365 (*self.0.stub)
2366 .create_entry_type(self.0.request, self.0.options)
2367 .await
2368 .map(gax::response::Response::into_body)
2369 }
2370
2371 pub fn poller(
2373 self,
2374 ) -> impl lro::Poller<crate::model::EntryType, crate::model::OperationMetadata> {
2375 type Operation =
2376 lro::internal::Operation<crate::model::EntryType, crate::model::OperationMetadata>;
2377 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2378 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2379
2380 let stub = self.0.stub.clone();
2381 let mut options = self.0.options.clone();
2382 options.set_retry_policy(gax::retry_policy::NeverRetry);
2383 let query = move |name| {
2384 let stub = stub.clone();
2385 let options = options.clone();
2386 async {
2387 let op = GetOperation::new(stub)
2388 .set_name(name)
2389 .with_options(options)
2390 .send()
2391 .await?;
2392 Ok(Operation::new(op))
2393 }
2394 };
2395
2396 let start = move || async {
2397 let op = self.send().await?;
2398 Ok(Operation::new(op))
2399 };
2400
2401 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2402 }
2403
2404 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2408 self.0.request.parent = v.into();
2409 self
2410 }
2411
2412 pub fn set_entry_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2416 self.0.request.entry_type_id = v.into();
2417 self
2418 }
2419
2420 pub fn set_entry_type<T>(mut self, v: T) -> Self
2424 where
2425 T: std::convert::Into<crate::model::EntryType>,
2426 {
2427 self.0.request.entry_type = std::option::Option::Some(v.into());
2428 self
2429 }
2430
2431 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
2435 where
2436 T: std::convert::Into<crate::model::EntryType>,
2437 {
2438 self.0.request.entry_type = v.map(|x| x.into());
2439 self
2440 }
2441
2442 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2444 self.0.request.validate_only = v.into();
2445 self
2446 }
2447 }
2448
2449 #[doc(hidden)]
2450 impl gax::options::internal::RequestBuilder for CreateEntryType {
2451 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2452 &mut self.0.options
2453 }
2454 }
2455
2456 #[derive(Clone, Debug)]
2474 pub struct UpdateEntryType(RequestBuilder<crate::model::UpdateEntryTypeRequest>);
2475
2476 impl UpdateEntryType {
2477 pub(crate) fn new(
2478 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2479 ) -> Self {
2480 Self(RequestBuilder::new(stub))
2481 }
2482
2483 pub fn with_request<V: Into<crate::model::UpdateEntryTypeRequest>>(mut self, v: V) -> Self {
2485 self.0.request = v.into();
2486 self
2487 }
2488
2489 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2491 self.0.options = v.into();
2492 self
2493 }
2494
2495 pub async fn send(self) -> Result<longrunning::model::Operation> {
2502 (*self.0.stub)
2503 .update_entry_type(self.0.request, self.0.options)
2504 .await
2505 .map(gax::response::Response::into_body)
2506 }
2507
2508 pub fn poller(
2510 self,
2511 ) -> impl lro::Poller<crate::model::EntryType, crate::model::OperationMetadata> {
2512 type Operation =
2513 lro::internal::Operation<crate::model::EntryType, crate::model::OperationMetadata>;
2514 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2515 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2516
2517 let stub = self.0.stub.clone();
2518 let mut options = self.0.options.clone();
2519 options.set_retry_policy(gax::retry_policy::NeverRetry);
2520 let query = move |name| {
2521 let stub = stub.clone();
2522 let options = options.clone();
2523 async {
2524 let op = GetOperation::new(stub)
2525 .set_name(name)
2526 .with_options(options)
2527 .send()
2528 .await?;
2529 Ok(Operation::new(op))
2530 }
2531 };
2532
2533 let start = move || async {
2534 let op = self.send().await?;
2535 Ok(Operation::new(op))
2536 };
2537
2538 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2539 }
2540
2541 pub fn set_entry_type<T>(mut self, v: T) -> Self
2545 where
2546 T: std::convert::Into<crate::model::EntryType>,
2547 {
2548 self.0.request.entry_type = std::option::Option::Some(v.into());
2549 self
2550 }
2551
2552 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
2556 where
2557 T: std::convert::Into<crate::model::EntryType>,
2558 {
2559 self.0.request.entry_type = v.map(|x| x.into());
2560 self
2561 }
2562
2563 pub fn set_update_mask<T>(mut self, v: T) -> Self
2567 where
2568 T: std::convert::Into<wkt::FieldMask>,
2569 {
2570 self.0.request.update_mask = std::option::Option::Some(v.into());
2571 self
2572 }
2573
2574 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2578 where
2579 T: std::convert::Into<wkt::FieldMask>,
2580 {
2581 self.0.request.update_mask = v.map(|x| x.into());
2582 self
2583 }
2584
2585 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2587 self.0.request.validate_only = v.into();
2588 self
2589 }
2590 }
2591
2592 #[doc(hidden)]
2593 impl gax::options::internal::RequestBuilder for UpdateEntryType {
2594 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2595 &mut self.0.options
2596 }
2597 }
2598
2599 #[derive(Clone, Debug)]
2617 pub struct DeleteEntryType(RequestBuilder<crate::model::DeleteEntryTypeRequest>);
2618
2619 impl DeleteEntryType {
2620 pub(crate) fn new(
2621 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2622 ) -> Self {
2623 Self(RequestBuilder::new(stub))
2624 }
2625
2626 pub fn with_request<V: Into<crate::model::DeleteEntryTypeRequest>>(mut self, v: V) -> Self {
2628 self.0.request = v.into();
2629 self
2630 }
2631
2632 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2634 self.0.options = v.into();
2635 self
2636 }
2637
2638 pub async fn send(self) -> Result<longrunning::model::Operation> {
2645 (*self.0.stub)
2646 .delete_entry_type(self.0.request, self.0.options)
2647 .await
2648 .map(gax::response::Response::into_body)
2649 }
2650
2651 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2653 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2654 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2655 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2656
2657 let stub = self.0.stub.clone();
2658 let mut options = self.0.options.clone();
2659 options.set_retry_policy(gax::retry_policy::NeverRetry);
2660 let query = move |name| {
2661 let stub = stub.clone();
2662 let options = options.clone();
2663 async {
2664 let op = GetOperation::new(stub)
2665 .set_name(name)
2666 .with_options(options)
2667 .send()
2668 .await?;
2669 Ok(Operation::new(op))
2670 }
2671 };
2672
2673 let start = move || async {
2674 let op = self.send().await?;
2675 Ok(Operation::new(op))
2676 };
2677
2678 lro::internal::new_unit_response_poller(
2679 polling_error_policy,
2680 polling_backoff_policy,
2681 start,
2682 query,
2683 )
2684 }
2685
2686 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2690 self.0.request.name = v.into();
2691 self
2692 }
2693
2694 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2696 self.0.request.etag = v.into();
2697 self
2698 }
2699 }
2700
2701 #[doc(hidden)]
2702 impl gax::options::internal::RequestBuilder for DeleteEntryType {
2703 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2704 &mut self.0.options
2705 }
2706 }
2707
2708 #[derive(Clone, Debug)]
2729 pub struct ListEntryTypes(RequestBuilder<crate::model::ListEntryTypesRequest>);
2730
2731 impl ListEntryTypes {
2732 pub(crate) fn new(
2733 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2734 ) -> Self {
2735 Self(RequestBuilder::new(stub))
2736 }
2737
2738 pub fn with_request<V: Into<crate::model::ListEntryTypesRequest>>(mut self, v: V) -> Self {
2740 self.0.request = v.into();
2741 self
2742 }
2743
2744 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2746 self.0.options = v.into();
2747 self
2748 }
2749
2750 pub async fn send(self) -> Result<crate::model::ListEntryTypesResponse> {
2752 (*self.0.stub)
2753 .list_entry_types(self.0.request, self.0.options)
2754 .await
2755 .map(gax::response::Response::into_body)
2756 }
2757
2758 pub fn by_page(
2760 self,
2761 ) -> impl gax::paginator::Paginator<crate::model::ListEntryTypesResponse, gax::error::Error>
2762 {
2763 use std::clone::Clone;
2764 let token = self.0.request.page_token.clone();
2765 let execute = move |token: String| {
2766 let mut builder = self.clone();
2767 builder.0.request = builder.0.request.set_page_token(token);
2768 builder.send()
2769 };
2770 gax::paginator::internal::new_paginator(token, execute)
2771 }
2772
2773 pub fn by_item(
2775 self,
2776 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntryTypesResponse, gax::error::Error>
2777 {
2778 use gax::paginator::Paginator;
2779 self.by_page().items()
2780 }
2781
2782 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2786 self.0.request.parent = v.into();
2787 self
2788 }
2789
2790 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2792 self.0.request.page_size = v.into();
2793 self
2794 }
2795
2796 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2798 self.0.request.page_token = v.into();
2799 self
2800 }
2801
2802 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2804 self.0.request.filter = v.into();
2805 self
2806 }
2807
2808 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2810 self.0.request.order_by = v.into();
2811 self
2812 }
2813 }
2814
2815 #[doc(hidden)]
2816 impl gax::options::internal::RequestBuilder for ListEntryTypes {
2817 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2818 &mut self.0.options
2819 }
2820 }
2821
2822 #[derive(Clone, Debug)]
2839 pub struct GetEntryType(RequestBuilder<crate::model::GetEntryTypeRequest>);
2840
2841 impl GetEntryType {
2842 pub(crate) fn new(
2843 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2844 ) -> Self {
2845 Self(RequestBuilder::new(stub))
2846 }
2847
2848 pub fn with_request<V: Into<crate::model::GetEntryTypeRequest>>(mut self, v: V) -> Self {
2850 self.0.request = v.into();
2851 self
2852 }
2853
2854 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2856 self.0.options = v.into();
2857 self
2858 }
2859
2860 pub async fn send(self) -> Result<crate::model::EntryType> {
2862 (*self.0.stub)
2863 .get_entry_type(self.0.request, self.0.options)
2864 .await
2865 .map(gax::response::Response::into_body)
2866 }
2867
2868 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2872 self.0.request.name = v.into();
2873 self
2874 }
2875 }
2876
2877 #[doc(hidden)]
2878 impl gax::options::internal::RequestBuilder for GetEntryType {
2879 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2880 &mut self.0.options
2881 }
2882 }
2883
2884 #[derive(Clone, Debug)]
2902 pub struct CreateAspectType(RequestBuilder<crate::model::CreateAspectTypeRequest>);
2903
2904 impl CreateAspectType {
2905 pub(crate) fn new(
2906 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2907 ) -> Self {
2908 Self(RequestBuilder::new(stub))
2909 }
2910
2911 pub fn with_request<V: Into<crate::model::CreateAspectTypeRequest>>(
2913 mut self,
2914 v: V,
2915 ) -> Self {
2916 self.0.request = v.into();
2917 self
2918 }
2919
2920 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2922 self.0.options = v.into();
2923 self
2924 }
2925
2926 pub async fn send(self) -> Result<longrunning::model::Operation> {
2933 (*self.0.stub)
2934 .create_aspect_type(self.0.request, self.0.options)
2935 .await
2936 .map(gax::response::Response::into_body)
2937 }
2938
2939 pub fn poller(
2941 self,
2942 ) -> impl lro::Poller<crate::model::AspectType, crate::model::OperationMetadata> {
2943 type Operation =
2944 lro::internal::Operation<crate::model::AspectType, crate::model::OperationMetadata>;
2945 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2946 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2947
2948 let stub = self.0.stub.clone();
2949 let mut options = self.0.options.clone();
2950 options.set_retry_policy(gax::retry_policy::NeverRetry);
2951 let query = move |name| {
2952 let stub = stub.clone();
2953 let options = options.clone();
2954 async {
2955 let op = GetOperation::new(stub)
2956 .set_name(name)
2957 .with_options(options)
2958 .send()
2959 .await?;
2960 Ok(Operation::new(op))
2961 }
2962 };
2963
2964 let start = move || async {
2965 let op = self.send().await?;
2966 Ok(Operation::new(op))
2967 };
2968
2969 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2970 }
2971
2972 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2976 self.0.request.parent = v.into();
2977 self
2978 }
2979
2980 pub fn set_aspect_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2984 self.0.request.aspect_type_id = v.into();
2985 self
2986 }
2987
2988 pub fn set_aspect_type<T>(mut self, v: T) -> Self
2992 where
2993 T: std::convert::Into<crate::model::AspectType>,
2994 {
2995 self.0.request.aspect_type = std::option::Option::Some(v.into());
2996 self
2997 }
2998
2999 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
3003 where
3004 T: std::convert::Into<crate::model::AspectType>,
3005 {
3006 self.0.request.aspect_type = v.map(|x| x.into());
3007 self
3008 }
3009
3010 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3012 self.0.request.validate_only = v.into();
3013 self
3014 }
3015 }
3016
3017 #[doc(hidden)]
3018 impl gax::options::internal::RequestBuilder for CreateAspectType {
3019 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3020 &mut self.0.options
3021 }
3022 }
3023
3024 #[derive(Clone, Debug)]
3042 pub struct UpdateAspectType(RequestBuilder<crate::model::UpdateAspectTypeRequest>);
3043
3044 impl UpdateAspectType {
3045 pub(crate) fn new(
3046 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3047 ) -> Self {
3048 Self(RequestBuilder::new(stub))
3049 }
3050
3051 pub fn with_request<V: Into<crate::model::UpdateAspectTypeRequest>>(
3053 mut self,
3054 v: V,
3055 ) -> Self {
3056 self.0.request = v.into();
3057 self
3058 }
3059
3060 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3062 self.0.options = v.into();
3063 self
3064 }
3065
3066 pub async fn send(self) -> Result<longrunning::model::Operation> {
3073 (*self.0.stub)
3074 .update_aspect_type(self.0.request, self.0.options)
3075 .await
3076 .map(gax::response::Response::into_body)
3077 }
3078
3079 pub fn poller(
3081 self,
3082 ) -> impl lro::Poller<crate::model::AspectType, crate::model::OperationMetadata> {
3083 type Operation =
3084 lro::internal::Operation<crate::model::AspectType, crate::model::OperationMetadata>;
3085 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3086 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3087
3088 let stub = self.0.stub.clone();
3089 let mut options = self.0.options.clone();
3090 options.set_retry_policy(gax::retry_policy::NeverRetry);
3091 let query = move |name| {
3092 let stub = stub.clone();
3093 let options = options.clone();
3094 async {
3095 let op = GetOperation::new(stub)
3096 .set_name(name)
3097 .with_options(options)
3098 .send()
3099 .await?;
3100 Ok(Operation::new(op))
3101 }
3102 };
3103
3104 let start = move || async {
3105 let op = self.send().await?;
3106 Ok(Operation::new(op))
3107 };
3108
3109 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3110 }
3111
3112 pub fn set_aspect_type<T>(mut self, v: T) -> Self
3116 where
3117 T: std::convert::Into<crate::model::AspectType>,
3118 {
3119 self.0.request.aspect_type = std::option::Option::Some(v.into());
3120 self
3121 }
3122
3123 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
3127 where
3128 T: std::convert::Into<crate::model::AspectType>,
3129 {
3130 self.0.request.aspect_type = v.map(|x| x.into());
3131 self
3132 }
3133
3134 pub fn set_update_mask<T>(mut self, v: T) -> Self
3138 where
3139 T: std::convert::Into<wkt::FieldMask>,
3140 {
3141 self.0.request.update_mask = std::option::Option::Some(v.into());
3142 self
3143 }
3144
3145 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3149 where
3150 T: std::convert::Into<wkt::FieldMask>,
3151 {
3152 self.0.request.update_mask = v.map(|x| x.into());
3153 self
3154 }
3155
3156 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3158 self.0.request.validate_only = v.into();
3159 self
3160 }
3161 }
3162
3163 #[doc(hidden)]
3164 impl gax::options::internal::RequestBuilder for UpdateAspectType {
3165 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3166 &mut self.0.options
3167 }
3168 }
3169
3170 #[derive(Clone, Debug)]
3188 pub struct DeleteAspectType(RequestBuilder<crate::model::DeleteAspectTypeRequest>);
3189
3190 impl DeleteAspectType {
3191 pub(crate) fn new(
3192 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3193 ) -> Self {
3194 Self(RequestBuilder::new(stub))
3195 }
3196
3197 pub fn with_request<V: Into<crate::model::DeleteAspectTypeRequest>>(
3199 mut self,
3200 v: V,
3201 ) -> Self {
3202 self.0.request = v.into();
3203 self
3204 }
3205
3206 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3208 self.0.options = v.into();
3209 self
3210 }
3211
3212 pub async fn send(self) -> Result<longrunning::model::Operation> {
3219 (*self.0.stub)
3220 .delete_aspect_type(self.0.request, self.0.options)
3221 .await
3222 .map(gax::response::Response::into_body)
3223 }
3224
3225 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3227 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3228 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3229 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3230
3231 let stub = self.0.stub.clone();
3232 let mut options = self.0.options.clone();
3233 options.set_retry_policy(gax::retry_policy::NeverRetry);
3234 let query = move |name| {
3235 let stub = stub.clone();
3236 let options = options.clone();
3237 async {
3238 let op = GetOperation::new(stub)
3239 .set_name(name)
3240 .with_options(options)
3241 .send()
3242 .await?;
3243 Ok(Operation::new(op))
3244 }
3245 };
3246
3247 let start = move || async {
3248 let op = self.send().await?;
3249 Ok(Operation::new(op))
3250 };
3251
3252 lro::internal::new_unit_response_poller(
3253 polling_error_policy,
3254 polling_backoff_policy,
3255 start,
3256 query,
3257 )
3258 }
3259
3260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3264 self.0.request.name = v.into();
3265 self
3266 }
3267
3268 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3270 self.0.request.etag = v.into();
3271 self
3272 }
3273 }
3274
3275 #[doc(hidden)]
3276 impl gax::options::internal::RequestBuilder for DeleteAspectType {
3277 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3278 &mut self.0.options
3279 }
3280 }
3281
3282 #[derive(Clone, Debug)]
3303 pub struct ListAspectTypes(RequestBuilder<crate::model::ListAspectTypesRequest>);
3304
3305 impl ListAspectTypes {
3306 pub(crate) fn new(
3307 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3308 ) -> Self {
3309 Self(RequestBuilder::new(stub))
3310 }
3311
3312 pub fn with_request<V: Into<crate::model::ListAspectTypesRequest>>(mut self, v: V) -> Self {
3314 self.0.request = v.into();
3315 self
3316 }
3317
3318 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3320 self.0.options = v.into();
3321 self
3322 }
3323
3324 pub async fn send(self) -> Result<crate::model::ListAspectTypesResponse> {
3326 (*self.0.stub)
3327 .list_aspect_types(self.0.request, self.0.options)
3328 .await
3329 .map(gax::response::Response::into_body)
3330 }
3331
3332 pub fn by_page(
3334 self,
3335 ) -> impl gax::paginator::Paginator<crate::model::ListAspectTypesResponse, gax::error::Error>
3336 {
3337 use std::clone::Clone;
3338 let token = self.0.request.page_token.clone();
3339 let execute = move |token: String| {
3340 let mut builder = self.clone();
3341 builder.0.request = builder.0.request.set_page_token(token);
3342 builder.send()
3343 };
3344 gax::paginator::internal::new_paginator(token, execute)
3345 }
3346
3347 pub fn by_item(
3349 self,
3350 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAspectTypesResponse, gax::error::Error>
3351 {
3352 use gax::paginator::Paginator;
3353 self.by_page().items()
3354 }
3355
3356 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3360 self.0.request.parent = v.into();
3361 self
3362 }
3363
3364 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3366 self.0.request.page_size = v.into();
3367 self
3368 }
3369
3370 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3372 self.0.request.page_token = v.into();
3373 self
3374 }
3375
3376 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3378 self.0.request.filter = v.into();
3379 self
3380 }
3381
3382 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3384 self.0.request.order_by = v.into();
3385 self
3386 }
3387 }
3388
3389 #[doc(hidden)]
3390 impl gax::options::internal::RequestBuilder for ListAspectTypes {
3391 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3392 &mut self.0.options
3393 }
3394 }
3395
3396 #[derive(Clone, Debug)]
3413 pub struct GetAspectType(RequestBuilder<crate::model::GetAspectTypeRequest>);
3414
3415 impl GetAspectType {
3416 pub(crate) fn new(
3417 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3418 ) -> Self {
3419 Self(RequestBuilder::new(stub))
3420 }
3421
3422 pub fn with_request<V: Into<crate::model::GetAspectTypeRequest>>(mut self, v: V) -> Self {
3424 self.0.request = v.into();
3425 self
3426 }
3427
3428 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3430 self.0.options = v.into();
3431 self
3432 }
3433
3434 pub async fn send(self) -> Result<crate::model::AspectType> {
3436 (*self.0.stub)
3437 .get_aspect_type(self.0.request, self.0.options)
3438 .await
3439 .map(gax::response::Response::into_body)
3440 }
3441
3442 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3446 self.0.request.name = v.into();
3447 self
3448 }
3449 }
3450
3451 #[doc(hidden)]
3452 impl gax::options::internal::RequestBuilder for GetAspectType {
3453 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3454 &mut self.0.options
3455 }
3456 }
3457
3458 #[derive(Clone, Debug)]
3476 pub struct CreateEntryGroup(RequestBuilder<crate::model::CreateEntryGroupRequest>);
3477
3478 impl CreateEntryGroup {
3479 pub(crate) fn new(
3480 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3481 ) -> Self {
3482 Self(RequestBuilder::new(stub))
3483 }
3484
3485 pub fn with_request<V: Into<crate::model::CreateEntryGroupRequest>>(
3487 mut self,
3488 v: V,
3489 ) -> Self {
3490 self.0.request = v.into();
3491 self
3492 }
3493
3494 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3496 self.0.options = v.into();
3497 self
3498 }
3499
3500 pub async fn send(self) -> Result<longrunning::model::Operation> {
3507 (*self.0.stub)
3508 .create_entry_group(self.0.request, self.0.options)
3509 .await
3510 .map(gax::response::Response::into_body)
3511 }
3512
3513 pub fn poller(
3515 self,
3516 ) -> impl lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata> {
3517 type Operation =
3518 lro::internal::Operation<crate::model::EntryGroup, crate::model::OperationMetadata>;
3519 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3520 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3521
3522 let stub = self.0.stub.clone();
3523 let mut options = self.0.options.clone();
3524 options.set_retry_policy(gax::retry_policy::NeverRetry);
3525 let query = move |name| {
3526 let stub = stub.clone();
3527 let options = options.clone();
3528 async {
3529 let op = GetOperation::new(stub)
3530 .set_name(name)
3531 .with_options(options)
3532 .send()
3533 .await?;
3534 Ok(Operation::new(op))
3535 }
3536 };
3537
3538 let start = move || async {
3539 let op = self.send().await?;
3540 Ok(Operation::new(op))
3541 };
3542
3543 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3544 }
3545
3546 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3550 self.0.request.parent = v.into();
3551 self
3552 }
3553
3554 pub fn set_entry_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3558 self.0.request.entry_group_id = v.into();
3559 self
3560 }
3561
3562 pub fn set_entry_group<T>(mut self, v: T) -> Self
3566 where
3567 T: std::convert::Into<crate::model::EntryGroup>,
3568 {
3569 self.0.request.entry_group = std::option::Option::Some(v.into());
3570 self
3571 }
3572
3573 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
3577 where
3578 T: std::convert::Into<crate::model::EntryGroup>,
3579 {
3580 self.0.request.entry_group = v.map(|x| x.into());
3581 self
3582 }
3583
3584 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3586 self.0.request.validate_only = v.into();
3587 self
3588 }
3589 }
3590
3591 #[doc(hidden)]
3592 impl gax::options::internal::RequestBuilder for CreateEntryGroup {
3593 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3594 &mut self.0.options
3595 }
3596 }
3597
3598 #[derive(Clone, Debug)]
3616 pub struct UpdateEntryGroup(RequestBuilder<crate::model::UpdateEntryGroupRequest>);
3617
3618 impl UpdateEntryGroup {
3619 pub(crate) fn new(
3620 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3621 ) -> Self {
3622 Self(RequestBuilder::new(stub))
3623 }
3624
3625 pub fn with_request<V: Into<crate::model::UpdateEntryGroupRequest>>(
3627 mut self,
3628 v: V,
3629 ) -> Self {
3630 self.0.request = v.into();
3631 self
3632 }
3633
3634 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3636 self.0.options = v.into();
3637 self
3638 }
3639
3640 pub async fn send(self) -> Result<longrunning::model::Operation> {
3647 (*self.0.stub)
3648 .update_entry_group(self.0.request, self.0.options)
3649 .await
3650 .map(gax::response::Response::into_body)
3651 }
3652
3653 pub fn poller(
3655 self,
3656 ) -> impl lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata> {
3657 type Operation =
3658 lro::internal::Operation<crate::model::EntryGroup, crate::model::OperationMetadata>;
3659 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3660 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3661
3662 let stub = self.0.stub.clone();
3663 let mut options = self.0.options.clone();
3664 options.set_retry_policy(gax::retry_policy::NeverRetry);
3665 let query = move |name| {
3666 let stub = stub.clone();
3667 let options = options.clone();
3668 async {
3669 let op = GetOperation::new(stub)
3670 .set_name(name)
3671 .with_options(options)
3672 .send()
3673 .await?;
3674 Ok(Operation::new(op))
3675 }
3676 };
3677
3678 let start = move || async {
3679 let op = self.send().await?;
3680 Ok(Operation::new(op))
3681 };
3682
3683 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3684 }
3685
3686 pub fn set_entry_group<T>(mut self, v: T) -> Self
3690 where
3691 T: std::convert::Into<crate::model::EntryGroup>,
3692 {
3693 self.0.request.entry_group = std::option::Option::Some(v.into());
3694 self
3695 }
3696
3697 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
3701 where
3702 T: std::convert::Into<crate::model::EntryGroup>,
3703 {
3704 self.0.request.entry_group = v.map(|x| x.into());
3705 self
3706 }
3707
3708 pub fn set_update_mask<T>(mut self, v: T) -> Self
3712 where
3713 T: std::convert::Into<wkt::FieldMask>,
3714 {
3715 self.0.request.update_mask = std::option::Option::Some(v.into());
3716 self
3717 }
3718
3719 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3723 where
3724 T: std::convert::Into<wkt::FieldMask>,
3725 {
3726 self.0.request.update_mask = v.map(|x| x.into());
3727 self
3728 }
3729
3730 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3732 self.0.request.validate_only = v.into();
3733 self
3734 }
3735 }
3736
3737 #[doc(hidden)]
3738 impl gax::options::internal::RequestBuilder for UpdateEntryGroup {
3739 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3740 &mut self.0.options
3741 }
3742 }
3743
3744 #[derive(Clone, Debug)]
3762 pub struct DeleteEntryGroup(RequestBuilder<crate::model::DeleteEntryGroupRequest>);
3763
3764 impl DeleteEntryGroup {
3765 pub(crate) fn new(
3766 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3767 ) -> Self {
3768 Self(RequestBuilder::new(stub))
3769 }
3770
3771 pub fn with_request<V: Into<crate::model::DeleteEntryGroupRequest>>(
3773 mut self,
3774 v: V,
3775 ) -> Self {
3776 self.0.request = v.into();
3777 self
3778 }
3779
3780 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3782 self.0.options = v.into();
3783 self
3784 }
3785
3786 pub async fn send(self) -> Result<longrunning::model::Operation> {
3793 (*self.0.stub)
3794 .delete_entry_group(self.0.request, self.0.options)
3795 .await
3796 .map(gax::response::Response::into_body)
3797 }
3798
3799 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3801 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3802 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3803 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3804
3805 let stub = self.0.stub.clone();
3806 let mut options = self.0.options.clone();
3807 options.set_retry_policy(gax::retry_policy::NeverRetry);
3808 let query = move |name| {
3809 let stub = stub.clone();
3810 let options = options.clone();
3811 async {
3812 let op = GetOperation::new(stub)
3813 .set_name(name)
3814 .with_options(options)
3815 .send()
3816 .await?;
3817 Ok(Operation::new(op))
3818 }
3819 };
3820
3821 let start = move || async {
3822 let op = self.send().await?;
3823 Ok(Operation::new(op))
3824 };
3825
3826 lro::internal::new_unit_response_poller(
3827 polling_error_policy,
3828 polling_backoff_policy,
3829 start,
3830 query,
3831 )
3832 }
3833
3834 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3838 self.0.request.name = v.into();
3839 self
3840 }
3841
3842 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3844 self.0.request.etag = v.into();
3845 self
3846 }
3847 }
3848
3849 #[doc(hidden)]
3850 impl gax::options::internal::RequestBuilder for DeleteEntryGroup {
3851 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3852 &mut self.0.options
3853 }
3854 }
3855
3856 #[derive(Clone, Debug)]
3877 pub struct ListEntryGroups(RequestBuilder<crate::model::ListEntryGroupsRequest>);
3878
3879 impl ListEntryGroups {
3880 pub(crate) fn new(
3881 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3882 ) -> Self {
3883 Self(RequestBuilder::new(stub))
3884 }
3885
3886 pub fn with_request<V: Into<crate::model::ListEntryGroupsRequest>>(mut self, v: V) -> Self {
3888 self.0.request = v.into();
3889 self
3890 }
3891
3892 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3894 self.0.options = v.into();
3895 self
3896 }
3897
3898 pub async fn send(self) -> Result<crate::model::ListEntryGroupsResponse> {
3900 (*self.0.stub)
3901 .list_entry_groups(self.0.request, self.0.options)
3902 .await
3903 .map(gax::response::Response::into_body)
3904 }
3905
3906 pub fn by_page(
3908 self,
3909 ) -> impl gax::paginator::Paginator<crate::model::ListEntryGroupsResponse, gax::error::Error>
3910 {
3911 use std::clone::Clone;
3912 let token = self.0.request.page_token.clone();
3913 let execute = move |token: String| {
3914 let mut builder = self.clone();
3915 builder.0.request = builder.0.request.set_page_token(token);
3916 builder.send()
3917 };
3918 gax::paginator::internal::new_paginator(token, execute)
3919 }
3920
3921 pub fn by_item(
3923 self,
3924 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntryGroupsResponse, gax::error::Error>
3925 {
3926 use gax::paginator::Paginator;
3927 self.by_page().items()
3928 }
3929
3930 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3934 self.0.request.parent = v.into();
3935 self
3936 }
3937
3938 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3940 self.0.request.page_size = v.into();
3941 self
3942 }
3943
3944 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3946 self.0.request.page_token = v.into();
3947 self
3948 }
3949
3950 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3952 self.0.request.filter = v.into();
3953 self
3954 }
3955
3956 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3958 self.0.request.order_by = v.into();
3959 self
3960 }
3961 }
3962
3963 #[doc(hidden)]
3964 impl gax::options::internal::RequestBuilder for ListEntryGroups {
3965 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3966 &mut self.0.options
3967 }
3968 }
3969
3970 #[derive(Clone, Debug)]
3987 pub struct GetEntryGroup(RequestBuilder<crate::model::GetEntryGroupRequest>);
3988
3989 impl GetEntryGroup {
3990 pub(crate) fn new(
3991 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3992 ) -> Self {
3993 Self(RequestBuilder::new(stub))
3994 }
3995
3996 pub fn with_request<V: Into<crate::model::GetEntryGroupRequest>>(mut self, v: V) -> Self {
3998 self.0.request = v.into();
3999 self
4000 }
4001
4002 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4004 self.0.options = v.into();
4005 self
4006 }
4007
4008 pub async fn send(self) -> Result<crate::model::EntryGroup> {
4010 (*self.0.stub)
4011 .get_entry_group(self.0.request, self.0.options)
4012 .await
4013 .map(gax::response::Response::into_body)
4014 }
4015
4016 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4020 self.0.request.name = v.into();
4021 self
4022 }
4023 }
4024
4025 #[doc(hidden)]
4026 impl gax::options::internal::RequestBuilder for GetEntryGroup {
4027 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4028 &mut self.0.options
4029 }
4030 }
4031
4032 #[derive(Clone, Debug)]
4049 pub struct CreateEntry(RequestBuilder<crate::model::CreateEntryRequest>);
4050
4051 impl CreateEntry {
4052 pub(crate) fn new(
4053 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4054 ) -> Self {
4055 Self(RequestBuilder::new(stub))
4056 }
4057
4058 pub fn with_request<V: Into<crate::model::CreateEntryRequest>>(mut self, v: V) -> Self {
4060 self.0.request = v.into();
4061 self
4062 }
4063
4064 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4066 self.0.options = v.into();
4067 self
4068 }
4069
4070 pub async fn send(self) -> Result<crate::model::Entry> {
4072 (*self.0.stub)
4073 .create_entry(self.0.request, self.0.options)
4074 .await
4075 .map(gax::response::Response::into_body)
4076 }
4077
4078 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4082 self.0.request.parent = v.into();
4083 self
4084 }
4085
4086 pub fn set_entry_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4090 self.0.request.entry_id = v.into();
4091 self
4092 }
4093
4094 pub fn set_entry<T>(mut self, v: T) -> Self
4098 where
4099 T: std::convert::Into<crate::model::Entry>,
4100 {
4101 self.0.request.entry = std::option::Option::Some(v.into());
4102 self
4103 }
4104
4105 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4109 where
4110 T: std::convert::Into<crate::model::Entry>,
4111 {
4112 self.0.request.entry = v.map(|x| x.into());
4113 self
4114 }
4115 }
4116
4117 #[doc(hidden)]
4118 impl gax::options::internal::RequestBuilder for CreateEntry {
4119 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4120 &mut self.0.options
4121 }
4122 }
4123
4124 #[derive(Clone, Debug)]
4141 pub struct UpdateEntry(RequestBuilder<crate::model::UpdateEntryRequest>);
4142
4143 impl UpdateEntry {
4144 pub(crate) fn new(
4145 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4146 ) -> Self {
4147 Self(RequestBuilder::new(stub))
4148 }
4149
4150 pub fn with_request<V: Into<crate::model::UpdateEntryRequest>>(mut self, v: V) -> Self {
4152 self.0.request = v.into();
4153 self
4154 }
4155
4156 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4158 self.0.options = v.into();
4159 self
4160 }
4161
4162 pub async fn send(self) -> Result<crate::model::Entry> {
4164 (*self.0.stub)
4165 .update_entry(self.0.request, self.0.options)
4166 .await
4167 .map(gax::response::Response::into_body)
4168 }
4169
4170 pub fn set_entry<T>(mut self, v: T) -> Self
4174 where
4175 T: std::convert::Into<crate::model::Entry>,
4176 {
4177 self.0.request.entry = std::option::Option::Some(v.into());
4178 self
4179 }
4180
4181 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4185 where
4186 T: std::convert::Into<crate::model::Entry>,
4187 {
4188 self.0.request.entry = v.map(|x| x.into());
4189 self
4190 }
4191
4192 pub fn set_update_mask<T>(mut self, v: T) -> Self
4194 where
4195 T: std::convert::Into<wkt::FieldMask>,
4196 {
4197 self.0.request.update_mask = std::option::Option::Some(v.into());
4198 self
4199 }
4200
4201 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4203 where
4204 T: std::convert::Into<wkt::FieldMask>,
4205 {
4206 self.0.request.update_mask = v.map(|x| x.into());
4207 self
4208 }
4209
4210 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4212 self.0.request.allow_missing = v.into();
4213 self
4214 }
4215
4216 pub fn set_delete_missing_aspects<T: Into<bool>>(mut self, v: T) -> Self {
4218 self.0.request.delete_missing_aspects = v.into();
4219 self
4220 }
4221
4222 pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
4224 where
4225 T: std::iter::IntoIterator<Item = V>,
4226 V: std::convert::Into<std::string::String>,
4227 {
4228 use std::iter::Iterator;
4229 self.0.request.aspect_keys = v.into_iter().map(|i| i.into()).collect();
4230 self
4231 }
4232 }
4233
4234 #[doc(hidden)]
4235 impl gax::options::internal::RequestBuilder for UpdateEntry {
4236 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4237 &mut self.0.options
4238 }
4239 }
4240
4241 #[derive(Clone, Debug)]
4258 pub struct DeleteEntry(RequestBuilder<crate::model::DeleteEntryRequest>);
4259
4260 impl DeleteEntry {
4261 pub(crate) fn new(
4262 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4263 ) -> Self {
4264 Self(RequestBuilder::new(stub))
4265 }
4266
4267 pub fn with_request<V: Into<crate::model::DeleteEntryRequest>>(mut self, v: V) -> Self {
4269 self.0.request = v.into();
4270 self
4271 }
4272
4273 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4275 self.0.options = v.into();
4276 self
4277 }
4278
4279 pub async fn send(self) -> Result<crate::model::Entry> {
4281 (*self.0.stub)
4282 .delete_entry(self.0.request, self.0.options)
4283 .await
4284 .map(gax::response::Response::into_body)
4285 }
4286
4287 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4291 self.0.request.name = v.into();
4292 self
4293 }
4294 }
4295
4296 #[doc(hidden)]
4297 impl gax::options::internal::RequestBuilder for DeleteEntry {
4298 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4299 &mut self.0.options
4300 }
4301 }
4302
4303 #[derive(Clone, Debug)]
4324 pub struct ListEntries(RequestBuilder<crate::model::ListEntriesRequest>);
4325
4326 impl ListEntries {
4327 pub(crate) fn new(
4328 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4329 ) -> Self {
4330 Self(RequestBuilder::new(stub))
4331 }
4332
4333 pub fn with_request<V: Into<crate::model::ListEntriesRequest>>(mut self, v: V) -> Self {
4335 self.0.request = v.into();
4336 self
4337 }
4338
4339 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4341 self.0.options = v.into();
4342 self
4343 }
4344
4345 pub async fn send(self) -> Result<crate::model::ListEntriesResponse> {
4347 (*self.0.stub)
4348 .list_entries(self.0.request, self.0.options)
4349 .await
4350 .map(gax::response::Response::into_body)
4351 }
4352
4353 pub fn by_page(
4355 self,
4356 ) -> impl gax::paginator::Paginator<crate::model::ListEntriesResponse, gax::error::Error>
4357 {
4358 use std::clone::Clone;
4359 let token = self.0.request.page_token.clone();
4360 let execute = move |token: String| {
4361 let mut builder = self.clone();
4362 builder.0.request = builder.0.request.set_page_token(token);
4363 builder.send()
4364 };
4365 gax::paginator::internal::new_paginator(token, execute)
4366 }
4367
4368 pub fn by_item(
4370 self,
4371 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntriesResponse, gax::error::Error>
4372 {
4373 use gax::paginator::Paginator;
4374 self.by_page().items()
4375 }
4376
4377 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4381 self.0.request.parent = v.into();
4382 self
4383 }
4384
4385 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4387 self.0.request.page_size = v.into();
4388 self
4389 }
4390
4391 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4393 self.0.request.page_token = v.into();
4394 self
4395 }
4396
4397 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4399 self.0.request.filter = v.into();
4400 self
4401 }
4402 }
4403
4404 #[doc(hidden)]
4405 impl gax::options::internal::RequestBuilder for ListEntries {
4406 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4407 &mut self.0.options
4408 }
4409 }
4410
4411 #[derive(Clone, Debug)]
4428 pub struct GetEntry(RequestBuilder<crate::model::GetEntryRequest>);
4429
4430 impl GetEntry {
4431 pub(crate) fn new(
4432 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4433 ) -> Self {
4434 Self(RequestBuilder::new(stub))
4435 }
4436
4437 pub fn with_request<V: Into<crate::model::GetEntryRequest>>(mut self, v: V) -> Self {
4439 self.0.request = v.into();
4440 self
4441 }
4442
4443 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4445 self.0.options = v.into();
4446 self
4447 }
4448
4449 pub async fn send(self) -> Result<crate::model::Entry> {
4451 (*self.0.stub)
4452 .get_entry(self.0.request, self.0.options)
4453 .await
4454 .map(gax::response::Response::into_body)
4455 }
4456
4457 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4461 self.0.request.name = v.into();
4462 self
4463 }
4464
4465 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
4467 self.0.request.view = v.into();
4468 self
4469 }
4470
4471 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
4473 where
4474 T: std::iter::IntoIterator<Item = V>,
4475 V: std::convert::Into<std::string::String>,
4476 {
4477 use std::iter::Iterator;
4478 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
4479 self
4480 }
4481
4482 pub fn set_paths<T, V>(mut self, v: T) -> Self
4484 where
4485 T: std::iter::IntoIterator<Item = V>,
4486 V: std::convert::Into<std::string::String>,
4487 {
4488 use std::iter::Iterator;
4489 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
4490 self
4491 }
4492 }
4493
4494 #[doc(hidden)]
4495 impl gax::options::internal::RequestBuilder for GetEntry {
4496 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4497 &mut self.0.options
4498 }
4499 }
4500
4501 #[derive(Clone, Debug)]
4518 pub struct LookupEntry(RequestBuilder<crate::model::LookupEntryRequest>);
4519
4520 impl LookupEntry {
4521 pub(crate) fn new(
4522 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4523 ) -> Self {
4524 Self(RequestBuilder::new(stub))
4525 }
4526
4527 pub fn with_request<V: Into<crate::model::LookupEntryRequest>>(mut self, v: V) -> Self {
4529 self.0.request = v.into();
4530 self
4531 }
4532
4533 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4535 self.0.options = v.into();
4536 self
4537 }
4538
4539 pub async fn send(self) -> Result<crate::model::Entry> {
4541 (*self.0.stub)
4542 .lookup_entry(self.0.request, self.0.options)
4543 .await
4544 .map(gax::response::Response::into_body)
4545 }
4546
4547 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4551 self.0.request.name = v.into();
4552 self
4553 }
4554
4555 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
4557 self.0.request.view = v.into();
4558 self
4559 }
4560
4561 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
4563 where
4564 T: std::iter::IntoIterator<Item = V>,
4565 V: std::convert::Into<std::string::String>,
4566 {
4567 use std::iter::Iterator;
4568 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
4569 self
4570 }
4571
4572 pub fn set_paths<T, V>(mut self, v: T) -> Self
4574 where
4575 T: std::iter::IntoIterator<Item = V>,
4576 V: std::convert::Into<std::string::String>,
4577 {
4578 use std::iter::Iterator;
4579 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
4580 self
4581 }
4582
4583 pub fn set_entry<T: Into<std::string::String>>(mut self, v: T) -> Self {
4587 self.0.request.entry = v.into();
4588 self
4589 }
4590 }
4591
4592 #[doc(hidden)]
4593 impl gax::options::internal::RequestBuilder for LookupEntry {
4594 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4595 &mut self.0.options
4596 }
4597 }
4598
4599 #[derive(Clone, Debug)]
4620 pub struct SearchEntries(RequestBuilder<crate::model::SearchEntriesRequest>);
4621
4622 impl SearchEntries {
4623 pub(crate) fn new(
4624 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4625 ) -> Self {
4626 Self(RequestBuilder::new(stub))
4627 }
4628
4629 pub fn with_request<V: Into<crate::model::SearchEntriesRequest>>(mut self, v: V) -> Self {
4631 self.0.request = v.into();
4632 self
4633 }
4634
4635 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4637 self.0.options = v.into();
4638 self
4639 }
4640
4641 pub async fn send(self) -> Result<crate::model::SearchEntriesResponse> {
4643 (*self.0.stub)
4644 .search_entries(self.0.request, self.0.options)
4645 .await
4646 .map(gax::response::Response::into_body)
4647 }
4648
4649 pub fn by_page(
4651 self,
4652 ) -> impl gax::paginator::Paginator<crate::model::SearchEntriesResponse, gax::error::Error>
4653 {
4654 use std::clone::Clone;
4655 let token = self.0.request.page_token.clone();
4656 let execute = move |token: String| {
4657 let mut builder = self.clone();
4658 builder.0.request = builder.0.request.set_page_token(token);
4659 builder.send()
4660 };
4661 gax::paginator::internal::new_paginator(token, execute)
4662 }
4663
4664 pub fn by_item(
4666 self,
4667 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchEntriesResponse, gax::error::Error>
4668 {
4669 use gax::paginator::Paginator;
4670 self.by_page().items()
4671 }
4672
4673 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4677 self.0.request.name = v.into();
4678 self
4679 }
4680
4681 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
4685 self.0.request.query = v.into();
4686 self
4687 }
4688
4689 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4691 self.0.request.page_size = v.into();
4692 self
4693 }
4694
4695 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4697 self.0.request.page_token = v.into();
4698 self
4699 }
4700
4701 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4703 self.0.request.order_by = v.into();
4704 self
4705 }
4706
4707 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
4709 self.0.request.scope = v.into();
4710 self
4711 }
4712
4713 pub fn set_semantic_search<T: Into<bool>>(mut self, v: T) -> Self {
4715 self.0.request.semantic_search = v.into();
4716 self
4717 }
4718 }
4719
4720 #[doc(hidden)]
4721 impl gax::options::internal::RequestBuilder for SearchEntries {
4722 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4723 &mut self.0.options
4724 }
4725 }
4726
4727 #[derive(Clone, Debug)]
4745 pub struct CreateMetadataJob(RequestBuilder<crate::model::CreateMetadataJobRequest>);
4746
4747 impl CreateMetadataJob {
4748 pub(crate) fn new(
4749 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4750 ) -> Self {
4751 Self(RequestBuilder::new(stub))
4752 }
4753
4754 pub fn with_request<V: Into<crate::model::CreateMetadataJobRequest>>(
4756 mut self,
4757 v: V,
4758 ) -> Self {
4759 self.0.request = v.into();
4760 self
4761 }
4762
4763 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4765 self.0.options = v.into();
4766 self
4767 }
4768
4769 pub async fn send(self) -> Result<longrunning::model::Operation> {
4776 (*self.0.stub)
4777 .create_metadata_job(self.0.request, self.0.options)
4778 .await
4779 .map(gax::response::Response::into_body)
4780 }
4781
4782 pub fn poller(
4784 self,
4785 ) -> impl lro::Poller<crate::model::MetadataJob, crate::model::OperationMetadata> {
4786 type Operation = lro::internal::Operation<
4787 crate::model::MetadataJob,
4788 crate::model::OperationMetadata,
4789 >;
4790 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4791 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4792
4793 let stub = self.0.stub.clone();
4794 let mut options = self.0.options.clone();
4795 options.set_retry_policy(gax::retry_policy::NeverRetry);
4796 let query = move |name| {
4797 let stub = stub.clone();
4798 let options = options.clone();
4799 async {
4800 let op = GetOperation::new(stub)
4801 .set_name(name)
4802 .with_options(options)
4803 .send()
4804 .await?;
4805 Ok(Operation::new(op))
4806 }
4807 };
4808
4809 let start = move || async {
4810 let op = self.send().await?;
4811 Ok(Operation::new(op))
4812 };
4813
4814 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4815 }
4816
4817 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4821 self.0.request.parent = v.into();
4822 self
4823 }
4824
4825 pub fn set_metadata_job<T>(mut self, v: T) -> Self
4829 where
4830 T: std::convert::Into<crate::model::MetadataJob>,
4831 {
4832 self.0.request.metadata_job = std::option::Option::Some(v.into());
4833 self
4834 }
4835
4836 pub fn set_or_clear_metadata_job<T>(mut self, v: std::option::Option<T>) -> Self
4840 where
4841 T: std::convert::Into<crate::model::MetadataJob>,
4842 {
4843 self.0.request.metadata_job = v.map(|x| x.into());
4844 self
4845 }
4846
4847 pub fn set_metadata_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4849 self.0.request.metadata_job_id = v.into();
4850 self
4851 }
4852
4853 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4855 self.0.request.validate_only = v.into();
4856 self
4857 }
4858 }
4859
4860 #[doc(hidden)]
4861 impl gax::options::internal::RequestBuilder for CreateMetadataJob {
4862 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4863 &mut self.0.options
4864 }
4865 }
4866
4867 #[derive(Clone, Debug)]
4884 pub struct GetMetadataJob(RequestBuilder<crate::model::GetMetadataJobRequest>);
4885
4886 impl GetMetadataJob {
4887 pub(crate) fn new(
4888 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4889 ) -> Self {
4890 Self(RequestBuilder::new(stub))
4891 }
4892
4893 pub fn with_request<V: Into<crate::model::GetMetadataJobRequest>>(mut self, v: V) -> Self {
4895 self.0.request = v.into();
4896 self
4897 }
4898
4899 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4901 self.0.options = v.into();
4902 self
4903 }
4904
4905 pub async fn send(self) -> Result<crate::model::MetadataJob> {
4907 (*self.0.stub)
4908 .get_metadata_job(self.0.request, self.0.options)
4909 .await
4910 .map(gax::response::Response::into_body)
4911 }
4912
4913 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4917 self.0.request.name = v.into();
4918 self
4919 }
4920 }
4921
4922 #[doc(hidden)]
4923 impl gax::options::internal::RequestBuilder for GetMetadataJob {
4924 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4925 &mut self.0.options
4926 }
4927 }
4928
4929 #[derive(Clone, Debug)]
4950 pub struct ListMetadataJobs(RequestBuilder<crate::model::ListMetadataJobsRequest>);
4951
4952 impl ListMetadataJobs {
4953 pub(crate) fn new(
4954 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4955 ) -> Self {
4956 Self(RequestBuilder::new(stub))
4957 }
4958
4959 pub fn with_request<V: Into<crate::model::ListMetadataJobsRequest>>(
4961 mut self,
4962 v: V,
4963 ) -> Self {
4964 self.0.request = v.into();
4965 self
4966 }
4967
4968 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4970 self.0.options = v.into();
4971 self
4972 }
4973
4974 pub async fn send(self) -> Result<crate::model::ListMetadataJobsResponse> {
4976 (*self.0.stub)
4977 .list_metadata_jobs(self.0.request, self.0.options)
4978 .await
4979 .map(gax::response::Response::into_body)
4980 }
4981
4982 pub fn by_page(
4984 self,
4985 ) -> impl gax::paginator::Paginator<crate::model::ListMetadataJobsResponse, gax::error::Error>
4986 {
4987 use std::clone::Clone;
4988 let token = self.0.request.page_token.clone();
4989 let execute = move |token: String| {
4990 let mut builder = self.clone();
4991 builder.0.request = builder.0.request.set_page_token(token);
4992 builder.send()
4993 };
4994 gax::paginator::internal::new_paginator(token, execute)
4995 }
4996
4997 pub fn by_item(
4999 self,
5000 ) -> impl gax::paginator::ItemPaginator<crate::model::ListMetadataJobsResponse, gax::error::Error>
5001 {
5002 use gax::paginator::Paginator;
5003 self.by_page().items()
5004 }
5005
5006 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5010 self.0.request.parent = v.into();
5011 self
5012 }
5013
5014 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5016 self.0.request.page_size = v.into();
5017 self
5018 }
5019
5020 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5022 self.0.request.page_token = v.into();
5023 self
5024 }
5025
5026 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5028 self.0.request.filter = v.into();
5029 self
5030 }
5031
5032 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5034 self.0.request.order_by = v.into();
5035 self
5036 }
5037 }
5038
5039 #[doc(hidden)]
5040 impl gax::options::internal::RequestBuilder for ListMetadataJobs {
5041 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5042 &mut self.0.options
5043 }
5044 }
5045
5046 #[derive(Clone, Debug)]
5063 pub struct CancelMetadataJob(RequestBuilder<crate::model::CancelMetadataJobRequest>);
5064
5065 impl CancelMetadataJob {
5066 pub(crate) fn new(
5067 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5068 ) -> Self {
5069 Self(RequestBuilder::new(stub))
5070 }
5071
5072 pub fn with_request<V: Into<crate::model::CancelMetadataJobRequest>>(
5074 mut self,
5075 v: V,
5076 ) -> Self {
5077 self.0.request = v.into();
5078 self
5079 }
5080
5081 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5083 self.0.options = v.into();
5084 self
5085 }
5086
5087 pub async fn send(self) -> Result<()> {
5089 (*self.0.stub)
5090 .cancel_metadata_job(self.0.request, self.0.options)
5091 .await
5092 .map(gax::response::Response::into_body)
5093 }
5094
5095 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5099 self.0.request.name = v.into();
5100 self
5101 }
5102 }
5103
5104 #[doc(hidden)]
5105 impl gax::options::internal::RequestBuilder for CancelMetadataJob {
5106 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5107 &mut self.0.options
5108 }
5109 }
5110
5111 #[derive(Clone, Debug)]
5128 pub struct CreateEntryLink(RequestBuilder<crate::model::CreateEntryLinkRequest>);
5129
5130 impl CreateEntryLink {
5131 pub(crate) fn new(
5132 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5133 ) -> Self {
5134 Self(RequestBuilder::new(stub))
5135 }
5136
5137 pub fn with_request<V: Into<crate::model::CreateEntryLinkRequest>>(mut self, v: V) -> Self {
5139 self.0.request = v.into();
5140 self
5141 }
5142
5143 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5145 self.0.options = v.into();
5146 self
5147 }
5148
5149 pub async fn send(self) -> Result<crate::model::EntryLink> {
5151 (*self.0.stub)
5152 .create_entry_link(self.0.request, self.0.options)
5153 .await
5154 .map(gax::response::Response::into_body)
5155 }
5156
5157 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5161 self.0.request.parent = v.into();
5162 self
5163 }
5164
5165 pub fn set_entry_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5169 self.0.request.entry_link_id = v.into();
5170 self
5171 }
5172
5173 pub fn set_entry_link<T>(mut self, v: T) -> Self
5177 where
5178 T: std::convert::Into<crate::model::EntryLink>,
5179 {
5180 self.0.request.entry_link = std::option::Option::Some(v.into());
5181 self
5182 }
5183
5184 pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
5188 where
5189 T: std::convert::Into<crate::model::EntryLink>,
5190 {
5191 self.0.request.entry_link = v.map(|x| x.into());
5192 self
5193 }
5194 }
5195
5196 #[doc(hidden)]
5197 impl gax::options::internal::RequestBuilder for CreateEntryLink {
5198 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5199 &mut self.0.options
5200 }
5201 }
5202
5203 #[derive(Clone, Debug)]
5220 pub struct DeleteEntryLink(RequestBuilder<crate::model::DeleteEntryLinkRequest>);
5221
5222 impl DeleteEntryLink {
5223 pub(crate) fn new(
5224 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5225 ) -> Self {
5226 Self(RequestBuilder::new(stub))
5227 }
5228
5229 pub fn with_request<V: Into<crate::model::DeleteEntryLinkRequest>>(mut self, v: V) -> Self {
5231 self.0.request = v.into();
5232 self
5233 }
5234
5235 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5237 self.0.options = v.into();
5238 self
5239 }
5240
5241 pub async fn send(self) -> Result<crate::model::EntryLink> {
5243 (*self.0.stub)
5244 .delete_entry_link(self.0.request, self.0.options)
5245 .await
5246 .map(gax::response::Response::into_body)
5247 }
5248
5249 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5253 self.0.request.name = v.into();
5254 self
5255 }
5256 }
5257
5258 #[doc(hidden)]
5259 impl gax::options::internal::RequestBuilder for DeleteEntryLink {
5260 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5261 &mut self.0.options
5262 }
5263 }
5264
5265 #[derive(Clone, Debug)]
5282 pub struct GetEntryLink(RequestBuilder<crate::model::GetEntryLinkRequest>);
5283
5284 impl GetEntryLink {
5285 pub(crate) fn new(
5286 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5287 ) -> Self {
5288 Self(RequestBuilder::new(stub))
5289 }
5290
5291 pub fn with_request<V: Into<crate::model::GetEntryLinkRequest>>(mut self, v: V) -> Self {
5293 self.0.request = v.into();
5294 self
5295 }
5296
5297 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5299 self.0.options = v.into();
5300 self
5301 }
5302
5303 pub async fn send(self) -> Result<crate::model::EntryLink> {
5305 (*self.0.stub)
5306 .get_entry_link(self.0.request, self.0.options)
5307 .await
5308 .map(gax::response::Response::into_body)
5309 }
5310
5311 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5315 self.0.request.name = v.into();
5316 self
5317 }
5318 }
5319
5320 #[doc(hidden)]
5321 impl gax::options::internal::RequestBuilder for GetEntryLink {
5322 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5323 &mut self.0.options
5324 }
5325 }
5326
5327 #[derive(Clone, Debug)]
5348 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5349
5350 impl ListLocations {
5351 pub(crate) fn new(
5352 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5353 ) -> Self {
5354 Self(RequestBuilder::new(stub))
5355 }
5356
5357 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5359 mut self,
5360 v: V,
5361 ) -> Self {
5362 self.0.request = v.into();
5363 self
5364 }
5365
5366 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5368 self.0.options = v.into();
5369 self
5370 }
5371
5372 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5374 (*self.0.stub)
5375 .list_locations(self.0.request, self.0.options)
5376 .await
5377 .map(gax::response::Response::into_body)
5378 }
5379
5380 pub fn by_page(
5382 self,
5383 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5384 {
5385 use std::clone::Clone;
5386 let token = self.0.request.page_token.clone();
5387 let execute = move |token: String| {
5388 let mut builder = self.clone();
5389 builder.0.request = builder.0.request.set_page_token(token);
5390 builder.send()
5391 };
5392 gax::paginator::internal::new_paginator(token, execute)
5393 }
5394
5395 pub fn by_item(
5397 self,
5398 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5399 {
5400 use gax::paginator::Paginator;
5401 self.by_page().items()
5402 }
5403
5404 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5406 self.0.request.name = v.into();
5407 self
5408 }
5409
5410 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5412 self.0.request.filter = v.into();
5413 self
5414 }
5415
5416 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5418 self.0.request.page_size = v.into();
5419 self
5420 }
5421
5422 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5424 self.0.request.page_token = v.into();
5425 self
5426 }
5427 }
5428
5429 #[doc(hidden)]
5430 impl gax::options::internal::RequestBuilder for ListLocations {
5431 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5432 &mut self.0.options
5433 }
5434 }
5435
5436 #[derive(Clone, Debug)]
5453 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5454
5455 impl GetLocation {
5456 pub(crate) fn new(
5457 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5458 ) -> Self {
5459 Self(RequestBuilder::new(stub))
5460 }
5461
5462 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5464 self.0.request = v.into();
5465 self
5466 }
5467
5468 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5470 self.0.options = v.into();
5471 self
5472 }
5473
5474 pub async fn send(self) -> Result<location::model::Location> {
5476 (*self.0.stub)
5477 .get_location(self.0.request, self.0.options)
5478 .await
5479 .map(gax::response::Response::into_body)
5480 }
5481
5482 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5484 self.0.request.name = v.into();
5485 self
5486 }
5487 }
5488
5489 #[doc(hidden)]
5490 impl gax::options::internal::RequestBuilder for GetLocation {
5491 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5492 &mut self.0.options
5493 }
5494 }
5495
5496 #[derive(Clone, Debug)]
5513 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5514
5515 impl SetIamPolicy {
5516 pub(crate) fn new(
5517 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5518 ) -> Self {
5519 Self(RequestBuilder::new(stub))
5520 }
5521
5522 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5524 self.0.request = v.into();
5525 self
5526 }
5527
5528 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5530 self.0.options = v.into();
5531 self
5532 }
5533
5534 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5536 (*self.0.stub)
5537 .set_iam_policy(self.0.request, self.0.options)
5538 .await
5539 .map(gax::response::Response::into_body)
5540 }
5541
5542 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5546 self.0.request.resource = v.into();
5547 self
5548 }
5549
5550 pub fn set_policy<T>(mut self, v: T) -> Self
5554 where
5555 T: std::convert::Into<iam_v1::model::Policy>,
5556 {
5557 self.0.request.policy = std::option::Option::Some(v.into());
5558 self
5559 }
5560
5561 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5565 where
5566 T: std::convert::Into<iam_v1::model::Policy>,
5567 {
5568 self.0.request.policy = v.map(|x| x.into());
5569 self
5570 }
5571
5572 pub fn set_update_mask<T>(mut self, v: T) -> Self
5574 where
5575 T: std::convert::Into<wkt::FieldMask>,
5576 {
5577 self.0.request.update_mask = std::option::Option::Some(v.into());
5578 self
5579 }
5580
5581 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5583 where
5584 T: std::convert::Into<wkt::FieldMask>,
5585 {
5586 self.0.request.update_mask = v.map(|x| x.into());
5587 self
5588 }
5589 }
5590
5591 #[doc(hidden)]
5592 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5593 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5594 &mut self.0.options
5595 }
5596 }
5597
5598 #[derive(Clone, Debug)]
5615 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5616
5617 impl GetIamPolicy {
5618 pub(crate) fn new(
5619 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5620 ) -> Self {
5621 Self(RequestBuilder::new(stub))
5622 }
5623
5624 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5626 self.0.request = v.into();
5627 self
5628 }
5629
5630 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5632 self.0.options = v.into();
5633 self
5634 }
5635
5636 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5638 (*self.0.stub)
5639 .get_iam_policy(self.0.request, self.0.options)
5640 .await
5641 .map(gax::response::Response::into_body)
5642 }
5643
5644 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5648 self.0.request.resource = v.into();
5649 self
5650 }
5651
5652 pub fn set_options<T>(mut self, v: T) -> Self
5654 where
5655 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5656 {
5657 self.0.request.options = std::option::Option::Some(v.into());
5658 self
5659 }
5660
5661 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5663 where
5664 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5665 {
5666 self.0.request.options = v.map(|x| x.into());
5667 self
5668 }
5669 }
5670
5671 #[doc(hidden)]
5672 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5673 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5674 &mut self.0.options
5675 }
5676 }
5677
5678 #[derive(Clone, Debug)]
5695 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5696
5697 impl TestIamPermissions {
5698 pub(crate) fn new(
5699 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5700 ) -> Self {
5701 Self(RequestBuilder::new(stub))
5702 }
5703
5704 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5706 mut self,
5707 v: V,
5708 ) -> Self {
5709 self.0.request = v.into();
5710 self
5711 }
5712
5713 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5715 self.0.options = v.into();
5716 self
5717 }
5718
5719 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5721 (*self.0.stub)
5722 .test_iam_permissions(self.0.request, self.0.options)
5723 .await
5724 .map(gax::response::Response::into_body)
5725 }
5726
5727 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5731 self.0.request.resource = v.into();
5732 self
5733 }
5734
5735 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5739 where
5740 T: std::iter::IntoIterator<Item = V>,
5741 V: std::convert::Into<std::string::String>,
5742 {
5743 use std::iter::Iterator;
5744 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5745 self
5746 }
5747 }
5748
5749 #[doc(hidden)]
5750 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5751 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5752 &mut self.0.options
5753 }
5754 }
5755
5756 #[derive(Clone, Debug)]
5777 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5778
5779 impl ListOperations {
5780 pub(crate) fn new(
5781 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5782 ) -> Self {
5783 Self(RequestBuilder::new(stub))
5784 }
5785
5786 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5788 mut self,
5789 v: V,
5790 ) -> Self {
5791 self.0.request = v.into();
5792 self
5793 }
5794
5795 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5797 self.0.options = v.into();
5798 self
5799 }
5800
5801 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5803 (*self.0.stub)
5804 .list_operations(self.0.request, self.0.options)
5805 .await
5806 .map(gax::response::Response::into_body)
5807 }
5808
5809 pub fn by_page(
5811 self,
5812 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5813 {
5814 use std::clone::Clone;
5815 let token = self.0.request.page_token.clone();
5816 let execute = move |token: String| {
5817 let mut builder = self.clone();
5818 builder.0.request = builder.0.request.set_page_token(token);
5819 builder.send()
5820 };
5821 gax::paginator::internal::new_paginator(token, execute)
5822 }
5823
5824 pub fn by_item(
5826 self,
5827 ) -> impl gax::paginator::ItemPaginator<
5828 longrunning::model::ListOperationsResponse,
5829 gax::error::Error,
5830 > {
5831 use gax::paginator::Paginator;
5832 self.by_page().items()
5833 }
5834
5835 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5837 self.0.request.name = v.into();
5838 self
5839 }
5840
5841 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5843 self.0.request.filter = v.into();
5844 self
5845 }
5846
5847 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5849 self.0.request.page_size = v.into();
5850 self
5851 }
5852
5853 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5855 self.0.request.page_token = v.into();
5856 self
5857 }
5858
5859 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5861 self.0.request.return_partial_success = v.into();
5862 self
5863 }
5864 }
5865
5866 #[doc(hidden)]
5867 impl gax::options::internal::RequestBuilder for ListOperations {
5868 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5869 &mut self.0.options
5870 }
5871 }
5872
5873 #[derive(Clone, Debug)]
5890 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5891
5892 impl GetOperation {
5893 pub(crate) fn new(
5894 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5895 ) -> Self {
5896 Self(RequestBuilder::new(stub))
5897 }
5898
5899 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5901 mut self,
5902 v: V,
5903 ) -> Self {
5904 self.0.request = v.into();
5905 self
5906 }
5907
5908 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5910 self.0.options = v.into();
5911 self
5912 }
5913
5914 pub async fn send(self) -> Result<longrunning::model::Operation> {
5916 (*self.0.stub)
5917 .get_operation(self.0.request, self.0.options)
5918 .await
5919 .map(gax::response::Response::into_body)
5920 }
5921
5922 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5924 self.0.request.name = v.into();
5925 self
5926 }
5927 }
5928
5929 #[doc(hidden)]
5930 impl gax::options::internal::RequestBuilder for GetOperation {
5931 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5932 &mut self.0.options
5933 }
5934 }
5935
5936 #[derive(Clone, Debug)]
5953 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5954
5955 impl DeleteOperation {
5956 pub(crate) fn new(
5957 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5958 ) -> Self {
5959 Self(RequestBuilder::new(stub))
5960 }
5961
5962 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5964 mut self,
5965 v: V,
5966 ) -> Self {
5967 self.0.request = v.into();
5968 self
5969 }
5970
5971 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5973 self.0.options = v.into();
5974 self
5975 }
5976
5977 pub async fn send(self) -> Result<()> {
5979 (*self.0.stub)
5980 .delete_operation(self.0.request, self.0.options)
5981 .await
5982 .map(gax::response::Response::into_body)
5983 }
5984
5985 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5987 self.0.request.name = v.into();
5988 self
5989 }
5990 }
5991
5992 #[doc(hidden)]
5993 impl gax::options::internal::RequestBuilder for DeleteOperation {
5994 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5995 &mut self.0.options
5996 }
5997 }
5998
5999 #[derive(Clone, Debug)]
6016 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6017
6018 impl CancelOperation {
6019 pub(crate) fn new(
6020 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6021 ) -> Self {
6022 Self(RequestBuilder::new(stub))
6023 }
6024
6025 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6027 mut self,
6028 v: V,
6029 ) -> Self {
6030 self.0.request = v.into();
6031 self
6032 }
6033
6034 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6036 self.0.options = v.into();
6037 self
6038 }
6039
6040 pub async fn send(self) -> Result<()> {
6042 (*self.0.stub)
6043 .cancel_operation(self.0.request, self.0.options)
6044 .await
6045 .map(gax::response::Response::into_body)
6046 }
6047
6048 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6050 self.0.request.name = v.into();
6051 self
6052 }
6053 }
6054
6055 #[doc(hidden)]
6056 impl gax::options::internal::RequestBuilder for CancelOperation {
6057 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6058 &mut self.0.options
6059 }
6060 }
6061}
6062
6063pub mod cmek_service {
6064 use crate::Result;
6065
6066 pub type ClientBuilder =
6080 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6081
6082 pub(crate) mod client {
6083 use super::super::super::client::CmekService;
6084 pub struct Factory;
6085 impl gax::client_builder::internal::ClientFactory for Factory {
6086 type Client = CmekService;
6087 type Credentials = gaxi::options::Credentials;
6088 async fn build(
6089 self,
6090 config: gaxi::options::ClientConfig,
6091 ) -> gax::client_builder::Result<Self::Client> {
6092 Self::Client::new(config).await
6093 }
6094 }
6095 }
6096
6097 #[derive(Clone, Debug)]
6099 pub(crate) struct RequestBuilder<R: std::default::Default> {
6100 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6101 request: R,
6102 options: gax::options::RequestOptions,
6103 }
6104
6105 impl<R> RequestBuilder<R>
6106 where
6107 R: std::default::Default,
6108 {
6109 pub(crate) fn new(
6110 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6111 ) -> Self {
6112 Self {
6113 stub,
6114 request: R::default(),
6115 options: gax::options::RequestOptions::default(),
6116 }
6117 }
6118 }
6119
6120 #[derive(Clone, Debug)]
6138 pub struct CreateEncryptionConfig(RequestBuilder<crate::model::CreateEncryptionConfigRequest>);
6139
6140 impl CreateEncryptionConfig {
6141 pub(crate) fn new(
6142 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6143 ) -> Self {
6144 Self(RequestBuilder::new(stub))
6145 }
6146
6147 pub fn with_request<V: Into<crate::model::CreateEncryptionConfigRequest>>(
6149 mut self,
6150 v: V,
6151 ) -> Self {
6152 self.0.request = v.into();
6153 self
6154 }
6155
6156 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6158 self.0.options = v.into();
6159 self
6160 }
6161
6162 pub async fn send(self) -> Result<longrunning::model::Operation> {
6169 (*self.0.stub)
6170 .create_encryption_config(self.0.request, self.0.options)
6171 .await
6172 .map(gax::response::Response::into_body)
6173 }
6174
6175 pub fn poller(
6177 self,
6178 ) -> impl lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
6179 {
6180 type Operation = lro::internal::Operation<
6181 crate::model::EncryptionConfig,
6182 crate::model::OperationMetadata,
6183 >;
6184 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6185 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6186
6187 let stub = self.0.stub.clone();
6188 let mut options = self.0.options.clone();
6189 options.set_retry_policy(gax::retry_policy::NeverRetry);
6190 let query = move |name| {
6191 let stub = stub.clone();
6192 let options = options.clone();
6193 async {
6194 let op = GetOperation::new(stub)
6195 .set_name(name)
6196 .with_options(options)
6197 .send()
6198 .await?;
6199 Ok(Operation::new(op))
6200 }
6201 };
6202
6203 let start = move || async {
6204 let op = self.send().await?;
6205 Ok(Operation::new(op))
6206 };
6207
6208 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6209 }
6210
6211 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6215 self.0.request.parent = v.into();
6216 self
6217 }
6218
6219 pub fn set_encryption_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6223 self.0.request.encryption_config_id = v.into();
6224 self
6225 }
6226
6227 pub fn set_encryption_config<T>(mut self, v: T) -> Self
6231 where
6232 T: std::convert::Into<crate::model::EncryptionConfig>,
6233 {
6234 self.0.request.encryption_config = std::option::Option::Some(v.into());
6235 self
6236 }
6237
6238 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
6242 where
6243 T: std::convert::Into<crate::model::EncryptionConfig>,
6244 {
6245 self.0.request.encryption_config = v.map(|x| x.into());
6246 self
6247 }
6248 }
6249
6250 #[doc(hidden)]
6251 impl gax::options::internal::RequestBuilder for CreateEncryptionConfig {
6252 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6253 &mut self.0.options
6254 }
6255 }
6256
6257 #[derive(Clone, Debug)]
6275 pub struct UpdateEncryptionConfig(RequestBuilder<crate::model::UpdateEncryptionConfigRequest>);
6276
6277 impl UpdateEncryptionConfig {
6278 pub(crate) fn new(
6279 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6280 ) -> Self {
6281 Self(RequestBuilder::new(stub))
6282 }
6283
6284 pub fn with_request<V: Into<crate::model::UpdateEncryptionConfigRequest>>(
6286 mut self,
6287 v: V,
6288 ) -> Self {
6289 self.0.request = v.into();
6290 self
6291 }
6292
6293 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6295 self.0.options = v.into();
6296 self
6297 }
6298
6299 pub async fn send(self) -> Result<longrunning::model::Operation> {
6306 (*self.0.stub)
6307 .update_encryption_config(self.0.request, self.0.options)
6308 .await
6309 .map(gax::response::Response::into_body)
6310 }
6311
6312 pub fn poller(
6314 self,
6315 ) -> impl lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
6316 {
6317 type Operation = lro::internal::Operation<
6318 crate::model::EncryptionConfig,
6319 crate::model::OperationMetadata,
6320 >;
6321 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6322 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6323
6324 let stub = self.0.stub.clone();
6325 let mut options = self.0.options.clone();
6326 options.set_retry_policy(gax::retry_policy::NeverRetry);
6327 let query = move |name| {
6328 let stub = stub.clone();
6329 let options = options.clone();
6330 async {
6331 let op = GetOperation::new(stub)
6332 .set_name(name)
6333 .with_options(options)
6334 .send()
6335 .await?;
6336 Ok(Operation::new(op))
6337 }
6338 };
6339
6340 let start = move || async {
6341 let op = self.send().await?;
6342 Ok(Operation::new(op))
6343 };
6344
6345 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6346 }
6347
6348 pub fn set_encryption_config<T>(mut self, v: T) -> Self
6352 where
6353 T: std::convert::Into<crate::model::EncryptionConfig>,
6354 {
6355 self.0.request.encryption_config = std::option::Option::Some(v.into());
6356 self
6357 }
6358
6359 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
6363 where
6364 T: std::convert::Into<crate::model::EncryptionConfig>,
6365 {
6366 self.0.request.encryption_config = v.map(|x| x.into());
6367 self
6368 }
6369
6370 pub fn set_update_mask<T>(mut self, v: T) -> Self
6372 where
6373 T: std::convert::Into<wkt::FieldMask>,
6374 {
6375 self.0.request.update_mask = std::option::Option::Some(v.into());
6376 self
6377 }
6378
6379 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6381 where
6382 T: std::convert::Into<wkt::FieldMask>,
6383 {
6384 self.0.request.update_mask = v.map(|x| x.into());
6385 self
6386 }
6387 }
6388
6389 #[doc(hidden)]
6390 impl gax::options::internal::RequestBuilder for UpdateEncryptionConfig {
6391 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6392 &mut self.0.options
6393 }
6394 }
6395
6396 #[derive(Clone, Debug)]
6414 pub struct DeleteEncryptionConfig(RequestBuilder<crate::model::DeleteEncryptionConfigRequest>);
6415
6416 impl DeleteEncryptionConfig {
6417 pub(crate) fn new(
6418 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6419 ) -> Self {
6420 Self(RequestBuilder::new(stub))
6421 }
6422
6423 pub fn with_request<V: Into<crate::model::DeleteEncryptionConfigRequest>>(
6425 mut self,
6426 v: V,
6427 ) -> Self {
6428 self.0.request = v.into();
6429 self
6430 }
6431
6432 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6434 self.0.options = v.into();
6435 self
6436 }
6437
6438 pub async fn send(self) -> Result<longrunning::model::Operation> {
6445 (*self.0.stub)
6446 .delete_encryption_config(self.0.request, self.0.options)
6447 .await
6448 .map(gax::response::Response::into_body)
6449 }
6450
6451 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
6453 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6454 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6455 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6456
6457 let stub = self.0.stub.clone();
6458 let mut options = self.0.options.clone();
6459 options.set_retry_policy(gax::retry_policy::NeverRetry);
6460 let query = move |name| {
6461 let stub = stub.clone();
6462 let options = options.clone();
6463 async {
6464 let op = GetOperation::new(stub)
6465 .set_name(name)
6466 .with_options(options)
6467 .send()
6468 .await?;
6469 Ok(Operation::new(op))
6470 }
6471 };
6472
6473 let start = move || async {
6474 let op = self.send().await?;
6475 Ok(Operation::new(op))
6476 };
6477
6478 lro::internal::new_unit_response_poller(
6479 polling_error_policy,
6480 polling_backoff_policy,
6481 start,
6482 query,
6483 )
6484 }
6485
6486 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6490 self.0.request.name = v.into();
6491 self
6492 }
6493
6494 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6496 self.0.request.etag = v.into();
6497 self
6498 }
6499 }
6500
6501 #[doc(hidden)]
6502 impl gax::options::internal::RequestBuilder for DeleteEncryptionConfig {
6503 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6504 &mut self.0.options
6505 }
6506 }
6507
6508 #[derive(Clone, Debug)]
6529 pub struct ListEncryptionConfigs(RequestBuilder<crate::model::ListEncryptionConfigsRequest>);
6530
6531 impl ListEncryptionConfigs {
6532 pub(crate) fn new(
6533 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6534 ) -> Self {
6535 Self(RequestBuilder::new(stub))
6536 }
6537
6538 pub fn with_request<V: Into<crate::model::ListEncryptionConfigsRequest>>(
6540 mut self,
6541 v: V,
6542 ) -> Self {
6543 self.0.request = v.into();
6544 self
6545 }
6546
6547 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6549 self.0.options = v.into();
6550 self
6551 }
6552
6553 pub async fn send(self) -> Result<crate::model::ListEncryptionConfigsResponse> {
6555 (*self.0.stub)
6556 .list_encryption_configs(self.0.request, self.0.options)
6557 .await
6558 .map(gax::response::Response::into_body)
6559 }
6560
6561 pub fn by_page(
6563 self,
6564 ) -> impl gax::paginator::Paginator<crate::model::ListEncryptionConfigsResponse, gax::error::Error>
6565 {
6566 use std::clone::Clone;
6567 let token = self.0.request.page_token.clone();
6568 let execute = move |token: String| {
6569 let mut builder = self.clone();
6570 builder.0.request = builder.0.request.set_page_token(token);
6571 builder.send()
6572 };
6573 gax::paginator::internal::new_paginator(token, execute)
6574 }
6575
6576 pub fn by_item(
6578 self,
6579 ) -> impl gax::paginator::ItemPaginator<
6580 crate::model::ListEncryptionConfigsResponse,
6581 gax::error::Error,
6582 > {
6583 use gax::paginator::Paginator;
6584 self.by_page().items()
6585 }
6586
6587 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6591 self.0.request.parent = v.into();
6592 self
6593 }
6594
6595 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6597 self.0.request.page_size = v.into();
6598 self
6599 }
6600
6601 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6603 self.0.request.page_token = v.into();
6604 self
6605 }
6606
6607 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6609 self.0.request.filter = v.into();
6610 self
6611 }
6612
6613 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6615 self.0.request.order_by = v.into();
6616 self
6617 }
6618 }
6619
6620 #[doc(hidden)]
6621 impl gax::options::internal::RequestBuilder for ListEncryptionConfigs {
6622 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6623 &mut self.0.options
6624 }
6625 }
6626
6627 #[derive(Clone, Debug)]
6644 pub struct GetEncryptionConfig(RequestBuilder<crate::model::GetEncryptionConfigRequest>);
6645
6646 impl GetEncryptionConfig {
6647 pub(crate) fn new(
6648 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6649 ) -> Self {
6650 Self(RequestBuilder::new(stub))
6651 }
6652
6653 pub fn with_request<V: Into<crate::model::GetEncryptionConfigRequest>>(
6655 mut self,
6656 v: V,
6657 ) -> Self {
6658 self.0.request = v.into();
6659 self
6660 }
6661
6662 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6664 self.0.options = v.into();
6665 self
6666 }
6667
6668 pub async fn send(self) -> Result<crate::model::EncryptionConfig> {
6670 (*self.0.stub)
6671 .get_encryption_config(self.0.request, self.0.options)
6672 .await
6673 .map(gax::response::Response::into_body)
6674 }
6675
6676 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6680 self.0.request.name = v.into();
6681 self
6682 }
6683 }
6684
6685 #[doc(hidden)]
6686 impl gax::options::internal::RequestBuilder for GetEncryptionConfig {
6687 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6688 &mut self.0.options
6689 }
6690 }
6691
6692 #[derive(Clone, Debug)]
6713 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
6714
6715 impl ListLocations {
6716 pub(crate) fn new(
6717 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6718 ) -> Self {
6719 Self(RequestBuilder::new(stub))
6720 }
6721
6722 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
6724 mut self,
6725 v: V,
6726 ) -> Self {
6727 self.0.request = v.into();
6728 self
6729 }
6730
6731 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6733 self.0.options = v.into();
6734 self
6735 }
6736
6737 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
6739 (*self.0.stub)
6740 .list_locations(self.0.request, self.0.options)
6741 .await
6742 .map(gax::response::Response::into_body)
6743 }
6744
6745 pub fn by_page(
6747 self,
6748 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
6749 {
6750 use std::clone::Clone;
6751 let token = self.0.request.page_token.clone();
6752 let execute = move |token: String| {
6753 let mut builder = self.clone();
6754 builder.0.request = builder.0.request.set_page_token(token);
6755 builder.send()
6756 };
6757 gax::paginator::internal::new_paginator(token, execute)
6758 }
6759
6760 pub fn by_item(
6762 self,
6763 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
6764 {
6765 use gax::paginator::Paginator;
6766 self.by_page().items()
6767 }
6768
6769 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6771 self.0.request.name = v.into();
6772 self
6773 }
6774
6775 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6777 self.0.request.filter = v.into();
6778 self
6779 }
6780
6781 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6783 self.0.request.page_size = v.into();
6784 self
6785 }
6786
6787 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6789 self.0.request.page_token = v.into();
6790 self
6791 }
6792 }
6793
6794 #[doc(hidden)]
6795 impl gax::options::internal::RequestBuilder for ListLocations {
6796 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6797 &mut self.0.options
6798 }
6799 }
6800
6801 #[derive(Clone, Debug)]
6818 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
6819
6820 impl GetLocation {
6821 pub(crate) fn new(
6822 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6823 ) -> Self {
6824 Self(RequestBuilder::new(stub))
6825 }
6826
6827 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
6829 self.0.request = v.into();
6830 self
6831 }
6832
6833 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6835 self.0.options = v.into();
6836 self
6837 }
6838
6839 pub async fn send(self) -> Result<location::model::Location> {
6841 (*self.0.stub)
6842 .get_location(self.0.request, self.0.options)
6843 .await
6844 .map(gax::response::Response::into_body)
6845 }
6846
6847 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6849 self.0.request.name = v.into();
6850 self
6851 }
6852 }
6853
6854 #[doc(hidden)]
6855 impl gax::options::internal::RequestBuilder for GetLocation {
6856 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6857 &mut self.0.options
6858 }
6859 }
6860
6861 #[derive(Clone, Debug)]
6878 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
6879
6880 impl SetIamPolicy {
6881 pub(crate) fn new(
6882 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6883 ) -> Self {
6884 Self(RequestBuilder::new(stub))
6885 }
6886
6887 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
6889 self.0.request = v.into();
6890 self
6891 }
6892
6893 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6895 self.0.options = v.into();
6896 self
6897 }
6898
6899 pub async fn send(self) -> Result<iam_v1::model::Policy> {
6901 (*self.0.stub)
6902 .set_iam_policy(self.0.request, self.0.options)
6903 .await
6904 .map(gax::response::Response::into_body)
6905 }
6906
6907 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6911 self.0.request.resource = v.into();
6912 self
6913 }
6914
6915 pub fn set_policy<T>(mut self, v: T) -> Self
6919 where
6920 T: std::convert::Into<iam_v1::model::Policy>,
6921 {
6922 self.0.request.policy = std::option::Option::Some(v.into());
6923 self
6924 }
6925
6926 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6930 where
6931 T: std::convert::Into<iam_v1::model::Policy>,
6932 {
6933 self.0.request.policy = v.map(|x| x.into());
6934 self
6935 }
6936
6937 pub fn set_update_mask<T>(mut self, v: T) -> Self
6939 where
6940 T: std::convert::Into<wkt::FieldMask>,
6941 {
6942 self.0.request.update_mask = std::option::Option::Some(v.into());
6943 self
6944 }
6945
6946 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6948 where
6949 T: std::convert::Into<wkt::FieldMask>,
6950 {
6951 self.0.request.update_mask = v.map(|x| x.into());
6952 self
6953 }
6954 }
6955
6956 #[doc(hidden)]
6957 impl gax::options::internal::RequestBuilder for SetIamPolicy {
6958 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6959 &mut self.0.options
6960 }
6961 }
6962
6963 #[derive(Clone, Debug)]
6980 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
6981
6982 impl GetIamPolicy {
6983 pub(crate) fn new(
6984 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6985 ) -> Self {
6986 Self(RequestBuilder::new(stub))
6987 }
6988
6989 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
6991 self.0.request = v.into();
6992 self
6993 }
6994
6995 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6997 self.0.options = v.into();
6998 self
6999 }
7000
7001 pub async fn send(self) -> Result<iam_v1::model::Policy> {
7003 (*self.0.stub)
7004 .get_iam_policy(self.0.request, self.0.options)
7005 .await
7006 .map(gax::response::Response::into_body)
7007 }
7008
7009 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7013 self.0.request.resource = v.into();
7014 self
7015 }
7016
7017 pub fn set_options<T>(mut self, v: T) -> Self
7019 where
7020 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7021 {
7022 self.0.request.options = std::option::Option::Some(v.into());
7023 self
7024 }
7025
7026 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7028 where
7029 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7030 {
7031 self.0.request.options = v.map(|x| x.into());
7032 self
7033 }
7034 }
7035
7036 #[doc(hidden)]
7037 impl gax::options::internal::RequestBuilder for GetIamPolicy {
7038 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7039 &mut self.0.options
7040 }
7041 }
7042
7043 #[derive(Clone, Debug)]
7060 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
7061
7062 impl TestIamPermissions {
7063 pub(crate) fn new(
7064 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7065 ) -> Self {
7066 Self(RequestBuilder::new(stub))
7067 }
7068
7069 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
7071 mut self,
7072 v: V,
7073 ) -> Self {
7074 self.0.request = v.into();
7075 self
7076 }
7077
7078 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7080 self.0.options = v.into();
7081 self
7082 }
7083
7084 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
7086 (*self.0.stub)
7087 .test_iam_permissions(self.0.request, self.0.options)
7088 .await
7089 .map(gax::response::Response::into_body)
7090 }
7091
7092 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7096 self.0.request.resource = v.into();
7097 self
7098 }
7099
7100 pub fn set_permissions<T, V>(mut self, v: T) -> Self
7104 where
7105 T: std::iter::IntoIterator<Item = V>,
7106 V: std::convert::Into<std::string::String>,
7107 {
7108 use std::iter::Iterator;
7109 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7110 self
7111 }
7112 }
7113
7114 #[doc(hidden)]
7115 impl gax::options::internal::RequestBuilder for TestIamPermissions {
7116 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7117 &mut self.0.options
7118 }
7119 }
7120
7121 #[derive(Clone, Debug)]
7142 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
7143
7144 impl ListOperations {
7145 pub(crate) fn new(
7146 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7147 ) -> Self {
7148 Self(RequestBuilder::new(stub))
7149 }
7150
7151 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
7153 mut self,
7154 v: V,
7155 ) -> Self {
7156 self.0.request = v.into();
7157 self
7158 }
7159
7160 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7162 self.0.options = v.into();
7163 self
7164 }
7165
7166 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
7168 (*self.0.stub)
7169 .list_operations(self.0.request, self.0.options)
7170 .await
7171 .map(gax::response::Response::into_body)
7172 }
7173
7174 pub fn by_page(
7176 self,
7177 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
7178 {
7179 use std::clone::Clone;
7180 let token = self.0.request.page_token.clone();
7181 let execute = move |token: String| {
7182 let mut builder = self.clone();
7183 builder.0.request = builder.0.request.set_page_token(token);
7184 builder.send()
7185 };
7186 gax::paginator::internal::new_paginator(token, execute)
7187 }
7188
7189 pub fn by_item(
7191 self,
7192 ) -> impl gax::paginator::ItemPaginator<
7193 longrunning::model::ListOperationsResponse,
7194 gax::error::Error,
7195 > {
7196 use gax::paginator::Paginator;
7197 self.by_page().items()
7198 }
7199
7200 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7202 self.0.request.name = v.into();
7203 self
7204 }
7205
7206 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7208 self.0.request.filter = v.into();
7209 self
7210 }
7211
7212 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7214 self.0.request.page_size = v.into();
7215 self
7216 }
7217
7218 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7220 self.0.request.page_token = v.into();
7221 self
7222 }
7223
7224 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7226 self.0.request.return_partial_success = v.into();
7227 self
7228 }
7229 }
7230
7231 #[doc(hidden)]
7232 impl gax::options::internal::RequestBuilder for ListOperations {
7233 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7234 &mut self.0.options
7235 }
7236 }
7237
7238 #[derive(Clone, Debug)]
7255 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7256
7257 impl GetOperation {
7258 pub(crate) fn new(
7259 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7260 ) -> Self {
7261 Self(RequestBuilder::new(stub))
7262 }
7263
7264 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7266 mut self,
7267 v: V,
7268 ) -> Self {
7269 self.0.request = v.into();
7270 self
7271 }
7272
7273 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7275 self.0.options = v.into();
7276 self
7277 }
7278
7279 pub async fn send(self) -> Result<longrunning::model::Operation> {
7281 (*self.0.stub)
7282 .get_operation(self.0.request, self.0.options)
7283 .await
7284 .map(gax::response::Response::into_body)
7285 }
7286
7287 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7289 self.0.request.name = v.into();
7290 self
7291 }
7292 }
7293
7294 #[doc(hidden)]
7295 impl gax::options::internal::RequestBuilder for GetOperation {
7296 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7297 &mut self.0.options
7298 }
7299 }
7300
7301 #[derive(Clone, Debug)]
7318 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
7319
7320 impl DeleteOperation {
7321 pub(crate) fn new(
7322 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7323 ) -> Self {
7324 Self(RequestBuilder::new(stub))
7325 }
7326
7327 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
7329 mut self,
7330 v: V,
7331 ) -> Self {
7332 self.0.request = v.into();
7333 self
7334 }
7335
7336 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7338 self.0.options = v.into();
7339 self
7340 }
7341
7342 pub async fn send(self) -> Result<()> {
7344 (*self.0.stub)
7345 .delete_operation(self.0.request, self.0.options)
7346 .await
7347 .map(gax::response::Response::into_body)
7348 }
7349
7350 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7352 self.0.request.name = v.into();
7353 self
7354 }
7355 }
7356
7357 #[doc(hidden)]
7358 impl gax::options::internal::RequestBuilder for DeleteOperation {
7359 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7360 &mut self.0.options
7361 }
7362 }
7363
7364 #[derive(Clone, Debug)]
7381 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
7382
7383 impl CancelOperation {
7384 pub(crate) fn new(
7385 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7386 ) -> Self {
7387 Self(RequestBuilder::new(stub))
7388 }
7389
7390 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
7392 mut self,
7393 v: V,
7394 ) -> Self {
7395 self.0.request = v.into();
7396 self
7397 }
7398
7399 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7401 self.0.options = v.into();
7402 self
7403 }
7404
7405 pub async fn send(self) -> Result<()> {
7407 (*self.0.stub)
7408 .cancel_operation(self.0.request, self.0.options)
7409 .await
7410 .map(gax::response::Response::into_body)
7411 }
7412
7413 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7415 self.0.request.name = v.into();
7416 self
7417 }
7418 }
7419
7420 #[doc(hidden)]
7421 impl gax::options::internal::RequestBuilder for CancelOperation {
7422 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7423 &mut self.0.options
7424 }
7425 }
7426}
7427
7428pub mod content_service {
7429 use crate::Result;
7430
7431 pub type ClientBuilder =
7445 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7446
7447 pub(crate) mod client {
7448 use super::super::super::client::ContentService;
7449 pub struct Factory;
7450 impl gax::client_builder::internal::ClientFactory for Factory {
7451 type Client = ContentService;
7452 type Credentials = gaxi::options::Credentials;
7453 async fn build(
7454 self,
7455 config: gaxi::options::ClientConfig,
7456 ) -> gax::client_builder::Result<Self::Client> {
7457 Self::Client::new(config).await
7458 }
7459 }
7460 }
7461
7462 #[derive(Clone, Debug)]
7464 pub(crate) struct RequestBuilder<R: std::default::Default> {
7465 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7466 request: R,
7467 options: gax::options::RequestOptions,
7468 }
7469
7470 impl<R> RequestBuilder<R>
7471 where
7472 R: std::default::Default,
7473 {
7474 pub(crate) fn new(
7475 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7476 ) -> Self {
7477 Self {
7478 stub,
7479 request: R::default(),
7480 options: gax::options::RequestOptions::default(),
7481 }
7482 }
7483 }
7484
7485 #[derive(Clone, Debug)]
7502 pub struct CreateContent(RequestBuilder<crate::model::CreateContentRequest>);
7503
7504 impl CreateContent {
7505 pub(crate) fn new(
7506 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7507 ) -> Self {
7508 Self(RequestBuilder::new(stub))
7509 }
7510
7511 pub fn with_request<V: Into<crate::model::CreateContentRequest>>(mut self, v: V) -> Self {
7513 self.0.request = v.into();
7514 self
7515 }
7516
7517 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7519 self.0.options = v.into();
7520 self
7521 }
7522
7523 pub async fn send(self) -> Result<crate::model::Content> {
7525 (*self.0.stub)
7526 .create_content(self.0.request, self.0.options)
7527 .await
7528 .map(gax::response::Response::into_body)
7529 }
7530
7531 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7535 self.0.request.parent = v.into();
7536 self
7537 }
7538
7539 pub fn set_content<T>(mut self, v: T) -> Self
7543 where
7544 T: std::convert::Into<crate::model::Content>,
7545 {
7546 self.0.request.content = std::option::Option::Some(v.into());
7547 self
7548 }
7549
7550 pub fn set_or_clear_content<T>(mut self, v: std::option::Option<T>) -> Self
7554 where
7555 T: std::convert::Into<crate::model::Content>,
7556 {
7557 self.0.request.content = v.map(|x| x.into());
7558 self
7559 }
7560
7561 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
7563 self.0.request.validate_only = v.into();
7564 self
7565 }
7566 }
7567
7568 #[doc(hidden)]
7569 impl gax::options::internal::RequestBuilder for CreateContent {
7570 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7571 &mut self.0.options
7572 }
7573 }
7574
7575 #[derive(Clone, Debug)]
7592 pub struct UpdateContent(RequestBuilder<crate::model::UpdateContentRequest>);
7593
7594 impl UpdateContent {
7595 pub(crate) fn new(
7596 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7597 ) -> Self {
7598 Self(RequestBuilder::new(stub))
7599 }
7600
7601 pub fn with_request<V: Into<crate::model::UpdateContentRequest>>(mut self, v: V) -> Self {
7603 self.0.request = v.into();
7604 self
7605 }
7606
7607 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7609 self.0.options = v.into();
7610 self
7611 }
7612
7613 pub async fn send(self) -> Result<crate::model::Content> {
7615 (*self.0.stub)
7616 .update_content(self.0.request, self.0.options)
7617 .await
7618 .map(gax::response::Response::into_body)
7619 }
7620
7621 pub fn set_update_mask<T>(mut self, v: T) -> Self
7625 where
7626 T: std::convert::Into<wkt::FieldMask>,
7627 {
7628 self.0.request.update_mask = std::option::Option::Some(v.into());
7629 self
7630 }
7631
7632 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7636 where
7637 T: std::convert::Into<wkt::FieldMask>,
7638 {
7639 self.0.request.update_mask = v.map(|x| x.into());
7640 self
7641 }
7642
7643 pub fn set_content<T>(mut self, v: T) -> Self
7647 where
7648 T: std::convert::Into<crate::model::Content>,
7649 {
7650 self.0.request.content = std::option::Option::Some(v.into());
7651 self
7652 }
7653
7654 pub fn set_or_clear_content<T>(mut self, v: std::option::Option<T>) -> Self
7658 where
7659 T: std::convert::Into<crate::model::Content>,
7660 {
7661 self.0.request.content = v.map(|x| x.into());
7662 self
7663 }
7664
7665 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
7667 self.0.request.validate_only = v.into();
7668 self
7669 }
7670 }
7671
7672 #[doc(hidden)]
7673 impl gax::options::internal::RequestBuilder for UpdateContent {
7674 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7675 &mut self.0.options
7676 }
7677 }
7678
7679 #[derive(Clone, Debug)]
7696 pub struct DeleteContent(RequestBuilder<crate::model::DeleteContentRequest>);
7697
7698 impl DeleteContent {
7699 pub(crate) fn new(
7700 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7701 ) -> Self {
7702 Self(RequestBuilder::new(stub))
7703 }
7704
7705 pub fn with_request<V: Into<crate::model::DeleteContentRequest>>(mut self, v: V) -> Self {
7707 self.0.request = v.into();
7708 self
7709 }
7710
7711 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7713 self.0.options = v.into();
7714 self
7715 }
7716
7717 pub async fn send(self) -> Result<()> {
7719 (*self.0.stub)
7720 .delete_content(self.0.request, self.0.options)
7721 .await
7722 .map(gax::response::Response::into_body)
7723 }
7724
7725 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7729 self.0.request.name = v.into();
7730 self
7731 }
7732 }
7733
7734 #[doc(hidden)]
7735 impl gax::options::internal::RequestBuilder for DeleteContent {
7736 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7737 &mut self.0.options
7738 }
7739 }
7740
7741 #[derive(Clone, Debug)]
7758 pub struct GetContent(RequestBuilder<crate::model::GetContentRequest>);
7759
7760 impl GetContent {
7761 pub(crate) fn new(
7762 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7763 ) -> Self {
7764 Self(RequestBuilder::new(stub))
7765 }
7766
7767 pub fn with_request<V: Into<crate::model::GetContentRequest>>(mut self, v: V) -> Self {
7769 self.0.request = v.into();
7770 self
7771 }
7772
7773 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7775 self.0.options = v.into();
7776 self
7777 }
7778
7779 pub async fn send(self) -> Result<crate::model::Content> {
7781 (*self.0.stub)
7782 .get_content(self.0.request, self.0.options)
7783 .await
7784 .map(gax::response::Response::into_body)
7785 }
7786
7787 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7791 self.0.request.name = v.into();
7792 self
7793 }
7794
7795 pub fn set_view<T: Into<crate::model::get_content_request::ContentView>>(
7797 mut self,
7798 v: T,
7799 ) -> Self {
7800 self.0.request.view = v.into();
7801 self
7802 }
7803 }
7804
7805 #[doc(hidden)]
7806 impl gax::options::internal::RequestBuilder for GetContent {
7807 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7808 &mut self.0.options
7809 }
7810 }
7811
7812 #[derive(Clone, Debug)]
7829 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
7830
7831 impl GetIamPolicy {
7832 pub(crate) fn new(
7833 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7834 ) -> Self {
7835 Self(RequestBuilder::new(stub))
7836 }
7837
7838 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
7840 self.0.request = v.into();
7841 self
7842 }
7843
7844 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7846 self.0.options = v.into();
7847 self
7848 }
7849
7850 pub async fn send(self) -> Result<iam_v1::model::Policy> {
7852 (*self.0.stub)
7853 .get_iam_policy(self.0.request, self.0.options)
7854 .await
7855 .map(gax::response::Response::into_body)
7856 }
7857
7858 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7862 self.0.request.resource = v.into();
7863 self
7864 }
7865
7866 pub fn set_options<T>(mut self, v: T) -> Self
7868 where
7869 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7870 {
7871 self.0.request.options = std::option::Option::Some(v.into());
7872 self
7873 }
7874
7875 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7877 where
7878 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7879 {
7880 self.0.request.options = v.map(|x| x.into());
7881 self
7882 }
7883 }
7884
7885 #[doc(hidden)]
7886 impl gax::options::internal::RequestBuilder for GetIamPolicy {
7887 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7888 &mut self.0.options
7889 }
7890 }
7891
7892 #[derive(Clone, Debug)]
7909 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
7910
7911 impl SetIamPolicy {
7912 pub(crate) fn new(
7913 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7914 ) -> Self {
7915 Self(RequestBuilder::new(stub))
7916 }
7917
7918 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
7920 self.0.request = v.into();
7921 self
7922 }
7923
7924 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7926 self.0.options = v.into();
7927 self
7928 }
7929
7930 pub async fn send(self) -> Result<iam_v1::model::Policy> {
7932 (*self.0.stub)
7933 .set_iam_policy(self.0.request, self.0.options)
7934 .await
7935 .map(gax::response::Response::into_body)
7936 }
7937
7938 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7942 self.0.request.resource = v.into();
7943 self
7944 }
7945
7946 pub fn set_policy<T>(mut self, v: T) -> Self
7950 where
7951 T: std::convert::Into<iam_v1::model::Policy>,
7952 {
7953 self.0.request.policy = std::option::Option::Some(v.into());
7954 self
7955 }
7956
7957 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7961 where
7962 T: std::convert::Into<iam_v1::model::Policy>,
7963 {
7964 self.0.request.policy = v.map(|x| x.into());
7965 self
7966 }
7967
7968 pub fn set_update_mask<T>(mut self, v: T) -> Self
7970 where
7971 T: std::convert::Into<wkt::FieldMask>,
7972 {
7973 self.0.request.update_mask = std::option::Option::Some(v.into());
7974 self
7975 }
7976
7977 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7979 where
7980 T: std::convert::Into<wkt::FieldMask>,
7981 {
7982 self.0.request.update_mask = v.map(|x| x.into());
7983 self
7984 }
7985 }
7986
7987 #[doc(hidden)]
7988 impl gax::options::internal::RequestBuilder for SetIamPolicy {
7989 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7990 &mut self.0.options
7991 }
7992 }
7993
7994 #[derive(Clone, Debug)]
8011 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
8012
8013 impl TestIamPermissions {
8014 pub(crate) fn new(
8015 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8016 ) -> Self {
8017 Self(RequestBuilder::new(stub))
8018 }
8019
8020 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
8022 mut self,
8023 v: V,
8024 ) -> Self {
8025 self.0.request = v.into();
8026 self
8027 }
8028
8029 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8031 self.0.options = v.into();
8032 self
8033 }
8034
8035 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
8037 (*self.0.stub)
8038 .test_iam_permissions(self.0.request, self.0.options)
8039 .await
8040 .map(gax::response::Response::into_body)
8041 }
8042
8043 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8047 self.0.request.resource = v.into();
8048 self
8049 }
8050
8051 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8055 where
8056 T: std::iter::IntoIterator<Item = V>,
8057 V: std::convert::Into<std::string::String>,
8058 {
8059 use std::iter::Iterator;
8060 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8061 self
8062 }
8063 }
8064
8065 #[doc(hidden)]
8066 impl gax::options::internal::RequestBuilder for TestIamPermissions {
8067 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8068 &mut self.0.options
8069 }
8070 }
8071
8072 #[derive(Clone, Debug)]
8093 pub struct ListContent(RequestBuilder<crate::model::ListContentRequest>);
8094
8095 impl ListContent {
8096 pub(crate) fn new(
8097 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8098 ) -> Self {
8099 Self(RequestBuilder::new(stub))
8100 }
8101
8102 pub fn with_request<V: Into<crate::model::ListContentRequest>>(mut self, v: V) -> Self {
8104 self.0.request = v.into();
8105 self
8106 }
8107
8108 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8110 self.0.options = v.into();
8111 self
8112 }
8113
8114 pub async fn send(self) -> Result<crate::model::ListContentResponse> {
8116 (*self.0.stub)
8117 .list_content(self.0.request, self.0.options)
8118 .await
8119 .map(gax::response::Response::into_body)
8120 }
8121
8122 pub fn by_page(
8124 self,
8125 ) -> impl gax::paginator::Paginator<crate::model::ListContentResponse, gax::error::Error>
8126 {
8127 use std::clone::Clone;
8128 let token = self.0.request.page_token.clone();
8129 let execute = move |token: String| {
8130 let mut builder = self.clone();
8131 builder.0.request = builder.0.request.set_page_token(token);
8132 builder.send()
8133 };
8134 gax::paginator::internal::new_paginator(token, execute)
8135 }
8136
8137 pub fn by_item(
8139 self,
8140 ) -> impl gax::paginator::ItemPaginator<crate::model::ListContentResponse, gax::error::Error>
8141 {
8142 use gax::paginator::Paginator;
8143 self.by_page().items()
8144 }
8145
8146 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8150 self.0.request.parent = v.into();
8151 self
8152 }
8153
8154 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8156 self.0.request.page_size = v.into();
8157 self
8158 }
8159
8160 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8162 self.0.request.page_token = v.into();
8163 self
8164 }
8165
8166 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8168 self.0.request.filter = v.into();
8169 self
8170 }
8171 }
8172
8173 #[doc(hidden)]
8174 impl gax::options::internal::RequestBuilder for ListContent {
8175 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8176 &mut self.0.options
8177 }
8178 }
8179
8180 #[derive(Clone, Debug)]
8201 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
8202
8203 impl ListLocations {
8204 pub(crate) fn new(
8205 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8206 ) -> Self {
8207 Self(RequestBuilder::new(stub))
8208 }
8209
8210 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
8212 mut self,
8213 v: V,
8214 ) -> Self {
8215 self.0.request = v.into();
8216 self
8217 }
8218
8219 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8221 self.0.options = v.into();
8222 self
8223 }
8224
8225 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
8227 (*self.0.stub)
8228 .list_locations(self.0.request, self.0.options)
8229 .await
8230 .map(gax::response::Response::into_body)
8231 }
8232
8233 pub fn by_page(
8235 self,
8236 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
8237 {
8238 use std::clone::Clone;
8239 let token = self.0.request.page_token.clone();
8240 let execute = move |token: String| {
8241 let mut builder = self.clone();
8242 builder.0.request = builder.0.request.set_page_token(token);
8243 builder.send()
8244 };
8245 gax::paginator::internal::new_paginator(token, execute)
8246 }
8247
8248 pub fn by_item(
8250 self,
8251 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
8252 {
8253 use gax::paginator::Paginator;
8254 self.by_page().items()
8255 }
8256
8257 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8259 self.0.request.name = v.into();
8260 self
8261 }
8262
8263 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8265 self.0.request.filter = v.into();
8266 self
8267 }
8268
8269 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8271 self.0.request.page_size = v.into();
8272 self
8273 }
8274
8275 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8277 self.0.request.page_token = v.into();
8278 self
8279 }
8280 }
8281
8282 #[doc(hidden)]
8283 impl gax::options::internal::RequestBuilder for ListLocations {
8284 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8285 &mut self.0.options
8286 }
8287 }
8288
8289 #[derive(Clone, Debug)]
8306 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
8307
8308 impl GetLocation {
8309 pub(crate) fn new(
8310 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8311 ) -> Self {
8312 Self(RequestBuilder::new(stub))
8313 }
8314
8315 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
8317 self.0.request = v.into();
8318 self
8319 }
8320
8321 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8323 self.0.options = v.into();
8324 self
8325 }
8326
8327 pub async fn send(self) -> Result<location::model::Location> {
8329 (*self.0.stub)
8330 .get_location(self.0.request, self.0.options)
8331 .await
8332 .map(gax::response::Response::into_body)
8333 }
8334
8335 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8337 self.0.request.name = v.into();
8338 self
8339 }
8340 }
8341
8342 #[doc(hidden)]
8343 impl gax::options::internal::RequestBuilder for GetLocation {
8344 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8345 &mut self.0.options
8346 }
8347 }
8348
8349 #[derive(Clone, Debug)]
8370 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8371
8372 impl ListOperations {
8373 pub(crate) fn new(
8374 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8375 ) -> Self {
8376 Self(RequestBuilder::new(stub))
8377 }
8378
8379 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8381 mut self,
8382 v: V,
8383 ) -> Self {
8384 self.0.request = v.into();
8385 self
8386 }
8387
8388 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8390 self.0.options = v.into();
8391 self
8392 }
8393
8394 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8396 (*self.0.stub)
8397 .list_operations(self.0.request, self.0.options)
8398 .await
8399 .map(gax::response::Response::into_body)
8400 }
8401
8402 pub fn by_page(
8404 self,
8405 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8406 {
8407 use std::clone::Clone;
8408 let token = self.0.request.page_token.clone();
8409 let execute = move |token: String| {
8410 let mut builder = self.clone();
8411 builder.0.request = builder.0.request.set_page_token(token);
8412 builder.send()
8413 };
8414 gax::paginator::internal::new_paginator(token, execute)
8415 }
8416
8417 pub fn by_item(
8419 self,
8420 ) -> impl gax::paginator::ItemPaginator<
8421 longrunning::model::ListOperationsResponse,
8422 gax::error::Error,
8423 > {
8424 use gax::paginator::Paginator;
8425 self.by_page().items()
8426 }
8427
8428 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8430 self.0.request.name = v.into();
8431 self
8432 }
8433
8434 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8436 self.0.request.filter = v.into();
8437 self
8438 }
8439
8440 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8442 self.0.request.page_size = v.into();
8443 self
8444 }
8445
8446 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8448 self.0.request.page_token = v.into();
8449 self
8450 }
8451
8452 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8454 self.0.request.return_partial_success = v.into();
8455 self
8456 }
8457 }
8458
8459 #[doc(hidden)]
8460 impl gax::options::internal::RequestBuilder for ListOperations {
8461 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8462 &mut self.0.options
8463 }
8464 }
8465
8466 #[derive(Clone, Debug)]
8483 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8484
8485 impl GetOperation {
8486 pub(crate) fn new(
8487 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8488 ) -> Self {
8489 Self(RequestBuilder::new(stub))
8490 }
8491
8492 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8494 mut self,
8495 v: V,
8496 ) -> Self {
8497 self.0.request = v.into();
8498 self
8499 }
8500
8501 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8503 self.0.options = v.into();
8504 self
8505 }
8506
8507 pub async fn send(self) -> Result<longrunning::model::Operation> {
8509 (*self.0.stub)
8510 .get_operation(self.0.request, self.0.options)
8511 .await
8512 .map(gax::response::Response::into_body)
8513 }
8514
8515 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8517 self.0.request.name = v.into();
8518 self
8519 }
8520 }
8521
8522 #[doc(hidden)]
8523 impl gax::options::internal::RequestBuilder for GetOperation {
8524 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8525 &mut self.0.options
8526 }
8527 }
8528
8529 #[derive(Clone, Debug)]
8546 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8547
8548 impl DeleteOperation {
8549 pub(crate) fn new(
8550 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8551 ) -> Self {
8552 Self(RequestBuilder::new(stub))
8553 }
8554
8555 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8557 mut self,
8558 v: V,
8559 ) -> Self {
8560 self.0.request = v.into();
8561 self
8562 }
8563
8564 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8566 self.0.options = v.into();
8567 self
8568 }
8569
8570 pub async fn send(self) -> Result<()> {
8572 (*self.0.stub)
8573 .delete_operation(self.0.request, self.0.options)
8574 .await
8575 .map(gax::response::Response::into_body)
8576 }
8577
8578 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8580 self.0.request.name = v.into();
8581 self
8582 }
8583 }
8584
8585 #[doc(hidden)]
8586 impl gax::options::internal::RequestBuilder for DeleteOperation {
8587 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8588 &mut self.0.options
8589 }
8590 }
8591
8592 #[derive(Clone, Debug)]
8609 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8610
8611 impl CancelOperation {
8612 pub(crate) fn new(
8613 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8614 ) -> Self {
8615 Self(RequestBuilder::new(stub))
8616 }
8617
8618 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8620 mut self,
8621 v: V,
8622 ) -> Self {
8623 self.0.request = v.into();
8624 self
8625 }
8626
8627 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8629 self.0.options = v.into();
8630 self
8631 }
8632
8633 pub async fn send(self) -> Result<()> {
8635 (*self.0.stub)
8636 .cancel_operation(self.0.request, self.0.options)
8637 .await
8638 .map(gax::response::Response::into_body)
8639 }
8640
8641 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8643 self.0.request.name = v.into();
8644 self
8645 }
8646 }
8647
8648 #[doc(hidden)]
8649 impl gax::options::internal::RequestBuilder for CancelOperation {
8650 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8651 &mut self.0.options
8652 }
8653 }
8654}
8655
8656pub mod data_taxonomy_service {
8657 use crate::Result;
8658
8659 pub type ClientBuilder =
8673 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8674
8675 pub(crate) mod client {
8676 use super::super::super::client::DataTaxonomyService;
8677 pub struct Factory;
8678 impl gax::client_builder::internal::ClientFactory for Factory {
8679 type Client = DataTaxonomyService;
8680 type Credentials = gaxi::options::Credentials;
8681 async fn build(
8682 self,
8683 config: gaxi::options::ClientConfig,
8684 ) -> gax::client_builder::Result<Self::Client> {
8685 Self::Client::new(config).await
8686 }
8687 }
8688 }
8689
8690 #[derive(Clone, Debug)]
8692 pub(crate) struct RequestBuilder<R: std::default::Default> {
8693 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8694 request: R,
8695 options: gax::options::RequestOptions,
8696 }
8697
8698 impl<R> RequestBuilder<R>
8699 where
8700 R: std::default::Default,
8701 {
8702 pub(crate) fn new(
8703 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8704 ) -> Self {
8705 Self {
8706 stub,
8707 request: R::default(),
8708 options: gax::options::RequestOptions::default(),
8709 }
8710 }
8711 }
8712
8713 #[derive(Clone, Debug)]
8731 pub struct CreateDataTaxonomy(RequestBuilder<crate::model::CreateDataTaxonomyRequest>);
8732
8733 impl CreateDataTaxonomy {
8734 pub(crate) fn new(
8735 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8736 ) -> Self {
8737 Self(RequestBuilder::new(stub))
8738 }
8739
8740 pub fn with_request<V: Into<crate::model::CreateDataTaxonomyRequest>>(
8742 mut self,
8743 v: V,
8744 ) -> Self {
8745 self.0.request = v.into();
8746 self
8747 }
8748
8749 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8751 self.0.options = v.into();
8752 self
8753 }
8754
8755 pub async fn send(self) -> Result<longrunning::model::Operation> {
8762 (*self.0.stub)
8763 .create_data_taxonomy(self.0.request, self.0.options)
8764 .await
8765 .map(gax::response::Response::into_body)
8766 }
8767
8768 pub fn poller(
8770 self,
8771 ) -> impl lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata> {
8772 type Operation = lro::internal::Operation<
8773 crate::model::DataTaxonomy,
8774 crate::model::OperationMetadata,
8775 >;
8776 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8777 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8778
8779 let stub = self.0.stub.clone();
8780 let mut options = self.0.options.clone();
8781 options.set_retry_policy(gax::retry_policy::NeverRetry);
8782 let query = move |name| {
8783 let stub = stub.clone();
8784 let options = options.clone();
8785 async {
8786 let op = GetOperation::new(stub)
8787 .set_name(name)
8788 .with_options(options)
8789 .send()
8790 .await?;
8791 Ok(Operation::new(op))
8792 }
8793 };
8794
8795 let start = move || async {
8796 let op = self.send().await?;
8797 Ok(Operation::new(op))
8798 };
8799
8800 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8801 }
8802
8803 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8807 self.0.request.parent = v.into();
8808 self
8809 }
8810
8811 pub fn set_data_taxonomy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8815 self.0.request.data_taxonomy_id = v.into();
8816 self
8817 }
8818
8819 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
8823 where
8824 T: std::convert::Into<crate::model::DataTaxonomy>,
8825 {
8826 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
8827 self
8828 }
8829
8830 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
8834 where
8835 T: std::convert::Into<crate::model::DataTaxonomy>,
8836 {
8837 self.0.request.data_taxonomy = v.map(|x| x.into());
8838 self
8839 }
8840
8841 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
8843 self.0.request.validate_only = v.into();
8844 self
8845 }
8846 }
8847
8848 #[doc(hidden)]
8849 impl gax::options::internal::RequestBuilder for CreateDataTaxonomy {
8850 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8851 &mut self.0.options
8852 }
8853 }
8854
8855 #[derive(Clone, Debug)]
8873 pub struct UpdateDataTaxonomy(RequestBuilder<crate::model::UpdateDataTaxonomyRequest>);
8874
8875 impl UpdateDataTaxonomy {
8876 pub(crate) fn new(
8877 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8878 ) -> Self {
8879 Self(RequestBuilder::new(stub))
8880 }
8881
8882 pub fn with_request<V: Into<crate::model::UpdateDataTaxonomyRequest>>(
8884 mut self,
8885 v: V,
8886 ) -> Self {
8887 self.0.request = v.into();
8888 self
8889 }
8890
8891 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8893 self.0.options = v.into();
8894 self
8895 }
8896
8897 pub async fn send(self) -> Result<longrunning::model::Operation> {
8904 (*self.0.stub)
8905 .update_data_taxonomy(self.0.request, self.0.options)
8906 .await
8907 .map(gax::response::Response::into_body)
8908 }
8909
8910 pub fn poller(
8912 self,
8913 ) -> impl lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata> {
8914 type Operation = lro::internal::Operation<
8915 crate::model::DataTaxonomy,
8916 crate::model::OperationMetadata,
8917 >;
8918 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8919 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8920
8921 let stub = self.0.stub.clone();
8922 let mut options = self.0.options.clone();
8923 options.set_retry_policy(gax::retry_policy::NeverRetry);
8924 let query = move |name| {
8925 let stub = stub.clone();
8926 let options = options.clone();
8927 async {
8928 let op = GetOperation::new(stub)
8929 .set_name(name)
8930 .with_options(options)
8931 .send()
8932 .await?;
8933 Ok(Operation::new(op))
8934 }
8935 };
8936
8937 let start = move || async {
8938 let op = self.send().await?;
8939 Ok(Operation::new(op))
8940 };
8941
8942 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8943 }
8944
8945 pub fn set_update_mask<T>(mut self, v: T) -> Self
8949 where
8950 T: std::convert::Into<wkt::FieldMask>,
8951 {
8952 self.0.request.update_mask = std::option::Option::Some(v.into());
8953 self
8954 }
8955
8956 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8960 where
8961 T: std::convert::Into<wkt::FieldMask>,
8962 {
8963 self.0.request.update_mask = v.map(|x| x.into());
8964 self
8965 }
8966
8967 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
8971 where
8972 T: std::convert::Into<crate::model::DataTaxonomy>,
8973 {
8974 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
8975 self
8976 }
8977
8978 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
8982 where
8983 T: std::convert::Into<crate::model::DataTaxonomy>,
8984 {
8985 self.0.request.data_taxonomy = v.map(|x| x.into());
8986 self
8987 }
8988
8989 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
8991 self.0.request.validate_only = v.into();
8992 self
8993 }
8994 }
8995
8996 #[doc(hidden)]
8997 impl gax::options::internal::RequestBuilder for UpdateDataTaxonomy {
8998 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8999 &mut self.0.options
9000 }
9001 }
9002
9003 #[derive(Clone, Debug)]
9021 pub struct DeleteDataTaxonomy(RequestBuilder<crate::model::DeleteDataTaxonomyRequest>);
9022
9023 impl DeleteDataTaxonomy {
9024 pub(crate) fn new(
9025 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9026 ) -> Self {
9027 Self(RequestBuilder::new(stub))
9028 }
9029
9030 pub fn with_request<V: Into<crate::model::DeleteDataTaxonomyRequest>>(
9032 mut self,
9033 v: V,
9034 ) -> Self {
9035 self.0.request = v.into();
9036 self
9037 }
9038
9039 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9041 self.0.options = v.into();
9042 self
9043 }
9044
9045 pub async fn send(self) -> Result<longrunning::model::Operation> {
9052 (*self.0.stub)
9053 .delete_data_taxonomy(self.0.request, self.0.options)
9054 .await
9055 .map(gax::response::Response::into_body)
9056 }
9057
9058 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9060 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9061 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9062 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9063
9064 let stub = self.0.stub.clone();
9065 let mut options = self.0.options.clone();
9066 options.set_retry_policy(gax::retry_policy::NeverRetry);
9067 let query = move |name| {
9068 let stub = stub.clone();
9069 let options = options.clone();
9070 async {
9071 let op = GetOperation::new(stub)
9072 .set_name(name)
9073 .with_options(options)
9074 .send()
9075 .await?;
9076 Ok(Operation::new(op))
9077 }
9078 };
9079
9080 let start = move || async {
9081 let op = self.send().await?;
9082 Ok(Operation::new(op))
9083 };
9084
9085 lro::internal::new_unit_response_poller(
9086 polling_error_policy,
9087 polling_backoff_policy,
9088 start,
9089 query,
9090 )
9091 }
9092
9093 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9097 self.0.request.name = v.into();
9098 self
9099 }
9100
9101 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
9103 self.0.request.etag = v.into();
9104 self
9105 }
9106 }
9107
9108 #[doc(hidden)]
9109 impl gax::options::internal::RequestBuilder for DeleteDataTaxonomy {
9110 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9111 &mut self.0.options
9112 }
9113 }
9114
9115 #[derive(Clone, Debug)]
9136 pub struct ListDataTaxonomies(RequestBuilder<crate::model::ListDataTaxonomiesRequest>);
9137
9138 impl ListDataTaxonomies {
9139 pub(crate) fn new(
9140 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9141 ) -> Self {
9142 Self(RequestBuilder::new(stub))
9143 }
9144
9145 pub fn with_request<V: Into<crate::model::ListDataTaxonomiesRequest>>(
9147 mut self,
9148 v: V,
9149 ) -> Self {
9150 self.0.request = v.into();
9151 self
9152 }
9153
9154 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9156 self.0.options = v.into();
9157 self
9158 }
9159
9160 pub async fn send(self) -> Result<crate::model::ListDataTaxonomiesResponse> {
9162 (*self.0.stub)
9163 .list_data_taxonomies(self.0.request, self.0.options)
9164 .await
9165 .map(gax::response::Response::into_body)
9166 }
9167
9168 pub fn by_page(
9170 self,
9171 ) -> impl gax::paginator::Paginator<crate::model::ListDataTaxonomiesResponse, gax::error::Error>
9172 {
9173 use std::clone::Clone;
9174 let token = self.0.request.page_token.clone();
9175 let execute = move |token: String| {
9176 let mut builder = self.clone();
9177 builder.0.request = builder.0.request.set_page_token(token);
9178 builder.send()
9179 };
9180 gax::paginator::internal::new_paginator(token, execute)
9181 }
9182
9183 pub fn by_item(
9185 self,
9186 ) -> impl gax::paginator::ItemPaginator<
9187 crate::model::ListDataTaxonomiesResponse,
9188 gax::error::Error,
9189 > {
9190 use gax::paginator::Paginator;
9191 self.by_page().items()
9192 }
9193
9194 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9198 self.0.request.parent = v.into();
9199 self
9200 }
9201
9202 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9204 self.0.request.page_size = v.into();
9205 self
9206 }
9207
9208 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9210 self.0.request.page_token = v.into();
9211 self
9212 }
9213
9214 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9216 self.0.request.filter = v.into();
9217 self
9218 }
9219
9220 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9222 self.0.request.order_by = v.into();
9223 self
9224 }
9225 }
9226
9227 #[doc(hidden)]
9228 impl gax::options::internal::RequestBuilder for ListDataTaxonomies {
9229 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9230 &mut self.0.options
9231 }
9232 }
9233
9234 #[derive(Clone, Debug)]
9251 pub struct GetDataTaxonomy(RequestBuilder<crate::model::GetDataTaxonomyRequest>);
9252
9253 impl GetDataTaxonomy {
9254 pub(crate) fn new(
9255 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9256 ) -> Self {
9257 Self(RequestBuilder::new(stub))
9258 }
9259
9260 pub fn with_request<V: Into<crate::model::GetDataTaxonomyRequest>>(mut self, v: V) -> Self {
9262 self.0.request = v.into();
9263 self
9264 }
9265
9266 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9268 self.0.options = v.into();
9269 self
9270 }
9271
9272 pub async fn send(self) -> Result<crate::model::DataTaxonomy> {
9274 (*self.0.stub)
9275 .get_data_taxonomy(self.0.request, self.0.options)
9276 .await
9277 .map(gax::response::Response::into_body)
9278 }
9279
9280 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9284 self.0.request.name = v.into();
9285 self
9286 }
9287 }
9288
9289 #[doc(hidden)]
9290 impl gax::options::internal::RequestBuilder for GetDataTaxonomy {
9291 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9292 &mut self.0.options
9293 }
9294 }
9295
9296 #[derive(Clone, Debug)]
9314 pub struct CreateDataAttributeBinding(
9315 RequestBuilder<crate::model::CreateDataAttributeBindingRequest>,
9316 );
9317
9318 impl CreateDataAttributeBinding {
9319 pub(crate) fn new(
9320 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9321 ) -> Self {
9322 Self(RequestBuilder::new(stub))
9323 }
9324
9325 pub fn with_request<V: Into<crate::model::CreateDataAttributeBindingRequest>>(
9327 mut self,
9328 v: V,
9329 ) -> Self {
9330 self.0.request = v.into();
9331 self
9332 }
9333
9334 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9336 self.0.options = v.into();
9337 self
9338 }
9339
9340 pub async fn send(self) -> Result<longrunning::model::Operation> {
9347 (*self.0.stub)
9348 .create_data_attribute_binding(self.0.request, self.0.options)
9349 .await
9350 .map(gax::response::Response::into_body)
9351 }
9352
9353 pub fn poller(
9355 self,
9356 ) -> impl lro::Poller<crate::model::DataAttributeBinding, crate::model::OperationMetadata>
9357 {
9358 type Operation = lro::internal::Operation<
9359 crate::model::DataAttributeBinding,
9360 crate::model::OperationMetadata,
9361 >;
9362 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9363 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9364
9365 let stub = self.0.stub.clone();
9366 let mut options = self.0.options.clone();
9367 options.set_retry_policy(gax::retry_policy::NeverRetry);
9368 let query = move |name| {
9369 let stub = stub.clone();
9370 let options = options.clone();
9371 async {
9372 let op = GetOperation::new(stub)
9373 .set_name(name)
9374 .with_options(options)
9375 .send()
9376 .await?;
9377 Ok(Operation::new(op))
9378 }
9379 };
9380
9381 let start = move || async {
9382 let op = self.send().await?;
9383 Ok(Operation::new(op))
9384 };
9385
9386 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9387 }
9388
9389 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9393 self.0.request.parent = v.into();
9394 self
9395 }
9396
9397 pub fn set_data_attribute_binding_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9401 self.0.request.data_attribute_binding_id = v.into();
9402 self
9403 }
9404
9405 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
9409 where
9410 T: std::convert::Into<crate::model::DataAttributeBinding>,
9411 {
9412 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
9413 self
9414 }
9415
9416 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
9420 where
9421 T: std::convert::Into<crate::model::DataAttributeBinding>,
9422 {
9423 self.0.request.data_attribute_binding = v.map(|x| x.into());
9424 self
9425 }
9426
9427 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9429 self.0.request.validate_only = v.into();
9430 self
9431 }
9432 }
9433
9434 #[doc(hidden)]
9435 impl gax::options::internal::RequestBuilder for CreateDataAttributeBinding {
9436 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9437 &mut self.0.options
9438 }
9439 }
9440
9441 #[derive(Clone, Debug)]
9459 pub struct UpdateDataAttributeBinding(
9460 RequestBuilder<crate::model::UpdateDataAttributeBindingRequest>,
9461 );
9462
9463 impl UpdateDataAttributeBinding {
9464 pub(crate) fn new(
9465 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9466 ) -> Self {
9467 Self(RequestBuilder::new(stub))
9468 }
9469
9470 pub fn with_request<V: Into<crate::model::UpdateDataAttributeBindingRequest>>(
9472 mut self,
9473 v: V,
9474 ) -> Self {
9475 self.0.request = v.into();
9476 self
9477 }
9478
9479 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9481 self.0.options = v.into();
9482 self
9483 }
9484
9485 pub async fn send(self) -> Result<longrunning::model::Operation> {
9492 (*self.0.stub)
9493 .update_data_attribute_binding(self.0.request, self.0.options)
9494 .await
9495 .map(gax::response::Response::into_body)
9496 }
9497
9498 pub fn poller(
9500 self,
9501 ) -> impl lro::Poller<crate::model::DataAttributeBinding, crate::model::OperationMetadata>
9502 {
9503 type Operation = lro::internal::Operation<
9504 crate::model::DataAttributeBinding,
9505 crate::model::OperationMetadata,
9506 >;
9507 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9508 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9509
9510 let stub = self.0.stub.clone();
9511 let mut options = self.0.options.clone();
9512 options.set_retry_policy(gax::retry_policy::NeverRetry);
9513 let query = move |name| {
9514 let stub = stub.clone();
9515 let options = options.clone();
9516 async {
9517 let op = GetOperation::new(stub)
9518 .set_name(name)
9519 .with_options(options)
9520 .send()
9521 .await?;
9522 Ok(Operation::new(op))
9523 }
9524 };
9525
9526 let start = move || async {
9527 let op = self.send().await?;
9528 Ok(Operation::new(op))
9529 };
9530
9531 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9532 }
9533
9534 pub fn set_update_mask<T>(mut self, v: T) -> Self
9538 where
9539 T: std::convert::Into<wkt::FieldMask>,
9540 {
9541 self.0.request.update_mask = std::option::Option::Some(v.into());
9542 self
9543 }
9544
9545 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9549 where
9550 T: std::convert::Into<wkt::FieldMask>,
9551 {
9552 self.0.request.update_mask = v.map(|x| x.into());
9553 self
9554 }
9555
9556 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
9560 where
9561 T: std::convert::Into<crate::model::DataAttributeBinding>,
9562 {
9563 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
9564 self
9565 }
9566
9567 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
9571 where
9572 T: std::convert::Into<crate::model::DataAttributeBinding>,
9573 {
9574 self.0.request.data_attribute_binding = v.map(|x| x.into());
9575 self
9576 }
9577
9578 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9580 self.0.request.validate_only = v.into();
9581 self
9582 }
9583 }
9584
9585 #[doc(hidden)]
9586 impl gax::options::internal::RequestBuilder for UpdateDataAttributeBinding {
9587 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9588 &mut self.0.options
9589 }
9590 }
9591
9592 #[derive(Clone, Debug)]
9610 pub struct DeleteDataAttributeBinding(
9611 RequestBuilder<crate::model::DeleteDataAttributeBindingRequest>,
9612 );
9613
9614 impl DeleteDataAttributeBinding {
9615 pub(crate) fn new(
9616 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9617 ) -> Self {
9618 Self(RequestBuilder::new(stub))
9619 }
9620
9621 pub fn with_request<V: Into<crate::model::DeleteDataAttributeBindingRequest>>(
9623 mut self,
9624 v: V,
9625 ) -> Self {
9626 self.0.request = v.into();
9627 self
9628 }
9629
9630 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9632 self.0.options = v.into();
9633 self
9634 }
9635
9636 pub async fn send(self) -> Result<longrunning::model::Operation> {
9643 (*self.0.stub)
9644 .delete_data_attribute_binding(self.0.request, self.0.options)
9645 .await
9646 .map(gax::response::Response::into_body)
9647 }
9648
9649 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9651 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9652 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9653 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9654
9655 let stub = self.0.stub.clone();
9656 let mut options = self.0.options.clone();
9657 options.set_retry_policy(gax::retry_policy::NeverRetry);
9658 let query = move |name| {
9659 let stub = stub.clone();
9660 let options = options.clone();
9661 async {
9662 let op = GetOperation::new(stub)
9663 .set_name(name)
9664 .with_options(options)
9665 .send()
9666 .await?;
9667 Ok(Operation::new(op))
9668 }
9669 };
9670
9671 let start = move || async {
9672 let op = self.send().await?;
9673 Ok(Operation::new(op))
9674 };
9675
9676 lro::internal::new_unit_response_poller(
9677 polling_error_policy,
9678 polling_backoff_policy,
9679 start,
9680 query,
9681 )
9682 }
9683
9684 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9688 self.0.request.name = v.into();
9689 self
9690 }
9691
9692 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
9696 self.0.request.etag = v.into();
9697 self
9698 }
9699 }
9700
9701 #[doc(hidden)]
9702 impl gax::options::internal::RequestBuilder for DeleteDataAttributeBinding {
9703 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9704 &mut self.0.options
9705 }
9706 }
9707
9708 #[derive(Clone, Debug)]
9729 pub struct ListDataAttributeBindings(
9730 RequestBuilder<crate::model::ListDataAttributeBindingsRequest>,
9731 );
9732
9733 impl ListDataAttributeBindings {
9734 pub(crate) fn new(
9735 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9736 ) -> Self {
9737 Self(RequestBuilder::new(stub))
9738 }
9739
9740 pub fn with_request<V: Into<crate::model::ListDataAttributeBindingsRequest>>(
9742 mut self,
9743 v: V,
9744 ) -> Self {
9745 self.0.request = v.into();
9746 self
9747 }
9748
9749 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9751 self.0.options = v.into();
9752 self
9753 }
9754
9755 pub async fn send(self) -> Result<crate::model::ListDataAttributeBindingsResponse> {
9757 (*self.0.stub)
9758 .list_data_attribute_bindings(self.0.request, self.0.options)
9759 .await
9760 .map(gax::response::Response::into_body)
9761 }
9762
9763 pub fn by_page(
9765 self,
9766 ) -> impl gax::paginator::Paginator<
9767 crate::model::ListDataAttributeBindingsResponse,
9768 gax::error::Error,
9769 > {
9770 use std::clone::Clone;
9771 let token = self.0.request.page_token.clone();
9772 let execute = move |token: String| {
9773 let mut builder = self.clone();
9774 builder.0.request = builder.0.request.set_page_token(token);
9775 builder.send()
9776 };
9777 gax::paginator::internal::new_paginator(token, execute)
9778 }
9779
9780 pub fn by_item(
9782 self,
9783 ) -> impl gax::paginator::ItemPaginator<
9784 crate::model::ListDataAttributeBindingsResponse,
9785 gax::error::Error,
9786 > {
9787 use gax::paginator::Paginator;
9788 self.by_page().items()
9789 }
9790
9791 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9795 self.0.request.parent = v.into();
9796 self
9797 }
9798
9799 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9801 self.0.request.page_size = v.into();
9802 self
9803 }
9804
9805 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9807 self.0.request.page_token = v.into();
9808 self
9809 }
9810
9811 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9813 self.0.request.filter = v.into();
9814 self
9815 }
9816
9817 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9819 self.0.request.order_by = v.into();
9820 self
9821 }
9822 }
9823
9824 #[doc(hidden)]
9825 impl gax::options::internal::RequestBuilder for ListDataAttributeBindings {
9826 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9827 &mut self.0.options
9828 }
9829 }
9830
9831 #[derive(Clone, Debug)]
9848 pub struct GetDataAttributeBinding(
9849 RequestBuilder<crate::model::GetDataAttributeBindingRequest>,
9850 );
9851
9852 impl GetDataAttributeBinding {
9853 pub(crate) fn new(
9854 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9855 ) -> Self {
9856 Self(RequestBuilder::new(stub))
9857 }
9858
9859 pub fn with_request<V: Into<crate::model::GetDataAttributeBindingRequest>>(
9861 mut self,
9862 v: V,
9863 ) -> Self {
9864 self.0.request = v.into();
9865 self
9866 }
9867
9868 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9870 self.0.options = v.into();
9871 self
9872 }
9873
9874 pub async fn send(self) -> Result<crate::model::DataAttributeBinding> {
9876 (*self.0.stub)
9877 .get_data_attribute_binding(self.0.request, self.0.options)
9878 .await
9879 .map(gax::response::Response::into_body)
9880 }
9881
9882 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9886 self.0.request.name = v.into();
9887 self
9888 }
9889 }
9890
9891 #[doc(hidden)]
9892 impl gax::options::internal::RequestBuilder for GetDataAttributeBinding {
9893 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9894 &mut self.0.options
9895 }
9896 }
9897
9898 #[derive(Clone, Debug)]
9916 pub struct CreateDataAttribute(RequestBuilder<crate::model::CreateDataAttributeRequest>);
9917
9918 impl CreateDataAttribute {
9919 pub(crate) fn new(
9920 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9921 ) -> Self {
9922 Self(RequestBuilder::new(stub))
9923 }
9924
9925 pub fn with_request<V: Into<crate::model::CreateDataAttributeRequest>>(
9927 mut self,
9928 v: V,
9929 ) -> Self {
9930 self.0.request = v.into();
9931 self
9932 }
9933
9934 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9936 self.0.options = v.into();
9937 self
9938 }
9939
9940 pub async fn send(self) -> Result<longrunning::model::Operation> {
9947 (*self.0.stub)
9948 .create_data_attribute(self.0.request, self.0.options)
9949 .await
9950 .map(gax::response::Response::into_body)
9951 }
9952
9953 pub fn poller(
9955 self,
9956 ) -> impl lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
9957 {
9958 type Operation = lro::internal::Operation<
9959 crate::model::DataAttribute,
9960 crate::model::OperationMetadata,
9961 >;
9962 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9963 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9964
9965 let stub = self.0.stub.clone();
9966 let mut options = self.0.options.clone();
9967 options.set_retry_policy(gax::retry_policy::NeverRetry);
9968 let query = move |name| {
9969 let stub = stub.clone();
9970 let options = options.clone();
9971 async {
9972 let op = GetOperation::new(stub)
9973 .set_name(name)
9974 .with_options(options)
9975 .send()
9976 .await?;
9977 Ok(Operation::new(op))
9978 }
9979 };
9980
9981 let start = move || async {
9982 let op = self.send().await?;
9983 Ok(Operation::new(op))
9984 };
9985
9986 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9987 }
9988
9989 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9993 self.0.request.parent = v.into();
9994 self
9995 }
9996
9997 pub fn set_data_attribute_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10001 self.0.request.data_attribute_id = v.into();
10002 self
10003 }
10004
10005 pub fn set_data_attribute<T>(mut self, v: T) -> Self
10009 where
10010 T: std::convert::Into<crate::model::DataAttribute>,
10011 {
10012 self.0.request.data_attribute = std::option::Option::Some(v.into());
10013 self
10014 }
10015
10016 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
10020 where
10021 T: std::convert::Into<crate::model::DataAttribute>,
10022 {
10023 self.0.request.data_attribute = v.map(|x| x.into());
10024 self
10025 }
10026
10027 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10029 self.0.request.validate_only = v.into();
10030 self
10031 }
10032 }
10033
10034 #[doc(hidden)]
10035 impl gax::options::internal::RequestBuilder for CreateDataAttribute {
10036 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10037 &mut self.0.options
10038 }
10039 }
10040
10041 #[derive(Clone, Debug)]
10059 pub struct UpdateDataAttribute(RequestBuilder<crate::model::UpdateDataAttributeRequest>);
10060
10061 impl UpdateDataAttribute {
10062 pub(crate) fn new(
10063 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10064 ) -> Self {
10065 Self(RequestBuilder::new(stub))
10066 }
10067
10068 pub fn with_request<V: Into<crate::model::UpdateDataAttributeRequest>>(
10070 mut self,
10071 v: V,
10072 ) -> Self {
10073 self.0.request = v.into();
10074 self
10075 }
10076
10077 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10079 self.0.options = v.into();
10080 self
10081 }
10082
10083 pub async fn send(self) -> Result<longrunning::model::Operation> {
10090 (*self.0.stub)
10091 .update_data_attribute(self.0.request, self.0.options)
10092 .await
10093 .map(gax::response::Response::into_body)
10094 }
10095
10096 pub fn poller(
10098 self,
10099 ) -> impl lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
10100 {
10101 type Operation = lro::internal::Operation<
10102 crate::model::DataAttribute,
10103 crate::model::OperationMetadata,
10104 >;
10105 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10106 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10107
10108 let stub = self.0.stub.clone();
10109 let mut options = self.0.options.clone();
10110 options.set_retry_policy(gax::retry_policy::NeverRetry);
10111 let query = move |name| {
10112 let stub = stub.clone();
10113 let options = options.clone();
10114 async {
10115 let op = GetOperation::new(stub)
10116 .set_name(name)
10117 .with_options(options)
10118 .send()
10119 .await?;
10120 Ok(Operation::new(op))
10121 }
10122 };
10123
10124 let start = move || async {
10125 let op = self.send().await?;
10126 Ok(Operation::new(op))
10127 };
10128
10129 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10130 }
10131
10132 pub fn set_update_mask<T>(mut self, v: T) -> Self
10136 where
10137 T: std::convert::Into<wkt::FieldMask>,
10138 {
10139 self.0.request.update_mask = std::option::Option::Some(v.into());
10140 self
10141 }
10142
10143 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10147 where
10148 T: std::convert::Into<wkt::FieldMask>,
10149 {
10150 self.0.request.update_mask = v.map(|x| x.into());
10151 self
10152 }
10153
10154 pub fn set_data_attribute<T>(mut self, v: T) -> Self
10158 where
10159 T: std::convert::Into<crate::model::DataAttribute>,
10160 {
10161 self.0.request.data_attribute = std::option::Option::Some(v.into());
10162 self
10163 }
10164
10165 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
10169 where
10170 T: std::convert::Into<crate::model::DataAttribute>,
10171 {
10172 self.0.request.data_attribute = v.map(|x| x.into());
10173 self
10174 }
10175
10176 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10178 self.0.request.validate_only = v.into();
10179 self
10180 }
10181 }
10182
10183 #[doc(hidden)]
10184 impl gax::options::internal::RequestBuilder for UpdateDataAttribute {
10185 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10186 &mut self.0.options
10187 }
10188 }
10189
10190 #[derive(Clone, Debug)]
10208 pub struct DeleteDataAttribute(RequestBuilder<crate::model::DeleteDataAttributeRequest>);
10209
10210 impl DeleteDataAttribute {
10211 pub(crate) fn new(
10212 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10213 ) -> Self {
10214 Self(RequestBuilder::new(stub))
10215 }
10216
10217 pub fn with_request<V: Into<crate::model::DeleteDataAttributeRequest>>(
10219 mut self,
10220 v: V,
10221 ) -> Self {
10222 self.0.request = v.into();
10223 self
10224 }
10225
10226 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10228 self.0.options = v.into();
10229 self
10230 }
10231
10232 pub async fn send(self) -> Result<longrunning::model::Operation> {
10239 (*self.0.stub)
10240 .delete_data_attribute(self.0.request, self.0.options)
10241 .await
10242 .map(gax::response::Response::into_body)
10243 }
10244
10245 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
10247 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10248 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10249 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10250
10251 let stub = self.0.stub.clone();
10252 let mut options = self.0.options.clone();
10253 options.set_retry_policy(gax::retry_policy::NeverRetry);
10254 let query = move |name| {
10255 let stub = stub.clone();
10256 let options = options.clone();
10257 async {
10258 let op = GetOperation::new(stub)
10259 .set_name(name)
10260 .with_options(options)
10261 .send()
10262 .await?;
10263 Ok(Operation::new(op))
10264 }
10265 };
10266
10267 let start = move || async {
10268 let op = self.send().await?;
10269 Ok(Operation::new(op))
10270 };
10271
10272 lro::internal::new_unit_response_poller(
10273 polling_error_policy,
10274 polling_backoff_policy,
10275 start,
10276 query,
10277 )
10278 }
10279
10280 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10284 self.0.request.name = v.into();
10285 self
10286 }
10287
10288 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
10290 self.0.request.etag = v.into();
10291 self
10292 }
10293 }
10294
10295 #[doc(hidden)]
10296 impl gax::options::internal::RequestBuilder for DeleteDataAttribute {
10297 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10298 &mut self.0.options
10299 }
10300 }
10301
10302 #[derive(Clone, Debug)]
10323 pub struct ListDataAttributes(RequestBuilder<crate::model::ListDataAttributesRequest>);
10324
10325 impl ListDataAttributes {
10326 pub(crate) fn new(
10327 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10328 ) -> Self {
10329 Self(RequestBuilder::new(stub))
10330 }
10331
10332 pub fn with_request<V: Into<crate::model::ListDataAttributesRequest>>(
10334 mut self,
10335 v: V,
10336 ) -> Self {
10337 self.0.request = v.into();
10338 self
10339 }
10340
10341 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10343 self.0.options = v.into();
10344 self
10345 }
10346
10347 pub async fn send(self) -> Result<crate::model::ListDataAttributesResponse> {
10349 (*self.0.stub)
10350 .list_data_attributes(self.0.request, self.0.options)
10351 .await
10352 .map(gax::response::Response::into_body)
10353 }
10354
10355 pub fn by_page(
10357 self,
10358 ) -> impl gax::paginator::Paginator<crate::model::ListDataAttributesResponse, gax::error::Error>
10359 {
10360 use std::clone::Clone;
10361 let token = self.0.request.page_token.clone();
10362 let execute = move |token: String| {
10363 let mut builder = self.clone();
10364 builder.0.request = builder.0.request.set_page_token(token);
10365 builder.send()
10366 };
10367 gax::paginator::internal::new_paginator(token, execute)
10368 }
10369
10370 pub fn by_item(
10372 self,
10373 ) -> impl gax::paginator::ItemPaginator<
10374 crate::model::ListDataAttributesResponse,
10375 gax::error::Error,
10376 > {
10377 use gax::paginator::Paginator;
10378 self.by_page().items()
10379 }
10380
10381 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10385 self.0.request.parent = v.into();
10386 self
10387 }
10388
10389 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10391 self.0.request.page_size = v.into();
10392 self
10393 }
10394
10395 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10397 self.0.request.page_token = v.into();
10398 self
10399 }
10400
10401 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10403 self.0.request.filter = v.into();
10404 self
10405 }
10406
10407 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10409 self.0.request.order_by = v.into();
10410 self
10411 }
10412 }
10413
10414 #[doc(hidden)]
10415 impl gax::options::internal::RequestBuilder for ListDataAttributes {
10416 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10417 &mut self.0.options
10418 }
10419 }
10420
10421 #[derive(Clone, Debug)]
10438 pub struct GetDataAttribute(RequestBuilder<crate::model::GetDataAttributeRequest>);
10439
10440 impl GetDataAttribute {
10441 pub(crate) fn new(
10442 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10443 ) -> Self {
10444 Self(RequestBuilder::new(stub))
10445 }
10446
10447 pub fn with_request<V: Into<crate::model::GetDataAttributeRequest>>(
10449 mut self,
10450 v: V,
10451 ) -> Self {
10452 self.0.request = v.into();
10453 self
10454 }
10455
10456 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10458 self.0.options = v.into();
10459 self
10460 }
10461
10462 pub async fn send(self) -> Result<crate::model::DataAttribute> {
10464 (*self.0.stub)
10465 .get_data_attribute(self.0.request, self.0.options)
10466 .await
10467 .map(gax::response::Response::into_body)
10468 }
10469
10470 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10474 self.0.request.name = v.into();
10475 self
10476 }
10477 }
10478
10479 #[doc(hidden)]
10480 impl gax::options::internal::RequestBuilder for GetDataAttribute {
10481 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10482 &mut self.0.options
10483 }
10484 }
10485
10486 #[derive(Clone, Debug)]
10507 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
10508
10509 impl ListLocations {
10510 pub(crate) fn new(
10511 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10512 ) -> Self {
10513 Self(RequestBuilder::new(stub))
10514 }
10515
10516 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
10518 mut self,
10519 v: V,
10520 ) -> Self {
10521 self.0.request = v.into();
10522 self
10523 }
10524
10525 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10527 self.0.options = v.into();
10528 self
10529 }
10530
10531 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
10533 (*self.0.stub)
10534 .list_locations(self.0.request, self.0.options)
10535 .await
10536 .map(gax::response::Response::into_body)
10537 }
10538
10539 pub fn by_page(
10541 self,
10542 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
10543 {
10544 use std::clone::Clone;
10545 let token = self.0.request.page_token.clone();
10546 let execute = move |token: String| {
10547 let mut builder = self.clone();
10548 builder.0.request = builder.0.request.set_page_token(token);
10549 builder.send()
10550 };
10551 gax::paginator::internal::new_paginator(token, execute)
10552 }
10553
10554 pub fn by_item(
10556 self,
10557 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
10558 {
10559 use gax::paginator::Paginator;
10560 self.by_page().items()
10561 }
10562
10563 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10565 self.0.request.name = v.into();
10566 self
10567 }
10568
10569 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10571 self.0.request.filter = v.into();
10572 self
10573 }
10574
10575 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10577 self.0.request.page_size = v.into();
10578 self
10579 }
10580
10581 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10583 self.0.request.page_token = v.into();
10584 self
10585 }
10586 }
10587
10588 #[doc(hidden)]
10589 impl gax::options::internal::RequestBuilder for ListLocations {
10590 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10591 &mut self.0.options
10592 }
10593 }
10594
10595 #[derive(Clone, Debug)]
10612 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10613
10614 impl GetLocation {
10615 pub(crate) fn new(
10616 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10617 ) -> Self {
10618 Self(RequestBuilder::new(stub))
10619 }
10620
10621 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10623 self.0.request = v.into();
10624 self
10625 }
10626
10627 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10629 self.0.options = v.into();
10630 self
10631 }
10632
10633 pub async fn send(self) -> Result<location::model::Location> {
10635 (*self.0.stub)
10636 .get_location(self.0.request, self.0.options)
10637 .await
10638 .map(gax::response::Response::into_body)
10639 }
10640
10641 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10643 self.0.request.name = v.into();
10644 self
10645 }
10646 }
10647
10648 #[doc(hidden)]
10649 impl gax::options::internal::RequestBuilder for GetLocation {
10650 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10651 &mut self.0.options
10652 }
10653 }
10654
10655 #[derive(Clone, Debug)]
10672 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
10673
10674 impl SetIamPolicy {
10675 pub(crate) fn new(
10676 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10677 ) -> Self {
10678 Self(RequestBuilder::new(stub))
10679 }
10680
10681 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
10683 self.0.request = v.into();
10684 self
10685 }
10686
10687 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10689 self.0.options = v.into();
10690 self
10691 }
10692
10693 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10695 (*self.0.stub)
10696 .set_iam_policy(self.0.request, self.0.options)
10697 .await
10698 .map(gax::response::Response::into_body)
10699 }
10700
10701 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10705 self.0.request.resource = v.into();
10706 self
10707 }
10708
10709 pub fn set_policy<T>(mut self, v: T) -> Self
10713 where
10714 T: std::convert::Into<iam_v1::model::Policy>,
10715 {
10716 self.0.request.policy = std::option::Option::Some(v.into());
10717 self
10718 }
10719
10720 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10724 where
10725 T: std::convert::Into<iam_v1::model::Policy>,
10726 {
10727 self.0.request.policy = v.map(|x| x.into());
10728 self
10729 }
10730
10731 pub fn set_update_mask<T>(mut self, v: T) -> Self
10733 where
10734 T: std::convert::Into<wkt::FieldMask>,
10735 {
10736 self.0.request.update_mask = std::option::Option::Some(v.into());
10737 self
10738 }
10739
10740 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10742 where
10743 T: std::convert::Into<wkt::FieldMask>,
10744 {
10745 self.0.request.update_mask = v.map(|x| x.into());
10746 self
10747 }
10748 }
10749
10750 #[doc(hidden)]
10751 impl gax::options::internal::RequestBuilder for SetIamPolicy {
10752 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10753 &mut self.0.options
10754 }
10755 }
10756
10757 #[derive(Clone, Debug)]
10774 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
10775
10776 impl GetIamPolicy {
10777 pub(crate) fn new(
10778 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10779 ) -> Self {
10780 Self(RequestBuilder::new(stub))
10781 }
10782
10783 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
10785 self.0.request = v.into();
10786 self
10787 }
10788
10789 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10791 self.0.options = v.into();
10792 self
10793 }
10794
10795 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10797 (*self.0.stub)
10798 .get_iam_policy(self.0.request, self.0.options)
10799 .await
10800 .map(gax::response::Response::into_body)
10801 }
10802
10803 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10807 self.0.request.resource = v.into();
10808 self
10809 }
10810
10811 pub fn set_options<T>(mut self, v: T) -> Self
10813 where
10814 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10815 {
10816 self.0.request.options = std::option::Option::Some(v.into());
10817 self
10818 }
10819
10820 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10822 where
10823 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10824 {
10825 self.0.request.options = v.map(|x| x.into());
10826 self
10827 }
10828 }
10829
10830 #[doc(hidden)]
10831 impl gax::options::internal::RequestBuilder for GetIamPolicy {
10832 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10833 &mut self.0.options
10834 }
10835 }
10836
10837 #[derive(Clone, Debug)]
10854 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
10855
10856 impl TestIamPermissions {
10857 pub(crate) fn new(
10858 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10859 ) -> Self {
10860 Self(RequestBuilder::new(stub))
10861 }
10862
10863 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
10865 mut self,
10866 v: V,
10867 ) -> Self {
10868 self.0.request = v.into();
10869 self
10870 }
10871
10872 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10874 self.0.options = v.into();
10875 self
10876 }
10877
10878 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
10880 (*self.0.stub)
10881 .test_iam_permissions(self.0.request, self.0.options)
10882 .await
10883 .map(gax::response::Response::into_body)
10884 }
10885
10886 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10890 self.0.request.resource = v.into();
10891 self
10892 }
10893
10894 pub fn set_permissions<T, V>(mut self, v: T) -> Self
10898 where
10899 T: std::iter::IntoIterator<Item = V>,
10900 V: std::convert::Into<std::string::String>,
10901 {
10902 use std::iter::Iterator;
10903 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10904 self
10905 }
10906 }
10907
10908 #[doc(hidden)]
10909 impl gax::options::internal::RequestBuilder for TestIamPermissions {
10910 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10911 &mut self.0.options
10912 }
10913 }
10914
10915 #[derive(Clone, Debug)]
10936 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10937
10938 impl ListOperations {
10939 pub(crate) fn new(
10940 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10941 ) -> Self {
10942 Self(RequestBuilder::new(stub))
10943 }
10944
10945 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10947 mut self,
10948 v: V,
10949 ) -> Self {
10950 self.0.request = v.into();
10951 self
10952 }
10953
10954 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10956 self.0.options = v.into();
10957 self
10958 }
10959
10960 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10962 (*self.0.stub)
10963 .list_operations(self.0.request, self.0.options)
10964 .await
10965 .map(gax::response::Response::into_body)
10966 }
10967
10968 pub fn by_page(
10970 self,
10971 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10972 {
10973 use std::clone::Clone;
10974 let token = self.0.request.page_token.clone();
10975 let execute = move |token: String| {
10976 let mut builder = self.clone();
10977 builder.0.request = builder.0.request.set_page_token(token);
10978 builder.send()
10979 };
10980 gax::paginator::internal::new_paginator(token, execute)
10981 }
10982
10983 pub fn by_item(
10985 self,
10986 ) -> impl gax::paginator::ItemPaginator<
10987 longrunning::model::ListOperationsResponse,
10988 gax::error::Error,
10989 > {
10990 use gax::paginator::Paginator;
10991 self.by_page().items()
10992 }
10993
10994 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10996 self.0.request.name = v.into();
10997 self
10998 }
10999
11000 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11002 self.0.request.filter = v.into();
11003 self
11004 }
11005
11006 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11008 self.0.request.page_size = v.into();
11009 self
11010 }
11011
11012 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11014 self.0.request.page_token = v.into();
11015 self
11016 }
11017
11018 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11020 self.0.request.return_partial_success = v.into();
11021 self
11022 }
11023 }
11024
11025 #[doc(hidden)]
11026 impl gax::options::internal::RequestBuilder for ListOperations {
11027 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11028 &mut self.0.options
11029 }
11030 }
11031
11032 #[derive(Clone, Debug)]
11049 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
11050
11051 impl GetOperation {
11052 pub(crate) fn new(
11053 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11054 ) -> Self {
11055 Self(RequestBuilder::new(stub))
11056 }
11057
11058 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
11060 mut self,
11061 v: V,
11062 ) -> Self {
11063 self.0.request = v.into();
11064 self
11065 }
11066
11067 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11069 self.0.options = v.into();
11070 self
11071 }
11072
11073 pub async fn send(self) -> Result<longrunning::model::Operation> {
11075 (*self.0.stub)
11076 .get_operation(self.0.request, self.0.options)
11077 .await
11078 .map(gax::response::Response::into_body)
11079 }
11080
11081 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11083 self.0.request.name = v.into();
11084 self
11085 }
11086 }
11087
11088 #[doc(hidden)]
11089 impl gax::options::internal::RequestBuilder for GetOperation {
11090 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11091 &mut self.0.options
11092 }
11093 }
11094
11095 #[derive(Clone, Debug)]
11112 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
11113
11114 impl DeleteOperation {
11115 pub(crate) fn new(
11116 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11117 ) -> Self {
11118 Self(RequestBuilder::new(stub))
11119 }
11120
11121 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
11123 mut self,
11124 v: V,
11125 ) -> Self {
11126 self.0.request = v.into();
11127 self
11128 }
11129
11130 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11132 self.0.options = v.into();
11133 self
11134 }
11135
11136 pub async fn send(self) -> Result<()> {
11138 (*self.0.stub)
11139 .delete_operation(self.0.request, self.0.options)
11140 .await
11141 .map(gax::response::Response::into_body)
11142 }
11143
11144 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11146 self.0.request.name = v.into();
11147 self
11148 }
11149 }
11150
11151 #[doc(hidden)]
11152 impl gax::options::internal::RequestBuilder for DeleteOperation {
11153 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11154 &mut self.0.options
11155 }
11156 }
11157
11158 #[derive(Clone, Debug)]
11175 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11176
11177 impl CancelOperation {
11178 pub(crate) fn new(
11179 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11180 ) -> Self {
11181 Self(RequestBuilder::new(stub))
11182 }
11183
11184 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11186 mut self,
11187 v: V,
11188 ) -> Self {
11189 self.0.request = v.into();
11190 self
11191 }
11192
11193 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11195 self.0.options = v.into();
11196 self
11197 }
11198
11199 pub async fn send(self) -> Result<()> {
11201 (*self.0.stub)
11202 .cancel_operation(self.0.request, self.0.options)
11203 .await
11204 .map(gax::response::Response::into_body)
11205 }
11206
11207 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11209 self.0.request.name = v.into();
11210 self
11211 }
11212 }
11213
11214 #[doc(hidden)]
11215 impl gax::options::internal::RequestBuilder for CancelOperation {
11216 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11217 &mut self.0.options
11218 }
11219 }
11220}
11221
11222pub mod data_scan_service {
11223 use crate::Result;
11224
11225 pub type ClientBuilder =
11239 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11240
11241 pub(crate) mod client {
11242 use super::super::super::client::DataScanService;
11243 pub struct Factory;
11244 impl gax::client_builder::internal::ClientFactory for Factory {
11245 type Client = DataScanService;
11246 type Credentials = gaxi::options::Credentials;
11247 async fn build(
11248 self,
11249 config: gaxi::options::ClientConfig,
11250 ) -> gax::client_builder::Result<Self::Client> {
11251 Self::Client::new(config).await
11252 }
11253 }
11254 }
11255
11256 #[derive(Clone, Debug)]
11258 pub(crate) struct RequestBuilder<R: std::default::Default> {
11259 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11260 request: R,
11261 options: gax::options::RequestOptions,
11262 }
11263
11264 impl<R> RequestBuilder<R>
11265 where
11266 R: std::default::Default,
11267 {
11268 pub(crate) fn new(
11269 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11270 ) -> Self {
11271 Self {
11272 stub,
11273 request: R::default(),
11274 options: gax::options::RequestOptions::default(),
11275 }
11276 }
11277 }
11278
11279 #[derive(Clone, Debug)]
11297 pub struct CreateDataScan(RequestBuilder<crate::model::CreateDataScanRequest>);
11298
11299 impl CreateDataScan {
11300 pub(crate) fn new(
11301 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11302 ) -> Self {
11303 Self(RequestBuilder::new(stub))
11304 }
11305
11306 pub fn with_request<V: Into<crate::model::CreateDataScanRequest>>(mut self, v: V) -> Self {
11308 self.0.request = v.into();
11309 self
11310 }
11311
11312 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11314 self.0.options = v.into();
11315 self
11316 }
11317
11318 pub async fn send(self) -> Result<longrunning::model::Operation> {
11325 (*self.0.stub)
11326 .create_data_scan(self.0.request, self.0.options)
11327 .await
11328 .map(gax::response::Response::into_body)
11329 }
11330
11331 pub fn poller(
11333 self,
11334 ) -> impl lro::Poller<crate::model::DataScan, crate::model::OperationMetadata> {
11335 type Operation =
11336 lro::internal::Operation<crate::model::DataScan, crate::model::OperationMetadata>;
11337 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11338 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11339
11340 let stub = self.0.stub.clone();
11341 let mut options = self.0.options.clone();
11342 options.set_retry_policy(gax::retry_policy::NeverRetry);
11343 let query = move |name| {
11344 let stub = stub.clone();
11345 let options = options.clone();
11346 async {
11347 let op = GetOperation::new(stub)
11348 .set_name(name)
11349 .with_options(options)
11350 .send()
11351 .await?;
11352 Ok(Operation::new(op))
11353 }
11354 };
11355
11356 let start = move || async {
11357 let op = self.send().await?;
11358 Ok(Operation::new(op))
11359 };
11360
11361 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
11362 }
11363
11364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11368 self.0.request.parent = v.into();
11369 self
11370 }
11371
11372 pub fn set_data_scan<T>(mut self, v: T) -> Self
11376 where
11377 T: std::convert::Into<crate::model::DataScan>,
11378 {
11379 self.0.request.data_scan = std::option::Option::Some(v.into());
11380 self
11381 }
11382
11383 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
11387 where
11388 T: std::convert::Into<crate::model::DataScan>,
11389 {
11390 self.0.request.data_scan = v.map(|x| x.into());
11391 self
11392 }
11393
11394 pub fn set_data_scan_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11398 self.0.request.data_scan_id = v.into();
11399 self
11400 }
11401
11402 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11404 self.0.request.validate_only = v.into();
11405 self
11406 }
11407 }
11408
11409 #[doc(hidden)]
11410 impl gax::options::internal::RequestBuilder for CreateDataScan {
11411 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11412 &mut self.0.options
11413 }
11414 }
11415
11416 #[derive(Clone, Debug)]
11434 pub struct UpdateDataScan(RequestBuilder<crate::model::UpdateDataScanRequest>);
11435
11436 impl UpdateDataScan {
11437 pub(crate) fn new(
11438 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11439 ) -> Self {
11440 Self(RequestBuilder::new(stub))
11441 }
11442
11443 pub fn with_request<V: Into<crate::model::UpdateDataScanRequest>>(mut self, v: V) -> Self {
11445 self.0.request = v.into();
11446 self
11447 }
11448
11449 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11451 self.0.options = v.into();
11452 self
11453 }
11454
11455 pub async fn send(self) -> Result<longrunning::model::Operation> {
11462 (*self.0.stub)
11463 .update_data_scan(self.0.request, self.0.options)
11464 .await
11465 .map(gax::response::Response::into_body)
11466 }
11467
11468 pub fn poller(
11470 self,
11471 ) -> impl lro::Poller<crate::model::DataScan, crate::model::OperationMetadata> {
11472 type Operation =
11473 lro::internal::Operation<crate::model::DataScan, crate::model::OperationMetadata>;
11474 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11475 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11476
11477 let stub = self.0.stub.clone();
11478 let mut options = self.0.options.clone();
11479 options.set_retry_policy(gax::retry_policy::NeverRetry);
11480 let query = move |name| {
11481 let stub = stub.clone();
11482 let options = options.clone();
11483 async {
11484 let op = GetOperation::new(stub)
11485 .set_name(name)
11486 .with_options(options)
11487 .send()
11488 .await?;
11489 Ok(Operation::new(op))
11490 }
11491 };
11492
11493 let start = move || async {
11494 let op = self.send().await?;
11495 Ok(Operation::new(op))
11496 };
11497
11498 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
11499 }
11500
11501 pub fn set_data_scan<T>(mut self, v: T) -> Self
11505 where
11506 T: std::convert::Into<crate::model::DataScan>,
11507 {
11508 self.0.request.data_scan = std::option::Option::Some(v.into());
11509 self
11510 }
11511
11512 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
11516 where
11517 T: std::convert::Into<crate::model::DataScan>,
11518 {
11519 self.0.request.data_scan = v.map(|x| x.into());
11520 self
11521 }
11522
11523 pub fn set_update_mask<T>(mut self, v: T) -> Self
11525 where
11526 T: std::convert::Into<wkt::FieldMask>,
11527 {
11528 self.0.request.update_mask = std::option::Option::Some(v.into());
11529 self
11530 }
11531
11532 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11534 where
11535 T: std::convert::Into<wkt::FieldMask>,
11536 {
11537 self.0.request.update_mask = v.map(|x| x.into());
11538 self
11539 }
11540
11541 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11543 self.0.request.validate_only = v.into();
11544 self
11545 }
11546 }
11547
11548 #[doc(hidden)]
11549 impl gax::options::internal::RequestBuilder for UpdateDataScan {
11550 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11551 &mut self.0.options
11552 }
11553 }
11554
11555 #[derive(Clone, Debug)]
11573 pub struct DeleteDataScan(RequestBuilder<crate::model::DeleteDataScanRequest>);
11574
11575 impl DeleteDataScan {
11576 pub(crate) fn new(
11577 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11578 ) -> Self {
11579 Self(RequestBuilder::new(stub))
11580 }
11581
11582 pub fn with_request<V: Into<crate::model::DeleteDataScanRequest>>(mut self, v: V) -> Self {
11584 self.0.request = v.into();
11585 self
11586 }
11587
11588 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11590 self.0.options = v.into();
11591 self
11592 }
11593
11594 pub async fn send(self) -> Result<longrunning::model::Operation> {
11601 (*self.0.stub)
11602 .delete_data_scan(self.0.request, self.0.options)
11603 .await
11604 .map(gax::response::Response::into_body)
11605 }
11606
11607 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
11609 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11610 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11611 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11612
11613 let stub = self.0.stub.clone();
11614 let mut options = self.0.options.clone();
11615 options.set_retry_policy(gax::retry_policy::NeverRetry);
11616 let query = move |name| {
11617 let stub = stub.clone();
11618 let options = options.clone();
11619 async {
11620 let op = GetOperation::new(stub)
11621 .set_name(name)
11622 .with_options(options)
11623 .send()
11624 .await?;
11625 Ok(Operation::new(op))
11626 }
11627 };
11628
11629 let start = move || async {
11630 let op = self.send().await?;
11631 Ok(Operation::new(op))
11632 };
11633
11634 lro::internal::new_unit_response_poller(
11635 polling_error_policy,
11636 polling_backoff_policy,
11637 start,
11638 query,
11639 )
11640 }
11641
11642 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11646 self.0.request.name = v.into();
11647 self
11648 }
11649
11650 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
11652 self.0.request.force = v.into();
11653 self
11654 }
11655 }
11656
11657 #[doc(hidden)]
11658 impl gax::options::internal::RequestBuilder for DeleteDataScan {
11659 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11660 &mut self.0.options
11661 }
11662 }
11663
11664 #[derive(Clone, Debug)]
11681 pub struct GetDataScan(RequestBuilder<crate::model::GetDataScanRequest>);
11682
11683 impl GetDataScan {
11684 pub(crate) fn new(
11685 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11686 ) -> Self {
11687 Self(RequestBuilder::new(stub))
11688 }
11689
11690 pub fn with_request<V: Into<crate::model::GetDataScanRequest>>(mut self, v: V) -> Self {
11692 self.0.request = v.into();
11693 self
11694 }
11695
11696 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11698 self.0.options = v.into();
11699 self
11700 }
11701
11702 pub async fn send(self) -> Result<crate::model::DataScan> {
11704 (*self.0.stub)
11705 .get_data_scan(self.0.request, self.0.options)
11706 .await
11707 .map(gax::response::Response::into_body)
11708 }
11709
11710 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11714 self.0.request.name = v.into();
11715 self
11716 }
11717
11718 pub fn set_view<T: Into<crate::model::get_data_scan_request::DataScanView>>(
11720 mut self,
11721 v: T,
11722 ) -> Self {
11723 self.0.request.view = v.into();
11724 self
11725 }
11726 }
11727
11728 #[doc(hidden)]
11729 impl gax::options::internal::RequestBuilder for GetDataScan {
11730 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11731 &mut self.0.options
11732 }
11733 }
11734
11735 #[derive(Clone, Debug)]
11756 pub struct ListDataScans(RequestBuilder<crate::model::ListDataScansRequest>);
11757
11758 impl ListDataScans {
11759 pub(crate) fn new(
11760 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11761 ) -> Self {
11762 Self(RequestBuilder::new(stub))
11763 }
11764
11765 pub fn with_request<V: Into<crate::model::ListDataScansRequest>>(mut self, v: V) -> Self {
11767 self.0.request = v.into();
11768 self
11769 }
11770
11771 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11773 self.0.options = v.into();
11774 self
11775 }
11776
11777 pub async fn send(self) -> Result<crate::model::ListDataScansResponse> {
11779 (*self.0.stub)
11780 .list_data_scans(self.0.request, self.0.options)
11781 .await
11782 .map(gax::response::Response::into_body)
11783 }
11784
11785 pub fn by_page(
11787 self,
11788 ) -> impl gax::paginator::Paginator<crate::model::ListDataScansResponse, gax::error::Error>
11789 {
11790 use std::clone::Clone;
11791 let token = self.0.request.page_token.clone();
11792 let execute = move |token: String| {
11793 let mut builder = self.clone();
11794 builder.0.request = builder.0.request.set_page_token(token);
11795 builder.send()
11796 };
11797 gax::paginator::internal::new_paginator(token, execute)
11798 }
11799
11800 pub fn by_item(
11802 self,
11803 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDataScansResponse, gax::error::Error>
11804 {
11805 use gax::paginator::Paginator;
11806 self.by_page().items()
11807 }
11808
11809 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11813 self.0.request.parent = v.into();
11814 self
11815 }
11816
11817 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11819 self.0.request.page_size = v.into();
11820 self
11821 }
11822
11823 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11825 self.0.request.page_token = v.into();
11826 self
11827 }
11828
11829 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11831 self.0.request.filter = v.into();
11832 self
11833 }
11834
11835 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11837 self.0.request.order_by = v.into();
11838 self
11839 }
11840 }
11841
11842 #[doc(hidden)]
11843 impl gax::options::internal::RequestBuilder for ListDataScans {
11844 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11845 &mut self.0.options
11846 }
11847 }
11848
11849 #[derive(Clone, Debug)]
11866 pub struct RunDataScan(RequestBuilder<crate::model::RunDataScanRequest>);
11867
11868 impl RunDataScan {
11869 pub(crate) fn new(
11870 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11871 ) -> Self {
11872 Self(RequestBuilder::new(stub))
11873 }
11874
11875 pub fn with_request<V: Into<crate::model::RunDataScanRequest>>(mut self, v: V) -> Self {
11877 self.0.request = v.into();
11878 self
11879 }
11880
11881 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11883 self.0.options = v.into();
11884 self
11885 }
11886
11887 pub async fn send(self) -> Result<crate::model::RunDataScanResponse> {
11889 (*self.0.stub)
11890 .run_data_scan(self.0.request, self.0.options)
11891 .await
11892 .map(gax::response::Response::into_body)
11893 }
11894
11895 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11899 self.0.request.name = v.into();
11900 self
11901 }
11902 }
11903
11904 #[doc(hidden)]
11905 impl gax::options::internal::RequestBuilder for RunDataScan {
11906 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11907 &mut self.0.options
11908 }
11909 }
11910
11911 #[derive(Clone, Debug)]
11928 pub struct GetDataScanJob(RequestBuilder<crate::model::GetDataScanJobRequest>);
11929
11930 impl GetDataScanJob {
11931 pub(crate) fn new(
11932 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11933 ) -> Self {
11934 Self(RequestBuilder::new(stub))
11935 }
11936
11937 pub fn with_request<V: Into<crate::model::GetDataScanJobRequest>>(mut self, v: V) -> Self {
11939 self.0.request = v.into();
11940 self
11941 }
11942
11943 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11945 self.0.options = v.into();
11946 self
11947 }
11948
11949 pub async fn send(self) -> Result<crate::model::DataScanJob> {
11951 (*self.0.stub)
11952 .get_data_scan_job(self.0.request, self.0.options)
11953 .await
11954 .map(gax::response::Response::into_body)
11955 }
11956
11957 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11961 self.0.request.name = v.into();
11962 self
11963 }
11964
11965 pub fn set_view<T: Into<crate::model::get_data_scan_job_request::DataScanJobView>>(
11967 mut self,
11968 v: T,
11969 ) -> Self {
11970 self.0.request.view = v.into();
11971 self
11972 }
11973 }
11974
11975 #[doc(hidden)]
11976 impl gax::options::internal::RequestBuilder for GetDataScanJob {
11977 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11978 &mut self.0.options
11979 }
11980 }
11981
11982 #[derive(Clone, Debug)]
12003 pub struct ListDataScanJobs(RequestBuilder<crate::model::ListDataScanJobsRequest>);
12004
12005 impl ListDataScanJobs {
12006 pub(crate) fn new(
12007 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12008 ) -> Self {
12009 Self(RequestBuilder::new(stub))
12010 }
12011
12012 pub fn with_request<V: Into<crate::model::ListDataScanJobsRequest>>(
12014 mut self,
12015 v: V,
12016 ) -> Self {
12017 self.0.request = v.into();
12018 self
12019 }
12020
12021 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12023 self.0.options = v.into();
12024 self
12025 }
12026
12027 pub async fn send(self) -> Result<crate::model::ListDataScanJobsResponse> {
12029 (*self.0.stub)
12030 .list_data_scan_jobs(self.0.request, self.0.options)
12031 .await
12032 .map(gax::response::Response::into_body)
12033 }
12034
12035 pub fn by_page(
12037 self,
12038 ) -> impl gax::paginator::Paginator<crate::model::ListDataScanJobsResponse, gax::error::Error>
12039 {
12040 use std::clone::Clone;
12041 let token = self.0.request.page_token.clone();
12042 let execute = move |token: String| {
12043 let mut builder = self.clone();
12044 builder.0.request = builder.0.request.set_page_token(token);
12045 builder.send()
12046 };
12047 gax::paginator::internal::new_paginator(token, execute)
12048 }
12049
12050 pub fn by_item(
12052 self,
12053 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDataScanJobsResponse, gax::error::Error>
12054 {
12055 use gax::paginator::Paginator;
12056 self.by_page().items()
12057 }
12058
12059 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12063 self.0.request.parent = v.into();
12064 self
12065 }
12066
12067 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12069 self.0.request.page_size = v.into();
12070 self
12071 }
12072
12073 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12075 self.0.request.page_token = v.into();
12076 self
12077 }
12078
12079 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12081 self.0.request.filter = v.into();
12082 self
12083 }
12084 }
12085
12086 #[doc(hidden)]
12087 impl gax::options::internal::RequestBuilder for ListDataScanJobs {
12088 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12089 &mut self.0.options
12090 }
12091 }
12092
12093 #[derive(Clone, Debug)]
12110 pub struct GenerateDataQualityRules(
12111 RequestBuilder<crate::model::GenerateDataQualityRulesRequest>,
12112 );
12113
12114 impl GenerateDataQualityRules {
12115 pub(crate) fn new(
12116 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12117 ) -> Self {
12118 Self(RequestBuilder::new(stub))
12119 }
12120
12121 pub fn with_request<V: Into<crate::model::GenerateDataQualityRulesRequest>>(
12123 mut self,
12124 v: V,
12125 ) -> Self {
12126 self.0.request = v.into();
12127 self
12128 }
12129
12130 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12132 self.0.options = v.into();
12133 self
12134 }
12135
12136 pub async fn send(self) -> Result<crate::model::GenerateDataQualityRulesResponse> {
12138 (*self.0.stub)
12139 .generate_data_quality_rules(self.0.request, self.0.options)
12140 .await
12141 .map(gax::response::Response::into_body)
12142 }
12143
12144 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12148 self.0.request.name = v.into();
12149 self
12150 }
12151 }
12152
12153 #[doc(hidden)]
12154 impl gax::options::internal::RequestBuilder for GenerateDataQualityRules {
12155 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12156 &mut self.0.options
12157 }
12158 }
12159
12160 #[derive(Clone, Debug)]
12181 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
12182
12183 impl ListLocations {
12184 pub(crate) fn new(
12185 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12186 ) -> Self {
12187 Self(RequestBuilder::new(stub))
12188 }
12189
12190 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
12192 mut self,
12193 v: V,
12194 ) -> Self {
12195 self.0.request = v.into();
12196 self
12197 }
12198
12199 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12201 self.0.options = v.into();
12202 self
12203 }
12204
12205 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
12207 (*self.0.stub)
12208 .list_locations(self.0.request, self.0.options)
12209 .await
12210 .map(gax::response::Response::into_body)
12211 }
12212
12213 pub fn by_page(
12215 self,
12216 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
12217 {
12218 use std::clone::Clone;
12219 let token = self.0.request.page_token.clone();
12220 let execute = move |token: String| {
12221 let mut builder = self.clone();
12222 builder.0.request = builder.0.request.set_page_token(token);
12223 builder.send()
12224 };
12225 gax::paginator::internal::new_paginator(token, execute)
12226 }
12227
12228 pub fn by_item(
12230 self,
12231 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
12232 {
12233 use gax::paginator::Paginator;
12234 self.by_page().items()
12235 }
12236
12237 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12239 self.0.request.name = v.into();
12240 self
12241 }
12242
12243 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12245 self.0.request.filter = v.into();
12246 self
12247 }
12248
12249 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12251 self.0.request.page_size = v.into();
12252 self
12253 }
12254
12255 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12257 self.0.request.page_token = v.into();
12258 self
12259 }
12260 }
12261
12262 #[doc(hidden)]
12263 impl gax::options::internal::RequestBuilder for ListLocations {
12264 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12265 &mut self.0.options
12266 }
12267 }
12268
12269 #[derive(Clone, Debug)]
12286 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
12287
12288 impl GetLocation {
12289 pub(crate) fn new(
12290 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12291 ) -> Self {
12292 Self(RequestBuilder::new(stub))
12293 }
12294
12295 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
12297 self.0.request = v.into();
12298 self
12299 }
12300
12301 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12303 self.0.options = v.into();
12304 self
12305 }
12306
12307 pub async fn send(self) -> Result<location::model::Location> {
12309 (*self.0.stub)
12310 .get_location(self.0.request, self.0.options)
12311 .await
12312 .map(gax::response::Response::into_body)
12313 }
12314
12315 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12317 self.0.request.name = v.into();
12318 self
12319 }
12320 }
12321
12322 #[doc(hidden)]
12323 impl gax::options::internal::RequestBuilder for GetLocation {
12324 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12325 &mut self.0.options
12326 }
12327 }
12328
12329 #[derive(Clone, Debug)]
12346 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
12347
12348 impl SetIamPolicy {
12349 pub(crate) fn new(
12350 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12351 ) -> Self {
12352 Self(RequestBuilder::new(stub))
12353 }
12354
12355 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
12357 self.0.request = v.into();
12358 self
12359 }
12360
12361 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12363 self.0.options = v.into();
12364 self
12365 }
12366
12367 pub async fn send(self) -> Result<iam_v1::model::Policy> {
12369 (*self.0.stub)
12370 .set_iam_policy(self.0.request, self.0.options)
12371 .await
12372 .map(gax::response::Response::into_body)
12373 }
12374
12375 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
12379 self.0.request.resource = v.into();
12380 self
12381 }
12382
12383 pub fn set_policy<T>(mut self, v: T) -> Self
12387 where
12388 T: std::convert::Into<iam_v1::model::Policy>,
12389 {
12390 self.0.request.policy = std::option::Option::Some(v.into());
12391 self
12392 }
12393
12394 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
12398 where
12399 T: std::convert::Into<iam_v1::model::Policy>,
12400 {
12401 self.0.request.policy = v.map(|x| x.into());
12402 self
12403 }
12404
12405 pub fn set_update_mask<T>(mut self, v: T) -> Self
12407 where
12408 T: std::convert::Into<wkt::FieldMask>,
12409 {
12410 self.0.request.update_mask = std::option::Option::Some(v.into());
12411 self
12412 }
12413
12414 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12416 where
12417 T: std::convert::Into<wkt::FieldMask>,
12418 {
12419 self.0.request.update_mask = v.map(|x| x.into());
12420 self
12421 }
12422 }
12423
12424 #[doc(hidden)]
12425 impl gax::options::internal::RequestBuilder for SetIamPolicy {
12426 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12427 &mut self.0.options
12428 }
12429 }
12430
12431 #[derive(Clone, Debug)]
12448 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
12449
12450 impl GetIamPolicy {
12451 pub(crate) fn new(
12452 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12453 ) -> Self {
12454 Self(RequestBuilder::new(stub))
12455 }
12456
12457 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
12459 self.0.request = v.into();
12460 self
12461 }
12462
12463 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12465 self.0.options = v.into();
12466 self
12467 }
12468
12469 pub async fn send(self) -> Result<iam_v1::model::Policy> {
12471 (*self.0.stub)
12472 .get_iam_policy(self.0.request, self.0.options)
12473 .await
12474 .map(gax::response::Response::into_body)
12475 }
12476
12477 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
12481 self.0.request.resource = v.into();
12482 self
12483 }
12484
12485 pub fn set_options<T>(mut self, v: T) -> Self
12487 where
12488 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
12489 {
12490 self.0.request.options = std::option::Option::Some(v.into());
12491 self
12492 }
12493
12494 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
12496 where
12497 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
12498 {
12499 self.0.request.options = v.map(|x| x.into());
12500 self
12501 }
12502 }
12503
12504 #[doc(hidden)]
12505 impl gax::options::internal::RequestBuilder for GetIamPolicy {
12506 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12507 &mut self.0.options
12508 }
12509 }
12510
12511 #[derive(Clone, Debug)]
12528 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
12529
12530 impl TestIamPermissions {
12531 pub(crate) fn new(
12532 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12533 ) -> Self {
12534 Self(RequestBuilder::new(stub))
12535 }
12536
12537 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
12539 mut self,
12540 v: V,
12541 ) -> Self {
12542 self.0.request = v.into();
12543 self
12544 }
12545
12546 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12548 self.0.options = v.into();
12549 self
12550 }
12551
12552 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
12554 (*self.0.stub)
12555 .test_iam_permissions(self.0.request, self.0.options)
12556 .await
12557 .map(gax::response::Response::into_body)
12558 }
12559
12560 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
12564 self.0.request.resource = v.into();
12565 self
12566 }
12567
12568 pub fn set_permissions<T, V>(mut self, v: T) -> Self
12572 where
12573 T: std::iter::IntoIterator<Item = V>,
12574 V: std::convert::Into<std::string::String>,
12575 {
12576 use std::iter::Iterator;
12577 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
12578 self
12579 }
12580 }
12581
12582 #[doc(hidden)]
12583 impl gax::options::internal::RequestBuilder for TestIamPermissions {
12584 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12585 &mut self.0.options
12586 }
12587 }
12588
12589 #[derive(Clone, Debug)]
12610 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
12611
12612 impl ListOperations {
12613 pub(crate) fn new(
12614 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12615 ) -> Self {
12616 Self(RequestBuilder::new(stub))
12617 }
12618
12619 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
12621 mut self,
12622 v: V,
12623 ) -> Self {
12624 self.0.request = v.into();
12625 self
12626 }
12627
12628 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12630 self.0.options = v.into();
12631 self
12632 }
12633
12634 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
12636 (*self.0.stub)
12637 .list_operations(self.0.request, self.0.options)
12638 .await
12639 .map(gax::response::Response::into_body)
12640 }
12641
12642 pub fn by_page(
12644 self,
12645 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
12646 {
12647 use std::clone::Clone;
12648 let token = self.0.request.page_token.clone();
12649 let execute = move |token: String| {
12650 let mut builder = self.clone();
12651 builder.0.request = builder.0.request.set_page_token(token);
12652 builder.send()
12653 };
12654 gax::paginator::internal::new_paginator(token, execute)
12655 }
12656
12657 pub fn by_item(
12659 self,
12660 ) -> impl gax::paginator::ItemPaginator<
12661 longrunning::model::ListOperationsResponse,
12662 gax::error::Error,
12663 > {
12664 use gax::paginator::Paginator;
12665 self.by_page().items()
12666 }
12667
12668 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12670 self.0.request.name = v.into();
12671 self
12672 }
12673
12674 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12676 self.0.request.filter = v.into();
12677 self
12678 }
12679
12680 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12682 self.0.request.page_size = v.into();
12683 self
12684 }
12685
12686 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12688 self.0.request.page_token = v.into();
12689 self
12690 }
12691
12692 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
12694 self.0.request.return_partial_success = v.into();
12695 self
12696 }
12697 }
12698
12699 #[doc(hidden)]
12700 impl gax::options::internal::RequestBuilder for ListOperations {
12701 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12702 &mut self.0.options
12703 }
12704 }
12705
12706 #[derive(Clone, Debug)]
12723 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
12724
12725 impl GetOperation {
12726 pub(crate) fn new(
12727 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12728 ) -> Self {
12729 Self(RequestBuilder::new(stub))
12730 }
12731
12732 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
12734 mut self,
12735 v: V,
12736 ) -> Self {
12737 self.0.request = v.into();
12738 self
12739 }
12740
12741 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12743 self.0.options = v.into();
12744 self
12745 }
12746
12747 pub async fn send(self) -> Result<longrunning::model::Operation> {
12749 (*self.0.stub)
12750 .get_operation(self.0.request, self.0.options)
12751 .await
12752 .map(gax::response::Response::into_body)
12753 }
12754
12755 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12757 self.0.request.name = v.into();
12758 self
12759 }
12760 }
12761
12762 #[doc(hidden)]
12763 impl gax::options::internal::RequestBuilder for GetOperation {
12764 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12765 &mut self.0.options
12766 }
12767 }
12768
12769 #[derive(Clone, Debug)]
12786 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
12787
12788 impl DeleteOperation {
12789 pub(crate) fn new(
12790 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12791 ) -> Self {
12792 Self(RequestBuilder::new(stub))
12793 }
12794
12795 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
12797 mut self,
12798 v: V,
12799 ) -> Self {
12800 self.0.request = v.into();
12801 self
12802 }
12803
12804 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12806 self.0.options = v.into();
12807 self
12808 }
12809
12810 pub async fn send(self) -> Result<()> {
12812 (*self.0.stub)
12813 .delete_operation(self.0.request, self.0.options)
12814 .await
12815 .map(gax::response::Response::into_body)
12816 }
12817
12818 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12820 self.0.request.name = v.into();
12821 self
12822 }
12823 }
12824
12825 #[doc(hidden)]
12826 impl gax::options::internal::RequestBuilder for DeleteOperation {
12827 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12828 &mut self.0.options
12829 }
12830 }
12831
12832 #[derive(Clone, Debug)]
12849 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
12850
12851 impl CancelOperation {
12852 pub(crate) fn new(
12853 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12854 ) -> Self {
12855 Self(RequestBuilder::new(stub))
12856 }
12857
12858 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
12860 mut self,
12861 v: V,
12862 ) -> Self {
12863 self.0.request = v.into();
12864 self
12865 }
12866
12867 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12869 self.0.options = v.into();
12870 self
12871 }
12872
12873 pub async fn send(self) -> Result<()> {
12875 (*self.0.stub)
12876 .cancel_operation(self.0.request, self.0.options)
12877 .await
12878 .map(gax::response::Response::into_body)
12879 }
12880
12881 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12883 self.0.request.name = v.into();
12884 self
12885 }
12886 }
12887
12888 #[doc(hidden)]
12889 impl gax::options::internal::RequestBuilder for CancelOperation {
12890 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12891 &mut self.0.options
12892 }
12893 }
12894}
12895
12896pub mod metadata_service {
12897 use crate::Result;
12898
12899 pub type ClientBuilder =
12913 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12914
12915 pub(crate) mod client {
12916 use super::super::super::client::MetadataService;
12917 pub struct Factory;
12918 impl gax::client_builder::internal::ClientFactory for Factory {
12919 type Client = MetadataService;
12920 type Credentials = gaxi::options::Credentials;
12921 async fn build(
12922 self,
12923 config: gaxi::options::ClientConfig,
12924 ) -> gax::client_builder::Result<Self::Client> {
12925 Self::Client::new(config).await
12926 }
12927 }
12928 }
12929
12930 #[derive(Clone, Debug)]
12932 pub(crate) struct RequestBuilder<R: std::default::Default> {
12933 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
12934 request: R,
12935 options: gax::options::RequestOptions,
12936 }
12937
12938 impl<R> RequestBuilder<R>
12939 where
12940 R: std::default::Default,
12941 {
12942 pub(crate) fn new(
12943 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
12944 ) -> Self {
12945 Self {
12946 stub,
12947 request: R::default(),
12948 options: gax::options::RequestOptions::default(),
12949 }
12950 }
12951 }
12952
12953 #[derive(Clone, Debug)]
12970 pub struct CreateEntity(RequestBuilder<crate::model::CreateEntityRequest>);
12971
12972 impl CreateEntity {
12973 pub(crate) fn new(
12974 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
12975 ) -> Self {
12976 Self(RequestBuilder::new(stub))
12977 }
12978
12979 pub fn with_request<V: Into<crate::model::CreateEntityRequest>>(mut self, v: V) -> Self {
12981 self.0.request = v.into();
12982 self
12983 }
12984
12985 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12987 self.0.options = v.into();
12988 self
12989 }
12990
12991 pub async fn send(self) -> Result<crate::model::Entity> {
12993 (*self.0.stub)
12994 .create_entity(self.0.request, self.0.options)
12995 .await
12996 .map(gax::response::Response::into_body)
12997 }
12998
12999 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13003 self.0.request.parent = v.into();
13004 self
13005 }
13006
13007 pub fn set_entity<T>(mut self, v: T) -> Self
13011 where
13012 T: std::convert::Into<crate::model::Entity>,
13013 {
13014 self.0.request.entity = std::option::Option::Some(v.into());
13015 self
13016 }
13017
13018 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
13022 where
13023 T: std::convert::Into<crate::model::Entity>,
13024 {
13025 self.0.request.entity = v.map(|x| x.into());
13026 self
13027 }
13028
13029 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13031 self.0.request.validate_only = v.into();
13032 self
13033 }
13034 }
13035
13036 #[doc(hidden)]
13037 impl gax::options::internal::RequestBuilder for CreateEntity {
13038 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13039 &mut self.0.options
13040 }
13041 }
13042
13043 #[derive(Clone, Debug)]
13060 pub struct UpdateEntity(RequestBuilder<crate::model::UpdateEntityRequest>);
13061
13062 impl UpdateEntity {
13063 pub(crate) fn new(
13064 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13065 ) -> Self {
13066 Self(RequestBuilder::new(stub))
13067 }
13068
13069 pub fn with_request<V: Into<crate::model::UpdateEntityRequest>>(mut self, v: V) -> Self {
13071 self.0.request = v.into();
13072 self
13073 }
13074
13075 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13077 self.0.options = v.into();
13078 self
13079 }
13080
13081 pub async fn send(self) -> Result<crate::model::Entity> {
13083 (*self.0.stub)
13084 .update_entity(self.0.request, self.0.options)
13085 .await
13086 .map(gax::response::Response::into_body)
13087 }
13088
13089 pub fn set_entity<T>(mut self, v: T) -> Self
13093 where
13094 T: std::convert::Into<crate::model::Entity>,
13095 {
13096 self.0.request.entity = std::option::Option::Some(v.into());
13097 self
13098 }
13099
13100 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
13104 where
13105 T: std::convert::Into<crate::model::Entity>,
13106 {
13107 self.0.request.entity = v.map(|x| x.into());
13108 self
13109 }
13110
13111 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13113 self.0.request.validate_only = v.into();
13114 self
13115 }
13116 }
13117
13118 #[doc(hidden)]
13119 impl gax::options::internal::RequestBuilder for UpdateEntity {
13120 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13121 &mut self.0.options
13122 }
13123 }
13124
13125 #[derive(Clone, Debug)]
13142 pub struct DeleteEntity(RequestBuilder<crate::model::DeleteEntityRequest>);
13143
13144 impl DeleteEntity {
13145 pub(crate) fn new(
13146 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13147 ) -> Self {
13148 Self(RequestBuilder::new(stub))
13149 }
13150
13151 pub fn with_request<V: Into<crate::model::DeleteEntityRequest>>(mut self, v: V) -> Self {
13153 self.0.request = v.into();
13154 self
13155 }
13156
13157 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13159 self.0.options = v.into();
13160 self
13161 }
13162
13163 pub async fn send(self) -> Result<()> {
13165 (*self.0.stub)
13166 .delete_entity(self.0.request, self.0.options)
13167 .await
13168 .map(gax::response::Response::into_body)
13169 }
13170
13171 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13175 self.0.request.name = v.into();
13176 self
13177 }
13178
13179 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
13183 self.0.request.etag = v.into();
13184 self
13185 }
13186 }
13187
13188 #[doc(hidden)]
13189 impl gax::options::internal::RequestBuilder for DeleteEntity {
13190 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13191 &mut self.0.options
13192 }
13193 }
13194
13195 #[derive(Clone, Debug)]
13212 pub struct GetEntity(RequestBuilder<crate::model::GetEntityRequest>);
13213
13214 impl GetEntity {
13215 pub(crate) fn new(
13216 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13217 ) -> Self {
13218 Self(RequestBuilder::new(stub))
13219 }
13220
13221 pub fn with_request<V: Into<crate::model::GetEntityRequest>>(mut self, v: V) -> Self {
13223 self.0.request = v.into();
13224 self
13225 }
13226
13227 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13229 self.0.options = v.into();
13230 self
13231 }
13232
13233 pub async fn send(self) -> Result<crate::model::Entity> {
13235 (*self.0.stub)
13236 .get_entity(self.0.request, self.0.options)
13237 .await
13238 .map(gax::response::Response::into_body)
13239 }
13240
13241 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13245 self.0.request.name = v.into();
13246 self
13247 }
13248
13249 pub fn set_view<T: Into<crate::model::get_entity_request::EntityView>>(
13251 mut self,
13252 v: T,
13253 ) -> Self {
13254 self.0.request.view = v.into();
13255 self
13256 }
13257 }
13258
13259 #[doc(hidden)]
13260 impl gax::options::internal::RequestBuilder for GetEntity {
13261 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13262 &mut self.0.options
13263 }
13264 }
13265
13266 #[derive(Clone, Debug)]
13287 pub struct ListEntities(RequestBuilder<crate::model::ListEntitiesRequest>);
13288
13289 impl ListEntities {
13290 pub(crate) fn new(
13291 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13292 ) -> Self {
13293 Self(RequestBuilder::new(stub))
13294 }
13295
13296 pub fn with_request<V: Into<crate::model::ListEntitiesRequest>>(mut self, v: V) -> Self {
13298 self.0.request = v.into();
13299 self
13300 }
13301
13302 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13304 self.0.options = v.into();
13305 self
13306 }
13307
13308 pub async fn send(self) -> Result<crate::model::ListEntitiesResponse> {
13310 (*self.0.stub)
13311 .list_entities(self.0.request, self.0.options)
13312 .await
13313 .map(gax::response::Response::into_body)
13314 }
13315
13316 pub fn by_page(
13318 self,
13319 ) -> impl gax::paginator::Paginator<crate::model::ListEntitiesResponse, gax::error::Error>
13320 {
13321 use std::clone::Clone;
13322 let token = self.0.request.page_token.clone();
13323 let execute = move |token: String| {
13324 let mut builder = self.clone();
13325 builder.0.request = builder.0.request.set_page_token(token);
13326 builder.send()
13327 };
13328 gax::paginator::internal::new_paginator(token, execute)
13329 }
13330
13331 pub fn by_item(
13333 self,
13334 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntitiesResponse, gax::error::Error>
13335 {
13336 use gax::paginator::Paginator;
13337 self.by_page().items()
13338 }
13339
13340 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13344 self.0.request.parent = v.into();
13345 self
13346 }
13347
13348 pub fn set_view<T: Into<crate::model::list_entities_request::EntityView>>(
13352 mut self,
13353 v: T,
13354 ) -> Self {
13355 self.0.request.view = v.into();
13356 self
13357 }
13358
13359 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13361 self.0.request.page_size = v.into();
13362 self
13363 }
13364
13365 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13367 self.0.request.page_token = v.into();
13368 self
13369 }
13370
13371 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13373 self.0.request.filter = v.into();
13374 self
13375 }
13376 }
13377
13378 #[doc(hidden)]
13379 impl gax::options::internal::RequestBuilder for ListEntities {
13380 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13381 &mut self.0.options
13382 }
13383 }
13384
13385 #[derive(Clone, Debug)]
13402 pub struct CreatePartition(RequestBuilder<crate::model::CreatePartitionRequest>);
13403
13404 impl CreatePartition {
13405 pub(crate) fn new(
13406 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13407 ) -> Self {
13408 Self(RequestBuilder::new(stub))
13409 }
13410
13411 pub fn with_request<V: Into<crate::model::CreatePartitionRequest>>(mut self, v: V) -> Self {
13413 self.0.request = v.into();
13414 self
13415 }
13416
13417 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13419 self.0.options = v.into();
13420 self
13421 }
13422
13423 pub async fn send(self) -> Result<crate::model::Partition> {
13425 (*self.0.stub)
13426 .create_partition(self.0.request, self.0.options)
13427 .await
13428 .map(gax::response::Response::into_body)
13429 }
13430
13431 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13435 self.0.request.parent = v.into();
13436 self
13437 }
13438
13439 pub fn set_partition<T>(mut self, v: T) -> Self
13443 where
13444 T: std::convert::Into<crate::model::Partition>,
13445 {
13446 self.0.request.partition = std::option::Option::Some(v.into());
13447 self
13448 }
13449
13450 pub fn set_or_clear_partition<T>(mut self, v: std::option::Option<T>) -> Self
13454 where
13455 T: std::convert::Into<crate::model::Partition>,
13456 {
13457 self.0.request.partition = v.map(|x| x.into());
13458 self
13459 }
13460
13461 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13463 self.0.request.validate_only = v.into();
13464 self
13465 }
13466 }
13467
13468 #[doc(hidden)]
13469 impl gax::options::internal::RequestBuilder for CreatePartition {
13470 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13471 &mut self.0.options
13472 }
13473 }
13474
13475 #[derive(Clone, Debug)]
13492 pub struct DeletePartition(RequestBuilder<crate::model::DeletePartitionRequest>);
13493
13494 impl DeletePartition {
13495 pub(crate) fn new(
13496 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13497 ) -> Self {
13498 Self(RequestBuilder::new(stub))
13499 }
13500
13501 pub fn with_request<V: Into<crate::model::DeletePartitionRequest>>(mut self, v: V) -> Self {
13503 self.0.request = v.into();
13504 self
13505 }
13506
13507 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13509 self.0.options = v.into();
13510 self
13511 }
13512
13513 pub async fn send(self) -> Result<()> {
13515 (*self.0.stub)
13516 .delete_partition(self.0.request, self.0.options)
13517 .await
13518 .map(gax::response::Response::into_body)
13519 }
13520
13521 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13525 self.0.request.name = v.into();
13526 self
13527 }
13528
13529 #[deprecated]
13531 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
13532 self.0.request.etag = v.into();
13533 self
13534 }
13535 }
13536
13537 #[doc(hidden)]
13538 impl gax::options::internal::RequestBuilder for DeletePartition {
13539 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13540 &mut self.0.options
13541 }
13542 }
13543
13544 #[derive(Clone, Debug)]
13561 pub struct GetPartition(RequestBuilder<crate::model::GetPartitionRequest>);
13562
13563 impl GetPartition {
13564 pub(crate) fn new(
13565 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13566 ) -> Self {
13567 Self(RequestBuilder::new(stub))
13568 }
13569
13570 pub fn with_request<V: Into<crate::model::GetPartitionRequest>>(mut self, v: V) -> Self {
13572 self.0.request = v.into();
13573 self
13574 }
13575
13576 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13578 self.0.options = v.into();
13579 self
13580 }
13581
13582 pub async fn send(self) -> Result<crate::model::Partition> {
13584 (*self.0.stub)
13585 .get_partition(self.0.request, self.0.options)
13586 .await
13587 .map(gax::response::Response::into_body)
13588 }
13589
13590 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13594 self.0.request.name = v.into();
13595 self
13596 }
13597 }
13598
13599 #[doc(hidden)]
13600 impl gax::options::internal::RequestBuilder for GetPartition {
13601 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13602 &mut self.0.options
13603 }
13604 }
13605
13606 #[derive(Clone, Debug)]
13627 pub struct ListPartitions(RequestBuilder<crate::model::ListPartitionsRequest>);
13628
13629 impl ListPartitions {
13630 pub(crate) fn new(
13631 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13632 ) -> Self {
13633 Self(RequestBuilder::new(stub))
13634 }
13635
13636 pub fn with_request<V: Into<crate::model::ListPartitionsRequest>>(mut self, v: V) -> Self {
13638 self.0.request = v.into();
13639 self
13640 }
13641
13642 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13644 self.0.options = v.into();
13645 self
13646 }
13647
13648 pub async fn send(self) -> Result<crate::model::ListPartitionsResponse> {
13650 (*self.0.stub)
13651 .list_partitions(self.0.request, self.0.options)
13652 .await
13653 .map(gax::response::Response::into_body)
13654 }
13655
13656 pub fn by_page(
13658 self,
13659 ) -> impl gax::paginator::Paginator<crate::model::ListPartitionsResponse, gax::error::Error>
13660 {
13661 use std::clone::Clone;
13662 let token = self.0.request.page_token.clone();
13663 let execute = move |token: String| {
13664 let mut builder = self.clone();
13665 builder.0.request = builder.0.request.set_page_token(token);
13666 builder.send()
13667 };
13668 gax::paginator::internal::new_paginator(token, execute)
13669 }
13670
13671 pub fn by_item(
13673 self,
13674 ) -> impl gax::paginator::ItemPaginator<crate::model::ListPartitionsResponse, gax::error::Error>
13675 {
13676 use gax::paginator::Paginator;
13677 self.by_page().items()
13678 }
13679
13680 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13684 self.0.request.parent = v.into();
13685 self
13686 }
13687
13688 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13690 self.0.request.page_size = v.into();
13691 self
13692 }
13693
13694 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13696 self.0.request.page_token = v.into();
13697 self
13698 }
13699
13700 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13702 self.0.request.filter = v.into();
13703 self
13704 }
13705 }
13706
13707 #[doc(hidden)]
13708 impl gax::options::internal::RequestBuilder for ListPartitions {
13709 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13710 &mut self.0.options
13711 }
13712 }
13713
13714 #[derive(Clone, Debug)]
13735 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
13736
13737 impl ListLocations {
13738 pub(crate) fn new(
13739 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13740 ) -> Self {
13741 Self(RequestBuilder::new(stub))
13742 }
13743
13744 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
13746 mut self,
13747 v: V,
13748 ) -> Self {
13749 self.0.request = v.into();
13750 self
13751 }
13752
13753 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13755 self.0.options = v.into();
13756 self
13757 }
13758
13759 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
13761 (*self.0.stub)
13762 .list_locations(self.0.request, self.0.options)
13763 .await
13764 .map(gax::response::Response::into_body)
13765 }
13766
13767 pub fn by_page(
13769 self,
13770 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
13771 {
13772 use std::clone::Clone;
13773 let token = self.0.request.page_token.clone();
13774 let execute = move |token: String| {
13775 let mut builder = self.clone();
13776 builder.0.request = builder.0.request.set_page_token(token);
13777 builder.send()
13778 };
13779 gax::paginator::internal::new_paginator(token, execute)
13780 }
13781
13782 pub fn by_item(
13784 self,
13785 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
13786 {
13787 use gax::paginator::Paginator;
13788 self.by_page().items()
13789 }
13790
13791 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13793 self.0.request.name = v.into();
13794 self
13795 }
13796
13797 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13799 self.0.request.filter = v.into();
13800 self
13801 }
13802
13803 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13805 self.0.request.page_size = v.into();
13806 self
13807 }
13808
13809 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13811 self.0.request.page_token = v.into();
13812 self
13813 }
13814 }
13815
13816 #[doc(hidden)]
13817 impl gax::options::internal::RequestBuilder for ListLocations {
13818 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13819 &mut self.0.options
13820 }
13821 }
13822
13823 #[derive(Clone, Debug)]
13840 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
13841
13842 impl GetLocation {
13843 pub(crate) fn new(
13844 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13845 ) -> Self {
13846 Self(RequestBuilder::new(stub))
13847 }
13848
13849 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
13851 self.0.request = v.into();
13852 self
13853 }
13854
13855 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13857 self.0.options = v.into();
13858 self
13859 }
13860
13861 pub async fn send(self) -> Result<location::model::Location> {
13863 (*self.0.stub)
13864 .get_location(self.0.request, self.0.options)
13865 .await
13866 .map(gax::response::Response::into_body)
13867 }
13868
13869 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13871 self.0.request.name = v.into();
13872 self
13873 }
13874 }
13875
13876 #[doc(hidden)]
13877 impl gax::options::internal::RequestBuilder for GetLocation {
13878 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13879 &mut self.0.options
13880 }
13881 }
13882
13883 #[derive(Clone, Debug)]
13900 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
13901
13902 impl SetIamPolicy {
13903 pub(crate) fn new(
13904 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13905 ) -> Self {
13906 Self(RequestBuilder::new(stub))
13907 }
13908
13909 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
13911 self.0.request = v.into();
13912 self
13913 }
13914
13915 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13917 self.0.options = v.into();
13918 self
13919 }
13920
13921 pub async fn send(self) -> Result<iam_v1::model::Policy> {
13923 (*self.0.stub)
13924 .set_iam_policy(self.0.request, self.0.options)
13925 .await
13926 .map(gax::response::Response::into_body)
13927 }
13928
13929 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
13933 self.0.request.resource = v.into();
13934 self
13935 }
13936
13937 pub fn set_policy<T>(mut self, v: T) -> Self
13941 where
13942 T: std::convert::Into<iam_v1::model::Policy>,
13943 {
13944 self.0.request.policy = std::option::Option::Some(v.into());
13945 self
13946 }
13947
13948 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
13952 where
13953 T: std::convert::Into<iam_v1::model::Policy>,
13954 {
13955 self.0.request.policy = v.map(|x| x.into());
13956 self
13957 }
13958
13959 pub fn set_update_mask<T>(mut self, v: T) -> Self
13961 where
13962 T: std::convert::Into<wkt::FieldMask>,
13963 {
13964 self.0.request.update_mask = std::option::Option::Some(v.into());
13965 self
13966 }
13967
13968 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13970 where
13971 T: std::convert::Into<wkt::FieldMask>,
13972 {
13973 self.0.request.update_mask = v.map(|x| x.into());
13974 self
13975 }
13976 }
13977
13978 #[doc(hidden)]
13979 impl gax::options::internal::RequestBuilder for SetIamPolicy {
13980 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13981 &mut self.0.options
13982 }
13983 }
13984
13985 #[derive(Clone, Debug)]
14002 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
14003
14004 impl GetIamPolicy {
14005 pub(crate) fn new(
14006 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14007 ) -> Self {
14008 Self(RequestBuilder::new(stub))
14009 }
14010
14011 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
14013 self.0.request = v.into();
14014 self
14015 }
14016
14017 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14019 self.0.options = v.into();
14020 self
14021 }
14022
14023 pub async fn send(self) -> Result<iam_v1::model::Policy> {
14025 (*self.0.stub)
14026 .get_iam_policy(self.0.request, self.0.options)
14027 .await
14028 .map(gax::response::Response::into_body)
14029 }
14030
14031 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14035 self.0.request.resource = v.into();
14036 self
14037 }
14038
14039 pub fn set_options<T>(mut self, v: T) -> Self
14041 where
14042 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
14043 {
14044 self.0.request.options = std::option::Option::Some(v.into());
14045 self
14046 }
14047
14048 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
14050 where
14051 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
14052 {
14053 self.0.request.options = v.map(|x| x.into());
14054 self
14055 }
14056 }
14057
14058 #[doc(hidden)]
14059 impl gax::options::internal::RequestBuilder for GetIamPolicy {
14060 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14061 &mut self.0.options
14062 }
14063 }
14064
14065 #[derive(Clone, Debug)]
14082 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
14083
14084 impl TestIamPermissions {
14085 pub(crate) fn new(
14086 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14087 ) -> Self {
14088 Self(RequestBuilder::new(stub))
14089 }
14090
14091 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
14093 mut self,
14094 v: V,
14095 ) -> Self {
14096 self.0.request = v.into();
14097 self
14098 }
14099
14100 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14102 self.0.options = v.into();
14103 self
14104 }
14105
14106 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
14108 (*self.0.stub)
14109 .test_iam_permissions(self.0.request, self.0.options)
14110 .await
14111 .map(gax::response::Response::into_body)
14112 }
14113
14114 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14118 self.0.request.resource = v.into();
14119 self
14120 }
14121
14122 pub fn set_permissions<T, V>(mut self, v: T) -> Self
14126 where
14127 T: std::iter::IntoIterator<Item = V>,
14128 V: std::convert::Into<std::string::String>,
14129 {
14130 use std::iter::Iterator;
14131 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
14132 self
14133 }
14134 }
14135
14136 #[doc(hidden)]
14137 impl gax::options::internal::RequestBuilder for TestIamPermissions {
14138 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14139 &mut self.0.options
14140 }
14141 }
14142
14143 #[derive(Clone, Debug)]
14164 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
14165
14166 impl ListOperations {
14167 pub(crate) fn new(
14168 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14169 ) -> Self {
14170 Self(RequestBuilder::new(stub))
14171 }
14172
14173 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
14175 mut self,
14176 v: V,
14177 ) -> Self {
14178 self.0.request = v.into();
14179 self
14180 }
14181
14182 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14184 self.0.options = v.into();
14185 self
14186 }
14187
14188 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
14190 (*self.0.stub)
14191 .list_operations(self.0.request, self.0.options)
14192 .await
14193 .map(gax::response::Response::into_body)
14194 }
14195
14196 pub fn by_page(
14198 self,
14199 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
14200 {
14201 use std::clone::Clone;
14202 let token = self.0.request.page_token.clone();
14203 let execute = move |token: String| {
14204 let mut builder = self.clone();
14205 builder.0.request = builder.0.request.set_page_token(token);
14206 builder.send()
14207 };
14208 gax::paginator::internal::new_paginator(token, execute)
14209 }
14210
14211 pub fn by_item(
14213 self,
14214 ) -> impl gax::paginator::ItemPaginator<
14215 longrunning::model::ListOperationsResponse,
14216 gax::error::Error,
14217 > {
14218 use gax::paginator::Paginator;
14219 self.by_page().items()
14220 }
14221
14222 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14224 self.0.request.name = v.into();
14225 self
14226 }
14227
14228 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14230 self.0.request.filter = v.into();
14231 self
14232 }
14233
14234 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14236 self.0.request.page_size = v.into();
14237 self
14238 }
14239
14240 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14242 self.0.request.page_token = v.into();
14243 self
14244 }
14245
14246 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14248 self.0.request.return_partial_success = v.into();
14249 self
14250 }
14251 }
14252
14253 #[doc(hidden)]
14254 impl gax::options::internal::RequestBuilder for ListOperations {
14255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14256 &mut self.0.options
14257 }
14258 }
14259
14260 #[derive(Clone, Debug)]
14277 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
14278
14279 impl GetOperation {
14280 pub(crate) fn new(
14281 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14282 ) -> Self {
14283 Self(RequestBuilder::new(stub))
14284 }
14285
14286 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
14288 mut self,
14289 v: V,
14290 ) -> Self {
14291 self.0.request = v.into();
14292 self
14293 }
14294
14295 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14297 self.0.options = v.into();
14298 self
14299 }
14300
14301 pub async fn send(self) -> Result<longrunning::model::Operation> {
14303 (*self.0.stub)
14304 .get_operation(self.0.request, self.0.options)
14305 .await
14306 .map(gax::response::Response::into_body)
14307 }
14308
14309 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14311 self.0.request.name = v.into();
14312 self
14313 }
14314 }
14315
14316 #[doc(hidden)]
14317 impl gax::options::internal::RequestBuilder for GetOperation {
14318 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14319 &mut self.0.options
14320 }
14321 }
14322
14323 #[derive(Clone, Debug)]
14340 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
14341
14342 impl DeleteOperation {
14343 pub(crate) fn new(
14344 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14345 ) -> Self {
14346 Self(RequestBuilder::new(stub))
14347 }
14348
14349 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
14351 mut self,
14352 v: V,
14353 ) -> Self {
14354 self.0.request = v.into();
14355 self
14356 }
14357
14358 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14360 self.0.options = v.into();
14361 self
14362 }
14363
14364 pub async fn send(self) -> Result<()> {
14366 (*self.0.stub)
14367 .delete_operation(self.0.request, self.0.options)
14368 .await
14369 .map(gax::response::Response::into_body)
14370 }
14371
14372 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14374 self.0.request.name = v.into();
14375 self
14376 }
14377 }
14378
14379 #[doc(hidden)]
14380 impl gax::options::internal::RequestBuilder for DeleteOperation {
14381 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14382 &mut self.0.options
14383 }
14384 }
14385
14386 #[derive(Clone, Debug)]
14403 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
14404
14405 impl CancelOperation {
14406 pub(crate) fn new(
14407 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14408 ) -> Self {
14409 Self(RequestBuilder::new(stub))
14410 }
14411
14412 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
14414 mut self,
14415 v: V,
14416 ) -> Self {
14417 self.0.request = v.into();
14418 self
14419 }
14420
14421 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14423 self.0.options = v.into();
14424 self
14425 }
14426
14427 pub async fn send(self) -> Result<()> {
14429 (*self.0.stub)
14430 .cancel_operation(self.0.request, self.0.options)
14431 .await
14432 .map(gax::response::Response::into_body)
14433 }
14434
14435 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14437 self.0.request.name = v.into();
14438 self
14439 }
14440 }
14441
14442 #[doc(hidden)]
14443 impl gax::options::internal::RequestBuilder for CancelOperation {
14444 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14445 &mut self.0.options
14446 }
14447 }
14448}
14449
14450pub mod dataplex_service {
14451 use crate::Result;
14452
14453 pub type ClientBuilder =
14467 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14468
14469 pub(crate) mod client {
14470 use super::super::super::client::DataplexService;
14471 pub struct Factory;
14472 impl gax::client_builder::internal::ClientFactory for Factory {
14473 type Client = DataplexService;
14474 type Credentials = gaxi::options::Credentials;
14475 async fn build(
14476 self,
14477 config: gaxi::options::ClientConfig,
14478 ) -> gax::client_builder::Result<Self::Client> {
14479 Self::Client::new(config).await
14480 }
14481 }
14482 }
14483
14484 #[derive(Clone, Debug)]
14486 pub(crate) struct RequestBuilder<R: std::default::Default> {
14487 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14488 request: R,
14489 options: gax::options::RequestOptions,
14490 }
14491
14492 impl<R> RequestBuilder<R>
14493 where
14494 R: std::default::Default,
14495 {
14496 pub(crate) fn new(
14497 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14498 ) -> Self {
14499 Self {
14500 stub,
14501 request: R::default(),
14502 options: gax::options::RequestOptions::default(),
14503 }
14504 }
14505 }
14506
14507 #[derive(Clone, Debug)]
14525 pub struct CreateLake(RequestBuilder<crate::model::CreateLakeRequest>);
14526
14527 impl CreateLake {
14528 pub(crate) fn new(
14529 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14530 ) -> Self {
14531 Self(RequestBuilder::new(stub))
14532 }
14533
14534 pub fn with_request<V: Into<crate::model::CreateLakeRequest>>(mut self, v: V) -> Self {
14536 self.0.request = v.into();
14537 self
14538 }
14539
14540 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14542 self.0.options = v.into();
14543 self
14544 }
14545
14546 pub async fn send(self) -> Result<longrunning::model::Operation> {
14553 (*self.0.stub)
14554 .create_lake(self.0.request, self.0.options)
14555 .await
14556 .map(gax::response::Response::into_body)
14557 }
14558
14559 pub fn poller(
14561 self,
14562 ) -> impl lro::Poller<crate::model::Lake, crate::model::OperationMetadata> {
14563 type Operation =
14564 lro::internal::Operation<crate::model::Lake, crate::model::OperationMetadata>;
14565 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14566 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14567
14568 let stub = self.0.stub.clone();
14569 let mut options = self.0.options.clone();
14570 options.set_retry_policy(gax::retry_policy::NeverRetry);
14571 let query = move |name| {
14572 let stub = stub.clone();
14573 let options = options.clone();
14574 async {
14575 let op = GetOperation::new(stub)
14576 .set_name(name)
14577 .with_options(options)
14578 .send()
14579 .await?;
14580 Ok(Operation::new(op))
14581 }
14582 };
14583
14584 let start = move || async {
14585 let op = self.send().await?;
14586 Ok(Operation::new(op))
14587 };
14588
14589 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
14590 }
14591
14592 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14596 self.0.request.parent = v.into();
14597 self
14598 }
14599
14600 pub fn set_lake_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14604 self.0.request.lake_id = v.into();
14605 self
14606 }
14607
14608 pub fn set_lake<T>(mut self, v: T) -> Self
14612 where
14613 T: std::convert::Into<crate::model::Lake>,
14614 {
14615 self.0.request.lake = std::option::Option::Some(v.into());
14616 self
14617 }
14618
14619 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
14623 where
14624 T: std::convert::Into<crate::model::Lake>,
14625 {
14626 self.0.request.lake = v.map(|x| x.into());
14627 self
14628 }
14629
14630 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14632 self.0.request.validate_only = v.into();
14633 self
14634 }
14635 }
14636
14637 #[doc(hidden)]
14638 impl gax::options::internal::RequestBuilder for CreateLake {
14639 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14640 &mut self.0.options
14641 }
14642 }
14643
14644 #[derive(Clone, Debug)]
14662 pub struct UpdateLake(RequestBuilder<crate::model::UpdateLakeRequest>);
14663
14664 impl UpdateLake {
14665 pub(crate) fn new(
14666 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14667 ) -> Self {
14668 Self(RequestBuilder::new(stub))
14669 }
14670
14671 pub fn with_request<V: Into<crate::model::UpdateLakeRequest>>(mut self, v: V) -> Self {
14673 self.0.request = v.into();
14674 self
14675 }
14676
14677 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14679 self.0.options = v.into();
14680 self
14681 }
14682
14683 pub async fn send(self) -> Result<longrunning::model::Operation> {
14690 (*self.0.stub)
14691 .update_lake(self.0.request, self.0.options)
14692 .await
14693 .map(gax::response::Response::into_body)
14694 }
14695
14696 pub fn poller(
14698 self,
14699 ) -> impl lro::Poller<crate::model::Lake, crate::model::OperationMetadata> {
14700 type Operation =
14701 lro::internal::Operation<crate::model::Lake, crate::model::OperationMetadata>;
14702 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14703 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14704
14705 let stub = self.0.stub.clone();
14706 let mut options = self.0.options.clone();
14707 options.set_retry_policy(gax::retry_policy::NeverRetry);
14708 let query = move |name| {
14709 let stub = stub.clone();
14710 let options = options.clone();
14711 async {
14712 let op = GetOperation::new(stub)
14713 .set_name(name)
14714 .with_options(options)
14715 .send()
14716 .await?;
14717 Ok(Operation::new(op))
14718 }
14719 };
14720
14721 let start = move || async {
14722 let op = self.send().await?;
14723 Ok(Operation::new(op))
14724 };
14725
14726 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
14727 }
14728
14729 pub fn set_update_mask<T>(mut self, v: T) -> Self
14733 where
14734 T: std::convert::Into<wkt::FieldMask>,
14735 {
14736 self.0.request.update_mask = std::option::Option::Some(v.into());
14737 self
14738 }
14739
14740 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14744 where
14745 T: std::convert::Into<wkt::FieldMask>,
14746 {
14747 self.0.request.update_mask = v.map(|x| x.into());
14748 self
14749 }
14750
14751 pub fn set_lake<T>(mut self, v: T) -> Self
14755 where
14756 T: std::convert::Into<crate::model::Lake>,
14757 {
14758 self.0.request.lake = std::option::Option::Some(v.into());
14759 self
14760 }
14761
14762 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
14766 where
14767 T: std::convert::Into<crate::model::Lake>,
14768 {
14769 self.0.request.lake = v.map(|x| x.into());
14770 self
14771 }
14772
14773 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14775 self.0.request.validate_only = v.into();
14776 self
14777 }
14778 }
14779
14780 #[doc(hidden)]
14781 impl gax::options::internal::RequestBuilder for UpdateLake {
14782 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14783 &mut self.0.options
14784 }
14785 }
14786
14787 #[derive(Clone, Debug)]
14805 pub struct DeleteLake(RequestBuilder<crate::model::DeleteLakeRequest>);
14806
14807 impl DeleteLake {
14808 pub(crate) fn new(
14809 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14810 ) -> Self {
14811 Self(RequestBuilder::new(stub))
14812 }
14813
14814 pub fn with_request<V: Into<crate::model::DeleteLakeRequest>>(mut self, v: V) -> Self {
14816 self.0.request = v.into();
14817 self
14818 }
14819
14820 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14822 self.0.options = v.into();
14823 self
14824 }
14825
14826 pub async fn send(self) -> Result<longrunning::model::Operation> {
14833 (*self.0.stub)
14834 .delete_lake(self.0.request, self.0.options)
14835 .await
14836 .map(gax::response::Response::into_body)
14837 }
14838
14839 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
14841 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14842 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14843 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14844
14845 let stub = self.0.stub.clone();
14846 let mut options = self.0.options.clone();
14847 options.set_retry_policy(gax::retry_policy::NeverRetry);
14848 let query = move |name| {
14849 let stub = stub.clone();
14850 let options = options.clone();
14851 async {
14852 let op = GetOperation::new(stub)
14853 .set_name(name)
14854 .with_options(options)
14855 .send()
14856 .await?;
14857 Ok(Operation::new(op))
14858 }
14859 };
14860
14861 let start = move || async {
14862 let op = self.send().await?;
14863 Ok(Operation::new(op))
14864 };
14865
14866 lro::internal::new_unit_response_poller(
14867 polling_error_policy,
14868 polling_backoff_policy,
14869 start,
14870 query,
14871 )
14872 }
14873
14874 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14878 self.0.request.name = v.into();
14879 self
14880 }
14881 }
14882
14883 #[doc(hidden)]
14884 impl gax::options::internal::RequestBuilder for DeleteLake {
14885 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14886 &mut self.0.options
14887 }
14888 }
14889
14890 #[derive(Clone, Debug)]
14911 pub struct ListLakes(RequestBuilder<crate::model::ListLakesRequest>);
14912
14913 impl ListLakes {
14914 pub(crate) fn new(
14915 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14916 ) -> Self {
14917 Self(RequestBuilder::new(stub))
14918 }
14919
14920 pub fn with_request<V: Into<crate::model::ListLakesRequest>>(mut self, v: V) -> Self {
14922 self.0.request = v.into();
14923 self
14924 }
14925
14926 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14928 self.0.options = v.into();
14929 self
14930 }
14931
14932 pub async fn send(self) -> Result<crate::model::ListLakesResponse> {
14934 (*self.0.stub)
14935 .list_lakes(self.0.request, self.0.options)
14936 .await
14937 .map(gax::response::Response::into_body)
14938 }
14939
14940 pub fn by_page(
14942 self,
14943 ) -> impl gax::paginator::Paginator<crate::model::ListLakesResponse, gax::error::Error>
14944 {
14945 use std::clone::Clone;
14946 let token = self.0.request.page_token.clone();
14947 let execute = move |token: String| {
14948 let mut builder = self.clone();
14949 builder.0.request = builder.0.request.set_page_token(token);
14950 builder.send()
14951 };
14952 gax::paginator::internal::new_paginator(token, execute)
14953 }
14954
14955 pub fn by_item(
14957 self,
14958 ) -> impl gax::paginator::ItemPaginator<crate::model::ListLakesResponse, gax::error::Error>
14959 {
14960 use gax::paginator::Paginator;
14961 self.by_page().items()
14962 }
14963
14964 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14968 self.0.request.parent = v.into();
14969 self
14970 }
14971
14972 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14974 self.0.request.page_size = v.into();
14975 self
14976 }
14977
14978 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14980 self.0.request.page_token = v.into();
14981 self
14982 }
14983
14984 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14986 self.0.request.filter = v.into();
14987 self
14988 }
14989
14990 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
14992 self.0.request.order_by = v.into();
14993 self
14994 }
14995 }
14996
14997 #[doc(hidden)]
14998 impl gax::options::internal::RequestBuilder for ListLakes {
14999 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15000 &mut self.0.options
15001 }
15002 }
15003
15004 #[derive(Clone, Debug)]
15021 pub struct GetLake(RequestBuilder<crate::model::GetLakeRequest>);
15022
15023 impl GetLake {
15024 pub(crate) fn new(
15025 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15026 ) -> Self {
15027 Self(RequestBuilder::new(stub))
15028 }
15029
15030 pub fn with_request<V: Into<crate::model::GetLakeRequest>>(mut self, v: V) -> Self {
15032 self.0.request = v.into();
15033 self
15034 }
15035
15036 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15038 self.0.options = v.into();
15039 self
15040 }
15041
15042 pub async fn send(self) -> Result<crate::model::Lake> {
15044 (*self.0.stub)
15045 .get_lake(self.0.request, self.0.options)
15046 .await
15047 .map(gax::response::Response::into_body)
15048 }
15049
15050 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15054 self.0.request.name = v.into();
15055 self
15056 }
15057 }
15058
15059 #[doc(hidden)]
15060 impl gax::options::internal::RequestBuilder for GetLake {
15061 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15062 &mut self.0.options
15063 }
15064 }
15065
15066 #[derive(Clone, Debug)]
15087 pub struct ListLakeActions(RequestBuilder<crate::model::ListLakeActionsRequest>);
15088
15089 impl ListLakeActions {
15090 pub(crate) fn new(
15091 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15092 ) -> Self {
15093 Self(RequestBuilder::new(stub))
15094 }
15095
15096 pub fn with_request<V: Into<crate::model::ListLakeActionsRequest>>(mut self, v: V) -> Self {
15098 self.0.request = v.into();
15099 self
15100 }
15101
15102 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15104 self.0.options = v.into();
15105 self
15106 }
15107
15108 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
15110 (*self.0.stub)
15111 .list_lake_actions(self.0.request, self.0.options)
15112 .await
15113 .map(gax::response::Response::into_body)
15114 }
15115
15116 pub fn by_page(
15118 self,
15119 ) -> impl gax::paginator::Paginator<crate::model::ListActionsResponse, gax::error::Error>
15120 {
15121 use std::clone::Clone;
15122 let token = self.0.request.page_token.clone();
15123 let execute = move |token: String| {
15124 let mut builder = self.clone();
15125 builder.0.request = builder.0.request.set_page_token(token);
15126 builder.send()
15127 };
15128 gax::paginator::internal::new_paginator(token, execute)
15129 }
15130
15131 pub fn by_item(
15133 self,
15134 ) -> impl gax::paginator::ItemPaginator<crate::model::ListActionsResponse, gax::error::Error>
15135 {
15136 use gax::paginator::Paginator;
15137 self.by_page().items()
15138 }
15139
15140 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15144 self.0.request.parent = v.into();
15145 self
15146 }
15147
15148 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15150 self.0.request.page_size = v.into();
15151 self
15152 }
15153
15154 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15156 self.0.request.page_token = v.into();
15157 self
15158 }
15159 }
15160
15161 #[doc(hidden)]
15162 impl gax::options::internal::RequestBuilder for ListLakeActions {
15163 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15164 &mut self.0.options
15165 }
15166 }
15167
15168 #[derive(Clone, Debug)]
15186 pub struct CreateZone(RequestBuilder<crate::model::CreateZoneRequest>);
15187
15188 impl CreateZone {
15189 pub(crate) fn new(
15190 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15191 ) -> Self {
15192 Self(RequestBuilder::new(stub))
15193 }
15194
15195 pub fn with_request<V: Into<crate::model::CreateZoneRequest>>(mut self, v: V) -> Self {
15197 self.0.request = v.into();
15198 self
15199 }
15200
15201 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15203 self.0.options = v.into();
15204 self
15205 }
15206
15207 pub async fn send(self) -> Result<longrunning::model::Operation> {
15214 (*self.0.stub)
15215 .create_zone(self.0.request, self.0.options)
15216 .await
15217 .map(gax::response::Response::into_body)
15218 }
15219
15220 pub fn poller(
15222 self,
15223 ) -> impl lro::Poller<crate::model::Zone, crate::model::OperationMetadata> {
15224 type Operation =
15225 lro::internal::Operation<crate::model::Zone, crate::model::OperationMetadata>;
15226 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15227 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15228
15229 let stub = self.0.stub.clone();
15230 let mut options = self.0.options.clone();
15231 options.set_retry_policy(gax::retry_policy::NeverRetry);
15232 let query = move |name| {
15233 let stub = stub.clone();
15234 let options = options.clone();
15235 async {
15236 let op = GetOperation::new(stub)
15237 .set_name(name)
15238 .with_options(options)
15239 .send()
15240 .await?;
15241 Ok(Operation::new(op))
15242 }
15243 };
15244
15245 let start = move || async {
15246 let op = self.send().await?;
15247 Ok(Operation::new(op))
15248 };
15249
15250 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
15251 }
15252
15253 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15257 self.0.request.parent = v.into();
15258 self
15259 }
15260
15261 pub fn set_zone_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15265 self.0.request.zone_id = v.into();
15266 self
15267 }
15268
15269 pub fn set_zone<T>(mut self, v: T) -> Self
15273 where
15274 T: std::convert::Into<crate::model::Zone>,
15275 {
15276 self.0.request.zone = std::option::Option::Some(v.into());
15277 self
15278 }
15279
15280 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
15284 where
15285 T: std::convert::Into<crate::model::Zone>,
15286 {
15287 self.0.request.zone = v.map(|x| x.into());
15288 self
15289 }
15290
15291 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15293 self.0.request.validate_only = v.into();
15294 self
15295 }
15296 }
15297
15298 #[doc(hidden)]
15299 impl gax::options::internal::RequestBuilder for CreateZone {
15300 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15301 &mut self.0.options
15302 }
15303 }
15304
15305 #[derive(Clone, Debug)]
15323 pub struct UpdateZone(RequestBuilder<crate::model::UpdateZoneRequest>);
15324
15325 impl UpdateZone {
15326 pub(crate) fn new(
15327 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15328 ) -> Self {
15329 Self(RequestBuilder::new(stub))
15330 }
15331
15332 pub fn with_request<V: Into<crate::model::UpdateZoneRequest>>(mut self, v: V) -> Self {
15334 self.0.request = v.into();
15335 self
15336 }
15337
15338 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15340 self.0.options = v.into();
15341 self
15342 }
15343
15344 pub async fn send(self) -> Result<longrunning::model::Operation> {
15351 (*self.0.stub)
15352 .update_zone(self.0.request, self.0.options)
15353 .await
15354 .map(gax::response::Response::into_body)
15355 }
15356
15357 pub fn poller(
15359 self,
15360 ) -> impl lro::Poller<crate::model::Zone, crate::model::OperationMetadata> {
15361 type Operation =
15362 lro::internal::Operation<crate::model::Zone, crate::model::OperationMetadata>;
15363 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15364 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15365
15366 let stub = self.0.stub.clone();
15367 let mut options = self.0.options.clone();
15368 options.set_retry_policy(gax::retry_policy::NeverRetry);
15369 let query = move |name| {
15370 let stub = stub.clone();
15371 let options = options.clone();
15372 async {
15373 let op = GetOperation::new(stub)
15374 .set_name(name)
15375 .with_options(options)
15376 .send()
15377 .await?;
15378 Ok(Operation::new(op))
15379 }
15380 };
15381
15382 let start = move || async {
15383 let op = self.send().await?;
15384 Ok(Operation::new(op))
15385 };
15386
15387 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
15388 }
15389
15390 pub fn set_update_mask<T>(mut self, v: T) -> Self
15394 where
15395 T: std::convert::Into<wkt::FieldMask>,
15396 {
15397 self.0.request.update_mask = std::option::Option::Some(v.into());
15398 self
15399 }
15400
15401 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15405 where
15406 T: std::convert::Into<wkt::FieldMask>,
15407 {
15408 self.0.request.update_mask = v.map(|x| x.into());
15409 self
15410 }
15411
15412 pub fn set_zone<T>(mut self, v: T) -> Self
15416 where
15417 T: std::convert::Into<crate::model::Zone>,
15418 {
15419 self.0.request.zone = std::option::Option::Some(v.into());
15420 self
15421 }
15422
15423 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
15427 where
15428 T: std::convert::Into<crate::model::Zone>,
15429 {
15430 self.0.request.zone = v.map(|x| x.into());
15431 self
15432 }
15433
15434 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15436 self.0.request.validate_only = v.into();
15437 self
15438 }
15439 }
15440
15441 #[doc(hidden)]
15442 impl gax::options::internal::RequestBuilder for UpdateZone {
15443 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15444 &mut self.0.options
15445 }
15446 }
15447
15448 #[derive(Clone, Debug)]
15466 pub struct DeleteZone(RequestBuilder<crate::model::DeleteZoneRequest>);
15467
15468 impl DeleteZone {
15469 pub(crate) fn new(
15470 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15471 ) -> Self {
15472 Self(RequestBuilder::new(stub))
15473 }
15474
15475 pub fn with_request<V: Into<crate::model::DeleteZoneRequest>>(mut self, v: V) -> Self {
15477 self.0.request = v.into();
15478 self
15479 }
15480
15481 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15483 self.0.options = v.into();
15484 self
15485 }
15486
15487 pub async fn send(self) -> Result<longrunning::model::Operation> {
15494 (*self.0.stub)
15495 .delete_zone(self.0.request, self.0.options)
15496 .await
15497 .map(gax::response::Response::into_body)
15498 }
15499
15500 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
15502 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15503 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15504 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15505
15506 let stub = self.0.stub.clone();
15507 let mut options = self.0.options.clone();
15508 options.set_retry_policy(gax::retry_policy::NeverRetry);
15509 let query = move |name| {
15510 let stub = stub.clone();
15511 let options = options.clone();
15512 async {
15513 let op = GetOperation::new(stub)
15514 .set_name(name)
15515 .with_options(options)
15516 .send()
15517 .await?;
15518 Ok(Operation::new(op))
15519 }
15520 };
15521
15522 let start = move || async {
15523 let op = self.send().await?;
15524 Ok(Operation::new(op))
15525 };
15526
15527 lro::internal::new_unit_response_poller(
15528 polling_error_policy,
15529 polling_backoff_policy,
15530 start,
15531 query,
15532 )
15533 }
15534
15535 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15539 self.0.request.name = v.into();
15540 self
15541 }
15542 }
15543
15544 #[doc(hidden)]
15545 impl gax::options::internal::RequestBuilder for DeleteZone {
15546 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15547 &mut self.0.options
15548 }
15549 }
15550
15551 #[derive(Clone, Debug)]
15572 pub struct ListZones(RequestBuilder<crate::model::ListZonesRequest>);
15573
15574 impl ListZones {
15575 pub(crate) fn new(
15576 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15577 ) -> Self {
15578 Self(RequestBuilder::new(stub))
15579 }
15580
15581 pub fn with_request<V: Into<crate::model::ListZonesRequest>>(mut self, v: V) -> Self {
15583 self.0.request = v.into();
15584 self
15585 }
15586
15587 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15589 self.0.options = v.into();
15590 self
15591 }
15592
15593 pub async fn send(self) -> Result<crate::model::ListZonesResponse> {
15595 (*self.0.stub)
15596 .list_zones(self.0.request, self.0.options)
15597 .await
15598 .map(gax::response::Response::into_body)
15599 }
15600
15601 pub fn by_page(
15603 self,
15604 ) -> impl gax::paginator::Paginator<crate::model::ListZonesResponse, gax::error::Error>
15605 {
15606 use std::clone::Clone;
15607 let token = self.0.request.page_token.clone();
15608 let execute = move |token: String| {
15609 let mut builder = self.clone();
15610 builder.0.request = builder.0.request.set_page_token(token);
15611 builder.send()
15612 };
15613 gax::paginator::internal::new_paginator(token, execute)
15614 }
15615
15616 pub fn by_item(
15618 self,
15619 ) -> impl gax::paginator::ItemPaginator<crate::model::ListZonesResponse, gax::error::Error>
15620 {
15621 use gax::paginator::Paginator;
15622 self.by_page().items()
15623 }
15624
15625 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15629 self.0.request.parent = v.into();
15630 self
15631 }
15632
15633 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15635 self.0.request.page_size = v.into();
15636 self
15637 }
15638
15639 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15641 self.0.request.page_token = v.into();
15642 self
15643 }
15644
15645 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15647 self.0.request.filter = v.into();
15648 self
15649 }
15650
15651 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
15653 self.0.request.order_by = v.into();
15654 self
15655 }
15656 }
15657
15658 #[doc(hidden)]
15659 impl gax::options::internal::RequestBuilder for ListZones {
15660 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15661 &mut self.0.options
15662 }
15663 }
15664
15665 #[derive(Clone, Debug)]
15682 pub struct GetZone(RequestBuilder<crate::model::GetZoneRequest>);
15683
15684 impl GetZone {
15685 pub(crate) fn new(
15686 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15687 ) -> Self {
15688 Self(RequestBuilder::new(stub))
15689 }
15690
15691 pub fn with_request<V: Into<crate::model::GetZoneRequest>>(mut self, v: V) -> Self {
15693 self.0.request = v.into();
15694 self
15695 }
15696
15697 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15699 self.0.options = v.into();
15700 self
15701 }
15702
15703 pub async fn send(self) -> Result<crate::model::Zone> {
15705 (*self.0.stub)
15706 .get_zone(self.0.request, self.0.options)
15707 .await
15708 .map(gax::response::Response::into_body)
15709 }
15710
15711 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15715 self.0.request.name = v.into();
15716 self
15717 }
15718 }
15719
15720 #[doc(hidden)]
15721 impl gax::options::internal::RequestBuilder for GetZone {
15722 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15723 &mut self.0.options
15724 }
15725 }
15726
15727 #[derive(Clone, Debug)]
15748 pub struct ListZoneActions(RequestBuilder<crate::model::ListZoneActionsRequest>);
15749
15750 impl ListZoneActions {
15751 pub(crate) fn new(
15752 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15753 ) -> Self {
15754 Self(RequestBuilder::new(stub))
15755 }
15756
15757 pub fn with_request<V: Into<crate::model::ListZoneActionsRequest>>(mut self, v: V) -> Self {
15759 self.0.request = v.into();
15760 self
15761 }
15762
15763 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15765 self.0.options = v.into();
15766 self
15767 }
15768
15769 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
15771 (*self.0.stub)
15772 .list_zone_actions(self.0.request, self.0.options)
15773 .await
15774 .map(gax::response::Response::into_body)
15775 }
15776
15777 pub fn by_page(
15779 self,
15780 ) -> impl gax::paginator::Paginator<crate::model::ListActionsResponse, gax::error::Error>
15781 {
15782 use std::clone::Clone;
15783 let token = self.0.request.page_token.clone();
15784 let execute = move |token: String| {
15785 let mut builder = self.clone();
15786 builder.0.request = builder.0.request.set_page_token(token);
15787 builder.send()
15788 };
15789 gax::paginator::internal::new_paginator(token, execute)
15790 }
15791
15792 pub fn by_item(
15794 self,
15795 ) -> impl gax::paginator::ItemPaginator<crate::model::ListActionsResponse, gax::error::Error>
15796 {
15797 use gax::paginator::Paginator;
15798 self.by_page().items()
15799 }
15800
15801 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15805 self.0.request.parent = v.into();
15806 self
15807 }
15808
15809 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15811 self.0.request.page_size = v.into();
15812 self
15813 }
15814
15815 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15817 self.0.request.page_token = v.into();
15818 self
15819 }
15820 }
15821
15822 #[doc(hidden)]
15823 impl gax::options::internal::RequestBuilder for ListZoneActions {
15824 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15825 &mut self.0.options
15826 }
15827 }
15828
15829 #[derive(Clone, Debug)]
15847 pub struct CreateAsset(RequestBuilder<crate::model::CreateAssetRequest>);
15848
15849 impl CreateAsset {
15850 pub(crate) fn new(
15851 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15852 ) -> Self {
15853 Self(RequestBuilder::new(stub))
15854 }
15855
15856 pub fn with_request<V: Into<crate::model::CreateAssetRequest>>(mut self, v: V) -> Self {
15858 self.0.request = v.into();
15859 self
15860 }
15861
15862 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15864 self.0.options = v.into();
15865 self
15866 }
15867
15868 pub async fn send(self) -> Result<longrunning::model::Operation> {
15875 (*self.0.stub)
15876 .create_asset(self.0.request, self.0.options)
15877 .await
15878 .map(gax::response::Response::into_body)
15879 }
15880
15881 pub fn poller(
15883 self,
15884 ) -> impl lro::Poller<crate::model::Asset, crate::model::OperationMetadata> {
15885 type Operation =
15886 lro::internal::Operation<crate::model::Asset, crate::model::OperationMetadata>;
15887 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15888 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15889
15890 let stub = self.0.stub.clone();
15891 let mut options = self.0.options.clone();
15892 options.set_retry_policy(gax::retry_policy::NeverRetry);
15893 let query = move |name| {
15894 let stub = stub.clone();
15895 let options = options.clone();
15896 async {
15897 let op = GetOperation::new(stub)
15898 .set_name(name)
15899 .with_options(options)
15900 .send()
15901 .await?;
15902 Ok(Operation::new(op))
15903 }
15904 };
15905
15906 let start = move || async {
15907 let op = self.send().await?;
15908 Ok(Operation::new(op))
15909 };
15910
15911 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
15912 }
15913
15914 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15918 self.0.request.parent = v.into();
15919 self
15920 }
15921
15922 pub fn set_asset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15926 self.0.request.asset_id = v.into();
15927 self
15928 }
15929
15930 pub fn set_asset<T>(mut self, v: T) -> Self
15934 where
15935 T: std::convert::Into<crate::model::Asset>,
15936 {
15937 self.0.request.asset = std::option::Option::Some(v.into());
15938 self
15939 }
15940
15941 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
15945 where
15946 T: std::convert::Into<crate::model::Asset>,
15947 {
15948 self.0.request.asset = v.map(|x| x.into());
15949 self
15950 }
15951
15952 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15954 self.0.request.validate_only = v.into();
15955 self
15956 }
15957 }
15958
15959 #[doc(hidden)]
15960 impl gax::options::internal::RequestBuilder for CreateAsset {
15961 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15962 &mut self.0.options
15963 }
15964 }
15965
15966 #[derive(Clone, Debug)]
15984 pub struct UpdateAsset(RequestBuilder<crate::model::UpdateAssetRequest>);
15985
15986 impl UpdateAsset {
15987 pub(crate) fn new(
15988 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15989 ) -> Self {
15990 Self(RequestBuilder::new(stub))
15991 }
15992
15993 pub fn with_request<V: Into<crate::model::UpdateAssetRequest>>(mut self, v: V) -> Self {
15995 self.0.request = v.into();
15996 self
15997 }
15998
15999 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16001 self.0.options = v.into();
16002 self
16003 }
16004
16005 pub async fn send(self) -> Result<longrunning::model::Operation> {
16012 (*self.0.stub)
16013 .update_asset(self.0.request, self.0.options)
16014 .await
16015 .map(gax::response::Response::into_body)
16016 }
16017
16018 pub fn poller(
16020 self,
16021 ) -> impl lro::Poller<crate::model::Asset, crate::model::OperationMetadata> {
16022 type Operation =
16023 lro::internal::Operation<crate::model::Asset, crate::model::OperationMetadata>;
16024 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16025 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16026
16027 let stub = self.0.stub.clone();
16028 let mut options = self.0.options.clone();
16029 options.set_retry_policy(gax::retry_policy::NeverRetry);
16030 let query = move |name| {
16031 let stub = stub.clone();
16032 let options = options.clone();
16033 async {
16034 let op = GetOperation::new(stub)
16035 .set_name(name)
16036 .with_options(options)
16037 .send()
16038 .await?;
16039 Ok(Operation::new(op))
16040 }
16041 };
16042
16043 let start = move || async {
16044 let op = self.send().await?;
16045 Ok(Operation::new(op))
16046 };
16047
16048 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
16049 }
16050
16051 pub fn set_update_mask<T>(mut self, v: T) -> Self
16055 where
16056 T: std::convert::Into<wkt::FieldMask>,
16057 {
16058 self.0.request.update_mask = std::option::Option::Some(v.into());
16059 self
16060 }
16061
16062 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16066 where
16067 T: std::convert::Into<wkt::FieldMask>,
16068 {
16069 self.0.request.update_mask = v.map(|x| x.into());
16070 self
16071 }
16072
16073 pub fn set_asset<T>(mut self, v: T) -> Self
16077 where
16078 T: std::convert::Into<crate::model::Asset>,
16079 {
16080 self.0.request.asset = std::option::Option::Some(v.into());
16081 self
16082 }
16083
16084 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
16088 where
16089 T: std::convert::Into<crate::model::Asset>,
16090 {
16091 self.0.request.asset = v.map(|x| x.into());
16092 self
16093 }
16094
16095 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16097 self.0.request.validate_only = v.into();
16098 self
16099 }
16100 }
16101
16102 #[doc(hidden)]
16103 impl gax::options::internal::RequestBuilder for UpdateAsset {
16104 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16105 &mut self.0.options
16106 }
16107 }
16108
16109 #[derive(Clone, Debug)]
16127 pub struct DeleteAsset(RequestBuilder<crate::model::DeleteAssetRequest>);
16128
16129 impl DeleteAsset {
16130 pub(crate) fn new(
16131 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16132 ) -> Self {
16133 Self(RequestBuilder::new(stub))
16134 }
16135
16136 pub fn with_request<V: Into<crate::model::DeleteAssetRequest>>(mut self, v: V) -> Self {
16138 self.0.request = v.into();
16139 self
16140 }
16141
16142 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16144 self.0.options = v.into();
16145 self
16146 }
16147
16148 pub async fn send(self) -> Result<longrunning::model::Operation> {
16155 (*self.0.stub)
16156 .delete_asset(self.0.request, self.0.options)
16157 .await
16158 .map(gax::response::Response::into_body)
16159 }
16160
16161 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
16163 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16164 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16165 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16166
16167 let stub = self.0.stub.clone();
16168 let mut options = self.0.options.clone();
16169 options.set_retry_policy(gax::retry_policy::NeverRetry);
16170 let query = move |name| {
16171 let stub = stub.clone();
16172 let options = options.clone();
16173 async {
16174 let op = GetOperation::new(stub)
16175 .set_name(name)
16176 .with_options(options)
16177 .send()
16178 .await?;
16179 Ok(Operation::new(op))
16180 }
16181 };
16182
16183 let start = move || async {
16184 let op = self.send().await?;
16185 Ok(Operation::new(op))
16186 };
16187
16188 lro::internal::new_unit_response_poller(
16189 polling_error_policy,
16190 polling_backoff_policy,
16191 start,
16192 query,
16193 )
16194 }
16195
16196 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16200 self.0.request.name = v.into();
16201 self
16202 }
16203 }
16204
16205 #[doc(hidden)]
16206 impl gax::options::internal::RequestBuilder for DeleteAsset {
16207 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16208 &mut self.0.options
16209 }
16210 }
16211
16212 #[derive(Clone, Debug)]
16233 pub struct ListAssets(RequestBuilder<crate::model::ListAssetsRequest>);
16234
16235 impl ListAssets {
16236 pub(crate) fn new(
16237 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16238 ) -> Self {
16239 Self(RequestBuilder::new(stub))
16240 }
16241
16242 pub fn with_request<V: Into<crate::model::ListAssetsRequest>>(mut self, v: V) -> Self {
16244 self.0.request = v.into();
16245 self
16246 }
16247
16248 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16250 self.0.options = v.into();
16251 self
16252 }
16253
16254 pub async fn send(self) -> Result<crate::model::ListAssetsResponse> {
16256 (*self.0.stub)
16257 .list_assets(self.0.request, self.0.options)
16258 .await
16259 .map(gax::response::Response::into_body)
16260 }
16261
16262 pub fn by_page(
16264 self,
16265 ) -> impl gax::paginator::Paginator<crate::model::ListAssetsResponse, gax::error::Error>
16266 {
16267 use std::clone::Clone;
16268 let token = self.0.request.page_token.clone();
16269 let execute = move |token: String| {
16270 let mut builder = self.clone();
16271 builder.0.request = builder.0.request.set_page_token(token);
16272 builder.send()
16273 };
16274 gax::paginator::internal::new_paginator(token, execute)
16275 }
16276
16277 pub fn by_item(
16279 self,
16280 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAssetsResponse, gax::error::Error>
16281 {
16282 use gax::paginator::Paginator;
16283 self.by_page().items()
16284 }
16285
16286 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16290 self.0.request.parent = v.into();
16291 self
16292 }
16293
16294 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16296 self.0.request.page_size = v.into();
16297 self
16298 }
16299
16300 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16302 self.0.request.page_token = v.into();
16303 self
16304 }
16305
16306 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16308 self.0.request.filter = v.into();
16309 self
16310 }
16311
16312 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
16314 self.0.request.order_by = v.into();
16315 self
16316 }
16317 }
16318
16319 #[doc(hidden)]
16320 impl gax::options::internal::RequestBuilder for ListAssets {
16321 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16322 &mut self.0.options
16323 }
16324 }
16325
16326 #[derive(Clone, Debug)]
16343 pub struct GetAsset(RequestBuilder<crate::model::GetAssetRequest>);
16344
16345 impl GetAsset {
16346 pub(crate) fn new(
16347 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16348 ) -> Self {
16349 Self(RequestBuilder::new(stub))
16350 }
16351
16352 pub fn with_request<V: Into<crate::model::GetAssetRequest>>(mut self, v: V) -> Self {
16354 self.0.request = v.into();
16355 self
16356 }
16357
16358 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16360 self.0.options = v.into();
16361 self
16362 }
16363
16364 pub async fn send(self) -> Result<crate::model::Asset> {
16366 (*self.0.stub)
16367 .get_asset(self.0.request, self.0.options)
16368 .await
16369 .map(gax::response::Response::into_body)
16370 }
16371
16372 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16376 self.0.request.name = v.into();
16377 self
16378 }
16379 }
16380
16381 #[doc(hidden)]
16382 impl gax::options::internal::RequestBuilder for GetAsset {
16383 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16384 &mut self.0.options
16385 }
16386 }
16387
16388 #[derive(Clone, Debug)]
16409 pub struct ListAssetActions(RequestBuilder<crate::model::ListAssetActionsRequest>);
16410
16411 impl ListAssetActions {
16412 pub(crate) fn new(
16413 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16414 ) -> Self {
16415 Self(RequestBuilder::new(stub))
16416 }
16417
16418 pub fn with_request<V: Into<crate::model::ListAssetActionsRequest>>(
16420 mut self,
16421 v: V,
16422 ) -> Self {
16423 self.0.request = v.into();
16424 self
16425 }
16426
16427 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16429 self.0.options = v.into();
16430 self
16431 }
16432
16433 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
16435 (*self.0.stub)
16436 .list_asset_actions(self.0.request, self.0.options)
16437 .await
16438 .map(gax::response::Response::into_body)
16439 }
16440
16441 pub fn by_page(
16443 self,
16444 ) -> impl gax::paginator::Paginator<crate::model::ListActionsResponse, gax::error::Error>
16445 {
16446 use std::clone::Clone;
16447 let token = self.0.request.page_token.clone();
16448 let execute = move |token: String| {
16449 let mut builder = self.clone();
16450 builder.0.request = builder.0.request.set_page_token(token);
16451 builder.send()
16452 };
16453 gax::paginator::internal::new_paginator(token, execute)
16454 }
16455
16456 pub fn by_item(
16458 self,
16459 ) -> impl gax::paginator::ItemPaginator<crate::model::ListActionsResponse, gax::error::Error>
16460 {
16461 use gax::paginator::Paginator;
16462 self.by_page().items()
16463 }
16464
16465 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16469 self.0.request.parent = v.into();
16470 self
16471 }
16472
16473 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16475 self.0.request.page_size = v.into();
16476 self
16477 }
16478
16479 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16481 self.0.request.page_token = v.into();
16482 self
16483 }
16484 }
16485
16486 #[doc(hidden)]
16487 impl gax::options::internal::RequestBuilder for ListAssetActions {
16488 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16489 &mut self.0.options
16490 }
16491 }
16492
16493 #[derive(Clone, Debug)]
16511 pub struct CreateTask(RequestBuilder<crate::model::CreateTaskRequest>);
16512
16513 impl CreateTask {
16514 pub(crate) fn new(
16515 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16516 ) -> Self {
16517 Self(RequestBuilder::new(stub))
16518 }
16519
16520 pub fn with_request<V: Into<crate::model::CreateTaskRequest>>(mut self, v: V) -> Self {
16522 self.0.request = v.into();
16523 self
16524 }
16525
16526 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16528 self.0.options = v.into();
16529 self
16530 }
16531
16532 pub async fn send(self) -> Result<longrunning::model::Operation> {
16539 (*self.0.stub)
16540 .create_task(self.0.request, self.0.options)
16541 .await
16542 .map(gax::response::Response::into_body)
16543 }
16544
16545 pub fn poller(
16547 self,
16548 ) -> impl lro::Poller<crate::model::Task, crate::model::OperationMetadata> {
16549 type Operation =
16550 lro::internal::Operation<crate::model::Task, crate::model::OperationMetadata>;
16551 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16552 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16553
16554 let stub = self.0.stub.clone();
16555 let mut options = self.0.options.clone();
16556 options.set_retry_policy(gax::retry_policy::NeverRetry);
16557 let query = move |name| {
16558 let stub = stub.clone();
16559 let options = options.clone();
16560 async {
16561 let op = GetOperation::new(stub)
16562 .set_name(name)
16563 .with_options(options)
16564 .send()
16565 .await?;
16566 Ok(Operation::new(op))
16567 }
16568 };
16569
16570 let start = move || async {
16571 let op = self.send().await?;
16572 Ok(Operation::new(op))
16573 };
16574
16575 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
16576 }
16577
16578 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16582 self.0.request.parent = v.into();
16583 self
16584 }
16585
16586 pub fn set_task_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16590 self.0.request.task_id = v.into();
16591 self
16592 }
16593
16594 pub fn set_task<T>(mut self, v: T) -> Self
16598 where
16599 T: std::convert::Into<crate::model::Task>,
16600 {
16601 self.0.request.task = std::option::Option::Some(v.into());
16602 self
16603 }
16604
16605 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
16609 where
16610 T: std::convert::Into<crate::model::Task>,
16611 {
16612 self.0.request.task = v.map(|x| x.into());
16613 self
16614 }
16615
16616 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16618 self.0.request.validate_only = v.into();
16619 self
16620 }
16621 }
16622
16623 #[doc(hidden)]
16624 impl gax::options::internal::RequestBuilder for CreateTask {
16625 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16626 &mut self.0.options
16627 }
16628 }
16629
16630 #[derive(Clone, Debug)]
16648 pub struct UpdateTask(RequestBuilder<crate::model::UpdateTaskRequest>);
16649
16650 impl UpdateTask {
16651 pub(crate) fn new(
16652 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16653 ) -> Self {
16654 Self(RequestBuilder::new(stub))
16655 }
16656
16657 pub fn with_request<V: Into<crate::model::UpdateTaskRequest>>(mut self, v: V) -> Self {
16659 self.0.request = v.into();
16660 self
16661 }
16662
16663 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16665 self.0.options = v.into();
16666 self
16667 }
16668
16669 pub async fn send(self) -> Result<longrunning::model::Operation> {
16676 (*self.0.stub)
16677 .update_task(self.0.request, self.0.options)
16678 .await
16679 .map(gax::response::Response::into_body)
16680 }
16681
16682 pub fn poller(
16684 self,
16685 ) -> impl lro::Poller<crate::model::Task, crate::model::OperationMetadata> {
16686 type Operation =
16687 lro::internal::Operation<crate::model::Task, crate::model::OperationMetadata>;
16688 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16689 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16690
16691 let stub = self.0.stub.clone();
16692 let mut options = self.0.options.clone();
16693 options.set_retry_policy(gax::retry_policy::NeverRetry);
16694 let query = move |name| {
16695 let stub = stub.clone();
16696 let options = options.clone();
16697 async {
16698 let op = GetOperation::new(stub)
16699 .set_name(name)
16700 .with_options(options)
16701 .send()
16702 .await?;
16703 Ok(Operation::new(op))
16704 }
16705 };
16706
16707 let start = move || async {
16708 let op = self.send().await?;
16709 Ok(Operation::new(op))
16710 };
16711
16712 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
16713 }
16714
16715 pub fn set_update_mask<T>(mut self, v: T) -> Self
16719 where
16720 T: std::convert::Into<wkt::FieldMask>,
16721 {
16722 self.0.request.update_mask = std::option::Option::Some(v.into());
16723 self
16724 }
16725
16726 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16730 where
16731 T: std::convert::Into<wkt::FieldMask>,
16732 {
16733 self.0.request.update_mask = v.map(|x| x.into());
16734 self
16735 }
16736
16737 pub fn set_task<T>(mut self, v: T) -> Self
16741 where
16742 T: std::convert::Into<crate::model::Task>,
16743 {
16744 self.0.request.task = std::option::Option::Some(v.into());
16745 self
16746 }
16747
16748 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
16752 where
16753 T: std::convert::Into<crate::model::Task>,
16754 {
16755 self.0.request.task = v.map(|x| x.into());
16756 self
16757 }
16758
16759 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16761 self.0.request.validate_only = v.into();
16762 self
16763 }
16764 }
16765
16766 #[doc(hidden)]
16767 impl gax::options::internal::RequestBuilder for UpdateTask {
16768 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16769 &mut self.0.options
16770 }
16771 }
16772
16773 #[derive(Clone, Debug)]
16791 pub struct DeleteTask(RequestBuilder<crate::model::DeleteTaskRequest>);
16792
16793 impl DeleteTask {
16794 pub(crate) fn new(
16795 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16796 ) -> Self {
16797 Self(RequestBuilder::new(stub))
16798 }
16799
16800 pub fn with_request<V: Into<crate::model::DeleteTaskRequest>>(mut self, v: V) -> Self {
16802 self.0.request = v.into();
16803 self
16804 }
16805
16806 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16808 self.0.options = v.into();
16809 self
16810 }
16811
16812 pub async fn send(self) -> Result<longrunning::model::Operation> {
16819 (*self.0.stub)
16820 .delete_task(self.0.request, self.0.options)
16821 .await
16822 .map(gax::response::Response::into_body)
16823 }
16824
16825 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
16827 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16828 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16829 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16830
16831 let stub = self.0.stub.clone();
16832 let mut options = self.0.options.clone();
16833 options.set_retry_policy(gax::retry_policy::NeverRetry);
16834 let query = move |name| {
16835 let stub = stub.clone();
16836 let options = options.clone();
16837 async {
16838 let op = GetOperation::new(stub)
16839 .set_name(name)
16840 .with_options(options)
16841 .send()
16842 .await?;
16843 Ok(Operation::new(op))
16844 }
16845 };
16846
16847 let start = move || async {
16848 let op = self.send().await?;
16849 Ok(Operation::new(op))
16850 };
16851
16852 lro::internal::new_unit_response_poller(
16853 polling_error_policy,
16854 polling_backoff_policy,
16855 start,
16856 query,
16857 )
16858 }
16859
16860 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16864 self.0.request.name = v.into();
16865 self
16866 }
16867 }
16868
16869 #[doc(hidden)]
16870 impl gax::options::internal::RequestBuilder for DeleteTask {
16871 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16872 &mut self.0.options
16873 }
16874 }
16875
16876 #[derive(Clone, Debug)]
16897 pub struct ListTasks(RequestBuilder<crate::model::ListTasksRequest>);
16898
16899 impl ListTasks {
16900 pub(crate) fn new(
16901 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16902 ) -> Self {
16903 Self(RequestBuilder::new(stub))
16904 }
16905
16906 pub fn with_request<V: Into<crate::model::ListTasksRequest>>(mut self, v: V) -> Self {
16908 self.0.request = v.into();
16909 self
16910 }
16911
16912 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16914 self.0.options = v.into();
16915 self
16916 }
16917
16918 pub async fn send(self) -> Result<crate::model::ListTasksResponse> {
16920 (*self.0.stub)
16921 .list_tasks(self.0.request, self.0.options)
16922 .await
16923 .map(gax::response::Response::into_body)
16924 }
16925
16926 pub fn by_page(
16928 self,
16929 ) -> impl gax::paginator::Paginator<crate::model::ListTasksResponse, gax::error::Error>
16930 {
16931 use std::clone::Clone;
16932 let token = self.0.request.page_token.clone();
16933 let execute = move |token: String| {
16934 let mut builder = self.clone();
16935 builder.0.request = builder.0.request.set_page_token(token);
16936 builder.send()
16937 };
16938 gax::paginator::internal::new_paginator(token, execute)
16939 }
16940
16941 pub fn by_item(
16943 self,
16944 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTasksResponse, gax::error::Error>
16945 {
16946 use gax::paginator::Paginator;
16947 self.by_page().items()
16948 }
16949
16950 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16954 self.0.request.parent = v.into();
16955 self
16956 }
16957
16958 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16960 self.0.request.page_size = v.into();
16961 self
16962 }
16963
16964 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16966 self.0.request.page_token = v.into();
16967 self
16968 }
16969
16970 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16972 self.0.request.filter = v.into();
16973 self
16974 }
16975
16976 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
16978 self.0.request.order_by = v.into();
16979 self
16980 }
16981 }
16982
16983 #[doc(hidden)]
16984 impl gax::options::internal::RequestBuilder for ListTasks {
16985 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16986 &mut self.0.options
16987 }
16988 }
16989
16990 #[derive(Clone, Debug)]
17007 pub struct GetTask(RequestBuilder<crate::model::GetTaskRequest>);
17008
17009 impl GetTask {
17010 pub(crate) fn new(
17011 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17012 ) -> Self {
17013 Self(RequestBuilder::new(stub))
17014 }
17015
17016 pub fn with_request<V: Into<crate::model::GetTaskRequest>>(mut self, v: V) -> Self {
17018 self.0.request = v.into();
17019 self
17020 }
17021
17022 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17024 self.0.options = v.into();
17025 self
17026 }
17027
17028 pub async fn send(self) -> Result<crate::model::Task> {
17030 (*self.0.stub)
17031 .get_task(self.0.request, self.0.options)
17032 .await
17033 .map(gax::response::Response::into_body)
17034 }
17035
17036 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17040 self.0.request.name = v.into();
17041 self
17042 }
17043 }
17044
17045 #[doc(hidden)]
17046 impl gax::options::internal::RequestBuilder for GetTask {
17047 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17048 &mut self.0.options
17049 }
17050 }
17051
17052 #[derive(Clone, Debug)]
17073 pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
17074
17075 impl ListJobs {
17076 pub(crate) fn new(
17077 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17078 ) -> Self {
17079 Self(RequestBuilder::new(stub))
17080 }
17081
17082 pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
17084 self.0.request = v.into();
17085 self
17086 }
17087
17088 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17090 self.0.options = v.into();
17091 self
17092 }
17093
17094 pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
17096 (*self.0.stub)
17097 .list_jobs(self.0.request, self.0.options)
17098 .await
17099 .map(gax::response::Response::into_body)
17100 }
17101
17102 pub fn by_page(
17104 self,
17105 ) -> impl gax::paginator::Paginator<crate::model::ListJobsResponse, gax::error::Error>
17106 {
17107 use std::clone::Clone;
17108 let token = self.0.request.page_token.clone();
17109 let execute = move |token: String| {
17110 let mut builder = self.clone();
17111 builder.0.request = builder.0.request.set_page_token(token);
17112 builder.send()
17113 };
17114 gax::paginator::internal::new_paginator(token, execute)
17115 }
17116
17117 pub fn by_item(
17119 self,
17120 ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobsResponse, gax::error::Error>
17121 {
17122 use gax::paginator::Paginator;
17123 self.by_page().items()
17124 }
17125
17126 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17130 self.0.request.parent = v.into();
17131 self
17132 }
17133
17134 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17136 self.0.request.page_size = v.into();
17137 self
17138 }
17139
17140 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17142 self.0.request.page_token = v.into();
17143 self
17144 }
17145 }
17146
17147 #[doc(hidden)]
17148 impl gax::options::internal::RequestBuilder for ListJobs {
17149 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17150 &mut self.0.options
17151 }
17152 }
17153
17154 #[derive(Clone, Debug)]
17171 pub struct RunTask(RequestBuilder<crate::model::RunTaskRequest>);
17172
17173 impl RunTask {
17174 pub(crate) fn new(
17175 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17176 ) -> Self {
17177 Self(RequestBuilder::new(stub))
17178 }
17179
17180 pub fn with_request<V: Into<crate::model::RunTaskRequest>>(mut self, v: V) -> Self {
17182 self.0.request = v.into();
17183 self
17184 }
17185
17186 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17188 self.0.options = v.into();
17189 self
17190 }
17191
17192 pub async fn send(self) -> Result<crate::model::RunTaskResponse> {
17194 (*self.0.stub)
17195 .run_task(self.0.request, self.0.options)
17196 .await
17197 .map(gax::response::Response::into_body)
17198 }
17199
17200 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17204 self.0.request.name = v.into();
17205 self
17206 }
17207
17208 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17210 where
17211 T: std::iter::IntoIterator<Item = (K, V)>,
17212 K: std::convert::Into<std::string::String>,
17213 V: std::convert::Into<std::string::String>,
17214 {
17215 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17216 self
17217 }
17218
17219 pub fn set_args<T, K, V>(mut self, v: T) -> Self
17221 where
17222 T: std::iter::IntoIterator<Item = (K, V)>,
17223 K: std::convert::Into<std::string::String>,
17224 V: std::convert::Into<std::string::String>,
17225 {
17226 self.0.request.args = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17227 self
17228 }
17229 }
17230
17231 #[doc(hidden)]
17232 impl gax::options::internal::RequestBuilder for RunTask {
17233 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17234 &mut self.0.options
17235 }
17236 }
17237
17238 #[derive(Clone, Debug)]
17255 pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
17256
17257 impl GetJob {
17258 pub(crate) fn new(
17259 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17260 ) -> Self {
17261 Self(RequestBuilder::new(stub))
17262 }
17263
17264 pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
17266 self.0.request = v.into();
17267 self
17268 }
17269
17270 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17272 self.0.options = v.into();
17273 self
17274 }
17275
17276 pub async fn send(self) -> Result<crate::model::Job> {
17278 (*self.0.stub)
17279 .get_job(self.0.request, self.0.options)
17280 .await
17281 .map(gax::response::Response::into_body)
17282 }
17283
17284 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17288 self.0.request.name = v.into();
17289 self
17290 }
17291 }
17292
17293 #[doc(hidden)]
17294 impl gax::options::internal::RequestBuilder for GetJob {
17295 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17296 &mut self.0.options
17297 }
17298 }
17299
17300 #[derive(Clone, Debug)]
17317 pub struct CancelJob(RequestBuilder<crate::model::CancelJobRequest>);
17318
17319 impl CancelJob {
17320 pub(crate) fn new(
17321 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17322 ) -> Self {
17323 Self(RequestBuilder::new(stub))
17324 }
17325
17326 pub fn with_request<V: Into<crate::model::CancelJobRequest>>(mut self, v: V) -> Self {
17328 self.0.request = v.into();
17329 self
17330 }
17331
17332 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17334 self.0.options = v.into();
17335 self
17336 }
17337
17338 pub async fn send(self) -> Result<()> {
17340 (*self.0.stub)
17341 .cancel_job(self.0.request, self.0.options)
17342 .await
17343 .map(gax::response::Response::into_body)
17344 }
17345
17346 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17350 self.0.request.name = v.into();
17351 self
17352 }
17353 }
17354
17355 #[doc(hidden)]
17356 impl gax::options::internal::RequestBuilder for CancelJob {
17357 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17358 &mut self.0.options
17359 }
17360 }
17361
17362 #[derive(Clone, Debug)]
17380 pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
17381
17382 impl CreateEnvironment {
17383 pub(crate) fn new(
17384 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17385 ) -> Self {
17386 Self(RequestBuilder::new(stub))
17387 }
17388
17389 pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
17391 mut self,
17392 v: V,
17393 ) -> Self {
17394 self.0.request = v.into();
17395 self
17396 }
17397
17398 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17400 self.0.options = v.into();
17401 self
17402 }
17403
17404 pub async fn send(self) -> Result<longrunning::model::Operation> {
17411 (*self.0.stub)
17412 .create_environment(self.0.request, self.0.options)
17413 .await
17414 .map(gax::response::Response::into_body)
17415 }
17416
17417 pub fn poller(
17419 self,
17420 ) -> impl lro::Poller<crate::model::Environment, crate::model::OperationMetadata> {
17421 type Operation = lro::internal::Operation<
17422 crate::model::Environment,
17423 crate::model::OperationMetadata,
17424 >;
17425 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17426 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17427
17428 let stub = self.0.stub.clone();
17429 let mut options = self.0.options.clone();
17430 options.set_retry_policy(gax::retry_policy::NeverRetry);
17431 let query = move |name| {
17432 let stub = stub.clone();
17433 let options = options.clone();
17434 async {
17435 let op = GetOperation::new(stub)
17436 .set_name(name)
17437 .with_options(options)
17438 .send()
17439 .await?;
17440 Ok(Operation::new(op))
17441 }
17442 };
17443
17444 let start = move || async {
17445 let op = self.send().await?;
17446 Ok(Operation::new(op))
17447 };
17448
17449 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
17450 }
17451
17452 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17456 self.0.request.parent = v.into();
17457 self
17458 }
17459
17460 pub fn set_environment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17464 self.0.request.environment_id = v.into();
17465 self
17466 }
17467
17468 pub fn set_environment<T>(mut self, v: T) -> Self
17472 where
17473 T: std::convert::Into<crate::model::Environment>,
17474 {
17475 self.0.request.environment = std::option::Option::Some(v.into());
17476 self
17477 }
17478
17479 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
17483 where
17484 T: std::convert::Into<crate::model::Environment>,
17485 {
17486 self.0.request.environment = v.map(|x| x.into());
17487 self
17488 }
17489
17490 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17492 self.0.request.validate_only = v.into();
17493 self
17494 }
17495 }
17496
17497 #[doc(hidden)]
17498 impl gax::options::internal::RequestBuilder for CreateEnvironment {
17499 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17500 &mut self.0.options
17501 }
17502 }
17503
17504 #[derive(Clone, Debug)]
17522 pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
17523
17524 impl UpdateEnvironment {
17525 pub(crate) fn new(
17526 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17527 ) -> Self {
17528 Self(RequestBuilder::new(stub))
17529 }
17530
17531 pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
17533 mut self,
17534 v: V,
17535 ) -> Self {
17536 self.0.request = v.into();
17537 self
17538 }
17539
17540 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17542 self.0.options = v.into();
17543 self
17544 }
17545
17546 pub async fn send(self) -> Result<longrunning::model::Operation> {
17553 (*self.0.stub)
17554 .update_environment(self.0.request, self.0.options)
17555 .await
17556 .map(gax::response::Response::into_body)
17557 }
17558
17559 pub fn poller(
17561 self,
17562 ) -> impl lro::Poller<crate::model::Environment, crate::model::OperationMetadata> {
17563 type Operation = lro::internal::Operation<
17564 crate::model::Environment,
17565 crate::model::OperationMetadata,
17566 >;
17567 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17568 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17569
17570 let stub = self.0.stub.clone();
17571 let mut options = self.0.options.clone();
17572 options.set_retry_policy(gax::retry_policy::NeverRetry);
17573 let query = move |name| {
17574 let stub = stub.clone();
17575 let options = options.clone();
17576 async {
17577 let op = GetOperation::new(stub)
17578 .set_name(name)
17579 .with_options(options)
17580 .send()
17581 .await?;
17582 Ok(Operation::new(op))
17583 }
17584 };
17585
17586 let start = move || async {
17587 let op = self.send().await?;
17588 Ok(Operation::new(op))
17589 };
17590
17591 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
17592 }
17593
17594 pub fn set_update_mask<T>(mut self, v: T) -> Self
17598 where
17599 T: std::convert::Into<wkt::FieldMask>,
17600 {
17601 self.0.request.update_mask = std::option::Option::Some(v.into());
17602 self
17603 }
17604
17605 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17609 where
17610 T: std::convert::Into<wkt::FieldMask>,
17611 {
17612 self.0.request.update_mask = v.map(|x| x.into());
17613 self
17614 }
17615
17616 pub fn set_environment<T>(mut self, v: T) -> Self
17620 where
17621 T: std::convert::Into<crate::model::Environment>,
17622 {
17623 self.0.request.environment = std::option::Option::Some(v.into());
17624 self
17625 }
17626
17627 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
17631 where
17632 T: std::convert::Into<crate::model::Environment>,
17633 {
17634 self.0.request.environment = v.map(|x| x.into());
17635 self
17636 }
17637
17638 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17640 self.0.request.validate_only = v.into();
17641 self
17642 }
17643 }
17644
17645 #[doc(hidden)]
17646 impl gax::options::internal::RequestBuilder for UpdateEnvironment {
17647 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17648 &mut self.0.options
17649 }
17650 }
17651
17652 #[derive(Clone, Debug)]
17670 pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
17671
17672 impl DeleteEnvironment {
17673 pub(crate) fn new(
17674 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17675 ) -> Self {
17676 Self(RequestBuilder::new(stub))
17677 }
17678
17679 pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
17681 mut self,
17682 v: V,
17683 ) -> Self {
17684 self.0.request = v.into();
17685 self
17686 }
17687
17688 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17690 self.0.options = v.into();
17691 self
17692 }
17693
17694 pub async fn send(self) -> Result<longrunning::model::Operation> {
17701 (*self.0.stub)
17702 .delete_environment(self.0.request, self.0.options)
17703 .await
17704 .map(gax::response::Response::into_body)
17705 }
17706
17707 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
17709 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17710 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17711 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17712
17713 let stub = self.0.stub.clone();
17714 let mut options = self.0.options.clone();
17715 options.set_retry_policy(gax::retry_policy::NeverRetry);
17716 let query = move |name| {
17717 let stub = stub.clone();
17718 let options = options.clone();
17719 async {
17720 let op = GetOperation::new(stub)
17721 .set_name(name)
17722 .with_options(options)
17723 .send()
17724 .await?;
17725 Ok(Operation::new(op))
17726 }
17727 };
17728
17729 let start = move || async {
17730 let op = self.send().await?;
17731 Ok(Operation::new(op))
17732 };
17733
17734 lro::internal::new_unit_response_poller(
17735 polling_error_policy,
17736 polling_backoff_policy,
17737 start,
17738 query,
17739 )
17740 }
17741
17742 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17746 self.0.request.name = v.into();
17747 self
17748 }
17749 }
17750
17751 #[doc(hidden)]
17752 impl gax::options::internal::RequestBuilder for DeleteEnvironment {
17753 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17754 &mut self.0.options
17755 }
17756 }
17757
17758 #[derive(Clone, Debug)]
17779 pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
17780
17781 impl ListEnvironments {
17782 pub(crate) fn new(
17783 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17784 ) -> Self {
17785 Self(RequestBuilder::new(stub))
17786 }
17787
17788 pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
17790 mut self,
17791 v: V,
17792 ) -> Self {
17793 self.0.request = v.into();
17794 self
17795 }
17796
17797 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17799 self.0.options = v.into();
17800 self
17801 }
17802
17803 pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
17805 (*self.0.stub)
17806 .list_environments(self.0.request, self.0.options)
17807 .await
17808 .map(gax::response::Response::into_body)
17809 }
17810
17811 pub fn by_page(
17813 self,
17814 ) -> impl gax::paginator::Paginator<crate::model::ListEnvironmentsResponse, gax::error::Error>
17815 {
17816 use std::clone::Clone;
17817 let token = self.0.request.page_token.clone();
17818 let execute = move |token: String| {
17819 let mut builder = self.clone();
17820 builder.0.request = builder.0.request.set_page_token(token);
17821 builder.send()
17822 };
17823 gax::paginator::internal::new_paginator(token, execute)
17824 }
17825
17826 pub fn by_item(
17828 self,
17829 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEnvironmentsResponse, gax::error::Error>
17830 {
17831 use gax::paginator::Paginator;
17832 self.by_page().items()
17833 }
17834
17835 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17839 self.0.request.parent = v.into();
17840 self
17841 }
17842
17843 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17845 self.0.request.page_size = v.into();
17846 self
17847 }
17848
17849 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17851 self.0.request.page_token = v.into();
17852 self
17853 }
17854
17855 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17857 self.0.request.filter = v.into();
17858 self
17859 }
17860
17861 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
17863 self.0.request.order_by = v.into();
17864 self
17865 }
17866 }
17867
17868 #[doc(hidden)]
17869 impl gax::options::internal::RequestBuilder for ListEnvironments {
17870 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17871 &mut self.0.options
17872 }
17873 }
17874
17875 #[derive(Clone, Debug)]
17892 pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
17893
17894 impl GetEnvironment {
17895 pub(crate) fn new(
17896 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17897 ) -> Self {
17898 Self(RequestBuilder::new(stub))
17899 }
17900
17901 pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
17903 self.0.request = v.into();
17904 self
17905 }
17906
17907 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17909 self.0.options = v.into();
17910 self
17911 }
17912
17913 pub async fn send(self) -> Result<crate::model::Environment> {
17915 (*self.0.stub)
17916 .get_environment(self.0.request, self.0.options)
17917 .await
17918 .map(gax::response::Response::into_body)
17919 }
17920
17921 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17925 self.0.request.name = v.into();
17926 self
17927 }
17928 }
17929
17930 #[doc(hidden)]
17931 impl gax::options::internal::RequestBuilder for GetEnvironment {
17932 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17933 &mut self.0.options
17934 }
17935 }
17936
17937 #[derive(Clone, Debug)]
17958 pub struct ListSessions(RequestBuilder<crate::model::ListSessionsRequest>);
17959
17960 impl ListSessions {
17961 pub(crate) fn new(
17962 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17963 ) -> Self {
17964 Self(RequestBuilder::new(stub))
17965 }
17966
17967 pub fn with_request<V: Into<crate::model::ListSessionsRequest>>(mut self, v: V) -> Self {
17969 self.0.request = v.into();
17970 self
17971 }
17972
17973 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17975 self.0.options = v.into();
17976 self
17977 }
17978
17979 pub async fn send(self) -> Result<crate::model::ListSessionsResponse> {
17981 (*self.0.stub)
17982 .list_sessions(self.0.request, self.0.options)
17983 .await
17984 .map(gax::response::Response::into_body)
17985 }
17986
17987 pub fn by_page(
17989 self,
17990 ) -> impl gax::paginator::Paginator<crate::model::ListSessionsResponse, gax::error::Error>
17991 {
17992 use std::clone::Clone;
17993 let token = self.0.request.page_token.clone();
17994 let execute = move |token: String| {
17995 let mut builder = self.clone();
17996 builder.0.request = builder.0.request.set_page_token(token);
17997 builder.send()
17998 };
17999 gax::paginator::internal::new_paginator(token, execute)
18000 }
18001
18002 pub fn by_item(
18004 self,
18005 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSessionsResponse, gax::error::Error>
18006 {
18007 use gax::paginator::Paginator;
18008 self.by_page().items()
18009 }
18010
18011 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18015 self.0.request.parent = v.into();
18016 self
18017 }
18018
18019 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18021 self.0.request.page_size = v.into();
18022 self
18023 }
18024
18025 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18027 self.0.request.page_token = v.into();
18028 self
18029 }
18030
18031 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18033 self.0.request.filter = v.into();
18034 self
18035 }
18036 }
18037
18038 #[doc(hidden)]
18039 impl gax::options::internal::RequestBuilder for ListSessions {
18040 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18041 &mut self.0.options
18042 }
18043 }
18044
18045 #[derive(Clone, Debug)]
18066 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
18067
18068 impl ListLocations {
18069 pub(crate) fn new(
18070 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18071 ) -> Self {
18072 Self(RequestBuilder::new(stub))
18073 }
18074
18075 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
18077 mut self,
18078 v: V,
18079 ) -> Self {
18080 self.0.request = v.into();
18081 self
18082 }
18083
18084 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18086 self.0.options = v.into();
18087 self
18088 }
18089
18090 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
18092 (*self.0.stub)
18093 .list_locations(self.0.request, self.0.options)
18094 .await
18095 .map(gax::response::Response::into_body)
18096 }
18097
18098 pub fn by_page(
18100 self,
18101 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
18102 {
18103 use std::clone::Clone;
18104 let token = self.0.request.page_token.clone();
18105 let execute = move |token: String| {
18106 let mut builder = self.clone();
18107 builder.0.request = builder.0.request.set_page_token(token);
18108 builder.send()
18109 };
18110 gax::paginator::internal::new_paginator(token, execute)
18111 }
18112
18113 pub fn by_item(
18115 self,
18116 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
18117 {
18118 use gax::paginator::Paginator;
18119 self.by_page().items()
18120 }
18121
18122 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18124 self.0.request.name = v.into();
18125 self
18126 }
18127
18128 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18130 self.0.request.filter = v.into();
18131 self
18132 }
18133
18134 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18136 self.0.request.page_size = v.into();
18137 self
18138 }
18139
18140 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18142 self.0.request.page_token = v.into();
18143 self
18144 }
18145 }
18146
18147 #[doc(hidden)]
18148 impl gax::options::internal::RequestBuilder for ListLocations {
18149 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18150 &mut self.0.options
18151 }
18152 }
18153
18154 #[derive(Clone, Debug)]
18171 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
18172
18173 impl GetLocation {
18174 pub(crate) fn new(
18175 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18176 ) -> Self {
18177 Self(RequestBuilder::new(stub))
18178 }
18179
18180 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
18182 self.0.request = v.into();
18183 self
18184 }
18185
18186 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18188 self.0.options = v.into();
18189 self
18190 }
18191
18192 pub async fn send(self) -> Result<location::model::Location> {
18194 (*self.0.stub)
18195 .get_location(self.0.request, self.0.options)
18196 .await
18197 .map(gax::response::Response::into_body)
18198 }
18199
18200 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18202 self.0.request.name = v.into();
18203 self
18204 }
18205 }
18206
18207 #[doc(hidden)]
18208 impl gax::options::internal::RequestBuilder for GetLocation {
18209 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18210 &mut self.0.options
18211 }
18212 }
18213
18214 #[derive(Clone, Debug)]
18231 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
18232
18233 impl SetIamPolicy {
18234 pub(crate) fn new(
18235 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18236 ) -> Self {
18237 Self(RequestBuilder::new(stub))
18238 }
18239
18240 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
18242 self.0.request = v.into();
18243 self
18244 }
18245
18246 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18248 self.0.options = v.into();
18249 self
18250 }
18251
18252 pub async fn send(self) -> Result<iam_v1::model::Policy> {
18254 (*self.0.stub)
18255 .set_iam_policy(self.0.request, self.0.options)
18256 .await
18257 .map(gax::response::Response::into_body)
18258 }
18259
18260 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
18264 self.0.request.resource = v.into();
18265 self
18266 }
18267
18268 pub fn set_policy<T>(mut self, v: T) -> Self
18272 where
18273 T: std::convert::Into<iam_v1::model::Policy>,
18274 {
18275 self.0.request.policy = std::option::Option::Some(v.into());
18276 self
18277 }
18278
18279 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
18283 where
18284 T: std::convert::Into<iam_v1::model::Policy>,
18285 {
18286 self.0.request.policy = v.map(|x| x.into());
18287 self
18288 }
18289
18290 pub fn set_update_mask<T>(mut self, v: T) -> Self
18292 where
18293 T: std::convert::Into<wkt::FieldMask>,
18294 {
18295 self.0.request.update_mask = std::option::Option::Some(v.into());
18296 self
18297 }
18298
18299 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18301 where
18302 T: std::convert::Into<wkt::FieldMask>,
18303 {
18304 self.0.request.update_mask = v.map(|x| x.into());
18305 self
18306 }
18307 }
18308
18309 #[doc(hidden)]
18310 impl gax::options::internal::RequestBuilder for SetIamPolicy {
18311 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18312 &mut self.0.options
18313 }
18314 }
18315
18316 #[derive(Clone, Debug)]
18333 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
18334
18335 impl GetIamPolicy {
18336 pub(crate) fn new(
18337 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18338 ) -> Self {
18339 Self(RequestBuilder::new(stub))
18340 }
18341
18342 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
18344 self.0.request = v.into();
18345 self
18346 }
18347
18348 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18350 self.0.options = v.into();
18351 self
18352 }
18353
18354 pub async fn send(self) -> Result<iam_v1::model::Policy> {
18356 (*self.0.stub)
18357 .get_iam_policy(self.0.request, self.0.options)
18358 .await
18359 .map(gax::response::Response::into_body)
18360 }
18361
18362 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
18366 self.0.request.resource = v.into();
18367 self
18368 }
18369
18370 pub fn set_options<T>(mut self, v: T) -> Self
18372 where
18373 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
18374 {
18375 self.0.request.options = std::option::Option::Some(v.into());
18376 self
18377 }
18378
18379 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
18381 where
18382 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
18383 {
18384 self.0.request.options = v.map(|x| x.into());
18385 self
18386 }
18387 }
18388
18389 #[doc(hidden)]
18390 impl gax::options::internal::RequestBuilder for GetIamPolicy {
18391 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18392 &mut self.0.options
18393 }
18394 }
18395
18396 #[derive(Clone, Debug)]
18413 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
18414
18415 impl TestIamPermissions {
18416 pub(crate) fn new(
18417 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18418 ) -> Self {
18419 Self(RequestBuilder::new(stub))
18420 }
18421
18422 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
18424 mut self,
18425 v: V,
18426 ) -> Self {
18427 self.0.request = v.into();
18428 self
18429 }
18430
18431 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18433 self.0.options = v.into();
18434 self
18435 }
18436
18437 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
18439 (*self.0.stub)
18440 .test_iam_permissions(self.0.request, self.0.options)
18441 .await
18442 .map(gax::response::Response::into_body)
18443 }
18444
18445 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
18449 self.0.request.resource = v.into();
18450 self
18451 }
18452
18453 pub fn set_permissions<T, V>(mut self, v: T) -> Self
18457 where
18458 T: std::iter::IntoIterator<Item = V>,
18459 V: std::convert::Into<std::string::String>,
18460 {
18461 use std::iter::Iterator;
18462 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
18463 self
18464 }
18465 }
18466
18467 #[doc(hidden)]
18468 impl gax::options::internal::RequestBuilder for TestIamPermissions {
18469 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18470 &mut self.0.options
18471 }
18472 }
18473
18474 #[derive(Clone, Debug)]
18495 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
18496
18497 impl ListOperations {
18498 pub(crate) fn new(
18499 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18500 ) -> Self {
18501 Self(RequestBuilder::new(stub))
18502 }
18503
18504 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
18506 mut self,
18507 v: V,
18508 ) -> Self {
18509 self.0.request = v.into();
18510 self
18511 }
18512
18513 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18515 self.0.options = v.into();
18516 self
18517 }
18518
18519 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
18521 (*self.0.stub)
18522 .list_operations(self.0.request, self.0.options)
18523 .await
18524 .map(gax::response::Response::into_body)
18525 }
18526
18527 pub fn by_page(
18529 self,
18530 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
18531 {
18532 use std::clone::Clone;
18533 let token = self.0.request.page_token.clone();
18534 let execute = move |token: String| {
18535 let mut builder = self.clone();
18536 builder.0.request = builder.0.request.set_page_token(token);
18537 builder.send()
18538 };
18539 gax::paginator::internal::new_paginator(token, execute)
18540 }
18541
18542 pub fn by_item(
18544 self,
18545 ) -> impl gax::paginator::ItemPaginator<
18546 longrunning::model::ListOperationsResponse,
18547 gax::error::Error,
18548 > {
18549 use gax::paginator::Paginator;
18550 self.by_page().items()
18551 }
18552
18553 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18555 self.0.request.name = v.into();
18556 self
18557 }
18558
18559 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18561 self.0.request.filter = v.into();
18562 self
18563 }
18564
18565 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18567 self.0.request.page_size = v.into();
18568 self
18569 }
18570
18571 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18573 self.0.request.page_token = v.into();
18574 self
18575 }
18576
18577 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
18579 self.0.request.return_partial_success = v.into();
18580 self
18581 }
18582 }
18583
18584 #[doc(hidden)]
18585 impl gax::options::internal::RequestBuilder for ListOperations {
18586 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18587 &mut self.0.options
18588 }
18589 }
18590
18591 #[derive(Clone, Debug)]
18608 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
18609
18610 impl GetOperation {
18611 pub(crate) fn new(
18612 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18613 ) -> Self {
18614 Self(RequestBuilder::new(stub))
18615 }
18616
18617 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
18619 mut self,
18620 v: V,
18621 ) -> Self {
18622 self.0.request = v.into();
18623 self
18624 }
18625
18626 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18628 self.0.options = v.into();
18629 self
18630 }
18631
18632 pub async fn send(self) -> Result<longrunning::model::Operation> {
18634 (*self.0.stub)
18635 .get_operation(self.0.request, self.0.options)
18636 .await
18637 .map(gax::response::Response::into_body)
18638 }
18639
18640 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18642 self.0.request.name = v.into();
18643 self
18644 }
18645 }
18646
18647 #[doc(hidden)]
18648 impl gax::options::internal::RequestBuilder for GetOperation {
18649 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18650 &mut self.0.options
18651 }
18652 }
18653
18654 #[derive(Clone, Debug)]
18671 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
18672
18673 impl DeleteOperation {
18674 pub(crate) fn new(
18675 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18676 ) -> Self {
18677 Self(RequestBuilder::new(stub))
18678 }
18679
18680 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
18682 mut self,
18683 v: V,
18684 ) -> Self {
18685 self.0.request = v.into();
18686 self
18687 }
18688
18689 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18691 self.0.options = v.into();
18692 self
18693 }
18694
18695 pub async fn send(self) -> Result<()> {
18697 (*self.0.stub)
18698 .delete_operation(self.0.request, self.0.options)
18699 .await
18700 .map(gax::response::Response::into_body)
18701 }
18702
18703 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18705 self.0.request.name = v.into();
18706 self
18707 }
18708 }
18709
18710 #[doc(hidden)]
18711 impl gax::options::internal::RequestBuilder for DeleteOperation {
18712 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18713 &mut self.0.options
18714 }
18715 }
18716
18717 #[derive(Clone, Debug)]
18734 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
18735
18736 impl CancelOperation {
18737 pub(crate) fn new(
18738 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18739 ) -> Self {
18740 Self(RequestBuilder::new(stub))
18741 }
18742
18743 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
18745 mut self,
18746 v: V,
18747 ) -> Self {
18748 self.0.request = v.into();
18749 self
18750 }
18751
18752 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18754 self.0.options = v.into();
18755 self
18756 }
18757
18758 pub async fn send(self) -> Result<()> {
18760 (*self.0.stub)
18761 .cancel_operation(self.0.request, self.0.options)
18762 .await
18763 .map(gax::response::Response::into_body)
18764 }
18765
18766 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18768 self.0.request.name = v.into();
18769 self
18770 }
18771 }
18772
18773 #[doc(hidden)]
18774 impl gax::options::internal::RequestBuilder for CancelOperation {
18775 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18776 &mut self.0.options
18777 }
18778 }
18779}