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)]
93 pub struct CreateGlossary(RequestBuilder<crate::model::CreateGlossaryRequest>);
94
95 impl CreateGlossary {
96 pub(crate) fn new(
97 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
98 ) -> Self {
99 Self(RequestBuilder::new(stub))
100 }
101
102 pub fn with_request<V: Into<crate::model::CreateGlossaryRequest>>(mut self, v: V) -> Self {
104 self.0.request = v.into();
105 self
106 }
107
108 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
110 self.0.options = v.into();
111 self
112 }
113
114 pub async fn send(self) -> Result<longrunning::model::Operation> {
121 (*self.0.stub)
122 .create_glossary(self.0.request, self.0.options)
123 .await
124 .map(gax::response::Response::into_body)
125 }
126
127 pub fn poller(
129 self,
130 ) -> impl lro::Poller<crate::model::Glossary, crate::model::OperationMetadata> {
131 type Operation =
132 lro::internal::Operation<crate::model::Glossary, crate::model::OperationMetadata>;
133 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
134 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
135
136 let stub = self.0.stub.clone();
137 let mut options = self.0.options.clone();
138 options.set_retry_policy(gax::retry_policy::NeverRetry);
139 let query = move |name| {
140 let stub = stub.clone();
141 let options = options.clone();
142 async {
143 let op = GetOperation::new(stub)
144 .set_name(name)
145 .with_options(options)
146 .send()
147 .await?;
148 Ok(Operation::new(op))
149 }
150 };
151
152 let start = move || async {
153 let op = self.send().await?;
154 Ok(Operation::new(op))
155 };
156
157 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
158 }
159
160 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.parent = v.into();
165 self
166 }
167
168 pub fn set_glossary_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.glossary_id = v.into();
173 self
174 }
175
176 pub fn set_glossary<T>(mut self, v: T) -> Self
180 where
181 T: std::convert::Into<crate::model::Glossary>,
182 {
183 self.0.request.glossary = std::option::Option::Some(v.into());
184 self
185 }
186
187 pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
191 where
192 T: std::convert::Into<crate::model::Glossary>,
193 {
194 self.0.request.glossary = v.map(|x| x.into());
195 self
196 }
197
198 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
200 self.0.request.validate_only = v.into();
201 self
202 }
203 }
204
205 #[doc(hidden)]
206 impl gax::options::internal::RequestBuilder for CreateGlossary {
207 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
208 &mut self.0.options
209 }
210 }
211
212 #[derive(Clone, Debug)]
231 pub struct UpdateGlossary(RequestBuilder<crate::model::UpdateGlossaryRequest>);
232
233 impl UpdateGlossary {
234 pub(crate) fn new(
235 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
236 ) -> Self {
237 Self(RequestBuilder::new(stub))
238 }
239
240 pub fn with_request<V: Into<crate::model::UpdateGlossaryRequest>>(mut self, v: V) -> Self {
242 self.0.request = v.into();
243 self
244 }
245
246 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
248 self.0.options = v.into();
249 self
250 }
251
252 pub async fn send(self) -> Result<longrunning::model::Operation> {
259 (*self.0.stub)
260 .update_glossary(self.0.request, self.0.options)
261 .await
262 .map(gax::response::Response::into_body)
263 }
264
265 pub fn poller(
267 self,
268 ) -> impl lro::Poller<crate::model::Glossary, crate::model::OperationMetadata> {
269 type Operation =
270 lro::internal::Operation<crate::model::Glossary, crate::model::OperationMetadata>;
271 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
272 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
273
274 let stub = self.0.stub.clone();
275 let mut options = self.0.options.clone();
276 options.set_retry_policy(gax::retry_policy::NeverRetry);
277 let query = move |name| {
278 let stub = stub.clone();
279 let options = options.clone();
280 async {
281 let op = GetOperation::new(stub)
282 .set_name(name)
283 .with_options(options)
284 .send()
285 .await?;
286 Ok(Operation::new(op))
287 }
288 };
289
290 let start = move || async {
291 let op = self.send().await?;
292 Ok(Operation::new(op))
293 };
294
295 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
296 }
297
298 pub fn set_glossary<T>(mut self, v: T) -> Self
302 where
303 T: std::convert::Into<crate::model::Glossary>,
304 {
305 self.0.request.glossary = std::option::Option::Some(v.into());
306 self
307 }
308
309 pub fn set_or_clear_glossary<T>(mut self, v: std::option::Option<T>) -> Self
313 where
314 T: std::convert::Into<crate::model::Glossary>,
315 {
316 self.0.request.glossary = v.map(|x| x.into());
317 self
318 }
319
320 pub fn set_update_mask<T>(mut self, v: T) -> Self
324 where
325 T: std::convert::Into<wkt::FieldMask>,
326 {
327 self.0.request.update_mask = std::option::Option::Some(v.into());
328 self
329 }
330
331 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
335 where
336 T: std::convert::Into<wkt::FieldMask>,
337 {
338 self.0.request.update_mask = v.map(|x| x.into());
339 self
340 }
341
342 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
344 self.0.request.validate_only = v.into();
345 self
346 }
347 }
348
349 #[doc(hidden)]
350 impl gax::options::internal::RequestBuilder for UpdateGlossary {
351 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
352 &mut self.0.options
353 }
354 }
355
356 #[derive(Clone, Debug)]
375 pub struct DeleteGlossary(RequestBuilder<crate::model::DeleteGlossaryRequest>);
376
377 impl DeleteGlossary {
378 pub(crate) fn new(
379 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
380 ) -> Self {
381 Self(RequestBuilder::new(stub))
382 }
383
384 pub fn with_request<V: Into<crate::model::DeleteGlossaryRequest>>(mut self, v: V) -> Self {
386 self.0.request = v.into();
387 self
388 }
389
390 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
392 self.0.options = v.into();
393 self
394 }
395
396 pub async fn send(self) -> Result<longrunning::model::Operation> {
403 (*self.0.stub)
404 .delete_glossary(self.0.request, self.0.options)
405 .await
406 .map(gax::response::Response::into_body)
407 }
408
409 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
411 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
412 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
413 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
414
415 let stub = self.0.stub.clone();
416 let mut options = self.0.options.clone();
417 options.set_retry_policy(gax::retry_policy::NeverRetry);
418 let query = move |name| {
419 let stub = stub.clone();
420 let options = options.clone();
421 async {
422 let op = GetOperation::new(stub)
423 .set_name(name)
424 .with_options(options)
425 .send()
426 .await?;
427 Ok(Operation::new(op))
428 }
429 };
430
431 let start = move || async {
432 let op = self.send().await?;
433 Ok(Operation::new(op))
434 };
435
436 lro::internal::new_unit_response_poller(
437 polling_error_policy,
438 polling_backoff_policy,
439 start,
440 query,
441 )
442 }
443
444 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
448 self.0.request.name = v.into();
449 self
450 }
451
452 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
454 self.0.request.etag = v.into();
455 self
456 }
457 }
458
459 #[doc(hidden)]
460 impl gax::options::internal::RequestBuilder for DeleteGlossary {
461 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
462 &mut self.0.options
463 }
464 }
465
466 #[derive(Clone, Debug)]
484 pub struct GetGlossary(RequestBuilder<crate::model::GetGlossaryRequest>);
485
486 impl GetGlossary {
487 pub(crate) fn new(
488 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
489 ) -> Self {
490 Self(RequestBuilder::new(stub))
491 }
492
493 pub fn with_request<V: Into<crate::model::GetGlossaryRequest>>(mut self, v: V) -> Self {
495 self.0.request = v.into();
496 self
497 }
498
499 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
501 self.0.options = v.into();
502 self
503 }
504
505 pub async fn send(self) -> Result<crate::model::Glossary> {
507 (*self.0.stub)
508 .get_glossary(self.0.request, self.0.options)
509 .await
510 .map(gax::response::Response::into_body)
511 }
512
513 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
517 self.0.request.name = v.into();
518 self
519 }
520 }
521
522 #[doc(hidden)]
523 impl gax::options::internal::RequestBuilder for GetGlossary {
524 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
525 &mut self.0.options
526 }
527 }
528
529 #[derive(Clone, Debug)]
551 pub struct ListGlossaries(RequestBuilder<crate::model::ListGlossariesRequest>);
552
553 impl ListGlossaries {
554 pub(crate) fn new(
555 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
556 ) -> Self {
557 Self(RequestBuilder::new(stub))
558 }
559
560 pub fn with_request<V: Into<crate::model::ListGlossariesRequest>>(mut self, v: V) -> Self {
562 self.0.request = v.into();
563 self
564 }
565
566 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
568 self.0.options = v.into();
569 self
570 }
571
572 pub async fn send(self) -> Result<crate::model::ListGlossariesResponse> {
574 (*self.0.stub)
575 .list_glossaries(self.0.request, self.0.options)
576 .await
577 .map(gax::response::Response::into_body)
578 }
579
580 pub fn by_page(
582 self,
583 ) -> impl gax::paginator::Paginator<crate::model::ListGlossariesResponse, gax::error::Error>
584 {
585 use std::clone::Clone;
586 let token = self.0.request.page_token.clone();
587 let execute = move |token: String| {
588 let mut builder = self.clone();
589 builder.0.request = builder.0.request.set_page_token(token);
590 builder.send()
591 };
592 gax::paginator::internal::new_paginator(token, execute)
593 }
594
595 pub fn by_item(
597 self,
598 ) -> impl gax::paginator::ItemPaginator<crate::model::ListGlossariesResponse, gax::error::Error>
599 {
600 use gax::paginator::Paginator;
601 self.by_page().items()
602 }
603
604 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
608 self.0.request.parent = v.into();
609 self
610 }
611
612 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
614 self.0.request.page_size = v.into();
615 self
616 }
617
618 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
620 self.0.request.page_token = v.into();
621 self
622 }
623
624 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
626 self.0.request.filter = v.into();
627 self
628 }
629
630 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
632 self.0.request.order_by = v.into();
633 self
634 }
635 }
636
637 #[doc(hidden)]
638 impl gax::options::internal::RequestBuilder for ListGlossaries {
639 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
640 &mut self.0.options
641 }
642 }
643
644 #[derive(Clone, Debug)]
662 pub struct CreateGlossaryCategory(RequestBuilder<crate::model::CreateGlossaryCategoryRequest>);
663
664 impl CreateGlossaryCategory {
665 pub(crate) fn new(
666 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
667 ) -> Self {
668 Self(RequestBuilder::new(stub))
669 }
670
671 pub fn with_request<V: Into<crate::model::CreateGlossaryCategoryRequest>>(
673 mut self,
674 v: V,
675 ) -> Self {
676 self.0.request = v.into();
677 self
678 }
679
680 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
682 self.0.options = v.into();
683 self
684 }
685
686 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
688 (*self.0.stub)
689 .create_glossary_category(self.0.request, self.0.options)
690 .await
691 .map(gax::response::Response::into_body)
692 }
693
694 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
698 self.0.request.parent = v.into();
699 self
700 }
701
702 pub fn set_category_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
706 self.0.request.category_id = v.into();
707 self
708 }
709
710 pub fn set_category<T>(mut self, v: T) -> Self
714 where
715 T: std::convert::Into<crate::model::GlossaryCategory>,
716 {
717 self.0.request.category = std::option::Option::Some(v.into());
718 self
719 }
720
721 pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
725 where
726 T: std::convert::Into<crate::model::GlossaryCategory>,
727 {
728 self.0.request.category = v.map(|x| x.into());
729 self
730 }
731 }
732
733 #[doc(hidden)]
734 impl gax::options::internal::RequestBuilder for CreateGlossaryCategory {
735 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
736 &mut self.0.options
737 }
738 }
739
740 #[derive(Clone, Debug)]
758 pub struct UpdateGlossaryCategory(RequestBuilder<crate::model::UpdateGlossaryCategoryRequest>);
759
760 impl UpdateGlossaryCategory {
761 pub(crate) fn new(
762 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
763 ) -> Self {
764 Self(RequestBuilder::new(stub))
765 }
766
767 pub fn with_request<V: Into<crate::model::UpdateGlossaryCategoryRequest>>(
769 mut self,
770 v: V,
771 ) -> Self {
772 self.0.request = v.into();
773 self
774 }
775
776 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
778 self.0.options = v.into();
779 self
780 }
781
782 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
784 (*self.0.stub)
785 .update_glossary_category(self.0.request, self.0.options)
786 .await
787 .map(gax::response::Response::into_body)
788 }
789
790 pub fn set_category<T>(mut self, v: T) -> Self
794 where
795 T: std::convert::Into<crate::model::GlossaryCategory>,
796 {
797 self.0.request.category = std::option::Option::Some(v.into());
798 self
799 }
800
801 pub fn set_or_clear_category<T>(mut self, v: std::option::Option<T>) -> Self
805 where
806 T: std::convert::Into<crate::model::GlossaryCategory>,
807 {
808 self.0.request.category = v.map(|x| x.into());
809 self
810 }
811
812 pub fn set_update_mask<T>(mut self, v: T) -> Self
816 where
817 T: std::convert::Into<wkt::FieldMask>,
818 {
819 self.0.request.update_mask = std::option::Option::Some(v.into());
820 self
821 }
822
823 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
827 where
828 T: std::convert::Into<wkt::FieldMask>,
829 {
830 self.0.request.update_mask = v.map(|x| x.into());
831 self
832 }
833 }
834
835 #[doc(hidden)]
836 impl gax::options::internal::RequestBuilder for UpdateGlossaryCategory {
837 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
838 &mut self.0.options
839 }
840 }
841
842 #[derive(Clone, Debug)]
860 pub struct DeleteGlossaryCategory(RequestBuilder<crate::model::DeleteGlossaryCategoryRequest>);
861
862 impl DeleteGlossaryCategory {
863 pub(crate) fn new(
864 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
865 ) -> Self {
866 Self(RequestBuilder::new(stub))
867 }
868
869 pub fn with_request<V: Into<crate::model::DeleteGlossaryCategoryRequest>>(
871 mut self,
872 v: V,
873 ) -> Self {
874 self.0.request = v.into();
875 self
876 }
877
878 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
880 self.0.options = v.into();
881 self
882 }
883
884 pub async fn send(self) -> Result<()> {
886 (*self.0.stub)
887 .delete_glossary_category(self.0.request, self.0.options)
888 .await
889 .map(gax::response::Response::into_body)
890 }
891
892 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
896 self.0.request.name = v.into();
897 self
898 }
899 }
900
901 #[doc(hidden)]
902 impl gax::options::internal::RequestBuilder for DeleteGlossaryCategory {
903 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
904 &mut self.0.options
905 }
906 }
907
908 #[derive(Clone, Debug)]
926 pub struct GetGlossaryCategory(RequestBuilder<crate::model::GetGlossaryCategoryRequest>);
927
928 impl GetGlossaryCategory {
929 pub(crate) fn new(
930 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
931 ) -> Self {
932 Self(RequestBuilder::new(stub))
933 }
934
935 pub fn with_request<V: Into<crate::model::GetGlossaryCategoryRequest>>(
937 mut self,
938 v: V,
939 ) -> Self {
940 self.0.request = v.into();
941 self
942 }
943
944 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
946 self.0.options = v.into();
947 self
948 }
949
950 pub async fn send(self) -> Result<crate::model::GlossaryCategory> {
952 (*self.0.stub)
953 .get_glossary_category(self.0.request, self.0.options)
954 .await
955 .map(gax::response::Response::into_body)
956 }
957
958 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
962 self.0.request.name = v.into();
963 self
964 }
965 }
966
967 #[doc(hidden)]
968 impl gax::options::internal::RequestBuilder for GetGlossaryCategory {
969 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
970 &mut self.0.options
971 }
972 }
973
974 #[derive(Clone, Debug)]
996 pub struct ListGlossaryCategories(RequestBuilder<crate::model::ListGlossaryCategoriesRequest>);
997
998 impl ListGlossaryCategories {
999 pub(crate) fn new(
1000 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1001 ) -> Self {
1002 Self(RequestBuilder::new(stub))
1003 }
1004
1005 pub fn with_request<V: Into<crate::model::ListGlossaryCategoriesRequest>>(
1007 mut self,
1008 v: V,
1009 ) -> Self {
1010 self.0.request = v.into();
1011 self
1012 }
1013
1014 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1016 self.0.options = v.into();
1017 self
1018 }
1019
1020 pub async fn send(self) -> Result<crate::model::ListGlossaryCategoriesResponse> {
1022 (*self.0.stub)
1023 .list_glossary_categories(self.0.request, self.0.options)
1024 .await
1025 .map(gax::response::Response::into_body)
1026 }
1027
1028 pub fn by_page(
1030 self,
1031 ) -> impl gax::paginator::Paginator<
1032 crate::model::ListGlossaryCategoriesResponse,
1033 gax::error::Error,
1034 > {
1035 use std::clone::Clone;
1036 let token = self.0.request.page_token.clone();
1037 let execute = move |token: String| {
1038 let mut builder = self.clone();
1039 builder.0.request = builder.0.request.set_page_token(token);
1040 builder.send()
1041 };
1042 gax::paginator::internal::new_paginator(token, execute)
1043 }
1044
1045 pub fn by_item(
1047 self,
1048 ) -> impl gax::paginator::ItemPaginator<
1049 crate::model::ListGlossaryCategoriesResponse,
1050 gax::error::Error,
1051 > {
1052 use gax::paginator::Paginator;
1053 self.by_page().items()
1054 }
1055
1056 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060 self.0.request.parent = v.into();
1061 self
1062 }
1063
1064 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1066 self.0.request.page_size = v.into();
1067 self
1068 }
1069
1070 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1072 self.0.request.page_token = v.into();
1073 self
1074 }
1075
1076 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1078 self.0.request.filter = v.into();
1079 self
1080 }
1081
1082 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1084 self.0.request.order_by = v.into();
1085 self
1086 }
1087 }
1088
1089 #[doc(hidden)]
1090 impl gax::options::internal::RequestBuilder for ListGlossaryCategories {
1091 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1092 &mut self.0.options
1093 }
1094 }
1095
1096 #[derive(Clone, Debug)]
1114 pub struct CreateGlossaryTerm(RequestBuilder<crate::model::CreateGlossaryTermRequest>);
1115
1116 impl CreateGlossaryTerm {
1117 pub(crate) fn new(
1118 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1119 ) -> Self {
1120 Self(RequestBuilder::new(stub))
1121 }
1122
1123 pub fn with_request<V: Into<crate::model::CreateGlossaryTermRequest>>(
1125 mut self,
1126 v: V,
1127 ) -> Self {
1128 self.0.request = v.into();
1129 self
1130 }
1131
1132 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1134 self.0.options = v.into();
1135 self
1136 }
1137
1138 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1140 (*self.0.stub)
1141 .create_glossary_term(self.0.request, self.0.options)
1142 .await
1143 .map(gax::response::Response::into_body)
1144 }
1145
1146 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1150 self.0.request.parent = v.into();
1151 self
1152 }
1153
1154 pub fn set_term_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1158 self.0.request.term_id = v.into();
1159 self
1160 }
1161
1162 pub fn set_term<T>(mut self, v: T) -> Self
1166 where
1167 T: std::convert::Into<crate::model::GlossaryTerm>,
1168 {
1169 self.0.request.term = std::option::Option::Some(v.into());
1170 self
1171 }
1172
1173 pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
1177 where
1178 T: std::convert::Into<crate::model::GlossaryTerm>,
1179 {
1180 self.0.request.term = v.map(|x| x.into());
1181 self
1182 }
1183 }
1184
1185 #[doc(hidden)]
1186 impl gax::options::internal::RequestBuilder for CreateGlossaryTerm {
1187 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1188 &mut self.0.options
1189 }
1190 }
1191
1192 #[derive(Clone, Debug)]
1210 pub struct UpdateGlossaryTerm(RequestBuilder<crate::model::UpdateGlossaryTermRequest>);
1211
1212 impl UpdateGlossaryTerm {
1213 pub(crate) fn new(
1214 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1215 ) -> Self {
1216 Self(RequestBuilder::new(stub))
1217 }
1218
1219 pub fn with_request<V: Into<crate::model::UpdateGlossaryTermRequest>>(
1221 mut self,
1222 v: V,
1223 ) -> Self {
1224 self.0.request = v.into();
1225 self
1226 }
1227
1228 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1230 self.0.options = v.into();
1231 self
1232 }
1233
1234 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1236 (*self.0.stub)
1237 .update_glossary_term(self.0.request, self.0.options)
1238 .await
1239 .map(gax::response::Response::into_body)
1240 }
1241
1242 pub fn set_term<T>(mut self, v: T) -> Self
1246 where
1247 T: std::convert::Into<crate::model::GlossaryTerm>,
1248 {
1249 self.0.request.term = std::option::Option::Some(v.into());
1250 self
1251 }
1252
1253 pub fn set_or_clear_term<T>(mut self, v: std::option::Option<T>) -> Self
1257 where
1258 T: std::convert::Into<crate::model::GlossaryTerm>,
1259 {
1260 self.0.request.term = v.map(|x| x.into());
1261 self
1262 }
1263
1264 pub fn set_update_mask<T>(mut self, v: T) -> Self
1268 where
1269 T: std::convert::Into<wkt::FieldMask>,
1270 {
1271 self.0.request.update_mask = std::option::Option::Some(v.into());
1272 self
1273 }
1274
1275 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1279 where
1280 T: std::convert::Into<wkt::FieldMask>,
1281 {
1282 self.0.request.update_mask = v.map(|x| x.into());
1283 self
1284 }
1285 }
1286
1287 #[doc(hidden)]
1288 impl gax::options::internal::RequestBuilder for UpdateGlossaryTerm {
1289 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1290 &mut self.0.options
1291 }
1292 }
1293
1294 #[derive(Clone, Debug)]
1312 pub struct DeleteGlossaryTerm(RequestBuilder<crate::model::DeleteGlossaryTermRequest>);
1313
1314 impl DeleteGlossaryTerm {
1315 pub(crate) fn new(
1316 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1317 ) -> Self {
1318 Self(RequestBuilder::new(stub))
1319 }
1320
1321 pub fn with_request<V: Into<crate::model::DeleteGlossaryTermRequest>>(
1323 mut self,
1324 v: V,
1325 ) -> Self {
1326 self.0.request = v.into();
1327 self
1328 }
1329
1330 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1332 self.0.options = v.into();
1333 self
1334 }
1335
1336 pub async fn send(self) -> Result<()> {
1338 (*self.0.stub)
1339 .delete_glossary_term(self.0.request, self.0.options)
1340 .await
1341 .map(gax::response::Response::into_body)
1342 }
1343
1344 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1348 self.0.request.name = v.into();
1349 self
1350 }
1351 }
1352
1353 #[doc(hidden)]
1354 impl gax::options::internal::RequestBuilder for DeleteGlossaryTerm {
1355 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1356 &mut self.0.options
1357 }
1358 }
1359
1360 #[derive(Clone, Debug)]
1378 pub struct GetGlossaryTerm(RequestBuilder<crate::model::GetGlossaryTermRequest>);
1379
1380 impl GetGlossaryTerm {
1381 pub(crate) fn new(
1382 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1383 ) -> Self {
1384 Self(RequestBuilder::new(stub))
1385 }
1386
1387 pub fn with_request<V: Into<crate::model::GetGlossaryTermRequest>>(mut self, v: V) -> Self {
1389 self.0.request = v.into();
1390 self
1391 }
1392
1393 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1395 self.0.options = v.into();
1396 self
1397 }
1398
1399 pub async fn send(self) -> Result<crate::model::GlossaryTerm> {
1401 (*self.0.stub)
1402 .get_glossary_term(self.0.request, self.0.options)
1403 .await
1404 .map(gax::response::Response::into_body)
1405 }
1406
1407 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1411 self.0.request.name = v.into();
1412 self
1413 }
1414 }
1415
1416 #[doc(hidden)]
1417 impl gax::options::internal::RequestBuilder for GetGlossaryTerm {
1418 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1419 &mut self.0.options
1420 }
1421 }
1422
1423 #[derive(Clone, Debug)]
1445 pub struct ListGlossaryTerms(RequestBuilder<crate::model::ListGlossaryTermsRequest>);
1446
1447 impl ListGlossaryTerms {
1448 pub(crate) fn new(
1449 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1450 ) -> Self {
1451 Self(RequestBuilder::new(stub))
1452 }
1453
1454 pub fn with_request<V: Into<crate::model::ListGlossaryTermsRequest>>(
1456 mut self,
1457 v: V,
1458 ) -> Self {
1459 self.0.request = v.into();
1460 self
1461 }
1462
1463 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1465 self.0.options = v.into();
1466 self
1467 }
1468
1469 pub async fn send(self) -> Result<crate::model::ListGlossaryTermsResponse> {
1471 (*self.0.stub)
1472 .list_glossary_terms(self.0.request, self.0.options)
1473 .await
1474 .map(gax::response::Response::into_body)
1475 }
1476
1477 pub fn by_page(
1479 self,
1480 ) -> impl gax::paginator::Paginator<crate::model::ListGlossaryTermsResponse, gax::error::Error>
1481 {
1482 use std::clone::Clone;
1483 let token = self.0.request.page_token.clone();
1484 let execute = move |token: String| {
1485 let mut builder = self.clone();
1486 builder.0.request = builder.0.request.set_page_token(token);
1487 builder.send()
1488 };
1489 gax::paginator::internal::new_paginator(token, execute)
1490 }
1491
1492 pub fn by_item(
1494 self,
1495 ) -> impl gax::paginator::ItemPaginator<crate::model::ListGlossaryTermsResponse, gax::error::Error>
1496 {
1497 use gax::paginator::Paginator;
1498 self.by_page().items()
1499 }
1500
1501 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1505 self.0.request.parent = v.into();
1506 self
1507 }
1508
1509 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1511 self.0.request.page_size = v.into();
1512 self
1513 }
1514
1515 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1517 self.0.request.page_token = v.into();
1518 self
1519 }
1520
1521 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1523 self.0.request.filter = v.into();
1524 self
1525 }
1526
1527 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1529 self.0.request.order_by = v.into();
1530 self
1531 }
1532 }
1533
1534 #[doc(hidden)]
1535 impl gax::options::internal::RequestBuilder for ListGlossaryTerms {
1536 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1537 &mut self.0.options
1538 }
1539 }
1540
1541 #[derive(Clone, Debug)]
1563 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1564
1565 impl ListLocations {
1566 pub(crate) fn new(
1567 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1568 ) -> Self {
1569 Self(RequestBuilder::new(stub))
1570 }
1571
1572 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1574 mut self,
1575 v: V,
1576 ) -> Self {
1577 self.0.request = v.into();
1578 self
1579 }
1580
1581 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1583 self.0.options = v.into();
1584 self
1585 }
1586
1587 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1589 (*self.0.stub)
1590 .list_locations(self.0.request, self.0.options)
1591 .await
1592 .map(gax::response::Response::into_body)
1593 }
1594
1595 pub fn by_page(
1597 self,
1598 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1599 {
1600 use std::clone::Clone;
1601 let token = self.0.request.page_token.clone();
1602 let execute = move |token: String| {
1603 let mut builder = self.clone();
1604 builder.0.request = builder.0.request.set_page_token(token);
1605 builder.send()
1606 };
1607 gax::paginator::internal::new_paginator(token, execute)
1608 }
1609
1610 pub fn by_item(
1612 self,
1613 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1614 {
1615 use gax::paginator::Paginator;
1616 self.by_page().items()
1617 }
1618
1619 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1621 self.0.request.name = v.into();
1622 self
1623 }
1624
1625 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1627 self.0.request.filter = v.into();
1628 self
1629 }
1630
1631 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1633 self.0.request.page_size = v.into();
1634 self
1635 }
1636
1637 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1639 self.0.request.page_token = v.into();
1640 self
1641 }
1642 }
1643
1644 #[doc(hidden)]
1645 impl gax::options::internal::RequestBuilder for ListLocations {
1646 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1647 &mut self.0.options
1648 }
1649 }
1650
1651 #[derive(Clone, Debug)]
1669 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1670
1671 impl GetLocation {
1672 pub(crate) fn new(
1673 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1674 ) -> Self {
1675 Self(RequestBuilder::new(stub))
1676 }
1677
1678 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1680 self.0.request = v.into();
1681 self
1682 }
1683
1684 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1686 self.0.options = v.into();
1687 self
1688 }
1689
1690 pub async fn send(self) -> Result<location::model::Location> {
1692 (*self.0.stub)
1693 .get_location(self.0.request, self.0.options)
1694 .await
1695 .map(gax::response::Response::into_body)
1696 }
1697
1698 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1700 self.0.request.name = v.into();
1701 self
1702 }
1703 }
1704
1705 #[doc(hidden)]
1706 impl gax::options::internal::RequestBuilder for GetLocation {
1707 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1708 &mut self.0.options
1709 }
1710 }
1711
1712 #[derive(Clone, Debug)]
1730 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1731
1732 impl SetIamPolicy {
1733 pub(crate) fn new(
1734 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1735 ) -> Self {
1736 Self(RequestBuilder::new(stub))
1737 }
1738
1739 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1741 self.0.request = v.into();
1742 self
1743 }
1744
1745 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1747 self.0.options = v.into();
1748 self
1749 }
1750
1751 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1753 (*self.0.stub)
1754 .set_iam_policy(self.0.request, self.0.options)
1755 .await
1756 .map(gax::response::Response::into_body)
1757 }
1758
1759 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1763 self.0.request.resource = v.into();
1764 self
1765 }
1766
1767 pub fn set_policy<T>(mut self, v: T) -> Self
1771 where
1772 T: std::convert::Into<iam_v1::model::Policy>,
1773 {
1774 self.0.request.policy = std::option::Option::Some(v.into());
1775 self
1776 }
1777
1778 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1782 where
1783 T: std::convert::Into<iam_v1::model::Policy>,
1784 {
1785 self.0.request.policy = v.map(|x| x.into());
1786 self
1787 }
1788
1789 pub fn set_update_mask<T>(mut self, v: T) -> Self
1791 where
1792 T: std::convert::Into<wkt::FieldMask>,
1793 {
1794 self.0.request.update_mask = std::option::Option::Some(v.into());
1795 self
1796 }
1797
1798 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1800 where
1801 T: std::convert::Into<wkt::FieldMask>,
1802 {
1803 self.0.request.update_mask = v.map(|x| x.into());
1804 self
1805 }
1806 }
1807
1808 #[doc(hidden)]
1809 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1810 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1811 &mut self.0.options
1812 }
1813 }
1814
1815 #[derive(Clone, Debug)]
1833 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1834
1835 impl GetIamPolicy {
1836 pub(crate) fn new(
1837 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1838 ) -> Self {
1839 Self(RequestBuilder::new(stub))
1840 }
1841
1842 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1844 self.0.request = v.into();
1845 self
1846 }
1847
1848 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1850 self.0.options = v.into();
1851 self
1852 }
1853
1854 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1856 (*self.0.stub)
1857 .get_iam_policy(self.0.request, self.0.options)
1858 .await
1859 .map(gax::response::Response::into_body)
1860 }
1861
1862 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1866 self.0.request.resource = v.into();
1867 self
1868 }
1869
1870 pub fn set_options<T>(mut self, v: T) -> Self
1872 where
1873 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1874 {
1875 self.0.request.options = std::option::Option::Some(v.into());
1876 self
1877 }
1878
1879 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1881 where
1882 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1883 {
1884 self.0.request.options = v.map(|x| x.into());
1885 self
1886 }
1887 }
1888
1889 #[doc(hidden)]
1890 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1891 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1892 &mut self.0.options
1893 }
1894 }
1895
1896 #[derive(Clone, Debug)]
1914 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1915
1916 impl TestIamPermissions {
1917 pub(crate) fn new(
1918 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
1919 ) -> Self {
1920 Self(RequestBuilder::new(stub))
1921 }
1922
1923 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1925 mut self,
1926 v: V,
1927 ) -> Self {
1928 self.0.request = v.into();
1929 self
1930 }
1931
1932 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1934 self.0.options = v.into();
1935 self
1936 }
1937
1938 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1940 (*self.0.stub)
1941 .test_iam_permissions(self.0.request, self.0.options)
1942 .await
1943 .map(gax::response::Response::into_body)
1944 }
1945
1946 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1950 self.0.request.resource = v.into();
1951 self
1952 }
1953
1954 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1958 where
1959 T: std::iter::IntoIterator<Item = V>,
1960 V: std::convert::Into<std::string::String>,
1961 {
1962 use std::iter::Iterator;
1963 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1964 self
1965 }
1966 }
1967
1968 #[doc(hidden)]
1969 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1970 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1971 &mut self.0.options
1972 }
1973 }
1974
1975 #[derive(Clone, Debug)]
1997 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1998
1999 impl ListOperations {
2000 pub(crate) fn new(
2001 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2002 ) -> Self {
2003 Self(RequestBuilder::new(stub))
2004 }
2005
2006 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2008 mut self,
2009 v: V,
2010 ) -> Self {
2011 self.0.request = v.into();
2012 self
2013 }
2014
2015 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2017 self.0.options = v.into();
2018 self
2019 }
2020
2021 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2023 (*self.0.stub)
2024 .list_operations(self.0.request, self.0.options)
2025 .await
2026 .map(gax::response::Response::into_body)
2027 }
2028
2029 pub fn by_page(
2031 self,
2032 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2033 {
2034 use std::clone::Clone;
2035 let token = self.0.request.page_token.clone();
2036 let execute = move |token: String| {
2037 let mut builder = self.clone();
2038 builder.0.request = builder.0.request.set_page_token(token);
2039 builder.send()
2040 };
2041 gax::paginator::internal::new_paginator(token, execute)
2042 }
2043
2044 pub fn by_item(
2046 self,
2047 ) -> impl gax::paginator::ItemPaginator<
2048 longrunning::model::ListOperationsResponse,
2049 gax::error::Error,
2050 > {
2051 use gax::paginator::Paginator;
2052 self.by_page().items()
2053 }
2054
2055 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2057 self.0.request.name = v.into();
2058 self
2059 }
2060
2061 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2063 self.0.request.filter = v.into();
2064 self
2065 }
2066
2067 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2069 self.0.request.page_size = v.into();
2070 self
2071 }
2072
2073 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2075 self.0.request.page_token = v.into();
2076 self
2077 }
2078
2079 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2081 self.0.request.return_partial_success = v.into();
2082 self
2083 }
2084 }
2085
2086 #[doc(hidden)]
2087 impl gax::options::internal::RequestBuilder for ListOperations {
2088 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2089 &mut self.0.options
2090 }
2091 }
2092
2093 #[derive(Clone, Debug)]
2111 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2112
2113 impl GetOperation {
2114 pub(crate) fn new(
2115 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2116 ) -> Self {
2117 Self(RequestBuilder::new(stub))
2118 }
2119
2120 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2122 mut self,
2123 v: V,
2124 ) -> Self {
2125 self.0.request = v.into();
2126 self
2127 }
2128
2129 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2131 self.0.options = v.into();
2132 self
2133 }
2134
2135 pub async fn send(self) -> Result<longrunning::model::Operation> {
2137 (*self.0.stub)
2138 .get_operation(self.0.request, self.0.options)
2139 .await
2140 .map(gax::response::Response::into_body)
2141 }
2142
2143 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2145 self.0.request.name = v.into();
2146 self
2147 }
2148 }
2149
2150 #[doc(hidden)]
2151 impl gax::options::internal::RequestBuilder for GetOperation {
2152 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2153 &mut self.0.options
2154 }
2155 }
2156
2157 #[derive(Clone, Debug)]
2175 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2176
2177 impl DeleteOperation {
2178 pub(crate) fn new(
2179 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2180 ) -> Self {
2181 Self(RequestBuilder::new(stub))
2182 }
2183
2184 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2186 mut self,
2187 v: V,
2188 ) -> Self {
2189 self.0.request = v.into();
2190 self
2191 }
2192
2193 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2195 self.0.options = v.into();
2196 self
2197 }
2198
2199 pub async fn send(self) -> Result<()> {
2201 (*self.0.stub)
2202 .delete_operation(self.0.request, self.0.options)
2203 .await
2204 .map(gax::response::Response::into_body)
2205 }
2206
2207 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2209 self.0.request.name = v.into();
2210 self
2211 }
2212 }
2213
2214 #[doc(hidden)]
2215 impl gax::options::internal::RequestBuilder for DeleteOperation {
2216 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2217 &mut self.0.options
2218 }
2219 }
2220
2221 #[derive(Clone, Debug)]
2239 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2240
2241 impl CancelOperation {
2242 pub(crate) fn new(
2243 stub: std::sync::Arc<dyn super::super::stub::dynamic::BusinessGlossaryService>,
2244 ) -> Self {
2245 Self(RequestBuilder::new(stub))
2246 }
2247
2248 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2250 mut self,
2251 v: V,
2252 ) -> Self {
2253 self.0.request = v.into();
2254 self
2255 }
2256
2257 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2259 self.0.options = v.into();
2260 self
2261 }
2262
2263 pub async fn send(self) -> Result<()> {
2265 (*self.0.stub)
2266 .cancel_operation(self.0.request, self.0.options)
2267 .await
2268 .map(gax::response::Response::into_body)
2269 }
2270
2271 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2273 self.0.request.name = v.into();
2274 self
2275 }
2276 }
2277
2278 #[doc(hidden)]
2279 impl gax::options::internal::RequestBuilder for CancelOperation {
2280 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2281 &mut self.0.options
2282 }
2283 }
2284}
2285
2286pub mod catalog_service {
2287 use crate::Result;
2288
2289 pub type ClientBuilder =
2303 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2304
2305 pub(crate) mod client {
2306 use super::super::super::client::CatalogService;
2307 pub struct Factory;
2308 impl gax::client_builder::internal::ClientFactory for Factory {
2309 type Client = CatalogService;
2310 type Credentials = gaxi::options::Credentials;
2311 async fn build(
2312 self,
2313 config: gaxi::options::ClientConfig,
2314 ) -> gax::client_builder::Result<Self::Client> {
2315 Self::Client::new(config).await
2316 }
2317 }
2318 }
2319
2320 #[derive(Clone, Debug)]
2322 pub(crate) struct RequestBuilder<R: std::default::Default> {
2323 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2324 request: R,
2325 options: gax::options::RequestOptions,
2326 }
2327
2328 impl<R> RequestBuilder<R>
2329 where
2330 R: std::default::Default,
2331 {
2332 pub(crate) fn new(
2333 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2334 ) -> Self {
2335 Self {
2336 stub,
2337 request: R::default(),
2338 options: gax::options::RequestOptions::default(),
2339 }
2340 }
2341 }
2342
2343 #[derive(Clone, Debug)]
2362 pub struct CreateEntryType(RequestBuilder<crate::model::CreateEntryTypeRequest>);
2363
2364 impl CreateEntryType {
2365 pub(crate) fn new(
2366 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2367 ) -> Self {
2368 Self(RequestBuilder::new(stub))
2369 }
2370
2371 pub fn with_request<V: Into<crate::model::CreateEntryTypeRequest>>(mut self, v: V) -> Self {
2373 self.0.request = v.into();
2374 self
2375 }
2376
2377 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2379 self.0.options = v.into();
2380 self
2381 }
2382
2383 pub async fn send(self) -> Result<longrunning::model::Operation> {
2390 (*self.0.stub)
2391 .create_entry_type(self.0.request, self.0.options)
2392 .await
2393 .map(gax::response::Response::into_body)
2394 }
2395
2396 pub fn poller(
2398 self,
2399 ) -> impl lro::Poller<crate::model::EntryType, crate::model::OperationMetadata> {
2400 type Operation =
2401 lro::internal::Operation<crate::model::EntryType, crate::model::OperationMetadata>;
2402 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2403 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2404
2405 let stub = self.0.stub.clone();
2406 let mut options = self.0.options.clone();
2407 options.set_retry_policy(gax::retry_policy::NeverRetry);
2408 let query = move |name| {
2409 let stub = stub.clone();
2410 let options = options.clone();
2411 async {
2412 let op = GetOperation::new(stub)
2413 .set_name(name)
2414 .with_options(options)
2415 .send()
2416 .await?;
2417 Ok(Operation::new(op))
2418 }
2419 };
2420
2421 let start = move || async {
2422 let op = self.send().await?;
2423 Ok(Operation::new(op))
2424 };
2425
2426 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2427 }
2428
2429 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2433 self.0.request.parent = v.into();
2434 self
2435 }
2436
2437 pub fn set_entry_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2441 self.0.request.entry_type_id = v.into();
2442 self
2443 }
2444
2445 pub fn set_entry_type<T>(mut self, v: T) -> Self
2449 where
2450 T: std::convert::Into<crate::model::EntryType>,
2451 {
2452 self.0.request.entry_type = std::option::Option::Some(v.into());
2453 self
2454 }
2455
2456 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
2460 where
2461 T: std::convert::Into<crate::model::EntryType>,
2462 {
2463 self.0.request.entry_type = v.map(|x| x.into());
2464 self
2465 }
2466
2467 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2469 self.0.request.validate_only = v.into();
2470 self
2471 }
2472 }
2473
2474 #[doc(hidden)]
2475 impl gax::options::internal::RequestBuilder for CreateEntryType {
2476 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2477 &mut self.0.options
2478 }
2479 }
2480
2481 #[derive(Clone, Debug)]
2500 pub struct UpdateEntryType(RequestBuilder<crate::model::UpdateEntryTypeRequest>);
2501
2502 impl UpdateEntryType {
2503 pub(crate) fn new(
2504 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2505 ) -> Self {
2506 Self(RequestBuilder::new(stub))
2507 }
2508
2509 pub fn with_request<V: Into<crate::model::UpdateEntryTypeRequest>>(mut self, v: V) -> Self {
2511 self.0.request = v.into();
2512 self
2513 }
2514
2515 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2517 self.0.options = v.into();
2518 self
2519 }
2520
2521 pub async fn send(self) -> Result<longrunning::model::Operation> {
2528 (*self.0.stub)
2529 .update_entry_type(self.0.request, self.0.options)
2530 .await
2531 .map(gax::response::Response::into_body)
2532 }
2533
2534 pub fn poller(
2536 self,
2537 ) -> impl lro::Poller<crate::model::EntryType, crate::model::OperationMetadata> {
2538 type Operation =
2539 lro::internal::Operation<crate::model::EntryType, crate::model::OperationMetadata>;
2540 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2541 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2542
2543 let stub = self.0.stub.clone();
2544 let mut options = self.0.options.clone();
2545 options.set_retry_policy(gax::retry_policy::NeverRetry);
2546 let query = move |name| {
2547 let stub = stub.clone();
2548 let options = options.clone();
2549 async {
2550 let op = GetOperation::new(stub)
2551 .set_name(name)
2552 .with_options(options)
2553 .send()
2554 .await?;
2555 Ok(Operation::new(op))
2556 }
2557 };
2558
2559 let start = move || async {
2560 let op = self.send().await?;
2561 Ok(Operation::new(op))
2562 };
2563
2564 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2565 }
2566
2567 pub fn set_entry_type<T>(mut self, v: T) -> Self
2571 where
2572 T: std::convert::Into<crate::model::EntryType>,
2573 {
2574 self.0.request.entry_type = std::option::Option::Some(v.into());
2575 self
2576 }
2577
2578 pub fn set_or_clear_entry_type<T>(mut self, v: std::option::Option<T>) -> Self
2582 where
2583 T: std::convert::Into<crate::model::EntryType>,
2584 {
2585 self.0.request.entry_type = v.map(|x| x.into());
2586 self
2587 }
2588
2589 pub fn set_update_mask<T>(mut self, v: T) -> Self
2593 where
2594 T: std::convert::Into<wkt::FieldMask>,
2595 {
2596 self.0.request.update_mask = std::option::Option::Some(v.into());
2597 self
2598 }
2599
2600 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2604 where
2605 T: std::convert::Into<wkt::FieldMask>,
2606 {
2607 self.0.request.update_mask = v.map(|x| x.into());
2608 self
2609 }
2610
2611 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2613 self.0.request.validate_only = v.into();
2614 self
2615 }
2616 }
2617
2618 #[doc(hidden)]
2619 impl gax::options::internal::RequestBuilder for UpdateEntryType {
2620 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2621 &mut self.0.options
2622 }
2623 }
2624
2625 #[derive(Clone, Debug)]
2644 pub struct DeleteEntryType(RequestBuilder<crate::model::DeleteEntryTypeRequest>);
2645
2646 impl DeleteEntryType {
2647 pub(crate) fn new(
2648 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2649 ) -> Self {
2650 Self(RequestBuilder::new(stub))
2651 }
2652
2653 pub fn with_request<V: Into<crate::model::DeleteEntryTypeRequest>>(mut self, v: V) -> Self {
2655 self.0.request = v.into();
2656 self
2657 }
2658
2659 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2661 self.0.options = v.into();
2662 self
2663 }
2664
2665 pub async fn send(self) -> Result<longrunning::model::Operation> {
2672 (*self.0.stub)
2673 .delete_entry_type(self.0.request, self.0.options)
2674 .await
2675 .map(gax::response::Response::into_body)
2676 }
2677
2678 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2680 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2681 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2682 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2683
2684 let stub = self.0.stub.clone();
2685 let mut options = self.0.options.clone();
2686 options.set_retry_policy(gax::retry_policy::NeverRetry);
2687 let query = move |name| {
2688 let stub = stub.clone();
2689 let options = options.clone();
2690 async {
2691 let op = GetOperation::new(stub)
2692 .set_name(name)
2693 .with_options(options)
2694 .send()
2695 .await?;
2696 Ok(Operation::new(op))
2697 }
2698 };
2699
2700 let start = move || async {
2701 let op = self.send().await?;
2702 Ok(Operation::new(op))
2703 };
2704
2705 lro::internal::new_unit_response_poller(
2706 polling_error_policy,
2707 polling_backoff_policy,
2708 start,
2709 query,
2710 )
2711 }
2712
2713 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2717 self.0.request.name = v.into();
2718 self
2719 }
2720
2721 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2723 self.0.request.etag = v.into();
2724 self
2725 }
2726 }
2727
2728 #[doc(hidden)]
2729 impl gax::options::internal::RequestBuilder for DeleteEntryType {
2730 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2731 &mut self.0.options
2732 }
2733 }
2734
2735 #[derive(Clone, Debug)]
2757 pub struct ListEntryTypes(RequestBuilder<crate::model::ListEntryTypesRequest>);
2758
2759 impl ListEntryTypes {
2760 pub(crate) fn new(
2761 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2762 ) -> Self {
2763 Self(RequestBuilder::new(stub))
2764 }
2765
2766 pub fn with_request<V: Into<crate::model::ListEntryTypesRequest>>(mut self, v: V) -> Self {
2768 self.0.request = v.into();
2769 self
2770 }
2771
2772 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2774 self.0.options = v.into();
2775 self
2776 }
2777
2778 pub async fn send(self) -> Result<crate::model::ListEntryTypesResponse> {
2780 (*self.0.stub)
2781 .list_entry_types(self.0.request, self.0.options)
2782 .await
2783 .map(gax::response::Response::into_body)
2784 }
2785
2786 pub fn by_page(
2788 self,
2789 ) -> impl gax::paginator::Paginator<crate::model::ListEntryTypesResponse, gax::error::Error>
2790 {
2791 use std::clone::Clone;
2792 let token = self.0.request.page_token.clone();
2793 let execute = move |token: String| {
2794 let mut builder = self.clone();
2795 builder.0.request = builder.0.request.set_page_token(token);
2796 builder.send()
2797 };
2798 gax::paginator::internal::new_paginator(token, execute)
2799 }
2800
2801 pub fn by_item(
2803 self,
2804 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntryTypesResponse, gax::error::Error>
2805 {
2806 use gax::paginator::Paginator;
2807 self.by_page().items()
2808 }
2809
2810 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2814 self.0.request.parent = v.into();
2815 self
2816 }
2817
2818 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2820 self.0.request.page_size = v.into();
2821 self
2822 }
2823
2824 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2826 self.0.request.page_token = v.into();
2827 self
2828 }
2829
2830 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2832 self.0.request.filter = v.into();
2833 self
2834 }
2835
2836 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2838 self.0.request.order_by = v.into();
2839 self
2840 }
2841 }
2842
2843 #[doc(hidden)]
2844 impl gax::options::internal::RequestBuilder for ListEntryTypes {
2845 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2846 &mut self.0.options
2847 }
2848 }
2849
2850 #[derive(Clone, Debug)]
2868 pub struct GetEntryType(RequestBuilder<crate::model::GetEntryTypeRequest>);
2869
2870 impl GetEntryType {
2871 pub(crate) fn new(
2872 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2873 ) -> Self {
2874 Self(RequestBuilder::new(stub))
2875 }
2876
2877 pub fn with_request<V: Into<crate::model::GetEntryTypeRequest>>(mut self, v: V) -> Self {
2879 self.0.request = v.into();
2880 self
2881 }
2882
2883 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2885 self.0.options = v.into();
2886 self
2887 }
2888
2889 pub async fn send(self) -> Result<crate::model::EntryType> {
2891 (*self.0.stub)
2892 .get_entry_type(self.0.request, self.0.options)
2893 .await
2894 .map(gax::response::Response::into_body)
2895 }
2896
2897 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2901 self.0.request.name = v.into();
2902 self
2903 }
2904 }
2905
2906 #[doc(hidden)]
2907 impl gax::options::internal::RequestBuilder for GetEntryType {
2908 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2909 &mut self.0.options
2910 }
2911 }
2912
2913 #[derive(Clone, Debug)]
2932 pub struct CreateAspectType(RequestBuilder<crate::model::CreateAspectTypeRequest>);
2933
2934 impl CreateAspectType {
2935 pub(crate) fn new(
2936 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
2937 ) -> Self {
2938 Self(RequestBuilder::new(stub))
2939 }
2940
2941 pub fn with_request<V: Into<crate::model::CreateAspectTypeRequest>>(
2943 mut self,
2944 v: V,
2945 ) -> Self {
2946 self.0.request = v.into();
2947 self
2948 }
2949
2950 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2952 self.0.options = v.into();
2953 self
2954 }
2955
2956 pub async fn send(self) -> Result<longrunning::model::Operation> {
2963 (*self.0.stub)
2964 .create_aspect_type(self.0.request, self.0.options)
2965 .await
2966 .map(gax::response::Response::into_body)
2967 }
2968
2969 pub fn poller(
2971 self,
2972 ) -> impl lro::Poller<crate::model::AspectType, crate::model::OperationMetadata> {
2973 type Operation =
2974 lro::internal::Operation<crate::model::AspectType, crate::model::OperationMetadata>;
2975 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2976 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2977
2978 let stub = self.0.stub.clone();
2979 let mut options = self.0.options.clone();
2980 options.set_retry_policy(gax::retry_policy::NeverRetry);
2981 let query = move |name| {
2982 let stub = stub.clone();
2983 let options = options.clone();
2984 async {
2985 let op = GetOperation::new(stub)
2986 .set_name(name)
2987 .with_options(options)
2988 .send()
2989 .await?;
2990 Ok(Operation::new(op))
2991 }
2992 };
2993
2994 let start = move || async {
2995 let op = self.send().await?;
2996 Ok(Operation::new(op))
2997 };
2998
2999 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3000 }
3001
3002 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3006 self.0.request.parent = v.into();
3007 self
3008 }
3009
3010 pub fn set_aspect_type_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3014 self.0.request.aspect_type_id = v.into();
3015 self
3016 }
3017
3018 pub fn set_aspect_type<T>(mut self, v: T) -> Self
3022 where
3023 T: std::convert::Into<crate::model::AspectType>,
3024 {
3025 self.0.request.aspect_type = std::option::Option::Some(v.into());
3026 self
3027 }
3028
3029 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
3033 where
3034 T: std::convert::Into<crate::model::AspectType>,
3035 {
3036 self.0.request.aspect_type = v.map(|x| x.into());
3037 self
3038 }
3039
3040 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3042 self.0.request.validate_only = v.into();
3043 self
3044 }
3045 }
3046
3047 #[doc(hidden)]
3048 impl gax::options::internal::RequestBuilder for CreateAspectType {
3049 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3050 &mut self.0.options
3051 }
3052 }
3053
3054 #[derive(Clone, Debug)]
3073 pub struct UpdateAspectType(RequestBuilder<crate::model::UpdateAspectTypeRequest>);
3074
3075 impl UpdateAspectType {
3076 pub(crate) fn new(
3077 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3078 ) -> Self {
3079 Self(RequestBuilder::new(stub))
3080 }
3081
3082 pub fn with_request<V: Into<crate::model::UpdateAspectTypeRequest>>(
3084 mut self,
3085 v: V,
3086 ) -> Self {
3087 self.0.request = v.into();
3088 self
3089 }
3090
3091 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3093 self.0.options = v.into();
3094 self
3095 }
3096
3097 pub async fn send(self) -> Result<longrunning::model::Operation> {
3104 (*self.0.stub)
3105 .update_aspect_type(self.0.request, self.0.options)
3106 .await
3107 .map(gax::response::Response::into_body)
3108 }
3109
3110 pub fn poller(
3112 self,
3113 ) -> impl lro::Poller<crate::model::AspectType, crate::model::OperationMetadata> {
3114 type Operation =
3115 lro::internal::Operation<crate::model::AspectType, crate::model::OperationMetadata>;
3116 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3117 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3118
3119 let stub = self.0.stub.clone();
3120 let mut options = self.0.options.clone();
3121 options.set_retry_policy(gax::retry_policy::NeverRetry);
3122 let query = move |name| {
3123 let stub = stub.clone();
3124 let options = options.clone();
3125 async {
3126 let op = GetOperation::new(stub)
3127 .set_name(name)
3128 .with_options(options)
3129 .send()
3130 .await?;
3131 Ok(Operation::new(op))
3132 }
3133 };
3134
3135 let start = move || async {
3136 let op = self.send().await?;
3137 Ok(Operation::new(op))
3138 };
3139
3140 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3141 }
3142
3143 pub fn set_aspect_type<T>(mut self, v: T) -> Self
3147 where
3148 T: std::convert::Into<crate::model::AspectType>,
3149 {
3150 self.0.request.aspect_type = std::option::Option::Some(v.into());
3151 self
3152 }
3153
3154 pub fn set_or_clear_aspect_type<T>(mut self, v: std::option::Option<T>) -> Self
3158 where
3159 T: std::convert::Into<crate::model::AspectType>,
3160 {
3161 self.0.request.aspect_type = v.map(|x| x.into());
3162 self
3163 }
3164
3165 pub fn set_update_mask<T>(mut self, v: T) -> Self
3169 where
3170 T: std::convert::Into<wkt::FieldMask>,
3171 {
3172 self.0.request.update_mask = std::option::Option::Some(v.into());
3173 self
3174 }
3175
3176 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3180 where
3181 T: std::convert::Into<wkt::FieldMask>,
3182 {
3183 self.0.request.update_mask = v.map(|x| x.into());
3184 self
3185 }
3186
3187 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3189 self.0.request.validate_only = v.into();
3190 self
3191 }
3192 }
3193
3194 #[doc(hidden)]
3195 impl gax::options::internal::RequestBuilder for UpdateAspectType {
3196 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3197 &mut self.0.options
3198 }
3199 }
3200
3201 #[derive(Clone, Debug)]
3220 pub struct DeleteAspectType(RequestBuilder<crate::model::DeleteAspectTypeRequest>);
3221
3222 impl DeleteAspectType {
3223 pub(crate) fn new(
3224 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3225 ) -> Self {
3226 Self(RequestBuilder::new(stub))
3227 }
3228
3229 pub fn with_request<V: Into<crate::model::DeleteAspectTypeRequest>>(
3231 mut self,
3232 v: V,
3233 ) -> Self {
3234 self.0.request = v.into();
3235 self
3236 }
3237
3238 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3240 self.0.options = v.into();
3241 self
3242 }
3243
3244 pub async fn send(self) -> Result<longrunning::model::Operation> {
3251 (*self.0.stub)
3252 .delete_aspect_type(self.0.request, self.0.options)
3253 .await
3254 .map(gax::response::Response::into_body)
3255 }
3256
3257 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3259 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3260 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3261 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3262
3263 let stub = self.0.stub.clone();
3264 let mut options = self.0.options.clone();
3265 options.set_retry_policy(gax::retry_policy::NeverRetry);
3266 let query = move |name| {
3267 let stub = stub.clone();
3268 let options = options.clone();
3269 async {
3270 let op = GetOperation::new(stub)
3271 .set_name(name)
3272 .with_options(options)
3273 .send()
3274 .await?;
3275 Ok(Operation::new(op))
3276 }
3277 };
3278
3279 let start = move || async {
3280 let op = self.send().await?;
3281 Ok(Operation::new(op))
3282 };
3283
3284 lro::internal::new_unit_response_poller(
3285 polling_error_policy,
3286 polling_backoff_policy,
3287 start,
3288 query,
3289 )
3290 }
3291
3292 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3296 self.0.request.name = v.into();
3297 self
3298 }
3299
3300 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3302 self.0.request.etag = v.into();
3303 self
3304 }
3305 }
3306
3307 #[doc(hidden)]
3308 impl gax::options::internal::RequestBuilder for DeleteAspectType {
3309 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3310 &mut self.0.options
3311 }
3312 }
3313
3314 #[derive(Clone, Debug)]
3336 pub struct ListAspectTypes(RequestBuilder<crate::model::ListAspectTypesRequest>);
3337
3338 impl ListAspectTypes {
3339 pub(crate) fn new(
3340 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3341 ) -> Self {
3342 Self(RequestBuilder::new(stub))
3343 }
3344
3345 pub fn with_request<V: Into<crate::model::ListAspectTypesRequest>>(mut self, v: V) -> Self {
3347 self.0.request = v.into();
3348 self
3349 }
3350
3351 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3353 self.0.options = v.into();
3354 self
3355 }
3356
3357 pub async fn send(self) -> Result<crate::model::ListAspectTypesResponse> {
3359 (*self.0.stub)
3360 .list_aspect_types(self.0.request, self.0.options)
3361 .await
3362 .map(gax::response::Response::into_body)
3363 }
3364
3365 pub fn by_page(
3367 self,
3368 ) -> impl gax::paginator::Paginator<crate::model::ListAspectTypesResponse, gax::error::Error>
3369 {
3370 use std::clone::Clone;
3371 let token = self.0.request.page_token.clone();
3372 let execute = move |token: String| {
3373 let mut builder = self.clone();
3374 builder.0.request = builder.0.request.set_page_token(token);
3375 builder.send()
3376 };
3377 gax::paginator::internal::new_paginator(token, execute)
3378 }
3379
3380 pub fn by_item(
3382 self,
3383 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAspectTypesResponse, gax::error::Error>
3384 {
3385 use gax::paginator::Paginator;
3386 self.by_page().items()
3387 }
3388
3389 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3393 self.0.request.parent = v.into();
3394 self
3395 }
3396
3397 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3399 self.0.request.page_size = v.into();
3400 self
3401 }
3402
3403 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3405 self.0.request.page_token = v.into();
3406 self
3407 }
3408
3409 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3411 self.0.request.filter = v.into();
3412 self
3413 }
3414
3415 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3417 self.0.request.order_by = v.into();
3418 self
3419 }
3420 }
3421
3422 #[doc(hidden)]
3423 impl gax::options::internal::RequestBuilder for ListAspectTypes {
3424 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3425 &mut self.0.options
3426 }
3427 }
3428
3429 #[derive(Clone, Debug)]
3447 pub struct GetAspectType(RequestBuilder<crate::model::GetAspectTypeRequest>);
3448
3449 impl GetAspectType {
3450 pub(crate) fn new(
3451 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3452 ) -> Self {
3453 Self(RequestBuilder::new(stub))
3454 }
3455
3456 pub fn with_request<V: Into<crate::model::GetAspectTypeRequest>>(mut self, v: V) -> Self {
3458 self.0.request = v.into();
3459 self
3460 }
3461
3462 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3464 self.0.options = v.into();
3465 self
3466 }
3467
3468 pub async fn send(self) -> Result<crate::model::AspectType> {
3470 (*self.0.stub)
3471 .get_aspect_type(self.0.request, self.0.options)
3472 .await
3473 .map(gax::response::Response::into_body)
3474 }
3475
3476 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3480 self.0.request.name = v.into();
3481 self
3482 }
3483 }
3484
3485 #[doc(hidden)]
3486 impl gax::options::internal::RequestBuilder for GetAspectType {
3487 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3488 &mut self.0.options
3489 }
3490 }
3491
3492 #[derive(Clone, Debug)]
3511 pub struct CreateEntryGroup(RequestBuilder<crate::model::CreateEntryGroupRequest>);
3512
3513 impl CreateEntryGroup {
3514 pub(crate) fn new(
3515 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3516 ) -> Self {
3517 Self(RequestBuilder::new(stub))
3518 }
3519
3520 pub fn with_request<V: Into<crate::model::CreateEntryGroupRequest>>(
3522 mut self,
3523 v: V,
3524 ) -> Self {
3525 self.0.request = v.into();
3526 self
3527 }
3528
3529 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3531 self.0.options = v.into();
3532 self
3533 }
3534
3535 pub async fn send(self) -> Result<longrunning::model::Operation> {
3542 (*self.0.stub)
3543 .create_entry_group(self.0.request, self.0.options)
3544 .await
3545 .map(gax::response::Response::into_body)
3546 }
3547
3548 pub fn poller(
3550 self,
3551 ) -> impl lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata> {
3552 type Operation =
3553 lro::internal::Operation<crate::model::EntryGroup, crate::model::OperationMetadata>;
3554 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3555 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3556
3557 let stub = self.0.stub.clone();
3558 let mut options = self.0.options.clone();
3559 options.set_retry_policy(gax::retry_policy::NeverRetry);
3560 let query = move |name| {
3561 let stub = stub.clone();
3562 let options = options.clone();
3563 async {
3564 let op = GetOperation::new(stub)
3565 .set_name(name)
3566 .with_options(options)
3567 .send()
3568 .await?;
3569 Ok(Operation::new(op))
3570 }
3571 };
3572
3573 let start = move || async {
3574 let op = self.send().await?;
3575 Ok(Operation::new(op))
3576 };
3577
3578 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3579 }
3580
3581 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3585 self.0.request.parent = v.into();
3586 self
3587 }
3588
3589 pub fn set_entry_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3593 self.0.request.entry_group_id = v.into();
3594 self
3595 }
3596
3597 pub fn set_entry_group<T>(mut self, v: T) -> Self
3601 where
3602 T: std::convert::Into<crate::model::EntryGroup>,
3603 {
3604 self.0.request.entry_group = std::option::Option::Some(v.into());
3605 self
3606 }
3607
3608 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
3612 where
3613 T: std::convert::Into<crate::model::EntryGroup>,
3614 {
3615 self.0.request.entry_group = v.map(|x| x.into());
3616 self
3617 }
3618
3619 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3621 self.0.request.validate_only = v.into();
3622 self
3623 }
3624 }
3625
3626 #[doc(hidden)]
3627 impl gax::options::internal::RequestBuilder for CreateEntryGroup {
3628 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3629 &mut self.0.options
3630 }
3631 }
3632
3633 #[derive(Clone, Debug)]
3652 pub struct UpdateEntryGroup(RequestBuilder<crate::model::UpdateEntryGroupRequest>);
3653
3654 impl UpdateEntryGroup {
3655 pub(crate) fn new(
3656 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3657 ) -> Self {
3658 Self(RequestBuilder::new(stub))
3659 }
3660
3661 pub fn with_request<V: Into<crate::model::UpdateEntryGroupRequest>>(
3663 mut self,
3664 v: V,
3665 ) -> Self {
3666 self.0.request = v.into();
3667 self
3668 }
3669
3670 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3672 self.0.options = v.into();
3673 self
3674 }
3675
3676 pub async fn send(self) -> Result<longrunning::model::Operation> {
3683 (*self.0.stub)
3684 .update_entry_group(self.0.request, self.0.options)
3685 .await
3686 .map(gax::response::Response::into_body)
3687 }
3688
3689 pub fn poller(
3691 self,
3692 ) -> impl lro::Poller<crate::model::EntryGroup, crate::model::OperationMetadata> {
3693 type Operation =
3694 lro::internal::Operation<crate::model::EntryGroup, crate::model::OperationMetadata>;
3695 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3696 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3697
3698 let stub = self.0.stub.clone();
3699 let mut options = self.0.options.clone();
3700 options.set_retry_policy(gax::retry_policy::NeverRetry);
3701 let query = move |name| {
3702 let stub = stub.clone();
3703 let options = options.clone();
3704 async {
3705 let op = GetOperation::new(stub)
3706 .set_name(name)
3707 .with_options(options)
3708 .send()
3709 .await?;
3710 Ok(Operation::new(op))
3711 }
3712 };
3713
3714 let start = move || async {
3715 let op = self.send().await?;
3716 Ok(Operation::new(op))
3717 };
3718
3719 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3720 }
3721
3722 pub fn set_entry_group<T>(mut self, v: T) -> Self
3726 where
3727 T: std::convert::Into<crate::model::EntryGroup>,
3728 {
3729 self.0.request.entry_group = std::option::Option::Some(v.into());
3730 self
3731 }
3732
3733 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
3737 where
3738 T: std::convert::Into<crate::model::EntryGroup>,
3739 {
3740 self.0.request.entry_group = v.map(|x| x.into());
3741 self
3742 }
3743
3744 pub fn set_update_mask<T>(mut self, v: T) -> Self
3748 where
3749 T: std::convert::Into<wkt::FieldMask>,
3750 {
3751 self.0.request.update_mask = std::option::Option::Some(v.into());
3752 self
3753 }
3754
3755 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3759 where
3760 T: std::convert::Into<wkt::FieldMask>,
3761 {
3762 self.0.request.update_mask = v.map(|x| x.into());
3763 self
3764 }
3765
3766 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3768 self.0.request.validate_only = v.into();
3769 self
3770 }
3771 }
3772
3773 #[doc(hidden)]
3774 impl gax::options::internal::RequestBuilder for UpdateEntryGroup {
3775 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3776 &mut self.0.options
3777 }
3778 }
3779
3780 #[derive(Clone, Debug)]
3799 pub struct DeleteEntryGroup(RequestBuilder<crate::model::DeleteEntryGroupRequest>);
3800
3801 impl DeleteEntryGroup {
3802 pub(crate) fn new(
3803 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3804 ) -> Self {
3805 Self(RequestBuilder::new(stub))
3806 }
3807
3808 pub fn with_request<V: Into<crate::model::DeleteEntryGroupRequest>>(
3810 mut self,
3811 v: V,
3812 ) -> Self {
3813 self.0.request = v.into();
3814 self
3815 }
3816
3817 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3819 self.0.options = v.into();
3820 self
3821 }
3822
3823 pub async fn send(self) -> Result<longrunning::model::Operation> {
3830 (*self.0.stub)
3831 .delete_entry_group(self.0.request, self.0.options)
3832 .await
3833 .map(gax::response::Response::into_body)
3834 }
3835
3836 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3838 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3839 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3840 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3841
3842 let stub = self.0.stub.clone();
3843 let mut options = self.0.options.clone();
3844 options.set_retry_policy(gax::retry_policy::NeverRetry);
3845 let query = move |name| {
3846 let stub = stub.clone();
3847 let options = options.clone();
3848 async {
3849 let op = GetOperation::new(stub)
3850 .set_name(name)
3851 .with_options(options)
3852 .send()
3853 .await?;
3854 Ok(Operation::new(op))
3855 }
3856 };
3857
3858 let start = move || async {
3859 let op = self.send().await?;
3860 Ok(Operation::new(op))
3861 };
3862
3863 lro::internal::new_unit_response_poller(
3864 polling_error_policy,
3865 polling_backoff_policy,
3866 start,
3867 query,
3868 )
3869 }
3870
3871 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3875 self.0.request.name = v.into();
3876 self
3877 }
3878
3879 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3881 self.0.request.etag = v.into();
3882 self
3883 }
3884 }
3885
3886 #[doc(hidden)]
3887 impl gax::options::internal::RequestBuilder for DeleteEntryGroup {
3888 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3889 &mut self.0.options
3890 }
3891 }
3892
3893 #[derive(Clone, Debug)]
3915 pub struct ListEntryGroups(RequestBuilder<crate::model::ListEntryGroupsRequest>);
3916
3917 impl ListEntryGroups {
3918 pub(crate) fn new(
3919 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
3920 ) -> Self {
3921 Self(RequestBuilder::new(stub))
3922 }
3923
3924 pub fn with_request<V: Into<crate::model::ListEntryGroupsRequest>>(mut self, v: V) -> Self {
3926 self.0.request = v.into();
3927 self
3928 }
3929
3930 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3932 self.0.options = v.into();
3933 self
3934 }
3935
3936 pub async fn send(self) -> Result<crate::model::ListEntryGroupsResponse> {
3938 (*self.0.stub)
3939 .list_entry_groups(self.0.request, self.0.options)
3940 .await
3941 .map(gax::response::Response::into_body)
3942 }
3943
3944 pub fn by_page(
3946 self,
3947 ) -> impl gax::paginator::Paginator<crate::model::ListEntryGroupsResponse, gax::error::Error>
3948 {
3949 use std::clone::Clone;
3950 let token = self.0.request.page_token.clone();
3951 let execute = move |token: String| {
3952 let mut builder = self.clone();
3953 builder.0.request = builder.0.request.set_page_token(token);
3954 builder.send()
3955 };
3956 gax::paginator::internal::new_paginator(token, execute)
3957 }
3958
3959 pub fn by_item(
3961 self,
3962 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntryGroupsResponse, gax::error::Error>
3963 {
3964 use gax::paginator::Paginator;
3965 self.by_page().items()
3966 }
3967
3968 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3972 self.0.request.parent = v.into();
3973 self
3974 }
3975
3976 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3978 self.0.request.page_size = v.into();
3979 self
3980 }
3981
3982 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3984 self.0.request.page_token = v.into();
3985 self
3986 }
3987
3988 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3990 self.0.request.filter = v.into();
3991 self
3992 }
3993
3994 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3996 self.0.request.order_by = v.into();
3997 self
3998 }
3999 }
4000
4001 #[doc(hidden)]
4002 impl gax::options::internal::RequestBuilder for ListEntryGroups {
4003 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4004 &mut self.0.options
4005 }
4006 }
4007
4008 #[derive(Clone, Debug)]
4026 pub struct GetEntryGroup(RequestBuilder<crate::model::GetEntryGroupRequest>);
4027
4028 impl GetEntryGroup {
4029 pub(crate) fn new(
4030 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4031 ) -> Self {
4032 Self(RequestBuilder::new(stub))
4033 }
4034
4035 pub fn with_request<V: Into<crate::model::GetEntryGroupRequest>>(mut self, v: V) -> Self {
4037 self.0.request = v.into();
4038 self
4039 }
4040
4041 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4043 self.0.options = v.into();
4044 self
4045 }
4046
4047 pub async fn send(self) -> Result<crate::model::EntryGroup> {
4049 (*self.0.stub)
4050 .get_entry_group(self.0.request, self.0.options)
4051 .await
4052 .map(gax::response::Response::into_body)
4053 }
4054
4055 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4059 self.0.request.name = v.into();
4060 self
4061 }
4062 }
4063
4064 #[doc(hidden)]
4065 impl gax::options::internal::RequestBuilder for GetEntryGroup {
4066 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4067 &mut self.0.options
4068 }
4069 }
4070
4071 #[derive(Clone, Debug)]
4089 pub struct CreateEntry(RequestBuilder<crate::model::CreateEntryRequest>);
4090
4091 impl CreateEntry {
4092 pub(crate) fn new(
4093 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4094 ) -> Self {
4095 Self(RequestBuilder::new(stub))
4096 }
4097
4098 pub fn with_request<V: Into<crate::model::CreateEntryRequest>>(mut self, v: V) -> Self {
4100 self.0.request = v.into();
4101 self
4102 }
4103
4104 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4106 self.0.options = v.into();
4107 self
4108 }
4109
4110 pub async fn send(self) -> Result<crate::model::Entry> {
4112 (*self.0.stub)
4113 .create_entry(self.0.request, self.0.options)
4114 .await
4115 .map(gax::response::Response::into_body)
4116 }
4117
4118 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4122 self.0.request.parent = v.into();
4123 self
4124 }
4125
4126 pub fn set_entry_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4130 self.0.request.entry_id = v.into();
4131 self
4132 }
4133
4134 pub fn set_entry<T>(mut self, v: T) -> Self
4138 where
4139 T: std::convert::Into<crate::model::Entry>,
4140 {
4141 self.0.request.entry = std::option::Option::Some(v.into());
4142 self
4143 }
4144
4145 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4149 where
4150 T: std::convert::Into<crate::model::Entry>,
4151 {
4152 self.0.request.entry = v.map(|x| x.into());
4153 self
4154 }
4155 }
4156
4157 #[doc(hidden)]
4158 impl gax::options::internal::RequestBuilder for CreateEntry {
4159 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4160 &mut self.0.options
4161 }
4162 }
4163
4164 #[derive(Clone, Debug)]
4182 pub struct UpdateEntry(RequestBuilder<crate::model::UpdateEntryRequest>);
4183
4184 impl UpdateEntry {
4185 pub(crate) fn new(
4186 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4187 ) -> Self {
4188 Self(RequestBuilder::new(stub))
4189 }
4190
4191 pub fn with_request<V: Into<crate::model::UpdateEntryRequest>>(mut self, v: V) -> Self {
4193 self.0.request = v.into();
4194 self
4195 }
4196
4197 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4199 self.0.options = v.into();
4200 self
4201 }
4202
4203 pub async fn send(self) -> Result<crate::model::Entry> {
4205 (*self.0.stub)
4206 .update_entry(self.0.request, self.0.options)
4207 .await
4208 .map(gax::response::Response::into_body)
4209 }
4210
4211 pub fn set_entry<T>(mut self, v: T) -> Self
4215 where
4216 T: std::convert::Into<crate::model::Entry>,
4217 {
4218 self.0.request.entry = std::option::Option::Some(v.into());
4219 self
4220 }
4221
4222 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
4226 where
4227 T: std::convert::Into<crate::model::Entry>,
4228 {
4229 self.0.request.entry = v.map(|x| x.into());
4230 self
4231 }
4232
4233 pub fn set_update_mask<T>(mut self, v: T) -> Self
4235 where
4236 T: std::convert::Into<wkt::FieldMask>,
4237 {
4238 self.0.request.update_mask = std::option::Option::Some(v.into());
4239 self
4240 }
4241
4242 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4244 where
4245 T: std::convert::Into<wkt::FieldMask>,
4246 {
4247 self.0.request.update_mask = v.map(|x| x.into());
4248 self
4249 }
4250
4251 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
4253 self.0.request.allow_missing = v.into();
4254 self
4255 }
4256
4257 pub fn set_delete_missing_aspects<T: Into<bool>>(mut self, v: T) -> Self {
4259 self.0.request.delete_missing_aspects = v.into();
4260 self
4261 }
4262
4263 pub fn set_aspect_keys<T, V>(mut self, v: T) -> Self
4265 where
4266 T: std::iter::IntoIterator<Item = V>,
4267 V: std::convert::Into<std::string::String>,
4268 {
4269 use std::iter::Iterator;
4270 self.0.request.aspect_keys = v.into_iter().map(|i| i.into()).collect();
4271 self
4272 }
4273 }
4274
4275 #[doc(hidden)]
4276 impl gax::options::internal::RequestBuilder for UpdateEntry {
4277 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4278 &mut self.0.options
4279 }
4280 }
4281
4282 #[derive(Clone, Debug)]
4300 pub struct DeleteEntry(RequestBuilder<crate::model::DeleteEntryRequest>);
4301
4302 impl DeleteEntry {
4303 pub(crate) fn new(
4304 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4305 ) -> Self {
4306 Self(RequestBuilder::new(stub))
4307 }
4308
4309 pub fn with_request<V: Into<crate::model::DeleteEntryRequest>>(mut self, v: V) -> Self {
4311 self.0.request = v.into();
4312 self
4313 }
4314
4315 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4317 self.0.options = v.into();
4318 self
4319 }
4320
4321 pub async fn send(self) -> Result<crate::model::Entry> {
4323 (*self.0.stub)
4324 .delete_entry(self.0.request, self.0.options)
4325 .await
4326 .map(gax::response::Response::into_body)
4327 }
4328
4329 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4333 self.0.request.name = v.into();
4334 self
4335 }
4336 }
4337
4338 #[doc(hidden)]
4339 impl gax::options::internal::RequestBuilder for DeleteEntry {
4340 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4341 &mut self.0.options
4342 }
4343 }
4344
4345 #[derive(Clone, Debug)]
4367 pub struct ListEntries(RequestBuilder<crate::model::ListEntriesRequest>);
4368
4369 impl ListEntries {
4370 pub(crate) fn new(
4371 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4372 ) -> Self {
4373 Self(RequestBuilder::new(stub))
4374 }
4375
4376 pub fn with_request<V: Into<crate::model::ListEntriesRequest>>(mut self, v: V) -> Self {
4378 self.0.request = v.into();
4379 self
4380 }
4381
4382 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4384 self.0.options = v.into();
4385 self
4386 }
4387
4388 pub async fn send(self) -> Result<crate::model::ListEntriesResponse> {
4390 (*self.0.stub)
4391 .list_entries(self.0.request, self.0.options)
4392 .await
4393 .map(gax::response::Response::into_body)
4394 }
4395
4396 pub fn by_page(
4398 self,
4399 ) -> impl gax::paginator::Paginator<crate::model::ListEntriesResponse, gax::error::Error>
4400 {
4401 use std::clone::Clone;
4402 let token = self.0.request.page_token.clone();
4403 let execute = move |token: String| {
4404 let mut builder = self.clone();
4405 builder.0.request = builder.0.request.set_page_token(token);
4406 builder.send()
4407 };
4408 gax::paginator::internal::new_paginator(token, execute)
4409 }
4410
4411 pub fn by_item(
4413 self,
4414 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntriesResponse, gax::error::Error>
4415 {
4416 use gax::paginator::Paginator;
4417 self.by_page().items()
4418 }
4419
4420 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4424 self.0.request.parent = v.into();
4425 self
4426 }
4427
4428 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4430 self.0.request.page_size = v.into();
4431 self
4432 }
4433
4434 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4436 self.0.request.page_token = v.into();
4437 self
4438 }
4439
4440 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4442 self.0.request.filter = v.into();
4443 self
4444 }
4445 }
4446
4447 #[doc(hidden)]
4448 impl gax::options::internal::RequestBuilder for ListEntries {
4449 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4450 &mut self.0.options
4451 }
4452 }
4453
4454 #[derive(Clone, Debug)]
4472 pub struct GetEntry(RequestBuilder<crate::model::GetEntryRequest>);
4473
4474 impl GetEntry {
4475 pub(crate) fn new(
4476 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4477 ) -> Self {
4478 Self(RequestBuilder::new(stub))
4479 }
4480
4481 pub fn with_request<V: Into<crate::model::GetEntryRequest>>(mut self, v: V) -> Self {
4483 self.0.request = v.into();
4484 self
4485 }
4486
4487 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4489 self.0.options = v.into();
4490 self
4491 }
4492
4493 pub async fn send(self) -> Result<crate::model::Entry> {
4495 (*self.0.stub)
4496 .get_entry(self.0.request, self.0.options)
4497 .await
4498 .map(gax::response::Response::into_body)
4499 }
4500
4501 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4505 self.0.request.name = v.into();
4506 self
4507 }
4508
4509 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
4511 self.0.request.view = v.into();
4512 self
4513 }
4514
4515 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
4517 where
4518 T: std::iter::IntoIterator<Item = V>,
4519 V: std::convert::Into<std::string::String>,
4520 {
4521 use std::iter::Iterator;
4522 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
4523 self
4524 }
4525
4526 pub fn set_paths<T, V>(mut self, v: T) -> Self
4528 where
4529 T: std::iter::IntoIterator<Item = V>,
4530 V: std::convert::Into<std::string::String>,
4531 {
4532 use std::iter::Iterator;
4533 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
4534 self
4535 }
4536 }
4537
4538 #[doc(hidden)]
4539 impl gax::options::internal::RequestBuilder for GetEntry {
4540 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4541 &mut self.0.options
4542 }
4543 }
4544
4545 #[derive(Clone, Debug)]
4563 pub struct LookupEntry(RequestBuilder<crate::model::LookupEntryRequest>);
4564
4565 impl LookupEntry {
4566 pub(crate) fn new(
4567 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4568 ) -> Self {
4569 Self(RequestBuilder::new(stub))
4570 }
4571
4572 pub fn with_request<V: Into<crate::model::LookupEntryRequest>>(mut self, v: V) -> Self {
4574 self.0.request = v.into();
4575 self
4576 }
4577
4578 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4580 self.0.options = v.into();
4581 self
4582 }
4583
4584 pub async fn send(self) -> Result<crate::model::Entry> {
4586 (*self.0.stub)
4587 .lookup_entry(self.0.request, self.0.options)
4588 .await
4589 .map(gax::response::Response::into_body)
4590 }
4591
4592 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4596 self.0.request.name = v.into();
4597 self
4598 }
4599
4600 pub fn set_view<T: Into<crate::model::EntryView>>(mut self, v: T) -> Self {
4602 self.0.request.view = v.into();
4603 self
4604 }
4605
4606 pub fn set_aspect_types<T, V>(mut self, v: T) -> Self
4608 where
4609 T: std::iter::IntoIterator<Item = V>,
4610 V: std::convert::Into<std::string::String>,
4611 {
4612 use std::iter::Iterator;
4613 self.0.request.aspect_types = v.into_iter().map(|i| i.into()).collect();
4614 self
4615 }
4616
4617 pub fn set_paths<T, V>(mut self, v: T) -> Self
4619 where
4620 T: std::iter::IntoIterator<Item = V>,
4621 V: std::convert::Into<std::string::String>,
4622 {
4623 use std::iter::Iterator;
4624 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
4625 self
4626 }
4627
4628 pub fn set_entry<T: Into<std::string::String>>(mut self, v: T) -> Self {
4632 self.0.request.entry = v.into();
4633 self
4634 }
4635 }
4636
4637 #[doc(hidden)]
4638 impl gax::options::internal::RequestBuilder for LookupEntry {
4639 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4640 &mut self.0.options
4641 }
4642 }
4643
4644 #[derive(Clone, Debug)]
4666 pub struct SearchEntries(RequestBuilder<crate::model::SearchEntriesRequest>);
4667
4668 impl SearchEntries {
4669 pub(crate) fn new(
4670 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4671 ) -> Self {
4672 Self(RequestBuilder::new(stub))
4673 }
4674
4675 pub fn with_request<V: Into<crate::model::SearchEntriesRequest>>(mut self, v: V) -> Self {
4677 self.0.request = v.into();
4678 self
4679 }
4680
4681 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4683 self.0.options = v.into();
4684 self
4685 }
4686
4687 pub async fn send(self) -> Result<crate::model::SearchEntriesResponse> {
4689 (*self.0.stub)
4690 .search_entries(self.0.request, self.0.options)
4691 .await
4692 .map(gax::response::Response::into_body)
4693 }
4694
4695 pub fn by_page(
4697 self,
4698 ) -> impl gax::paginator::Paginator<crate::model::SearchEntriesResponse, gax::error::Error>
4699 {
4700 use std::clone::Clone;
4701 let token = self.0.request.page_token.clone();
4702 let execute = move |token: String| {
4703 let mut builder = self.clone();
4704 builder.0.request = builder.0.request.set_page_token(token);
4705 builder.send()
4706 };
4707 gax::paginator::internal::new_paginator(token, execute)
4708 }
4709
4710 pub fn by_item(
4712 self,
4713 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchEntriesResponse, gax::error::Error>
4714 {
4715 use gax::paginator::Paginator;
4716 self.by_page().items()
4717 }
4718
4719 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4723 self.0.request.name = v.into();
4724 self
4725 }
4726
4727 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
4731 self.0.request.query = v.into();
4732 self
4733 }
4734
4735 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4737 self.0.request.page_size = v.into();
4738 self
4739 }
4740
4741 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4743 self.0.request.page_token = v.into();
4744 self
4745 }
4746
4747 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4749 self.0.request.order_by = v.into();
4750 self
4751 }
4752
4753 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
4755 self.0.request.scope = v.into();
4756 self
4757 }
4758
4759 pub fn set_semantic_search<T: Into<bool>>(mut self, v: T) -> Self {
4761 self.0.request.semantic_search = v.into();
4762 self
4763 }
4764 }
4765
4766 #[doc(hidden)]
4767 impl gax::options::internal::RequestBuilder for SearchEntries {
4768 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4769 &mut self.0.options
4770 }
4771 }
4772
4773 #[derive(Clone, Debug)]
4792 pub struct CreateMetadataJob(RequestBuilder<crate::model::CreateMetadataJobRequest>);
4793
4794 impl CreateMetadataJob {
4795 pub(crate) fn new(
4796 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4797 ) -> Self {
4798 Self(RequestBuilder::new(stub))
4799 }
4800
4801 pub fn with_request<V: Into<crate::model::CreateMetadataJobRequest>>(
4803 mut self,
4804 v: V,
4805 ) -> Self {
4806 self.0.request = v.into();
4807 self
4808 }
4809
4810 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4812 self.0.options = v.into();
4813 self
4814 }
4815
4816 pub async fn send(self) -> Result<longrunning::model::Operation> {
4823 (*self.0.stub)
4824 .create_metadata_job(self.0.request, self.0.options)
4825 .await
4826 .map(gax::response::Response::into_body)
4827 }
4828
4829 pub fn poller(
4831 self,
4832 ) -> impl lro::Poller<crate::model::MetadataJob, crate::model::OperationMetadata> {
4833 type Operation = lro::internal::Operation<
4834 crate::model::MetadataJob,
4835 crate::model::OperationMetadata,
4836 >;
4837 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4838 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4839
4840 let stub = self.0.stub.clone();
4841 let mut options = self.0.options.clone();
4842 options.set_retry_policy(gax::retry_policy::NeverRetry);
4843 let query = move |name| {
4844 let stub = stub.clone();
4845 let options = options.clone();
4846 async {
4847 let op = GetOperation::new(stub)
4848 .set_name(name)
4849 .with_options(options)
4850 .send()
4851 .await?;
4852 Ok(Operation::new(op))
4853 }
4854 };
4855
4856 let start = move || async {
4857 let op = self.send().await?;
4858 Ok(Operation::new(op))
4859 };
4860
4861 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4862 }
4863
4864 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4868 self.0.request.parent = v.into();
4869 self
4870 }
4871
4872 pub fn set_metadata_job<T>(mut self, v: T) -> Self
4876 where
4877 T: std::convert::Into<crate::model::MetadataJob>,
4878 {
4879 self.0.request.metadata_job = std::option::Option::Some(v.into());
4880 self
4881 }
4882
4883 pub fn set_or_clear_metadata_job<T>(mut self, v: std::option::Option<T>) -> Self
4887 where
4888 T: std::convert::Into<crate::model::MetadataJob>,
4889 {
4890 self.0.request.metadata_job = v.map(|x| x.into());
4891 self
4892 }
4893
4894 pub fn set_metadata_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4896 self.0.request.metadata_job_id = v.into();
4897 self
4898 }
4899
4900 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4902 self.0.request.validate_only = v.into();
4903 self
4904 }
4905 }
4906
4907 #[doc(hidden)]
4908 impl gax::options::internal::RequestBuilder for CreateMetadataJob {
4909 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4910 &mut self.0.options
4911 }
4912 }
4913
4914 #[derive(Clone, Debug)]
4932 pub struct GetMetadataJob(RequestBuilder<crate::model::GetMetadataJobRequest>);
4933
4934 impl GetMetadataJob {
4935 pub(crate) fn new(
4936 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
4937 ) -> Self {
4938 Self(RequestBuilder::new(stub))
4939 }
4940
4941 pub fn with_request<V: Into<crate::model::GetMetadataJobRequest>>(mut self, v: V) -> Self {
4943 self.0.request = v.into();
4944 self
4945 }
4946
4947 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4949 self.0.options = v.into();
4950 self
4951 }
4952
4953 pub async fn send(self) -> Result<crate::model::MetadataJob> {
4955 (*self.0.stub)
4956 .get_metadata_job(self.0.request, self.0.options)
4957 .await
4958 .map(gax::response::Response::into_body)
4959 }
4960
4961 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4965 self.0.request.name = v.into();
4966 self
4967 }
4968 }
4969
4970 #[doc(hidden)]
4971 impl gax::options::internal::RequestBuilder for GetMetadataJob {
4972 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4973 &mut self.0.options
4974 }
4975 }
4976
4977 #[derive(Clone, Debug)]
4999 pub struct ListMetadataJobs(RequestBuilder<crate::model::ListMetadataJobsRequest>);
5000
5001 impl ListMetadataJobs {
5002 pub(crate) fn new(
5003 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5004 ) -> Self {
5005 Self(RequestBuilder::new(stub))
5006 }
5007
5008 pub fn with_request<V: Into<crate::model::ListMetadataJobsRequest>>(
5010 mut self,
5011 v: V,
5012 ) -> Self {
5013 self.0.request = v.into();
5014 self
5015 }
5016
5017 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5019 self.0.options = v.into();
5020 self
5021 }
5022
5023 pub async fn send(self) -> Result<crate::model::ListMetadataJobsResponse> {
5025 (*self.0.stub)
5026 .list_metadata_jobs(self.0.request, self.0.options)
5027 .await
5028 .map(gax::response::Response::into_body)
5029 }
5030
5031 pub fn by_page(
5033 self,
5034 ) -> impl gax::paginator::Paginator<crate::model::ListMetadataJobsResponse, gax::error::Error>
5035 {
5036 use std::clone::Clone;
5037 let token = self.0.request.page_token.clone();
5038 let execute = move |token: String| {
5039 let mut builder = self.clone();
5040 builder.0.request = builder.0.request.set_page_token(token);
5041 builder.send()
5042 };
5043 gax::paginator::internal::new_paginator(token, execute)
5044 }
5045
5046 pub fn by_item(
5048 self,
5049 ) -> impl gax::paginator::ItemPaginator<crate::model::ListMetadataJobsResponse, gax::error::Error>
5050 {
5051 use gax::paginator::Paginator;
5052 self.by_page().items()
5053 }
5054
5055 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5059 self.0.request.parent = v.into();
5060 self
5061 }
5062
5063 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5065 self.0.request.page_size = v.into();
5066 self
5067 }
5068
5069 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5071 self.0.request.page_token = v.into();
5072 self
5073 }
5074
5075 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5077 self.0.request.filter = v.into();
5078 self
5079 }
5080
5081 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5083 self.0.request.order_by = v.into();
5084 self
5085 }
5086 }
5087
5088 #[doc(hidden)]
5089 impl gax::options::internal::RequestBuilder for ListMetadataJobs {
5090 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5091 &mut self.0.options
5092 }
5093 }
5094
5095 #[derive(Clone, Debug)]
5113 pub struct CancelMetadataJob(RequestBuilder<crate::model::CancelMetadataJobRequest>);
5114
5115 impl CancelMetadataJob {
5116 pub(crate) fn new(
5117 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5118 ) -> Self {
5119 Self(RequestBuilder::new(stub))
5120 }
5121
5122 pub fn with_request<V: Into<crate::model::CancelMetadataJobRequest>>(
5124 mut self,
5125 v: V,
5126 ) -> Self {
5127 self.0.request = v.into();
5128 self
5129 }
5130
5131 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5133 self.0.options = v.into();
5134 self
5135 }
5136
5137 pub async fn send(self) -> Result<()> {
5139 (*self.0.stub)
5140 .cancel_metadata_job(self.0.request, self.0.options)
5141 .await
5142 .map(gax::response::Response::into_body)
5143 }
5144
5145 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5149 self.0.request.name = v.into();
5150 self
5151 }
5152 }
5153
5154 #[doc(hidden)]
5155 impl gax::options::internal::RequestBuilder for CancelMetadataJob {
5156 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5157 &mut self.0.options
5158 }
5159 }
5160
5161 #[derive(Clone, Debug)]
5179 pub struct CreateEntryLink(RequestBuilder<crate::model::CreateEntryLinkRequest>);
5180
5181 impl CreateEntryLink {
5182 pub(crate) fn new(
5183 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5184 ) -> Self {
5185 Self(RequestBuilder::new(stub))
5186 }
5187
5188 pub fn with_request<V: Into<crate::model::CreateEntryLinkRequest>>(mut self, v: V) -> Self {
5190 self.0.request = v.into();
5191 self
5192 }
5193
5194 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5196 self.0.options = v.into();
5197 self
5198 }
5199
5200 pub async fn send(self) -> Result<crate::model::EntryLink> {
5202 (*self.0.stub)
5203 .create_entry_link(self.0.request, self.0.options)
5204 .await
5205 .map(gax::response::Response::into_body)
5206 }
5207
5208 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5212 self.0.request.parent = v.into();
5213 self
5214 }
5215
5216 pub fn set_entry_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5220 self.0.request.entry_link_id = v.into();
5221 self
5222 }
5223
5224 pub fn set_entry_link<T>(mut self, v: T) -> Self
5228 where
5229 T: std::convert::Into<crate::model::EntryLink>,
5230 {
5231 self.0.request.entry_link = std::option::Option::Some(v.into());
5232 self
5233 }
5234
5235 pub fn set_or_clear_entry_link<T>(mut self, v: std::option::Option<T>) -> Self
5239 where
5240 T: std::convert::Into<crate::model::EntryLink>,
5241 {
5242 self.0.request.entry_link = v.map(|x| x.into());
5243 self
5244 }
5245 }
5246
5247 #[doc(hidden)]
5248 impl gax::options::internal::RequestBuilder for CreateEntryLink {
5249 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5250 &mut self.0.options
5251 }
5252 }
5253
5254 #[derive(Clone, Debug)]
5272 pub struct DeleteEntryLink(RequestBuilder<crate::model::DeleteEntryLinkRequest>);
5273
5274 impl DeleteEntryLink {
5275 pub(crate) fn new(
5276 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5277 ) -> Self {
5278 Self(RequestBuilder::new(stub))
5279 }
5280
5281 pub fn with_request<V: Into<crate::model::DeleteEntryLinkRequest>>(mut self, v: V) -> Self {
5283 self.0.request = v.into();
5284 self
5285 }
5286
5287 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5289 self.0.options = v.into();
5290 self
5291 }
5292
5293 pub async fn send(self) -> Result<crate::model::EntryLink> {
5295 (*self.0.stub)
5296 .delete_entry_link(self.0.request, self.0.options)
5297 .await
5298 .map(gax::response::Response::into_body)
5299 }
5300
5301 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5305 self.0.request.name = v.into();
5306 self
5307 }
5308 }
5309
5310 #[doc(hidden)]
5311 impl gax::options::internal::RequestBuilder for DeleteEntryLink {
5312 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5313 &mut self.0.options
5314 }
5315 }
5316
5317 #[derive(Clone, Debug)]
5335 pub struct GetEntryLink(RequestBuilder<crate::model::GetEntryLinkRequest>);
5336
5337 impl GetEntryLink {
5338 pub(crate) fn new(
5339 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5340 ) -> Self {
5341 Self(RequestBuilder::new(stub))
5342 }
5343
5344 pub fn with_request<V: Into<crate::model::GetEntryLinkRequest>>(mut self, v: V) -> Self {
5346 self.0.request = v.into();
5347 self
5348 }
5349
5350 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5352 self.0.options = v.into();
5353 self
5354 }
5355
5356 pub async fn send(self) -> Result<crate::model::EntryLink> {
5358 (*self.0.stub)
5359 .get_entry_link(self.0.request, self.0.options)
5360 .await
5361 .map(gax::response::Response::into_body)
5362 }
5363
5364 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5368 self.0.request.name = v.into();
5369 self
5370 }
5371 }
5372
5373 #[doc(hidden)]
5374 impl gax::options::internal::RequestBuilder for GetEntryLink {
5375 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5376 &mut self.0.options
5377 }
5378 }
5379
5380 #[derive(Clone, Debug)]
5402 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5403
5404 impl ListLocations {
5405 pub(crate) fn new(
5406 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5407 ) -> Self {
5408 Self(RequestBuilder::new(stub))
5409 }
5410
5411 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5413 mut self,
5414 v: V,
5415 ) -> Self {
5416 self.0.request = v.into();
5417 self
5418 }
5419
5420 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5422 self.0.options = v.into();
5423 self
5424 }
5425
5426 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5428 (*self.0.stub)
5429 .list_locations(self.0.request, self.0.options)
5430 .await
5431 .map(gax::response::Response::into_body)
5432 }
5433
5434 pub fn by_page(
5436 self,
5437 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5438 {
5439 use std::clone::Clone;
5440 let token = self.0.request.page_token.clone();
5441 let execute = move |token: String| {
5442 let mut builder = self.clone();
5443 builder.0.request = builder.0.request.set_page_token(token);
5444 builder.send()
5445 };
5446 gax::paginator::internal::new_paginator(token, execute)
5447 }
5448
5449 pub fn by_item(
5451 self,
5452 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5453 {
5454 use gax::paginator::Paginator;
5455 self.by_page().items()
5456 }
5457
5458 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5460 self.0.request.name = v.into();
5461 self
5462 }
5463
5464 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5466 self.0.request.filter = v.into();
5467 self
5468 }
5469
5470 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5472 self.0.request.page_size = v.into();
5473 self
5474 }
5475
5476 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5478 self.0.request.page_token = v.into();
5479 self
5480 }
5481 }
5482
5483 #[doc(hidden)]
5484 impl gax::options::internal::RequestBuilder for ListLocations {
5485 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5486 &mut self.0.options
5487 }
5488 }
5489
5490 #[derive(Clone, Debug)]
5508 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5509
5510 impl GetLocation {
5511 pub(crate) fn new(
5512 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5513 ) -> Self {
5514 Self(RequestBuilder::new(stub))
5515 }
5516
5517 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5519 self.0.request = v.into();
5520 self
5521 }
5522
5523 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5525 self.0.options = v.into();
5526 self
5527 }
5528
5529 pub async fn send(self) -> Result<location::model::Location> {
5531 (*self.0.stub)
5532 .get_location(self.0.request, self.0.options)
5533 .await
5534 .map(gax::response::Response::into_body)
5535 }
5536
5537 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5539 self.0.request.name = v.into();
5540 self
5541 }
5542 }
5543
5544 #[doc(hidden)]
5545 impl gax::options::internal::RequestBuilder for GetLocation {
5546 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5547 &mut self.0.options
5548 }
5549 }
5550
5551 #[derive(Clone, Debug)]
5569 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5570
5571 impl SetIamPolicy {
5572 pub(crate) fn new(
5573 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5574 ) -> Self {
5575 Self(RequestBuilder::new(stub))
5576 }
5577
5578 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5580 self.0.request = v.into();
5581 self
5582 }
5583
5584 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5586 self.0.options = v.into();
5587 self
5588 }
5589
5590 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5592 (*self.0.stub)
5593 .set_iam_policy(self.0.request, self.0.options)
5594 .await
5595 .map(gax::response::Response::into_body)
5596 }
5597
5598 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5602 self.0.request.resource = v.into();
5603 self
5604 }
5605
5606 pub fn set_policy<T>(mut self, v: T) -> Self
5610 where
5611 T: std::convert::Into<iam_v1::model::Policy>,
5612 {
5613 self.0.request.policy = std::option::Option::Some(v.into());
5614 self
5615 }
5616
5617 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5621 where
5622 T: std::convert::Into<iam_v1::model::Policy>,
5623 {
5624 self.0.request.policy = v.map(|x| x.into());
5625 self
5626 }
5627
5628 pub fn set_update_mask<T>(mut self, v: T) -> Self
5630 where
5631 T: std::convert::Into<wkt::FieldMask>,
5632 {
5633 self.0.request.update_mask = std::option::Option::Some(v.into());
5634 self
5635 }
5636
5637 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5639 where
5640 T: std::convert::Into<wkt::FieldMask>,
5641 {
5642 self.0.request.update_mask = v.map(|x| x.into());
5643 self
5644 }
5645 }
5646
5647 #[doc(hidden)]
5648 impl gax::options::internal::RequestBuilder for SetIamPolicy {
5649 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5650 &mut self.0.options
5651 }
5652 }
5653
5654 #[derive(Clone, Debug)]
5672 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5673
5674 impl GetIamPolicy {
5675 pub(crate) fn new(
5676 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5677 ) -> Self {
5678 Self(RequestBuilder::new(stub))
5679 }
5680
5681 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5683 self.0.request = v.into();
5684 self
5685 }
5686
5687 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5689 self.0.options = v.into();
5690 self
5691 }
5692
5693 pub async fn send(self) -> Result<iam_v1::model::Policy> {
5695 (*self.0.stub)
5696 .get_iam_policy(self.0.request, self.0.options)
5697 .await
5698 .map(gax::response::Response::into_body)
5699 }
5700
5701 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5705 self.0.request.resource = v.into();
5706 self
5707 }
5708
5709 pub fn set_options<T>(mut self, v: T) -> Self
5711 where
5712 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5713 {
5714 self.0.request.options = std::option::Option::Some(v.into());
5715 self
5716 }
5717
5718 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5720 where
5721 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5722 {
5723 self.0.request.options = v.map(|x| x.into());
5724 self
5725 }
5726 }
5727
5728 #[doc(hidden)]
5729 impl gax::options::internal::RequestBuilder for GetIamPolicy {
5730 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5731 &mut self.0.options
5732 }
5733 }
5734
5735 #[derive(Clone, Debug)]
5753 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5754
5755 impl TestIamPermissions {
5756 pub(crate) fn new(
5757 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5758 ) -> Self {
5759 Self(RequestBuilder::new(stub))
5760 }
5761
5762 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5764 mut self,
5765 v: V,
5766 ) -> Self {
5767 self.0.request = v.into();
5768 self
5769 }
5770
5771 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5773 self.0.options = v.into();
5774 self
5775 }
5776
5777 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5779 (*self.0.stub)
5780 .test_iam_permissions(self.0.request, self.0.options)
5781 .await
5782 .map(gax::response::Response::into_body)
5783 }
5784
5785 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5789 self.0.request.resource = v.into();
5790 self
5791 }
5792
5793 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5797 where
5798 T: std::iter::IntoIterator<Item = V>,
5799 V: std::convert::Into<std::string::String>,
5800 {
5801 use std::iter::Iterator;
5802 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5803 self
5804 }
5805 }
5806
5807 #[doc(hidden)]
5808 impl gax::options::internal::RequestBuilder for TestIamPermissions {
5809 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5810 &mut self.0.options
5811 }
5812 }
5813
5814 #[derive(Clone, Debug)]
5836 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5837
5838 impl ListOperations {
5839 pub(crate) fn new(
5840 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5841 ) -> Self {
5842 Self(RequestBuilder::new(stub))
5843 }
5844
5845 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5847 mut self,
5848 v: V,
5849 ) -> Self {
5850 self.0.request = v.into();
5851 self
5852 }
5853
5854 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5856 self.0.options = v.into();
5857 self
5858 }
5859
5860 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5862 (*self.0.stub)
5863 .list_operations(self.0.request, self.0.options)
5864 .await
5865 .map(gax::response::Response::into_body)
5866 }
5867
5868 pub fn by_page(
5870 self,
5871 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5872 {
5873 use std::clone::Clone;
5874 let token = self.0.request.page_token.clone();
5875 let execute = move |token: String| {
5876 let mut builder = self.clone();
5877 builder.0.request = builder.0.request.set_page_token(token);
5878 builder.send()
5879 };
5880 gax::paginator::internal::new_paginator(token, execute)
5881 }
5882
5883 pub fn by_item(
5885 self,
5886 ) -> impl gax::paginator::ItemPaginator<
5887 longrunning::model::ListOperationsResponse,
5888 gax::error::Error,
5889 > {
5890 use gax::paginator::Paginator;
5891 self.by_page().items()
5892 }
5893
5894 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5896 self.0.request.name = v.into();
5897 self
5898 }
5899
5900 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5902 self.0.request.filter = v.into();
5903 self
5904 }
5905
5906 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5908 self.0.request.page_size = v.into();
5909 self
5910 }
5911
5912 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5914 self.0.request.page_token = v.into();
5915 self
5916 }
5917
5918 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5920 self.0.request.return_partial_success = v.into();
5921 self
5922 }
5923 }
5924
5925 #[doc(hidden)]
5926 impl gax::options::internal::RequestBuilder for ListOperations {
5927 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5928 &mut self.0.options
5929 }
5930 }
5931
5932 #[derive(Clone, Debug)]
5950 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5951
5952 impl GetOperation {
5953 pub(crate) fn new(
5954 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
5955 ) -> Self {
5956 Self(RequestBuilder::new(stub))
5957 }
5958
5959 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5961 mut self,
5962 v: V,
5963 ) -> Self {
5964 self.0.request = v.into();
5965 self
5966 }
5967
5968 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5970 self.0.options = v.into();
5971 self
5972 }
5973
5974 pub async fn send(self) -> Result<longrunning::model::Operation> {
5976 (*self.0.stub)
5977 .get_operation(self.0.request, self.0.options)
5978 .await
5979 .map(gax::response::Response::into_body)
5980 }
5981
5982 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5984 self.0.request.name = v.into();
5985 self
5986 }
5987 }
5988
5989 #[doc(hidden)]
5990 impl gax::options::internal::RequestBuilder for GetOperation {
5991 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5992 &mut self.0.options
5993 }
5994 }
5995
5996 #[derive(Clone, Debug)]
6014 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6015
6016 impl DeleteOperation {
6017 pub(crate) fn new(
6018 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6019 ) -> Self {
6020 Self(RequestBuilder::new(stub))
6021 }
6022
6023 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6025 mut self,
6026 v: V,
6027 ) -> Self {
6028 self.0.request = v.into();
6029 self
6030 }
6031
6032 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6034 self.0.options = v.into();
6035 self
6036 }
6037
6038 pub async fn send(self) -> Result<()> {
6040 (*self.0.stub)
6041 .delete_operation(self.0.request, self.0.options)
6042 .await
6043 .map(gax::response::Response::into_body)
6044 }
6045
6046 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6048 self.0.request.name = v.into();
6049 self
6050 }
6051 }
6052
6053 #[doc(hidden)]
6054 impl gax::options::internal::RequestBuilder for DeleteOperation {
6055 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6056 &mut self.0.options
6057 }
6058 }
6059
6060 #[derive(Clone, Debug)]
6078 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6079
6080 impl CancelOperation {
6081 pub(crate) fn new(
6082 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
6083 ) -> Self {
6084 Self(RequestBuilder::new(stub))
6085 }
6086
6087 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6089 mut self,
6090 v: V,
6091 ) -> Self {
6092 self.0.request = v.into();
6093 self
6094 }
6095
6096 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6098 self.0.options = v.into();
6099 self
6100 }
6101
6102 pub async fn send(self) -> Result<()> {
6104 (*self.0.stub)
6105 .cancel_operation(self.0.request, self.0.options)
6106 .await
6107 .map(gax::response::Response::into_body)
6108 }
6109
6110 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6112 self.0.request.name = v.into();
6113 self
6114 }
6115 }
6116
6117 #[doc(hidden)]
6118 impl gax::options::internal::RequestBuilder for CancelOperation {
6119 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6120 &mut self.0.options
6121 }
6122 }
6123}
6124
6125pub mod cmek_service {
6126 use crate::Result;
6127
6128 pub type ClientBuilder =
6142 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6143
6144 pub(crate) mod client {
6145 use super::super::super::client::CmekService;
6146 pub struct Factory;
6147 impl gax::client_builder::internal::ClientFactory for Factory {
6148 type Client = CmekService;
6149 type Credentials = gaxi::options::Credentials;
6150 async fn build(
6151 self,
6152 config: gaxi::options::ClientConfig,
6153 ) -> gax::client_builder::Result<Self::Client> {
6154 Self::Client::new(config).await
6155 }
6156 }
6157 }
6158
6159 #[derive(Clone, Debug)]
6161 pub(crate) struct RequestBuilder<R: std::default::Default> {
6162 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6163 request: R,
6164 options: gax::options::RequestOptions,
6165 }
6166
6167 impl<R> RequestBuilder<R>
6168 where
6169 R: std::default::Default,
6170 {
6171 pub(crate) fn new(
6172 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6173 ) -> Self {
6174 Self {
6175 stub,
6176 request: R::default(),
6177 options: gax::options::RequestOptions::default(),
6178 }
6179 }
6180 }
6181
6182 #[derive(Clone, Debug)]
6201 pub struct CreateEncryptionConfig(RequestBuilder<crate::model::CreateEncryptionConfigRequest>);
6202
6203 impl CreateEncryptionConfig {
6204 pub(crate) fn new(
6205 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6206 ) -> Self {
6207 Self(RequestBuilder::new(stub))
6208 }
6209
6210 pub fn with_request<V: Into<crate::model::CreateEncryptionConfigRequest>>(
6212 mut self,
6213 v: V,
6214 ) -> Self {
6215 self.0.request = v.into();
6216 self
6217 }
6218
6219 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6221 self.0.options = v.into();
6222 self
6223 }
6224
6225 pub async fn send(self) -> Result<longrunning::model::Operation> {
6232 (*self.0.stub)
6233 .create_encryption_config(self.0.request, self.0.options)
6234 .await
6235 .map(gax::response::Response::into_body)
6236 }
6237
6238 pub fn poller(
6240 self,
6241 ) -> impl lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
6242 {
6243 type Operation = lro::internal::Operation<
6244 crate::model::EncryptionConfig,
6245 crate::model::OperationMetadata,
6246 >;
6247 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6248 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6249
6250 let stub = self.0.stub.clone();
6251 let mut options = self.0.options.clone();
6252 options.set_retry_policy(gax::retry_policy::NeverRetry);
6253 let query = move |name| {
6254 let stub = stub.clone();
6255 let options = options.clone();
6256 async {
6257 let op = GetOperation::new(stub)
6258 .set_name(name)
6259 .with_options(options)
6260 .send()
6261 .await?;
6262 Ok(Operation::new(op))
6263 }
6264 };
6265
6266 let start = move || async {
6267 let op = self.send().await?;
6268 Ok(Operation::new(op))
6269 };
6270
6271 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6272 }
6273
6274 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6278 self.0.request.parent = v.into();
6279 self
6280 }
6281
6282 pub fn set_encryption_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6286 self.0.request.encryption_config_id = v.into();
6287 self
6288 }
6289
6290 pub fn set_encryption_config<T>(mut self, v: T) -> Self
6294 where
6295 T: std::convert::Into<crate::model::EncryptionConfig>,
6296 {
6297 self.0.request.encryption_config = std::option::Option::Some(v.into());
6298 self
6299 }
6300
6301 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
6305 where
6306 T: std::convert::Into<crate::model::EncryptionConfig>,
6307 {
6308 self.0.request.encryption_config = v.map(|x| x.into());
6309 self
6310 }
6311 }
6312
6313 #[doc(hidden)]
6314 impl gax::options::internal::RequestBuilder for CreateEncryptionConfig {
6315 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6316 &mut self.0.options
6317 }
6318 }
6319
6320 #[derive(Clone, Debug)]
6339 pub struct UpdateEncryptionConfig(RequestBuilder<crate::model::UpdateEncryptionConfigRequest>);
6340
6341 impl UpdateEncryptionConfig {
6342 pub(crate) fn new(
6343 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6344 ) -> Self {
6345 Self(RequestBuilder::new(stub))
6346 }
6347
6348 pub fn with_request<V: Into<crate::model::UpdateEncryptionConfigRequest>>(
6350 mut self,
6351 v: V,
6352 ) -> Self {
6353 self.0.request = v.into();
6354 self
6355 }
6356
6357 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6359 self.0.options = v.into();
6360 self
6361 }
6362
6363 pub async fn send(self) -> Result<longrunning::model::Operation> {
6370 (*self.0.stub)
6371 .update_encryption_config(self.0.request, self.0.options)
6372 .await
6373 .map(gax::response::Response::into_body)
6374 }
6375
6376 pub fn poller(
6378 self,
6379 ) -> impl lro::Poller<crate::model::EncryptionConfig, crate::model::OperationMetadata>
6380 {
6381 type Operation = lro::internal::Operation<
6382 crate::model::EncryptionConfig,
6383 crate::model::OperationMetadata,
6384 >;
6385 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6386 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6387
6388 let stub = self.0.stub.clone();
6389 let mut options = self.0.options.clone();
6390 options.set_retry_policy(gax::retry_policy::NeverRetry);
6391 let query = move |name| {
6392 let stub = stub.clone();
6393 let options = options.clone();
6394 async {
6395 let op = GetOperation::new(stub)
6396 .set_name(name)
6397 .with_options(options)
6398 .send()
6399 .await?;
6400 Ok(Operation::new(op))
6401 }
6402 };
6403
6404 let start = move || async {
6405 let op = self.send().await?;
6406 Ok(Operation::new(op))
6407 };
6408
6409 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6410 }
6411
6412 pub fn set_encryption_config<T>(mut self, v: T) -> Self
6416 where
6417 T: std::convert::Into<crate::model::EncryptionConfig>,
6418 {
6419 self.0.request.encryption_config = std::option::Option::Some(v.into());
6420 self
6421 }
6422
6423 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
6427 where
6428 T: std::convert::Into<crate::model::EncryptionConfig>,
6429 {
6430 self.0.request.encryption_config = v.map(|x| x.into());
6431 self
6432 }
6433
6434 pub fn set_update_mask<T>(mut self, v: T) -> Self
6436 where
6437 T: std::convert::Into<wkt::FieldMask>,
6438 {
6439 self.0.request.update_mask = std::option::Option::Some(v.into());
6440 self
6441 }
6442
6443 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6445 where
6446 T: std::convert::Into<wkt::FieldMask>,
6447 {
6448 self.0.request.update_mask = v.map(|x| x.into());
6449 self
6450 }
6451 }
6452
6453 #[doc(hidden)]
6454 impl gax::options::internal::RequestBuilder for UpdateEncryptionConfig {
6455 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6456 &mut self.0.options
6457 }
6458 }
6459
6460 #[derive(Clone, Debug)]
6479 pub struct DeleteEncryptionConfig(RequestBuilder<crate::model::DeleteEncryptionConfigRequest>);
6480
6481 impl DeleteEncryptionConfig {
6482 pub(crate) fn new(
6483 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6484 ) -> Self {
6485 Self(RequestBuilder::new(stub))
6486 }
6487
6488 pub fn with_request<V: Into<crate::model::DeleteEncryptionConfigRequest>>(
6490 mut self,
6491 v: V,
6492 ) -> Self {
6493 self.0.request = v.into();
6494 self
6495 }
6496
6497 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6499 self.0.options = v.into();
6500 self
6501 }
6502
6503 pub async fn send(self) -> Result<longrunning::model::Operation> {
6510 (*self.0.stub)
6511 .delete_encryption_config(self.0.request, self.0.options)
6512 .await
6513 .map(gax::response::Response::into_body)
6514 }
6515
6516 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
6518 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6519 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6520 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6521
6522 let stub = self.0.stub.clone();
6523 let mut options = self.0.options.clone();
6524 options.set_retry_policy(gax::retry_policy::NeverRetry);
6525 let query = move |name| {
6526 let stub = stub.clone();
6527 let options = options.clone();
6528 async {
6529 let op = GetOperation::new(stub)
6530 .set_name(name)
6531 .with_options(options)
6532 .send()
6533 .await?;
6534 Ok(Operation::new(op))
6535 }
6536 };
6537
6538 let start = move || async {
6539 let op = self.send().await?;
6540 Ok(Operation::new(op))
6541 };
6542
6543 lro::internal::new_unit_response_poller(
6544 polling_error_policy,
6545 polling_backoff_policy,
6546 start,
6547 query,
6548 )
6549 }
6550
6551 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6555 self.0.request.name = v.into();
6556 self
6557 }
6558
6559 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6561 self.0.request.etag = v.into();
6562 self
6563 }
6564 }
6565
6566 #[doc(hidden)]
6567 impl gax::options::internal::RequestBuilder for DeleteEncryptionConfig {
6568 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6569 &mut self.0.options
6570 }
6571 }
6572
6573 #[derive(Clone, Debug)]
6595 pub struct ListEncryptionConfigs(RequestBuilder<crate::model::ListEncryptionConfigsRequest>);
6596
6597 impl ListEncryptionConfigs {
6598 pub(crate) fn new(
6599 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6600 ) -> Self {
6601 Self(RequestBuilder::new(stub))
6602 }
6603
6604 pub fn with_request<V: Into<crate::model::ListEncryptionConfigsRequest>>(
6606 mut self,
6607 v: V,
6608 ) -> Self {
6609 self.0.request = v.into();
6610 self
6611 }
6612
6613 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6615 self.0.options = v.into();
6616 self
6617 }
6618
6619 pub async fn send(self) -> Result<crate::model::ListEncryptionConfigsResponse> {
6621 (*self.0.stub)
6622 .list_encryption_configs(self.0.request, self.0.options)
6623 .await
6624 .map(gax::response::Response::into_body)
6625 }
6626
6627 pub fn by_page(
6629 self,
6630 ) -> impl gax::paginator::Paginator<crate::model::ListEncryptionConfigsResponse, gax::error::Error>
6631 {
6632 use std::clone::Clone;
6633 let token = self.0.request.page_token.clone();
6634 let execute = move |token: String| {
6635 let mut builder = self.clone();
6636 builder.0.request = builder.0.request.set_page_token(token);
6637 builder.send()
6638 };
6639 gax::paginator::internal::new_paginator(token, execute)
6640 }
6641
6642 pub fn by_item(
6644 self,
6645 ) -> impl gax::paginator::ItemPaginator<
6646 crate::model::ListEncryptionConfigsResponse,
6647 gax::error::Error,
6648 > {
6649 use gax::paginator::Paginator;
6650 self.by_page().items()
6651 }
6652
6653 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6657 self.0.request.parent = v.into();
6658 self
6659 }
6660
6661 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6663 self.0.request.page_size = v.into();
6664 self
6665 }
6666
6667 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6669 self.0.request.page_token = v.into();
6670 self
6671 }
6672
6673 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6675 self.0.request.filter = v.into();
6676 self
6677 }
6678
6679 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6681 self.0.request.order_by = v.into();
6682 self
6683 }
6684 }
6685
6686 #[doc(hidden)]
6687 impl gax::options::internal::RequestBuilder for ListEncryptionConfigs {
6688 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6689 &mut self.0.options
6690 }
6691 }
6692
6693 #[derive(Clone, Debug)]
6711 pub struct GetEncryptionConfig(RequestBuilder<crate::model::GetEncryptionConfigRequest>);
6712
6713 impl GetEncryptionConfig {
6714 pub(crate) fn new(
6715 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6716 ) -> Self {
6717 Self(RequestBuilder::new(stub))
6718 }
6719
6720 pub fn with_request<V: Into<crate::model::GetEncryptionConfigRequest>>(
6722 mut self,
6723 v: V,
6724 ) -> Self {
6725 self.0.request = v.into();
6726 self
6727 }
6728
6729 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6731 self.0.options = v.into();
6732 self
6733 }
6734
6735 pub async fn send(self) -> Result<crate::model::EncryptionConfig> {
6737 (*self.0.stub)
6738 .get_encryption_config(self.0.request, self.0.options)
6739 .await
6740 .map(gax::response::Response::into_body)
6741 }
6742
6743 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6747 self.0.request.name = v.into();
6748 self
6749 }
6750 }
6751
6752 #[doc(hidden)]
6753 impl gax::options::internal::RequestBuilder for GetEncryptionConfig {
6754 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6755 &mut self.0.options
6756 }
6757 }
6758
6759 #[derive(Clone, Debug)]
6781 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
6782
6783 impl ListLocations {
6784 pub(crate) fn new(
6785 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6786 ) -> Self {
6787 Self(RequestBuilder::new(stub))
6788 }
6789
6790 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
6792 mut self,
6793 v: V,
6794 ) -> Self {
6795 self.0.request = v.into();
6796 self
6797 }
6798
6799 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6801 self.0.options = v.into();
6802 self
6803 }
6804
6805 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
6807 (*self.0.stub)
6808 .list_locations(self.0.request, self.0.options)
6809 .await
6810 .map(gax::response::Response::into_body)
6811 }
6812
6813 pub fn by_page(
6815 self,
6816 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
6817 {
6818 use std::clone::Clone;
6819 let token = self.0.request.page_token.clone();
6820 let execute = move |token: String| {
6821 let mut builder = self.clone();
6822 builder.0.request = builder.0.request.set_page_token(token);
6823 builder.send()
6824 };
6825 gax::paginator::internal::new_paginator(token, execute)
6826 }
6827
6828 pub fn by_item(
6830 self,
6831 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
6832 {
6833 use gax::paginator::Paginator;
6834 self.by_page().items()
6835 }
6836
6837 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6839 self.0.request.name = v.into();
6840 self
6841 }
6842
6843 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6845 self.0.request.filter = v.into();
6846 self
6847 }
6848
6849 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6851 self.0.request.page_size = v.into();
6852 self
6853 }
6854
6855 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6857 self.0.request.page_token = v.into();
6858 self
6859 }
6860 }
6861
6862 #[doc(hidden)]
6863 impl gax::options::internal::RequestBuilder for ListLocations {
6864 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6865 &mut self.0.options
6866 }
6867 }
6868
6869 #[derive(Clone, Debug)]
6887 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
6888
6889 impl GetLocation {
6890 pub(crate) fn new(
6891 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6892 ) -> Self {
6893 Self(RequestBuilder::new(stub))
6894 }
6895
6896 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
6898 self.0.request = v.into();
6899 self
6900 }
6901
6902 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6904 self.0.options = v.into();
6905 self
6906 }
6907
6908 pub async fn send(self) -> Result<location::model::Location> {
6910 (*self.0.stub)
6911 .get_location(self.0.request, self.0.options)
6912 .await
6913 .map(gax::response::Response::into_body)
6914 }
6915
6916 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6918 self.0.request.name = v.into();
6919 self
6920 }
6921 }
6922
6923 #[doc(hidden)]
6924 impl gax::options::internal::RequestBuilder for GetLocation {
6925 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6926 &mut self.0.options
6927 }
6928 }
6929
6930 #[derive(Clone, Debug)]
6948 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
6949
6950 impl SetIamPolicy {
6951 pub(crate) fn new(
6952 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
6953 ) -> Self {
6954 Self(RequestBuilder::new(stub))
6955 }
6956
6957 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
6959 self.0.request = v.into();
6960 self
6961 }
6962
6963 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6965 self.0.options = v.into();
6966 self
6967 }
6968
6969 pub async fn send(self) -> Result<iam_v1::model::Policy> {
6971 (*self.0.stub)
6972 .set_iam_policy(self.0.request, self.0.options)
6973 .await
6974 .map(gax::response::Response::into_body)
6975 }
6976
6977 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6981 self.0.request.resource = v.into();
6982 self
6983 }
6984
6985 pub fn set_policy<T>(mut self, v: T) -> Self
6989 where
6990 T: std::convert::Into<iam_v1::model::Policy>,
6991 {
6992 self.0.request.policy = std::option::Option::Some(v.into());
6993 self
6994 }
6995
6996 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7000 where
7001 T: std::convert::Into<iam_v1::model::Policy>,
7002 {
7003 self.0.request.policy = v.map(|x| x.into());
7004 self
7005 }
7006
7007 pub fn set_update_mask<T>(mut self, v: T) -> Self
7009 where
7010 T: std::convert::Into<wkt::FieldMask>,
7011 {
7012 self.0.request.update_mask = std::option::Option::Some(v.into());
7013 self
7014 }
7015
7016 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7018 where
7019 T: std::convert::Into<wkt::FieldMask>,
7020 {
7021 self.0.request.update_mask = v.map(|x| x.into());
7022 self
7023 }
7024 }
7025
7026 #[doc(hidden)]
7027 impl gax::options::internal::RequestBuilder for SetIamPolicy {
7028 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7029 &mut self.0.options
7030 }
7031 }
7032
7033 #[derive(Clone, Debug)]
7051 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
7052
7053 impl GetIamPolicy {
7054 pub(crate) fn new(
7055 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7056 ) -> Self {
7057 Self(RequestBuilder::new(stub))
7058 }
7059
7060 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
7062 self.0.request = v.into();
7063 self
7064 }
7065
7066 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7068 self.0.options = v.into();
7069 self
7070 }
7071
7072 pub async fn send(self) -> Result<iam_v1::model::Policy> {
7074 (*self.0.stub)
7075 .get_iam_policy(self.0.request, self.0.options)
7076 .await
7077 .map(gax::response::Response::into_body)
7078 }
7079
7080 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7084 self.0.request.resource = v.into();
7085 self
7086 }
7087
7088 pub fn set_options<T>(mut self, v: T) -> Self
7090 where
7091 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7092 {
7093 self.0.request.options = std::option::Option::Some(v.into());
7094 self
7095 }
7096
7097 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7099 where
7100 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7101 {
7102 self.0.request.options = v.map(|x| x.into());
7103 self
7104 }
7105 }
7106
7107 #[doc(hidden)]
7108 impl gax::options::internal::RequestBuilder for GetIamPolicy {
7109 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7110 &mut self.0.options
7111 }
7112 }
7113
7114 #[derive(Clone, Debug)]
7132 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
7133
7134 impl TestIamPermissions {
7135 pub(crate) fn new(
7136 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7137 ) -> Self {
7138 Self(RequestBuilder::new(stub))
7139 }
7140
7141 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
7143 mut self,
7144 v: V,
7145 ) -> Self {
7146 self.0.request = v.into();
7147 self
7148 }
7149
7150 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7152 self.0.options = v.into();
7153 self
7154 }
7155
7156 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
7158 (*self.0.stub)
7159 .test_iam_permissions(self.0.request, self.0.options)
7160 .await
7161 .map(gax::response::Response::into_body)
7162 }
7163
7164 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7168 self.0.request.resource = v.into();
7169 self
7170 }
7171
7172 pub fn set_permissions<T, V>(mut self, v: T) -> Self
7176 where
7177 T: std::iter::IntoIterator<Item = V>,
7178 V: std::convert::Into<std::string::String>,
7179 {
7180 use std::iter::Iterator;
7181 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7182 self
7183 }
7184 }
7185
7186 #[doc(hidden)]
7187 impl gax::options::internal::RequestBuilder for TestIamPermissions {
7188 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7189 &mut self.0.options
7190 }
7191 }
7192
7193 #[derive(Clone, Debug)]
7215 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
7216
7217 impl ListOperations {
7218 pub(crate) fn new(
7219 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7220 ) -> Self {
7221 Self(RequestBuilder::new(stub))
7222 }
7223
7224 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
7226 mut self,
7227 v: V,
7228 ) -> Self {
7229 self.0.request = v.into();
7230 self
7231 }
7232
7233 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7235 self.0.options = v.into();
7236 self
7237 }
7238
7239 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
7241 (*self.0.stub)
7242 .list_operations(self.0.request, self.0.options)
7243 .await
7244 .map(gax::response::Response::into_body)
7245 }
7246
7247 pub fn by_page(
7249 self,
7250 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
7251 {
7252 use std::clone::Clone;
7253 let token = self.0.request.page_token.clone();
7254 let execute = move |token: String| {
7255 let mut builder = self.clone();
7256 builder.0.request = builder.0.request.set_page_token(token);
7257 builder.send()
7258 };
7259 gax::paginator::internal::new_paginator(token, execute)
7260 }
7261
7262 pub fn by_item(
7264 self,
7265 ) -> impl gax::paginator::ItemPaginator<
7266 longrunning::model::ListOperationsResponse,
7267 gax::error::Error,
7268 > {
7269 use gax::paginator::Paginator;
7270 self.by_page().items()
7271 }
7272
7273 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7275 self.0.request.name = v.into();
7276 self
7277 }
7278
7279 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7281 self.0.request.filter = v.into();
7282 self
7283 }
7284
7285 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7287 self.0.request.page_size = v.into();
7288 self
7289 }
7290
7291 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7293 self.0.request.page_token = v.into();
7294 self
7295 }
7296
7297 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7299 self.0.request.return_partial_success = v.into();
7300 self
7301 }
7302 }
7303
7304 #[doc(hidden)]
7305 impl gax::options::internal::RequestBuilder for ListOperations {
7306 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7307 &mut self.0.options
7308 }
7309 }
7310
7311 #[derive(Clone, Debug)]
7329 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7330
7331 impl GetOperation {
7332 pub(crate) fn new(
7333 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7334 ) -> Self {
7335 Self(RequestBuilder::new(stub))
7336 }
7337
7338 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7340 mut self,
7341 v: V,
7342 ) -> Self {
7343 self.0.request = v.into();
7344 self
7345 }
7346
7347 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7349 self.0.options = v.into();
7350 self
7351 }
7352
7353 pub async fn send(self) -> Result<longrunning::model::Operation> {
7355 (*self.0.stub)
7356 .get_operation(self.0.request, self.0.options)
7357 .await
7358 .map(gax::response::Response::into_body)
7359 }
7360
7361 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7363 self.0.request.name = v.into();
7364 self
7365 }
7366 }
7367
7368 #[doc(hidden)]
7369 impl gax::options::internal::RequestBuilder for GetOperation {
7370 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7371 &mut self.0.options
7372 }
7373 }
7374
7375 #[derive(Clone, Debug)]
7393 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
7394
7395 impl DeleteOperation {
7396 pub(crate) fn new(
7397 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7398 ) -> Self {
7399 Self(RequestBuilder::new(stub))
7400 }
7401
7402 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
7404 mut self,
7405 v: V,
7406 ) -> Self {
7407 self.0.request = v.into();
7408 self
7409 }
7410
7411 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7413 self.0.options = v.into();
7414 self
7415 }
7416
7417 pub async fn send(self) -> Result<()> {
7419 (*self.0.stub)
7420 .delete_operation(self.0.request, self.0.options)
7421 .await
7422 .map(gax::response::Response::into_body)
7423 }
7424
7425 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7427 self.0.request.name = v.into();
7428 self
7429 }
7430 }
7431
7432 #[doc(hidden)]
7433 impl gax::options::internal::RequestBuilder for DeleteOperation {
7434 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7435 &mut self.0.options
7436 }
7437 }
7438
7439 #[derive(Clone, Debug)]
7457 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
7458
7459 impl CancelOperation {
7460 pub(crate) fn new(
7461 stub: std::sync::Arc<dyn super::super::stub::dynamic::CmekService>,
7462 ) -> Self {
7463 Self(RequestBuilder::new(stub))
7464 }
7465
7466 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
7468 mut self,
7469 v: V,
7470 ) -> Self {
7471 self.0.request = v.into();
7472 self
7473 }
7474
7475 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7477 self.0.options = v.into();
7478 self
7479 }
7480
7481 pub async fn send(self) -> Result<()> {
7483 (*self.0.stub)
7484 .cancel_operation(self.0.request, self.0.options)
7485 .await
7486 .map(gax::response::Response::into_body)
7487 }
7488
7489 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7491 self.0.request.name = v.into();
7492 self
7493 }
7494 }
7495
7496 #[doc(hidden)]
7497 impl gax::options::internal::RequestBuilder for CancelOperation {
7498 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7499 &mut self.0.options
7500 }
7501 }
7502}
7503
7504pub mod content_service {
7505 use crate::Result;
7506
7507 pub type ClientBuilder =
7521 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7522
7523 pub(crate) mod client {
7524 use super::super::super::client::ContentService;
7525 pub struct Factory;
7526 impl gax::client_builder::internal::ClientFactory for Factory {
7527 type Client = ContentService;
7528 type Credentials = gaxi::options::Credentials;
7529 async fn build(
7530 self,
7531 config: gaxi::options::ClientConfig,
7532 ) -> gax::client_builder::Result<Self::Client> {
7533 Self::Client::new(config).await
7534 }
7535 }
7536 }
7537
7538 #[derive(Clone, Debug)]
7540 pub(crate) struct RequestBuilder<R: std::default::Default> {
7541 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7542 request: R,
7543 options: gax::options::RequestOptions,
7544 }
7545
7546 impl<R> RequestBuilder<R>
7547 where
7548 R: std::default::Default,
7549 {
7550 pub(crate) fn new(
7551 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7552 ) -> Self {
7553 Self {
7554 stub,
7555 request: R::default(),
7556 options: gax::options::RequestOptions::default(),
7557 }
7558 }
7559 }
7560
7561 #[derive(Clone, Debug)]
7579 pub struct CreateContent(RequestBuilder<crate::model::CreateContentRequest>);
7580
7581 impl CreateContent {
7582 pub(crate) fn new(
7583 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7584 ) -> Self {
7585 Self(RequestBuilder::new(stub))
7586 }
7587
7588 pub fn with_request<V: Into<crate::model::CreateContentRequest>>(mut self, v: V) -> Self {
7590 self.0.request = v.into();
7591 self
7592 }
7593
7594 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7596 self.0.options = v.into();
7597 self
7598 }
7599
7600 pub async fn send(self) -> Result<crate::model::Content> {
7602 (*self.0.stub)
7603 .create_content(self.0.request, self.0.options)
7604 .await
7605 .map(gax::response::Response::into_body)
7606 }
7607
7608 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7612 self.0.request.parent = v.into();
7613 self
7614 }
7615
7616 pub fn set_content<T>(mut self, v: T) -> Self
7620 where
7621 T: std::convert::Into<crate::model::Content>,
7622 {
7623 self.0.request.content = std::option::Option::Some(v.into());
7624 self
7625 }
7626
7627 pub fn set_or_clear_content<T>(mut self, v: std::option::Option<T>) -> Self
7631 where
7632 T: std::convert::Into<crate::model::Content>,
7633 {
7634 self.0.request.content = v.map(|x| x.into());
7635 self
7636 }
7637
7638 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
7640 self.0.request.validate_only = v.into();
7641 self
7642 }
7643 }
7644
7645 #[doc(hidden)]
7646 impl gax::options::internal::RequestBuilder for CreateContent {
7647 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7648 &mut self.0.options
7649 }
7650 }
7651
7652 #[derive(Clone, Debug)]
7670 pub struct UpdateContent(RequestBuilder<crate::model::UpdateContentRequest>);
7671
7672 impl UpdateContent {
7673 pub(crate) fn new(
7674 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7675 ) -> Self {
7676 Self(RequestBuilder::new(stub))
7677 }
7678
7679 pub fn with_request<V: Into<crate::model::UpdateContentRequest>>(mut self, v: V) -> Self {
7681 self.0.request = v.into();
7682 self
7683 }
7684
7685 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7687 self.0.options = v.into();
7688 self
7689 }
7690
7691 pub async fn send(self) -> Result<crate::model::Content> {
7693 (*self.0.stub)
7694 .update_content(self.0.request, self.0.options)
7695 .await
7696 .map(gax::response::Response::into_body)
7697 }
7698
7699 pub fn set_update_mask<T>(mut self, v: T) -> Self
7703 where
7704 T: std::convert::Into<wkt::FieldMask>,
7705 {
7706 self.0.request.update_mask = std::option::Option::Some(v.into());
7707 self
7708 }
7709
7710 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7714 where
7715 T: std::convert::Into<wkt::FieldMask>,
7716 {
7717 self.0.request.update_mask = v.map(|x| x.into());
7718 self
7719 }
7720
7721 pub fn set_content<T>(mut self, v: T) -> Self
7725 where
7726 T: std::convert::Into<crate::model::Content>,
7727 {
7728 self.0.request.content = std::option::Option::Some(v.into());
7729 self
7730 }
7731
7732 pub fn set_or_clear_content<T>(mut self, v: std::option::Option<T>) -> Self
7736 where
7737 T: std::convert::Into<crate::model::Content>,
7738 {
7739 self.0.request.content = v.map(|x| x.into());
7740 self
7741 }
7742
7743 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
7745 self.0.request.validate_only = v.into();
7746 self
7747 }
7748 }
7749
7750 #[doc(hidden)]
7751 impl gax::options::internal::RequestBuilder for UpdateContent {
7752 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7753 &mut self.0.options
7754 }
7755 }
7756
7757 #[derive(Clone, Debug)]
7775 pub struct DeleteContent(RequestBuilder<crate::model::DeleteContentRequest>);
7776
7777 impl DeleteContent {
7778 pub(crate) fn new(
7779 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7780 ) -> Self {
7781 Self(RequestBuilder::new(stub))
7782 }
7783
7784 pub fn with_request<V: Into<crate::model::DeleteContentRequest>>(mut self, v: V) -> Self {
7786 self.0.request = v.into();
7787 self
7788 }
7789
7790 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7792 self.0.options = v.into();
7793 self
7794 }
7795
7796 pub async fn send(self) -> Result<()> {
7798 (*self.0.stub)
7799 .delete_content(self.0.request, self.0.options)
7800 .await
7801 .map(gax::response::Response::into_body)
7802 }
7803
7804 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7808 self.0.request.name = v.into();
7809 self
7810 }
7811 }
7812
7813 #[doc(hidden)]
7814 impl gax::options::internal::RequestBuilder for DeleteContent {
7815 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7816 &mut self.0.options
7817 }
7818 }
7819
7820 #[derive(Clone, Debug)]
7838 pub struct GetContent(RequestBuilder<crate::model::GetContentRequest>);
7839
7840 impl GetContent {
7841 pub(crate) fn new(
7842 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7843 ) -> Self {
7844 Self(RequestBuilder::new(stub))
7845 }
7846
7847 pub fn with_request<V: Into<crate::model::GetContentRequest>>(mut self, v: V) -> Self {
7849 self.0.request = v.into();
7850 self
7851 }
7852
7853 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7855 self.0.options = v.into();
7856 self
7857 }
7858
7859 pub async fn send(self) -> Result<crate::model::Content> {
7861 (*self.0.stub)
7862 .get_content(self.0.request, self.0.options)
7863 .await
7864 .map(gax::response::Response::into_body)
7865 }
7866
7867 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7871 self.0.request.name = v.into();
7872 self
7873 }
7874
7875 pub fn set_view<T: Into<crate::model::get_content_request::ContentView>>(
7877 mut self,
7878 v: T,
7879 ) -> Self {
7880 self.0.request.view = v.into();
7881 self
7882 }
7883 }
7884
7885 #[doc(hidden)]
7886 impl gax::options::internal::RequestBuilder for GetContent {
7887 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7888 &mut self.0.options
7889 }
7890 }
7891
7892 #[derive(Clone, Debug)]
7910 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
7911
7912 impl GetIamPolicy {
7913 pub(crate) fn new(
7914 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7915 ) -> Self {
7916 Self(RequestBuilder::new(stub))
7917 }
7918
7919 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
7921 self.0.request = v.into();
7922 self
7923 }
7924
7925 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7927 self.0.options = v.into();
7928 self
7929 }
7930
7931 pub async fn send(self) -> Result<iam_v1::model::Policy> {
7933 (*self.0.stub)
7934 .get_iam_policy(self.0.request, self.0.options)
7935 .await
7936 .map(gax::response::Response::into_body)
7937 }
7938
7939 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7943 self.0.request.resource = v.into();
7944 self
7945 }
7946
7947 pub fn set_options<T>(mut self, v: T) -> Self
7949 where
7950 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7951 {
7952 self.0.request.options = std::option::Option::Some(v.into());
7953 self
7954 }
7955
7956 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7958 where
7959 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7960 {
7961 self.0.request.options = v.map(|x| x.into());
7962 self
7963 }
7964 }
7965
7966 #[doc(hidden)]
7967 impl gax::options::internal::RequestBuilder for GetIamPolicy {
7968 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7969 &mut self.0.options
7970 }
7971 }
7972
7973 #[derive(Clone, Debug)]
7991 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
7992
7993 impl SetIamPolicy {
7994 pub(crate) fn new(
7995 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
7996 ) -> Self {
7997 Self(RequestBuilder::new(stub))
7998 }
7999
8000 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
8002 self.0.request = v.into();
8003 self
8004 }
8005
8006 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8008 self.0.options = v.into();
8009 self
8010 }
8011
8012 pub async fn send(self) -> Result<iam_v1::model::Policy> {
8014 (*self.0.stub)
8015 .set_iam_policy(self.0.request, self.0.options)
8016 .await
8017 .map(gax::response::Response::into_body)
8018 }
8019
8020 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8024 self.0.request.resource = v.into();
8025 self
8026 }
8027
8028 pub fn set_policy<T>(mut self, v: T) -> Self
8032 where
8033 T: std::convert::Into<iam_v1::model::Policy>,
8034 {
8035 self.0.request.policy = std::option::Option::Some(v.into());
8036 self
8037 }
8038
8039 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8043 where
8044 T: std::convert::Into<iam_v1::model::Policy>,
8045 {
8046 self.0.request.policy = v.map(|x| x.into());
8047 self
8048 }
8049
8050 pub fn set_update_mask<T>(mut self, v: T) -> Self
8052 where
8053 T: std::convert::Into<wkt::FieldMask>,
8054 {
8055 self.0.request.update_mask = std::option::Option::Some(v.into());
8056 self
8057 }
8058
8059 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8061 where
8062 T: std::convert::Into<wkt::FieldMask>,
8063 {
8064 self.0.request.update_mask = v.map(|x| x.into());
8065 self
8066 }
8067 }
8068
8069 #[doc(hidden)]
8070 impl gax::options::internal::RequestBuilder for SetIamPolicy {
8071 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8072 &mut self.0.options
8073 }
8074 }
8075
8076 #[derive(Clone, Debug)]
8094 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
8095
8096 impl TestIamPermissions {
8097 pub(crate) fn new(
8098 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8099 ) -> Self {
8100 Self(RequestBuilder::new(stub))
8101 }
8102
8103 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
8105 mut self,
8106 v: V,
8107 ) -> Self {
8108 self.0.request = v.into();
8109 self
8110 }
8111
8112 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8114 self.0.options = v.into();
8115 self
8116 }
8117
8118 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
8120 (*self.0.stub)
8121 .test_iam_permissions(self.0.request, self.0.options)
8122 .await
8123 .map(gax::response::Response::into_body)
8124 }
8125
8126 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8130 self.0.request.resource = v.into();
8131 self
8132 }
8133
8134 pub fn set_permissions<T, V>(mut self, v: T) -> Self
8138 where
8139 T: std::iter::IntoIterator<Item = V>,
8140 V: std::convert::Into<std::string::String>,
8141 {
8142 use std::iter::Iterator;
8143 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8144 self
8145 }
8146 }
8147
8148 #[doc(hidden)]
8149 impl gax::options::internal::RequestBuilder for TestIamPermissions {
8150 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8151 &mut self.0.options
8152 }
8153 }
8154
8155 #[derive(Clone, Debug)]
8177 pub struct ListContent(RequestBuilder<crate::model::ListContentRequest>);
8178
8179 impl ListContent {
8180 pub(crate) fn new(
8181 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8182 ) -> Self {
8183 Self(RequestBuilder::new(stub))
8184 }
8185
8186 pub fn with_request<V: Into<crate::model::ListContentRequest>>(mut self, v: V) -> Self {
8188 self.0.request = v.into();
8189 self
8190 }
8191
8192 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8194 self.0.options = v.into();
8195 self
8196 }
8197
8198 pub async fn send(self) -> Result<crate::model::ListContentResponse> {
8200 (*self.0.stub)
8201 .list_content(self.0.request, self.0.options)
8202 .await
8203 .map(gax::response::Response::into_body)
8204 }
8205
8206 pub fn by_page(
8208 self,
8209 ) -> impl gax::paginator::Paginator<crate::model::ListContentResponse, gax::error::Error>
8210 {
8211 use std::clone::Clone;
8212 let token = self.0.request.page_token.clone();
8213 let execute = move |token: String| {
8214 let mut builder = self.clone();
8215 builder.0.request = builder.0.request.set_page_token(token);
8216 builder.send()
8217 };
8218 gax::paginator::internal::new_paginator(token, execute)
8219 }
8220
8221 pub fn by_item(
8223 self,
8224 ) -> impl gax::paginator::ItemPaginator<crate::model::ListContentResponse, gax::error::Error>
8225 {
8226 use gax::paginator::Paginator;
8227 self.by_page().items()
8228 }
8229
8230 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8234 self.0.request.parent = v.into();
8235 self
8236 }
8237
8238 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8240 self.0.request.page_size = v.into();
8241 self
8242 }
8243
8244 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8246 self.0.request.page_token = v.into();
8247 self
8248 }
8249
8250 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8252 self.0.request.filter = v.into();
8253 self
8254 }
8255 }
8256
8257 #[doc(hidden)]
8258 impl gax::options::internal::RequestBuilder for ListContent {
8259 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8260 &mut self.0.options
8261 }
8262 }
8263
8264 #[derive(Clone, Debug)]
8286 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
8287
8288 impl ListLocations {
8289 pub(crate) fn new(
8290 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8291 ) -> Self {
8292 Self(RequestBuilder::new(stub))
8293 }
8294
8295 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
8297 mut self,
8298 v: V,
8299 ) -> Self {
8300 self.0.request = v.into();
8301 self
8302 }
8303
8304 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8306 self.0.options = v.into();
8307 self
8308 }
8309
8310 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
8312 (*self.0.stub)
8313 .list_locations(self.0.request, self.0.options)
8314 .await
8315 .map(gax::response::Response::into_body)
8316 }
8317
8318 pub fn by_page(
8320 self,
8321 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
8322 {
8323 use std::clone::Clone;
8324 let token = self.0.request.page_token.clone();
8325 let execute = move |token: String| {
8326 let mut builder = self.clone();
8327 builder.0.request = builder.0.request.set_page_token(token);
8328 builder.send()
8329 };
8330 gax::paginator::internal::new_paginator(token, execute)
8331 }
8332
8333 pub fn by_item(
8335 self,
8336 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
8337 {
8338 use gax::paginator::Paginator;
8339 self.by_page().items()
8340 }
8341
8342 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8344 self.0.request.name = v.into();
8345 self
8346 }
8347
8348 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8350 self.0.request.filter = v.into();
8351 self
8352 }
8353
8354 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8356 self.0.request.page_size = v.into();
8357 self
8358 }
8359
8360 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8362 self.0.request.page_token = v.into();
8363 self
8364 }
8365 }
8366
8367 #[doc(hidden)]
8368 impl gax::options::internal::RequestBuilder for ListLocations {
8369 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8370 &mut self.0.options
8371 }
8372 }
8373
8374 #[derive(Clone, Debug)]
8392 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
8393
8394 impl GetLocation {
8395 pub(crate) fn new(
8396 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8397 ) -> Self {
8398 Self(RequestBuilder::new(stub))
8399 }
8400
8401 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
8403 self.0.request = v.into();
8404 self
8405 }
8406
8407 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8409 self.0.options = v.into();
8410 self
8411 }
8412
8413 pub async fn send(self) -> Result<location::model::Location> {
8415 (*self.0.stub)
8416 .get_location(self.0.request, self.0.options)
8417 .await
8418 .map(gax::response::Response::into_body)
8419 }
8420
8421 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8423 self.0.request.name = v.into();
8424 self
8425 }
8426 }
8427
8428 #[doc(hidden)]
8429 impl gax::options::internal::RequestBuilder for GetLocation {
8430 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8431 &mut self.0.options
8432 }
8433 }
8434
8435 #[derive(Clone, Debug)]
8457 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8458
8459 impl ListOperations {
8460 pub(crate) fn new(
8461 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8462 ) -> Self {
8463 Self(RequestBuilder::new(stub))
8464 }
8465
8466 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8468 mut self,
8469 v: V,
8470 ) -> Self {
8471 self.0.request = v.into();
8472 self
8473 }
8474
8475 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8477 self.0.options = v.into();
8478 self
8479 }
8480
8481 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8483 (*self.0.stub)
8484 .list_operations(self.0.request, self.0.options)
8485 .await
8486 .map(gax::response::Response::into_body)
8487 }
8488
8489 pub fn by_page(
8491 self,
8492 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8493 {
8494 use std::clone::Clone;
8495 let token = self.0.request.page_token.clone();
8496 let execute = move |token: String| {
8497 let mut builder = self.clone();
8498 builder.0.request = builder.0.request.set_page_token(token);
8499 builder.send()
8500 };
8501 gax::paginator::internal::new_paginator(token, execute)
8502 }
8503
8504 pub fn by_item(
8506 self,
8507 ) -> impl gax::paginator::ItemPaginator<
8508 longrunning::model::ListOperationsResponse,
8509 gax::error::Error,
8510 > {
8511 use gax::paginator::Paginator;
8512 self.by_page().items()
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 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8523 self.0.request.filter = v.into();
8524 self
8525 }
8526
8527 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8529 self.0.request.page_size = v.into();
8530 self
8531 }
8532
8533 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8535 self.0.request.page_token = v.into();
8536 self
8537 }
8538
8539 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8541 self.0.request.return_partial_success = v.into();
8542 self
8543 }
8544 }
8545
8546 #[doc(hidden)]
8547 impl gax::options::internal::RequestBuilder for ListOperations {
8548 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8549 &mut self.0.options
8550 }
8551 }
8552
8553 #[derive(Clone, Debug)]
8571 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8572
8573 impl GetOperation {
8574 pub(crate) fn new(
8575 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8576 ) -> Self {
8577 Self(RequestBuilder::new(stub))
8578 }
8579
8580 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8582 mut self,
8583 v: V,
8584 ) -> Self {
8585 self.0.request = v.into();
8586 self
8587 }
8588
8589 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8591 self.0.options = v.into();
8592 self
8593 }
8594
8595 pub async fn send(self) -> Result<longrunning::model::Operation> {
8597 (*self.0.stub)
8598 .get_operation(self.0.request, self.0.options)
8599 .await
8600 .map(gax::response::Response::into_body)
8601 }
8602
8603 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8605 self.0.request.name = v.into();
8606 self
8607 }
8608 }
8609
8610 #[doc(hidden)]
8611 impl gax::options::internal::RequestBuilder for GetOperation {
8612 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8613 &mut self.0.options
8614 }
8615 }
8616
8617 #[derive(Clone, Debug)]
8635 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8636
8637 impl DeleteOperation {
8638 pub(crate) fn new(
8639 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8640 ) -> Self {
8641 Self(RequestBuilder::new(stub))
8642 }
8643
8644 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8646 mut self,
8647 v: V,
8648 ) -> Self {
8649 self.0.request = v.into();
8650 self
8651 }
8652
8653 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8655 self.0.options = v.into();
8656 self
8657 }
8658
8659 pub async fn send(self) -> Result<()> {
8661 (*self.0.stub)
8662 .delete_operation(self.0.request, self.0.options)
8663 .await
8664 .map(gax::response::Response::into_body)
8665 }
8666
8667 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8669 self.0.request.name = v.into();
8670 self
8671 }
8672 }
8673
8674 #[doc(hidden)]
8675 impl gax::options::internal::RequestBuilder for DeleteOperation {
8676 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8677 &mut self.0.options
8678 }
8679 }
8680
8681 #[derive(Clone, Debug)]
8699 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8700
8701 impl CancelOperation {
8702 pub(crate) fn new(
8703 stub: std::sync::Arc<dyn super::super::stub::dynamic::ContentService>,
8704 ) -> Self {
8705 Self(RequestBuilder::new(stub))
8706 }
8707
8708 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8710 mut self,
8711 v: V,
8712 ) -> Self {
8713 self.0.request = v.into();
8714 self
8715 }
8716
8717 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8719 self.0.options = v.into();
8720 self
8721 }
8722
8723 pub async fn send(self) -> Result<()> {
8725 (*self.0.stub)
8726 .cancel_operation(self.0.request, self.0.options)
8727 .await
8728 .map(gax::response::Response::into_body)
8729 }
8730
8731 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8733 self.0.request.name = v.into();
8734 self
8735 }
8736 }
8737
8738 #[doc(hidden)]
8739 impl gax::options::internal::RequestBuilder for CancelOperation {
8740 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8741 &mut self.0.options
8742 }
8743 }
8744}
8745
8746pub mod data_taxonomy_service {
8747 use crate::Result;
8748
8749 pub type ClientBuilder =
8763 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8764
8765 pub(crate) mod client {
8766 use super::super::super::client::DataTaxonomyService;
8767 pub struct Factory;
8768 impl gax::client_builder::internal::ClientFactory for Factory {
8769 type Client = DataTaxonomyService;
8770 type Credentials = gaxi::options::Credentials;
8771 async fn build(
8772 self,
8773 config: gaxi::options::ClientConfig,
8774 ) -> gax::client_builder::Result<Self::Client> {
8775 Self::Client::new(config).await
8776 }
8777 }
8778 }
8779
8780 #[derive(Clone, Debug)]
8782 pub(crate) struct RequestBuilder<R: std::default::Default> {
8783 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8784 request: R,
8785 options: gax::options::RequestOptions,
8786 }
8787
8788 impl<R> RequestBuilder<R>
8789 where
8790 R: std::default::Default,
8791 {
8792 pub(crate) fn new(
8793 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8794 ) -> Self {
8795 Self {
8796 stub,
8797 request: R::default(),
8798 options: gax::options::RequestOptions::default(),
8799 }
8800 }
8801 }
8802
8803 #[derive(Clone, Debug)]
8822 pub struct CreateDataTaxonomy(RequestBuilder<crate::model::CreateDataTaxonomyRequest>);
8823
8824 impl CreateDataTaxonomy {
8825 pub(crate) fn new(
8826 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8827 ) -> Self {
8828 Self(RequestBuilder::new(stub))
8829 }
8830
8831 pub fn with_request<V: Into<crate::model::CreateDataTaxonomyRequest>>(
8833 mut self,
8834 v: V,
8835 ) -> Self {
8836 self.0.request = v.into();
8837 self
8838 }
8839
8840 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8842 self.0.options = v.into();
8843 self
8844 }
8845
8846 pub async fn send(self) -> Result<longrunning::model::Operation> {
8853 (*self.0.stub)
8854 .create_data_taxonomy(self.0.request, self.0.options)
8855 .await
8856 .map(gax::response::Response::into_body)
8857 }
8858
8859 pub fn poller(
8861 self,
8862 ) -> impl lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata> {
8863 type Operation = lro::internal::Operation<
8864 crate::model::DataTaxonomy,
8865 crate::model::OperationMetadata,
8866 >;
8867 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8868 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8869
8870 let stub = self.0.stub.clone();
8871 let mut options = self.0.options.clone();
8872 options.set_retry_policy(gax::retry_policy::NeverRetry);
8873 let query = move |name| {
8874 let stub = stub.clone();
8875 let options = options.clone();
8876 async {
8877 let op = GetOperation::new(stub)
8878 .set_name(name)
8879 .with_options(options)
8880 .send()
8881 .await?;
8882 Ok(Operation::new(op))
8883 }
8884 };
8885
8886 let start = move || async {
8887 let op = self.send().await?;
8888 Ok(Operation::new(op))
8889 };
8890
8891 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8892 }
8893
8894 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8898 self.0.request.parent = v.into();
8899 self
8900 }
8901
8902 pub fn set_data_taxonomy_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8906 self.0.request.data_taxonomy_id = v.into();
8907 self
8908 }
8909
8910 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
8914 where
8915 T: std::convert::Into<crate::model::DataTaxonomy>,
8916 {
8917 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
8918 self
8919 }
8920
8921 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
8925 where
8926 T: std::convert::Into<crate::model::DataTaxonomy>,
8927 {
8928 self.0.request.data_taxonomy = v.map(|x| x.into());
8929 self
8930 }
8931
8932 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
8934 self.0.request.validate_only = v.into();
8935 self
8936 }
8937 }
8938
8939 #[doc(hidden)]
8940 impl gax::options::internal::RequestBuilder for CreateDataTaxonomy {
8941 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8942 &mut self.0.options
8943 }
8944 }
8945
8946 #[derive(Clone, Debug)]
8965 pub struct UpdateDataTaxonomy(RequestBuilder<crate::model::UpdateDataTaxonomyRequest>);
8966
8967 impl UpdateDataTaxonomy {
8968 pub(crate) fn new(
8969 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
8970 ) -> Self {
8971 Self(RequestBuilder::new(stub))
8972 }
8973
8974 pub fn with_request<V: Into<crate::model::UpdateDataTaxonomyRequest>>(
8976 mut self,
8977 v: V,
8978 ) -> Self {
8979 self.0.request = v.into();
8980 self
8981 }
8982
8983 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8985 self.0.options = v.into();
8986 self
8987 }
8988
8989 pub async fn send(self) -> Result<longrunning::model::Operation> {
8996 (*self.0.stub)
8997 .update_data_taxonomy(self.0.request, self.0.options)
8998 .await
8999 .map(gax::response::Response::into_body)
9000 }
9001
9002 pub fn poller(
9004 self,
9005 ) -> impl lro::Poller<crate::model::DataTaxonomy, crate::model::OperationMetadata> {
9006 type Operation = lro::internal::Operation<
9007 crate::model::DataTaxonomy,
9008 crate::model::OperationMetadata,
9009 >;
9010 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9011 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9012
9013 let stub = self.0.stub.clone();
9014 let mut options = self.0.options.clone();
9015 options.set_retry_policy(gax::retry_policy::NeverRetry);
9016 let query = move |name| {
9017 let stub = stub.clone();
9018 let options = options.clone();
9019 async {
9020 let op = GetOperation::new(stub)
9021 .set_name(name)
9022 .with_options(options)
9023 .send()
9024 .await?;
9025 Ok(Operation::new(op))
9026 }
9027 };
9028
9029 let start = move || async {
9030 let op = self.send().await?;
9031 Ok(Operation::new(op))
9032 };
9033
9034 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9035 }
9036
9037 pub fn set_update_mask<T>(mut self, v: T) -> Self
9041 where
9042 T: std::convert::Into<wkt::FieldMask>,
9043 {
9044 self.0.request.update_mask = std::option::Option::Some(v.into());
9045 self
9046 }
9047
9048 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9052 where
9053 T: std::convert::Into<wkt::FieldMask>,
9054 {
9055 self.0.request.update_mask = v.map(|x| x.into());
9056 self
9057 }
9058
9059 pub fn set_data_taxonomy<T>(mut self, v: T) -> Self
9063 where
9064 T: std::convert::Into<crate::model::DataTaxonomy>,
9065 {
9066 self.0.request.data_taxonomy = std::option::Option::Some(v.into());
9067 self
9068 }
9069
9070 pub fn set_or_clear_data_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
9074 where
9075 T: std::convert::Into<crate::model::DataTaxonomy>,
9076 {
9077 self.0.request.data_taxonomy = v.map(|x| x.into());
9078 self
9079 }
9080
9081 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9083 self.0.request.validate_only = v.into();
9084 self
9085 }
9086 }
9087
9088 #[doc(hidden)]
9089 impl gax::options::internal::RequestBuilder for UpdateDataTaxonomy {
9090 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9091 &mut self.0.options
9092 }
9093 }
9094
9095 #[derive(Clone, Debug)]
9114 pub struct DeleteDataTaxonomy(RequestBuilder<crate::model::DeleteDataTaxonomyRequest>);
9115
9116 impl DeleteDataTaxonomy {
9117 pub(crate) fn new(
9118 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9119 ) -> Self {
9120 Self(RequestBuilder::new(stub))
9121 }
9122
9123 pub fn with_request<V: Into<crate::model::DeleteDataTaxonomyRequest>>(
9125 mut self,
9126 v: V,
9127 ) -> Self {
9128 self.0.request = v.into();
9129 self
9130 }
9131
9132 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9134 self.0.options = v.into();
9135 self
9136 }
9137
9138 pub async fn send(self) -> Result<longrunning::model::Operation> {
9145 (*self.0.stub)
9146 .delete_data_taxonomy(self.0.request, self.0.options)
9147 .await
9148 .map(gax::response::Response::into_body)
9149 }
9150
9151 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9153 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9154 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9155 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9156
9157 let stub = self.0.stub.clone();
9158 let mut options = self.0.options.clone();
9159 options.set_retry_policy(gax::retry_policy::NeverRetry);
9160 let query = move |name| {
9161 let stub = stub.clone();
9162 let options = options.clone();
9163 async {
9164 let op = GetOperation::new(stub)
9165 .set_name(name)
9166 .with_options(options)
9167 .send()
9168 .await?;
9169 Ok(Operation::new(op))
9170 }
9171 };
9172
9173 let start = move || async {
9174 let op = self.send().await?;
9175 Ok(Operation::new(op))
9176 };
9177
9178 lro::internal::new_unit_response_poller(
9179 polling_error_policy,
9180 polling_backoff_policy,
9181 start,
9182 query,
9183 )
9184 }
9185
9186 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9190 self.0.request.name = v.into();
9191 self
9192 }
9193
9194 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
9196 self.0.request.etag = v.into();
9197 self
9198 }
9199 }
9200
9201 #[doc(hidden)]
9202 impl gax::options::internal::RequestBuilder for DeleteDataTaxonomy {
9203 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9204 &mut self.0.options
9205 }
9206 }
9207
9208 #[derive(Clone, Debug)]
9230 pub struct ListDataTaxonomies(RequestBuilder<crate::model::ListDataTaxonomiesRequest>);
9231
9232 impl ListDataTaxonomies {
9233 pub(crate) fn new(
9234 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9235 ) -> Self {
9236 Self(RequestBuilder::new(stub))
9237 }
9238
9239 pub fn with_request<V: Into<crate::model::ListDataTaxonomiesRequest>>(
9241 mut self,
9242 v: V,
9243 ) -> Self {
9244 self.0.request = v.into();
9245 self
9246 }
9247
9248 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9250 self.0.options = v.into();
9251 self
9252 }
9253
9254 pub async fn send(self) -> Result<crate::model::ListDataTaxonomiesResponse> {
9256 (*self.0.stub)
9257 .list_data_taxonomies(self.0.request, self.0.options)
9258 .await
9259 .map(gax::response::Response::into_body)
9260 }
9261
9262 pub fn by_page(
9264 self,
9265 ) -> impl gax::paginator::Paginator<crate::model::ListDataTaxonomiesResponse, gax::error::Error>
9266 {
9267 use std::clone::Clone;
9268 let token = self.0.request.page_token.clone();
9269 let execute = move |token: String| {
9270 let mut builder = self.clone();
9271 builder.0.request = builder.0.request.set_page_token(token);
9272 builder.send()
9273 };
9274 gax::paginator::internal::new_paginator(token, execute)
9275 }
9276
9277 pub fn by_item(
9279 self,
9280 ) -> impl gax::paginator::ItemPaginator<
9281 crate::model::ListDataTaxonomiesResponse,
9282 gax::error::Error,
9283 > {
9284 use gax::paginator::Paginator;
9285 self.by_page().items()
9286 }
9287
9288 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9292 self.0.request.parent = v.into();
9293 self
9294 }
9295
9296 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9298 self.0.request.page_size = v.into();
9299 self
9300 }
9301
9302 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9304 self.0.request.page_token = v.into();
9305 self
9306 }
9307
9308 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9310 self.0.request.filter = v.into();
9311 self
9312 }
9313
9314 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9316 self.0.request.order_by = v.into();
9317 self
9318 }
9319 }
9320
9321 #[doc(hidden)]
9322 impl gax::options::internal::RequestBuilder for ListDataTaxonomies {
9323 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9324 &mut self.0.options
9325 }
9326 }
9327
9328 #[derive(Clone, Debug)]
9346 pub struct GetDataTaxonomy(RequestBuilder<crate::model::GetDataTaxonomyRequest>);
9347
9348 impl GetDataTaxonomy {
9349 pub(crate) fn new(
9350 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9351 ) -> Self {
9352 Self(RequestBuilder::new(stub))
9353 }
9354
9355 pub fn with_request<V: Into<crate::model::GetDataTaxonomyRequest>>(mut self, v: V) -> Self {
9357 self.0.request = v.into();
9358 self
9359 }
9360
9361 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9363 self.0.options = v.into();
9364 self
9365 }
9366
9367 pub async fn send(self) -> Result<crate::model::DataTaxonomy> {
9369 (*self.0.stub)
9370 .get_data_taxonomy(self.0.request, self.0.options)
9371 .await
9372 .map(gax::response::Response::into_body)
9373 }
9374
9375 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9379 self.0.request.name = v.into();
9380 self
9381 }
9382 }
9383
9384 #[doc(hidden)]
9385 impl gax::options::internal::RequestBuilder for GetDataTaxonomy {
9386 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9387 &mut self.0.options
9388 }
9389 }
9390
9391 #[derive(Clone, Debug)]
9410 pub struct CreateDataAttributeBinding(
9411 RequestBuilder<crate::model::CreateDataAttributeBindingRequest>,
9412 );
9413
9414 impl CreateDataAttributeBinding {
9415 pub(crate) fn new(
9416 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9417 ) -> Self {
9418 Self(RequestBuilder::new(stub))
9419 }
9420
9421 pub fn with_request<V: Into<crate::model::CreateDataAttributeBindingRequest>>(
9423 mut self,
9424 v: V,
9425 ) -> Self {
9426 self.0.request = v.into();
9427 self
9428 }
9429
9430 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9432 self.0.options = v.into();
9433 self
9434 }
9435
9436 pub async fn send(self) -> Result<longrunning::model::Operation> {
9443 (*self.0.stub)
9444 .create_data_attribute_binding(self.0.request, self.0.options)
9445 .await
9446 .map(gax::response::Response::into_body)
9447 }
9448
9449 pub fn poller(
9451 self,
9452 ) -> impl lro::Poller<crate::model::DataAttributeBinding, crate::model::OperationMetadata>
9453 {
9454 type Operation = lro::internal::Operation<
9455 crate::model::DataAttributeBinding,
9456 crate::model::OperationMetadata,
9457 >;
9458 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9459 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9460
9461 let stub = self.0.stub.clone();
9462 let mut options = self.0.options.clone();
9463 options.set_retry_policy(gax::retry_policy::NeverRetry);
9464 let query = move |name| {
9465 let stub = stub.clone();
9466 let options = options.clone();
9467 async {
9468 let op = GetOperation::new(stub)
9469 .set_name(name)
9470 .with_options(options)
9471 .send()
9472 .await?;
9473 Ok(Operation::new(op))
9474 }
9475 };
9476
9477 let start = move || async {
9478 let op = self.send().await?;
9479 Ok(Operation::new(op))
9480 };
9481
9482 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9483 }
9484
9485 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9489 self.0.request.parent = v.into();
9490 self
9491 }
9492
9493 pub fn set_data_attribute_binding_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9497 self.0.request.data_attribute_binding_id = v.into();
9498 self
9499 }
9500
9501 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
9505 where
9506 T: std::convert::Into<crate::model::DataAttributeBinding>,
9507 {
9508 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
9509 self
9510 }
9511
9512 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
9516 where
9517 T: std::convert::Into<crate::model::DataAttributeBinding>,
9518 {
9519 self.0.request.data_attribute_binding = v.map(|x| x.into());
9520 self
9521 }
9522
9523 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9525 self.0.request.validate_only = v.into();
9526 self
9527 }
9528 }
9529
9530 #[doc(hidden)]
9531 impl gax::options::internal::RequestBuilder for CreateDataAttributeBinding {
9532 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9533 &mut self.0.options
9534 }
9535 }
9536
9537 #[derive(Clone, Debug)]
9556 pub struct UpdateDataAttributeBinding(
9557 RequestBuilder<crate::model::UpdateDataAttributeBindingRequest>,
9558 );
9559
9560 impl UpdateDataAttributeBinding {
9561 pub(crate) fn new(
9562 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9563 ) -> Self {
9564 Self(RequestBuilder::new(stub))
9565 }
9566
9567 pub fn with_request<V: Into<crate::model::UpdateDataAttributeBindingRequest>>(
9569 mut self,
9570 v: V,
9571 ) -> Self {
9572 self.0.request = v.into();
9573 self
9574 }
9575
9576 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9578 self.0.options = v.into();
9579 self
9580 }
9581
9582 pub async fn send(self) -> Result<longrunning::model::Operation> {
9589 (*self.0.stub)
9590 .update_data_attribute_binding(self.0.request, self.0.options)
9591 .await
9592 .map(gax::response::Response::into_body)
9593 }
9594
9595 pub fn poller(
9597 self,
9598 ) -> impl lro::Poller<crate::model::DataAttributeBinding, crate::model::OperationMetadata>
9599 {
9600 type Operation = lro::internal::Operation<
9601 crate::model::DataAttributeBinding,
9602 crate::model::OperationMetadata,
9603 >;
9604 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9605 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9606
9607 let stub = self.0.stub.clone();
9608 let mut options = self.0.options.clone();
9609 options.set_retry_policy(gax::retry_policy::NeverRetry);
9610 let query = move |name| {
9611 let stub = stub.clone();
9612 let options = options.clone();
9613 async {
9614 let op = GetOperation::new(stub)
9615 .set_name(name)
9616 .with_options(options)
9617 .send()
9618 .await?;
9619 Ok(Operation::new(op))
9620 }
9621 };
9622
9623 let start = move || async {
9624 let op = self.send().await?;
9625 Ok(Operation::new(op))
9626 };
9627
9628 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9629 }
9630
9631 pub fn set_update_mask<T>(mut self, v: T) -> Self
9635 where
9636 T: std::convert::Into<wkt::FieldMask>,
9637 {
9638 self.0.request.update_mask = std::option::Option::Some(v.into());
9639 self
9640 }
9641
9642 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9646 where
9647 T: std::convert::Into<wkt::FieldMask>,
9648 {
9649 self.0.request.update_mask = v.map(|x| x.into());
9650 self
9651 }
9652
9653 pub fn set_data_attribute_binding<T>(mut self, v: T) -> Self
9657 where
9658 T: std::convert::Into<crate::model::DataAttributeBinding>,
9659 {
9660 self.0.request.data_attribute_binding = std::option::Option::Some(v.into());
9661 self
9662 }
9663
9664 pub fn set_or_clear_data_attribute_binding<T>(mut self, v: std::option::Option<T>) -> Self
9668 where
9669 T: std::convert::Into<crate::model::DataAttributeBinding>,
9670 {
9671 self.0.request.data_attribute_binding = v.map(|x| x.into());
9672 self
9673 }
9674
9675 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
9677 self.0.request.validate_only = v.into();
9678 self
9679 }
9680 }
9681
9682 #[doc(hidden)]
9683 impl gax::options::internal::RequestBuilder for UpdateDataAttributeBinding {
9684 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9685 &mut self.0.options
9686 }
9687 }
9688
9689 #[derive(Clone, Debug)]
9708 pub struct DeleteDataAttributeBinding(
9709 RequestBuilder<crate::model::DeleteDataAttributeBindingRequest>,
9710 );
9711
9712 impl DeleteDataAttributeBinding {
9713 pub(crate) fn new(
9714 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9715 ) -> Self {
9716 Self(RequestBuilder::new(stub))
9717 }
9718
9719 pub fn with_request<V: Into<crate::model::DeleteDataAttributeBindingRequest>>(
9721 mut self,
9722 v: V,
9723 ) -> Self {
9724 self.0.request = v.into();
9725 self
9726 }
9727
9728 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9730 self.0.options = v.into();
9731 self
9732 }
9733
9734 pub async fn send(self) -> Result<longrunning::model::Operation> {
9741 (*self.0.stub)
9742 .delete_data_attribute_binding(self.0.request, self.0.options)
9743 .await
9744 .map(gax::response::Response::into_body)
9745 }
9746
9747 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9749 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9750 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9751 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9752
9753 let stub = self.0.stub.clone();
9754 let mut options = self.0.options.clone();
9755 options.set_retry_policy(gax::retry_policy::NeverRetry);
9756 let query = move |name| {
9757 let stub = stub.clone();
9758 let options = options.clone();
9759 async {
9760 let op = GetOperation::new(stub)
9761 .set_name(name)
9762 .with_options(options)
9763 .send()
9764 .await?;
9765 Ok(Operation::new(op))
9766 }
9767 };
9768
9769 let start = move || async {
9770 let op = self.send().await?;
9771 Ok(Operation::new(op))
9772 };
9773
9774 lro::internal::new_unit_response_poller(
9775 polling_error_policy,
9776 polling_backoff_policy,
9777 start,
9778 query,
9779 )
9780 }
9781
9782 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9786 self.0.request.name = v.into();
9787 self
9788 }
9789
9790 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
9794 self.0.request.etag = v.into();
9795 self
9796 }
9797 }
9798
9799 #[doc(hidden)]
9800 impl gax::options::internal::RequestBuilder for DeleteDataAttributeBinding {
9801 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9802 &mut self.0.options
9803 }
9804 }
9805
9806 #[derive(Clone, Debug)]
9828 pub struct ListDataAttributeBindings(
9829 RequestBuilder<crate::model::ListDataAttributeBindingsRequest>,
9830 );
9831
9832 impl ListDataAttributeBindings {
9833 pub(crate) fn new(
9834 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9835 ) -> Self {
9836 Self(RequestBuilder::new(stub))
9837 }
9838
9839 pub fn with_request<V: Into<crate::model::ListDataAttributeBindingsRequest>>(
9841 mut self,
9842 v: V,
9843 ) -> Self {
9844 self.0.request = v.into();
9845 self
9846 }
9847
9848 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9850 self.0.options = v.into();
9851 self
9852 }
9853
9854 pub async fn send(self) -> Result<crate::model::ListDataAttributeBindingsResponse> {
9856 (*self.0.stub)
9857 .list_data_attribute_bindings(self.0.request, self.0.options)
9858 .await
9859 .map(gax::response::Response::into_body)
9860 }
9861
9862 pub fn by_page(
9864 self,
9865 ) -> impl gax::paginator::Paginator<
9866 crate::model::ListDataAttributeBindingsResponse,
9867 gax::error::Error,
9868 > {
9869 use std::clone::Clone;
9870 let token = self.0.request.page_token.clone();
9871 let execute = move |token: String| {
9872 let mut builder = self.clone();
9873 builder.0.request = builder.0.request.set_page_token(token);
9874 builder.send()
9875 };
9876 gax::paginator::internal::new_paginator(token, execute)
9877 }
9878
9879 pub fn by_item(
9881 self,
9882 ) -> impl gax::paginator::ItemPaginator<
9883 crate::model::ListDataAttributeBindingsResponse,
9884 gax::error::Error,
9885 > {
9886 use gax::paginator::Paginator;
9887 self.by_page().items()
9888 }
9889
9890 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9894 self.0.request.parent = v.into();
9895 self
9896 }
9897
9898 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9900 self.0.request.page_size = v.into();
9901 self
9902 }
9903
9904 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9906 self.0.request.page_token = v.into();
9907 self
9908 }
9909
9910 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9912 self.0.request.filter = v.into();
9913 self
9914 }
9915
9916 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9918 self.0.request.order_by = v.into();
9919 self
9920 }
9921 }
9922
9923 #[doc(hidden)]
9924 impl gax::options::internal::RequestBuilder for ListDataAttributeBindings {
9925 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9926 &mut self.0.options
9927 }
9928 }
9929
9930 #[derive(Clone, Debug)]
9948 pub struct GetDataAttributeBinding(
9949 RequestBuilder<crate::model::GetDataAttributeBindingRequest>,
9950 );
9951
9952 impl GetDataAttributeBinding {
9953 pub(crate) fn new(
9954 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
9955 ) -> Self {
9956 Self(RequestBuilder::new(stub))
9957 }
9958
9959 pub fn with_request<V: Into<crate::model::GetDataAttributeBindingRequest>>(
9961 mut self,
9962 v: V,
9963 ) -> Self {
9964 self.0.request = v.into();
9965 self
9966 }
9967
9968 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9970 self.0.options = v.into();
9971 self
9972 }
9973
9974 pub async fn send(self) -> Result<crate::model::DataAttributeBinding> {
9976 (*self.0.stub)
9977 .get_data_attribute_binding(self.0.request, self.0.options)
9978 .await
9979 .map(gax::response::Response::into_body)
9980 }
9981
9982 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9986 self.0.request.name = v.into();
9987 self
9988 }
9989 }
9990
9991 #[doc(hidden)]
9992 impl gax::options::internal::RequestBuilder for GetDataAttributeBinding {
9993 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9994 &mut self.0.options
9995 }
9996 }
9997
9998 #[derive(Clone, Debug)]
10017 pub struct CreateDataAttribute(RequestBuilder<crate::model::CreateDataAttributeRequest>);
10018
10019 impl CreateDataAttribute {
10020 pub(crate) fn new(
10021 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10022 ) -> Self {
10023 Self(RequestBuilder::new(stub))
10024 }
10025
10026 pub fn with_request<V: Into<crate::model::CreateDataAttributeRequest>>(
10028 mut self,
10029 v: V,
10030 ) -> Self {
10031 self.0.request = v.into();
10032 self
10033 }
10034
10035 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10037 self.0.options = v.into();
10038 self
10039 }
10040
10041 pub async fn send(self) -> Result<longrunning::model::Operation> {
10048 (*self.0.stub)
10049 .create_data_attribute(self.0.request, self.0.options)
10050 .await
10051 .map(gax::response::Response::into_body)
10052 }
10053
10054 pub fn poller(
10056 self,
10057 ) -> impl lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
10058 {
10059 type Operation = lro::internal::Operation<
10060 crate::model::DataAttribute,
10061 crate::model::OperationMetadata,
10062 >;
10063 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10064 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10065
10066 let stub = self.0.stub.clone();
10067 let mut options = self.0.options.clone();
10068 options.set_retry_policy(gax::retry_policy::NeverRetry);
10069 let query = move |name| {
10070 let stub = stub.clone();
10071 let options = options.clone();
10072 async {
10073 let op = GetOperation::new(stub)
10074 .set_name(name)
10075 .with_options(options)
10076 .send()
10077 .await?;
10078 Ok(Operation::new(op))
10079 }
10080 };
10081
10082 let start = move || async {
10083 let op = self.send().await?;
10084 Ok(Operation::new(op))
10085 };
10086
10087 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10088 }
10089
10090 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10094 self.0.request.parent = v.into();
10095 self
10096 }
10097
10098 pub fn set_data_attribute_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10102 self.0.request.data_attribute_id = v.into();
10103 self
10104 }
10105
10106 pub fn set_data_attribute<T>(mut self, v: T) -> Self
10110 where
10111 T: std::convert::Into<crate::model::DataAttribute>,
10112 {
10113 self.0.request.data_attribute = std::option::Option::Some(v.into());
10114 self
10115 }
10116
10117 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
10121 where
10122 T: std::convert::Into<crate::model::DataAttribute>,
10123 {
10124 self.0.request.data_attribute = v.map(|x| x.into());
10125 self
10126 }
10127
10128 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10130 self.0.request.validate_only = v.into();
10131 self
10132 }
10133 }
10134
10135 #[doc(hidden)]
10136 impl gax::options::internal::RequestBuilder for CreateDataAttribute {
10137 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10138 &mut self.0.options
10139 }
10140 }
10141
10142 #[derive(Clone, Debug)]
10161 pub struct UpdateDataAttribute(RequestBuilder<crate::model::UpdateDataAttributeRequest>);
10162
10163 impl UpdateDataAttribute {
10164 pub(crate) fn new(
10165 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10166 ) -> Self {
10167 Self(RequestBuilder::new(stub))
10168 }
10169
10170 pub fn with_request<V: Into<crate::model::UpdateDataAttributeRequest>>(
10172 mut self,
10173 v: V,
10174 ) -> Self {
10175 self.0.request = v.into();
10176 self
10177 }
10178
10179 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10181 self.0.options = v.into();
10182 self
10183 }
10184
10185 pub async fn send(self) -> Result<longrunning::model::Operation> {
10192 (*self.0.stub)
10193 .update_data_attribute(self.0.request, self.0.options)
10194 .await
10195 .map(gax::response::Response::into_body)
10196 }
10197
10198 pub fn poller(
10200 self,
10201 ) -> impl lro::Poller<crate::model::DataAttribute, crate::model::OperationMetadata>
10202 {
10203 type Operation = lro::internal::Operation<
10204 crate::model::DataAttribute,
10205 crate::model::OperationMetadata,
10206 >;
10207 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10208 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10209
10210 let stub = self.0.stub.clone();
10211 let mut options = self.0.options.clone();
10212 options.set_retry_policy(gax::retry_policy::NeverRetry);
10213 let query = move |name| {
10214 let stub = stub.clone();
10215 let options = options.clone();
10216 async {
10217 let op = GetOperation::new(stub)
10218 .set_name(name)
10219 .with_options(options)
10220 .send()
10221 .await?;
10222 Ok(Operation::new(op))
10223 }
10224 };
10225
10226 let start = move || async {
10227 let op = self.send().await?;
10228 Ok(Operation::new(op))
10229 };
10230
10231 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10232 }
10233
10234 pub fn set_update_mask<T>(mut self, v: T) -> Self
10238 where
10239 T: std::convert::Into<wkt::FieldMask>,
10240 {
10241 self.0.request.update_mask = std::option::Option::Some(v.into());
10242 self
10243 }
10244
10245 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10249 where
10250 T: std::convert::Into<wkt::FieldMask>,
10251 {
10252 self.0.request.update_mask = v.map(|x| x.into());
10253 self
10254 }
10255
10256 pub fn set_data_attribute<T>(mut self, v: T) -> Self
10260 where
10261 T: std::convert::Into<crate::model::DataAttribute>,
10262 {
10263 self.0.request.data_attribute = std::option::Option::Some(v.into());
10264 self
10265 }
10266
10267 pub fn set_or_clear_data_attribute<T>(mut self, v: std::option::Option<T>) -> Self
10271 where
10272 T: std::convert::Into<crate::model::DataAttribute>,
10273 {
10274 self.0.request.data_attribute = v.map(|x| x.into());
10275 self
10276 }
10277
10278 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
10280 self.0.request.validate_only = v.into();
10281 self
10282 }
10283 }
10284
10285 #[doc(hidden)]
10286 impl gax::options::internal::RequestBuilder for UpdateDataAttribute {
10287 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10288 &mut self.0.options
10289 }
10290 }
10291
10292 #[derive(Clone, Debug)]
10311 pub struct DeleteDataAttribute(RequestBuilder<crate::model::DeleteDataAttributeRequest>);
10312
10313 impl DeleteDataAttribute {
10314 pub(crate) fn new(
10315 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10316 ) -> Self {
10317 Self(RequestBuilder::new(stub))
10318 }
10319
10320 pub fn with_request<V: Into<crate::model::DeleteDataAttributeRequest>>(
10322 mut self,
10323 v: V,
10324 ) -> Self {
10325 self.0.request = v.into();
10326 self
10327 }
10328
10329 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10331 self.0.options = v.into();
10332 self
10333 }
10334
10335 pub async fn send(self) -> Result<longrunning::model::Operation> {
10342 (*self.0.stub)
10343 .delete_data_attribute(self.0.request, self.0.options)
10344 .await
10345 .map(gax::response::Response::into_body)
10346 }
10347
10348 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
10350 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10351 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10352 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10353
10354 let stub = self.0.stub.clone();
10355 let mut options = self.0.options.clone();
10356 options.set_retry_policy(gax::retry_policy::NeverRetry);
10357 let query = move |name| {
10358 let stub = stub.clone();
10359 let options = options.clone();
10360 async {
10361 let op = GetOperation::new(stub)
10362 .set_name(name)
10363 .with_options(options)
10364 .send()
10365 .await?;
10366 Ok(Operation::new(op))
10367 }
10368 };
10369
10370 let start = move || async {
10371 let op = self.send().await?;
10372 Ok(Operation::new(op))
10373 };
10374
10375 lro::internal::new_unit_response_poller(
10376 polling_error_policy,
10377 polling_backoff_policy,
10378 start,
10379 query,
10380 )
10381 }
10382
10383 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10387 self.0.request.name = v.into();
10388 self
10389 }
10390
10391 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
10393 self.0.request.etag = v.into();
10394 self
10395 }
10396 }
10397
10398 #[doc(hidden)]
10399 impl gax::options::internal::RequestBuilder for DeleteDataAttribute {
10400 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10401 &mut self.0.options
10402 }
10403 }
10404
10405 #[derive(Clone, Debug)]
10427 pub struct ListDataAttributes(RequestBuilder<crate::model::ListDataAttributesRequest>);
10428
10429 impl ListDataAttributes {
10430 pub(crate) fn new(
10431 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10432 ) -> Self {
10433 Self(RequestBuilder::new(stub))
10434 }
10435
10436 pub fn with_request<V: Into<crate::model::ListDataAttributesRequest>>(
10438 mut self,
10439 v: V,
10440 ) -> Self {
10441 self.0.request = v.into();
10442 self
10443 }
10444
10445 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10447 self.0.options = v.into();
10448 self
10449 }
10450
10451 pub async fn send(self) -> Result<crate::model::ListDataAttributesResponse> {
10453 (*self.0.stub)
10454 .list_data_attributes(self.0.request, self.0.options)
10455 .await
10456 .map(gax::response::Response::into_body)
10457 }
10458
10459 pub fn by_page(
10461 self,
10462 ) -> impl gax::paginator::Paginator<crate::model::ListDataAttributesResponse, gax::error::Error>
10463 {
10464 use std::clone::Clone;
10465 let token = self.0.request.page_token.clone();
10466 let execute = move |token: String| {
10467 let mut builder = self.clone();
10468 builder.0.request = builder.0.request.set_page_token(token);
10469 builder.send()
10470 };
10471 gax::paginator::internal::new_paginator(token, execute)
10472 }
10473
10474 pub fn by_item(
10476 self,
10477 ) -> impl gax::paginator::ItemPaginator<
10478 crate::model::ListDataAttributesResponse,
10479 gax::error::Error,
10480 > {
10481 use gax::paginator::Paginator;
10482 self.by_page().items()
10483 }
10484
10485 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10489 self.0.request.parent = v.into();
10490 self
10491 }
10492
10493 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10495 self.0.request.page_size = v.into();
10496 self
10497 }
10498
10499 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10501 self.0.request.page_token = v.into();
10502 self
10503 }
10504
10505 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10507 self.0.request.filter = v.into();
10508 self
10509 }
10510
10511 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10513 self.0.request.order_by = v.into();
10514 self
10515 }
10516 }
10517
10518 #[doc(hidden)]
10519 impl gax::options::internal::RequestBuilder for ListDataAttributes {
10520 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10521 &mut self.0.options
10522 }
10523 }
10524
10525 #[derive(Clone, Debug)]
10543 pub struct GetDataAttribute(RequestBuilder<crate::model::GetDataAttributeRequest>);
10544
10545 impl GetDataAttribute {
10546 pub(crate) fn new(
10547 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10548 ) -> Self {
10549 Self(RequestBuilder::new(stub))
10550 }
10551
10552 pub fn with_request<V: Into<crate::model::GetDataAttributeRequest>>(
10554 mut self,
10555 v: V,
10556 ) -> Self {
10557 self.0.request = v.into();
10558 self
10559 }
10560
10561 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10563 self.0.options = v.into();
10564 self
10565 }
10566
10567 pub async fn send(self) -> Result<crate::model::DataAttribute> {
10569 (*self.0.stub)
10570 .get_data_attribute(self.0.request, self.0.options)
10571 .await
10572 .map(gax::response::Response::into_body)
10573 }
10574
10575 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10579 self.0.request.name = v.into();
10580 self
10581 }
10582 }
10583
10584 #[doc(hidden)]
10585 impl gax::options::internal::RequestBuilder for GetDataAttribute {
10586 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10587 &mut self.0.options
10588 }
10589 }
10590
10591 #[derive(Clone, Debug)]
10613 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
10614
10615 impl ListLocations {
10616 pub(crate) fn new(
10617 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10618 ) -> Self {
10619 Self(RequestBuilder::new(stub))
10620 }
10621
10622 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
10624 mut self,
10625 v: V,
10626 ) -> Self {
10627 self.0.request = v.into();
10628 self
10629 }
10630
10631 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10633 self.0.options = v.into();
10634 self
10635 }
10636
10637 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
10639 (*self.0.stub)
10640 .list_locations(self.0.request, self.0.options)
10641 .await
10642 .map(gax::response::Response::into_body)
10643 }
10644
10645 pub fn by_page(
10647 self,
10648 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
10649 {
10650 use std::clone::Clone;
10651 let token = self.0.request.page_token.clone();
10652 let execute = move |token: String| {
10653 let mut builder = self.clone();
10654 builder.0.request = builder.0.request.set_page_token(token);
10655 builder.send()
10656 };
10657 gax::paginator::internal::new_paginator(token, execute)
10658 }
10659
10660 pub fn by_item(
10662 self,
10663 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
10664 {
10665 use gax::paginator::Paginator;
10666 self.by_page().items()
10667 }
10668
10669 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10671 self.0.request.name = v.into();
10672 self
10673 }
10674
10675 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10677 self.0.request.filter = v.into();
10678 self
10679 }
10680
10681 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10683 self.0.request.page_size = v.into();
10684 self
10685 }
10686
10687 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10689 self.0.request.page_token = v.into();
10690 self
10691 }
10692 }
10693
10694 #[doc(hidden)]
10695 impl gax::options::internal::RequestBuilder for ListLocations {
10696 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10697 &mut self.0.options
10698 }
10699 }
10700
10701 #[derive(Clone, Debug)]
10719 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10720
10721 impl GetLocation {
10722 pub(crate) fn new(
10723 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10724 ) -> Self {
10725 Self(RequestBuilder::new(stub))
10726 }
10727
10728 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10730 self.0.request = v.into();
10731 self
10732 }
10733
10734 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10736 self.0.options = v.into();
10737 self
10738 }
10739
10740 pub async fn send(self) -> Result<location::model::Location> {
10742 (*self.0.stub)
10743 .get_location(self.0.request, self.0.options)
10744 .await
10745 .map(gax::response::Response::into_body)
10746 }
10747
10748 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10750 self.0.request.name = v.into();
10751 self
10752 }
10753 }
10754
10755 #[doc(hidden)]
10756 impl gax::options::internal::RequestBuilder for GetLocation {
10757 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10758 &mut self.0.options
10759 }
10760 }
10761
10762 #[derive(Clone, Debug)]
10780 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
10781
10782 impl SetIamPolicy {
10783 pub(crate) fn new(
10784 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10785 ) -> Self {
10786 Self(RequestBuilder::new(stub))
10787 }
10788
10789 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
10791 self.0.request = v.into();
10792 self
10793 }
10794
10795 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10797 self.0.options = v.into();
10798 self
10799 }
10800
10801 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10803 (*self.0.stub)
10804 .set_iam_policy(self.0.request, self.0.options)
10805 .await
10806 .map(gax::response::Response::into_body)
10807 }
10808
10809 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10813 self.0.request.resource = v.into();
10814 self
10815 }
10816
10817 pub fn set_policy<T>(mut self, v: T) -> Self
10821 where
10822 T: std::convert::Into<iam_v1::model::Policy>,
10823 {
10824 self.0.request.policy = std::option::Option::Some(v.into());
10825 self
10826 }
10827
10828 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10832 where
10833 T: std::convert::Into<iam_v1::model::Policy>,
10834 {
10835 self.0.request.policy = v.map(|x| x.into());
10836 self
10837 }
10838
10839 pub fn set_update_mask<T>(mut self, v: T) -> Self
10841 where
10842 T: std::convert::Into<wkt::FieldMask>,
10843 {
10844 self.0.request.update_mask = std::option::Option::Some(v.into());
10845 self
10846 }
10847
10848 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10850 where
10851 T: std::convert::Into<wkt::FieldMask>,
10852 {
10853 self.0.request.update_mask = v.map(|x| x.into());
10854 self
10855 }
10856 }
10857
10858 #[doc(hidden)]
10859 impl gax::options::internal::RequestBuilder for SetIamPolicy {
10860 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10861 &mut self.0.options
10862 }
10863 }
10864
10865 #[derive(Clone, Debug)]
10883 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
10884
10885 impl GetIamPolicy {
10886 pub(crate) fn new(
10887 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10888 ) -> Self {
10889 Self(RequestBuilder::new(stub))
10890 }
10891
10892 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
10894 self.0.request = v.into();
10895 self
10896 }
10897
10898 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10900 self.0.options = v.into();
10901 self
10902 }
10903
10904 pub async fn send(self) -> Result<iam_v1::model::Policy> {
10906 (*self.0.stub)
10907 .get_iam_policy(self.0.request, self.0.options)
10908 .await
10909 .map(gax::response::Response::into_body)
10910 }
10911
10912 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10916 self.0.request.resource = v.into();
10917 self
10918 }
10919
10920 pub fn set_options<T>(mut self, v: T) -> Self
10922 where
10923 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10924 {
10925 self.0.request.options = std::option::Option::Some(v.into());
10926 self
10927 }
10928
10929 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10931 where
10932 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10933 {
10934 self.0.request.options = v.map(|x| x.into());
10935 self
10936 }
10937 }
10938
10939 #[doc(hidden)]
10940 impl gax::options::internal::RequestBuilder for GetIamPolicy {
10941 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10942 &mut self.0.options
10943 }
10944 }
10945
10946 #[derive(Clone, Debug)]
10964 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
10965
10966 impl TestIamPermissions {
10967 pub(crate) fn new(
10968 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
10969 ) -> Self {
10970 Self(RequestBuilder::new(stub))
10971 }
10972
10973 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
10975 mut self,
10976 v: V,
10977 ) -> Self {
10978 self.0.request = v.into();
10979 self
10980 }
10981
10982 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10984 self.0.options = v.into();
10985 self
10986 }
10987
10988 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
10990 (*self.0.stub)
10991 .test_iam_permissions(self.0.request, self.0.options)
10992 .await
10993 .map(gax::response::Response::into_body)
10994 }
10995
10996 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11000 self.0.request.resource = v.into();
11001 self
11002 }
11003
11004 pub fn set_permissions<T, V>(mut self, v: T) -> Self
11008 where
11009 T: std::iter::IntoIterator<Item = V>,
11010 V: std::convert::Into<std::string::String>,
11011 {
11012 use std::iter::Iterator;
11013 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11014 self
11015 }
11016 }
11017
11018 #[doc(hidden)]
11019 impl gax::options::internal::RequestBuilder for TestIamPermissions {
11020 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11021 &mut self.0.options
11022 }
11023 }
11024
11025 #[derive(Clone, Debug)]
11047 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
11048
11049 impl ListOperations {
11050 pub(crate) fn new(
11051 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11052 ) -> Self {
11053 Self(RequestBuilder::new(stub))
11054 }
11055
11056 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
11058 mut self,
11059 v: V,
11060 ) -> Self {
11061 self.0.request = v.into();
11062 self
11063 }
11064
11065 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11067 self.0.options = v.into();
11068 self
11069 }
11070
11071 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
11073 (*self.0.stub)
11074 .list_operations(self.0.request, self.0.options)
11075 .await
11076 .map(gax::response::Response::into_body)
11077 }
11078
11079 pub fn by_page(
11081 self,
11082 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
11083 {
11084 use std::clone::Clone;
11085 let token = self.0.request.page_token.clone();
11086 let execute = move |token: String| {
11087 let mut builder = self.clone();
11088 builder.0.request = builder.0.request.set_page_token(token);
11089 builder.send()
11090 };
11091 gax::paginator::internal::new_paginator(token, execute)
11092 }
11093
11094 pub fn by_item(
11096 self,
11097 ) -> impl gax::paginator::ItemPaginator<
11098 longrunning::model::ListOperationsResponse,
11099 gax::error::Error,
11100 > {
11101 use gax::paginator::Paginator;
11102 self.by_page().items()
11103 }
11104
11105 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11107 self.0.request.name = v.into();
11108 self
11109 }
11110
11111 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11113 self.0.request.filter = v.into();
11114 self
11115 }
11116
11117 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11119 self.0.request.page_size = v.into();
11120 self
11121 }
11122
11123 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11125 self.0.request.page_token = v.into();
11126 self
11127 }
11128
11129 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11131 self.0.request.return_partial_success = v.into();
11132 self
11133 }
11134 }
11135
11136 #[doc(hidden)]
11137 impl gax::options::internal::RequestBuilder for ListOperations {
11138 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11139 &mut self.0.options
11140 }
11141 }
11142
11143 #[derive(Clone, Debug)]
11161 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
11162
11163 impl GetOperation {
11164 pub(crate) fn new(
11165 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11166 ) -> Self {
11167 Self(RequestBuilder::new(stub))
11168 }
11169
11170 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
11172 mut self,
11173 v: V,
11174 ) -> Self {
11175 self.0.request = v.into();
11176 self
11177 }
11178
11179 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11181 self.0.options = v.into();
11182 self
11183 }
11184
11185 pub async fn send(self) -> Result<longrunning::model::Operation> {
11187 (*self.0.stub)
11188 .get_operation(self.0.request, self.0.options)
11189 .await
11190 .map(gax::response::Response::into_body)
11191 }
11192
11193 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11195 self.0.request.name = v.into();
11196 self
11197 }
11198 }
11199
11200 #[doc(hidden)]
11201 impl gax::options::internal::RequestBuilder for GetOperation {
11202 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11203 &mut self.0.options
11204 }
11205 }
11206
11207 #[derive(Clone, Debug)]
11225 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
11226
11227 impl DeleteOperation {
11228 pub(crate) fn new(
11229 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11230 ) -> Self {
11231 Self(RequestBuilder::new(stub))
11232 }
11233
11234 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
11236 mut self,
11237 v: V,
11238 ) -> Self {
11239 self.0.request = v.into();
11240 self
11241 }
11242
11243 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11245 self.0.options = v.into();
11246 self
11247 }
11248
11249 pub async fn send(self) -> Result<()> {
11251 (*self.0.stub)
11252 .delete_operation(self.0.request, self.0.options)
11253 .await
11254 .map(gax::response::Response::into_body)
11255 }
11256
11257 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11259 self.0.request.name = v.into();
11260 self
11261 }
11262 }
11263
11264 #[doc(hidden)]
11265 impl gax::options::internal::RequestBuilder for DeleteOperation {
11266 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11267 &mut self.0.options
11268 }
11269 }
11270
11271 #[derive(Clone, Debug)]
11289 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11290
11291 impl CancelOperation {
11292 pub(crate) fn new(
11293 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTaxonomyService>,
11294 ) -> Self {
11295 Self(RequestBuilder::new(stub))
11296 }
11297
11298 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11300 mut self,
11301 v: V,
11302 ) -> Self {
11303 self.0.request = v.into();
11304 self
11305 }
11306
11307 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11309 self.0.options = v.into();
11310 self
11311 }
11312
11313 pub async fn send(self) -> Result<()> {
11315 (*self.0.stub)
11316 .cancel_operation(self.0.request, self.0.options)
11317 .await
11318 .map(gax::response::Response::into_body)
11319 }
11320
11321 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11323 self.0.request.name = v.into();
11324 self
11325 }
11326 }
11327
11328 #[doc(hidden)]
11329 impl gax::options::internal::RequestBuilder for CancelOperation {
11330 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11331 &mut self.0.options
11332 }
11333 }
11334}
11335
11336pub mod data_scan_service {
11337 use crate::Result;
11338
11339 pub type ClientBuilder =
11353 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11354
11355 pub(crate) mod client {
11356 use super::super::super::client::DataScanService;
11357 pub struct Factory;
11358 impl gax::client_builder::internal::ClientFactory for Factory {
11359 type Client = DataScanService;
11360 type Credentials = gaxi::options::Credentials;
11361 async fn build(
11362 self,
11363 config: gaxi::options::ClientConfig,
11364 ) -> gax::client_builder::Result<Self::Client> {
11365 Self::Client::new(config).await
11366 }
11367 }
11368 }
11369
11370 #[derive(Clone, Debug)]
11372 pub(crate) struct RequestBuilder<R: std::default::Default> {
11373 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11374 request: R,
11375 options: gax::options::RequestOptions,
11376 }
11377
11378 impl<R> RequestBuilder<R>
11379 where
11380 R: std::default::Default,
11381 {
11382 pub(crate) fn new(
11383 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11384 ) -> Self {
11385 Self {
11386 stub,
11387 request: R::default(),
11388 options: gax::options::RequestOptions::default(),
11389 }
11390 }
11391 }
11392
11393 #[derive(Clone, Debug)]
11412 pub struct CreateDataScan(RequestBuilder<crate::model::CreateDataScanRequest>);
11413
11414 impl CreateDataScan {
11415 pub(crate) fn new(
11416 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11417 ) -> Self {
11418 Self(RequestBuilder::new(stub))
11419 }
11420
11421 pub fn with_request<V: Into<crate::model::CreateDataScanRequest>>(mut self, v: V) -> Self {
11423 self.0.request = v.into();
11424 self
11425 }
11426
11427 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11429 self.0.options = v.into();
11430 self
11431 }
11432
11433 pub async fn send(self) -> Result<longrunning::model::Operation> {
11440 (*self.0.stub)
11441 .create_data_scan(self.0.request, self.0.options)
11442 .await
11443 .map(gax::response::Response::into_body)
11444 }
11445
11446 pub fn poller(
11448 self,
11449 ) -> impl lro::Poller<crate::model::DataScan, crate::model::OperationMetadata> {
11450 type Operation =
11451 lro::internal::Operation<crate::model::DataScan, crate::model::OperationMetadata>;
11452 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11453 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11454
11455 let stub = self.0.stub.clone();
11456 let mut options = self.0.options.clone();
11457 options.set_retry_policy(gax::retry_policy::NeverRetry);
11458 let query = move |name| {
11459 let stub = stub.clone();
11460 let options = options.clone();
11461 async {
11462 let op = GetOperation::new(stub)
11463 .set_name(name)
11464 .with_options(options)
11465 .send()
11466 .await?;
11467 Ok(Operation::new(op))
11468 }
11469 };
11470
11471 let start = move || async {
11472 let op = self.send().await?;
11473 Ok(Operation::new(op))
11474 };
11475
11476 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
11477 }
11478
11479 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11483 self.0.request.parent = v.into();
11484 self
11485 }
11486
11487 pub fn set_data_scan<T>(mut self, v: T) -> Self
11491 where
11492 T: std::convert::Into<crate::model::DataScan>,
11493 {
11494 self.0.request.data_scan = std::option::Option::Some(v.into());
11495 self
11496 }
11497
11498 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
11502 where
11503 T: std::convert::Into<crate::model::DataScan>,
11504 {
11505 self.0.request.data_scan = v.map(|x| x.into());
11506 self
11507 }
11508
11509 pub fn set_data_scan_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
11513 self.0.request.data_scan_id = v.into();
11514 self
11515 }
11516
11517 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11519 self.0.request.validate_only = v.into();
11520 self
11521 }
11522 }
11523
11524 #[doc(hidden)]
11525 impl gax::options::internal::RequestBuilder for CreateDataScan {
11526 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11527 &mut self.0.options
11528 }
11529 }
11530
11531 #[derive(Clone, Debug)]
11550 pub struct UpdateDataScan(RequestBuilder<crate::model::UpdateDataScanRequest>);
11551
11552 impl UpdateDataScan {
11553 pub(crate) fn new(
11554 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11555 ) -> Self {
11556 Self(RequestBuilder::new(stub))
11557 }
11558
11559 pub fn with_request<V: Into<crate::model::UpdateDataScanRequest>>(mut self, v: V) -> Self {
11561 self.0.request = v.into();
11562 self
11563 }
11564
11565 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11567 self.0.options = v.into();
11568 self
11569 }
11570
11571 pub async fn send(self) -> Result<longrunning::model::Operation> {
11578 (*self.0.stub)
11579 .update_data_scan(self.0.request, self.0.options)
11580 .await
11581 .map(gax::response::Response::into_body)
11582 }
11583
11584 pub fn poller(
11586 self,
11587 ) -> impl lro::Poller<crate::model::DataScan, crate::model::OperationMetadata> {
11588 type Operation =
11589 lro::internal::Operation<crate::model::DataScan, crate::model::OperationMetadata>;
11590 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11591 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11592
11593 let stub = self.0.stub.clone();
11594 let mut options = self.0.options.clone();
11595 options.set_retry_policy(gax::retry_policy::NeverRetry);
11596 let query = move |name| {
11597 let stub = stub.clone();
11598 let options = options.clone();
11599 async {
11600 let op = GetOperation::new(stub)
11601 .set_name(name)
11602 .with_options(options)
11603 .send()
11604 .await?;
11605 Ok(Operation::new(op))
11606 }
11607 };
11608
11609 let start = move || async {
11610 let op = self.send().await?;
11611 Ok(Operation::new(op))
11612 };
11613
11614 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
11615 }
11616
11617 pub fn set_data_scan<T>(mut self, v: T) -> Self
11621 where
11622 T: std::convert::Into<crate::model::DataScan>,
11623 {
11624 self.0.request.data_scan = std::option::Option::Some(v.into());
11625 self
11626 }
11627
11628 pub fn set_or_clear_data_scan<T>(mut self, v: std::option::Option<T>) -> Self
11632 where
11633 T: std::convert::Into<crate::model::DataScan>,
11634 {
11635 self.0.request.data_scan = v.map(|x| x.into());
11636 self
11637 }
11638
11639 pub fn set_update_mask<T>(mut self, v: T) -> Self
11641 where
11642 T: std::convert::Into<wkt::FieldMask>,
11643 {
11644 self.0.request.update_mask = std::option::Option::Some(v.into());
11645 self
11646 }
11647
11648 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11650 where
11651 T: std::convert::Into<wkt::FieldMask>,
11652 {
11653 self.0.request.update_mask = v.map(|x| x.into());
11654 self
11655 }
11656
11657 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
11659 self.0.request.validate_only = v.into();
11660 self
11661 }
11662 }
11663
11664 #[doc(hidden)]
11665 impl gax::options::internal::RequestBuilder for UpdateDataScan {
11666 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11667 &mut self.0.options
11668 }
11669 }
11670
11671 #[derive(Clone, Debug)]
11690 pub struct DeleteDataScan(RequestBuilder<crate::model::DeleteDataScanRequest>);
11691
11692 impl DeleteDataScan {
11693 pub(crate) fn new(
11694 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11695 ) -> Self {
11696 Self(RequestBuilder::new(stub))
11697 }
11698
11699 pub fn with_request<V: Into<crate::model::DeleteDataScanRequest>>(mut self, v: V) -> Self {
11701 self.0.request = v.into();
11702 self
11703 }
11704
11705 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11707 self.0.options = v.into();
11708 self
11709 }
11710
11711 pub async fn send(self) -> Result<longrunning::model::Operation> {
11718 (*self.0.stub)
11719 .delete_data_scan(self.0.request, self.0.options)
11720 .await
11721 .map(gax::response::Response::into_body)
11722 }
11723
11724 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
11726 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
11727 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11728 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11729
11730 let stub = self.0.stub.clone();
11731 let mut options = self.0.options.clone();
11732 options.set_retry_policy(gax::retry_policy::NeverRetry);
11733 let query = move |name| {
11734 let stub = stub.clone();
11735 let options = options.clone();
11736 async {
11737 let op = GetOperation::new(stub)
11738 .set_name(name)
11739 .with_options(options)
11740 .send()
11741 .await?;
11742 Ok(Operation::new(op))
11743 }
11744 };
11745
11746 let start = move || async {
11747 let op = self.send().await?;
11748 Ok(Operation::new(op))
11749 };
11750
11751 lro::internal::new_unit_response_poller(
11752 polling_error_policy,
11753 polling_backoff_policy,
11754 start,
11755 query,
11756 )
11757 }
11758
11759 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11763 self.0.request.name = v.into();
11764 self
11765 }
11766
11767 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
11769 self.0.request.force = v.into();
11770 self
11771 }
11772 }
11773
11774 #[doc(hidden)]
11775 impl gax::options::internal::RequestBuilder for DeleteDataScan {
11776 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11777 &mut self.0.options
11778 }
11779 }
11780
11781 #[derive(Clone, Debug)]
11799 pub struct GetDataScan(RequestBuilder<crate::model::GetDataScanRequest>);
11800
11801 impl GetDataScan {
11802 pub(crate) fn new(
11803 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11804 ) -> Self {
11805 Self(RequestBuilder::new(stub))
11806 }
11807
11808 pub fn with_request<V: Into<crate::model::GetDataScanRequest>>(mut self, v: V) -> Self {
11810 self.0.request = v.into();
11811 self
11812 }
11813
11814 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11816 self.0.options = v.into();
11817 self
11818 }
11819
11820 pub async fn send(self) -> Result<crate::model::DataScan> {
11822 (*self.0.stub)
11823 .get_data_scan(self.0.request, self.0.options)
11824 .await
11825 .map(gax::response::Response::into_body)
11826 }
11827
11828 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11832 self.0.request.name = v.into();
11833 self
11834 }
11835
11836 pub fn set_view<T: Into<crate::model::get_data_scan_request::DataScanView>>(
11838 mut self,
11839 v: T,
11840 ) -> Self {
11841 self.0.request.view = v.into();
11842 self
11843 }
11844 }
11845
11846 #[doc(hidden)]
11847 impl gax::options::internal::RequestBuilder for GetDataScan {
11848 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11849 &mut self.0.options
11850 }
11851 }
11852
11853 #[derive(Clone, Debug)]
11875 pub struct ListDataScans(RequestBuilder<crate::model::ListDataScansRequest>);
11876
11877 impl ListDataScans {
11878 pub(crate) fn new(
11879 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11880 ) -> Self {
11881 Self(RequestBuilder::new(stub))
11882 }
11883
11884 pub fn with_request<V: Into<crate::model::ListDataScansRequest>>(mut self, v: V) -> Self {
11886 self.0.request = v.into();
11887 self
11888 }
11889
11890 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11892 self.0.options = v.into();
11893 self
11894 }
11895
11896 pub async fn send(self) -> Result<crate::model::ListDataScansResponse> {
11898 (*self.0.stub)
11899 .list_data_scans(self.0.request, self.0.options)
11900 .await
11901 .map(gax::response::Response::into_body)
11902 }
11903
11904 pub fn by_page(
11906 self,
11907 ) -> impl gax::paginator::Paginator<crate::model::ListDataScansResponse, gax::error::Error>
11908 {
11909 use std::clone::Clone;
11910 let token = self.0.request.page_token.clone();
11911 let execute = move |token: String| {
11912 let mut builder = self.clone();
11913 builder.0.request = builder.0.request.set_page_token(token);
11914 builder.send()
11915 };
11916 gax::paginator::internal::new_paginator(token, execute)
11917 }
11918
11919 pub fn by_item(
11921 self,
11922 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDataScansResponse, gax::error::Error>
11923 {
11924 use gax::paginator::Paginator;
11925 self.by_page().items()
11926 }
11927
11928 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11932 self.0.request.parent = v.into();
11933 self
11934 }
11935
11936 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11938 self.0.request.page_size = v.into();
11939 self
11940 }
11941
11942 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11944 self.0.request.page_token = v.into();
11945 self
11946 }
11947
11948 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11950 self.0.request.filter = v.into();
11951 self
11952 }
11953
11954 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
11956 self.0.request.order_by = v.into();
11957 self
11958 }
11959 }
11960
11961 #[doc(hidden)]
11962 impl gax::options::internal::RequestBuilder for ListDataScans {
11963 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11964 &mut self.0.options
11965 }
11966 }
11967
11968 #[derive(Clone, Debug)]
11986 pub struct RunDataScan(RequestBuilder<crate::model::RunDataScanRequest>);
11987
11988 impl RunDataScan {
11989 pub(crate) fn new(
11990 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
11991 ) -> Self {
11992 Self(RequestBuilder::new(stub))
11993 }
11994
11995 pub fn with_request<V: Into<crate::model::RunDataScanRequest>>(mut self, v: V) -> Self {
11997 self.0.request = v.into();
11998 self
11999 }
12000
12001 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12003 self.0.options = v.into();
12004 self
12005 }
12006
12007 pub async fn send(self) -> Result<crate::model::RunDataScanResponse> {
12009 (*self.0.stub)
12010 .run_data_scan(self.0.request, self.0.options)
12011 .await
12012 .map(gax::response::Response::into_body)
12013 }
12014
12015 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12019 self.0.request.name = v.into();
12020 self
12021 }
12022 }
12023
12024 #[doc(hidden)]
12025 impl gax::options::internal::RequestBuilder for RunDataScan {
12026 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12027 &mut self.0.options
12028 }
12029 }
12030
12031 #[derive(Clone, Debug)]
12049 pub struct GetDataScanJob(RequestBuilder<crate::model::GetDataScanJobRequest>);
12050
12051 impl GetDataScanJob {
12052 pub(crate) fn new(
12053 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12054 ) -> Self {
12055 Self(RequestBuilder::new(stub))
12056 }
12057
12058 pub fn with_request<V: Into<crate::model::GetDataScanJobRequest>>(mut self, v: V) -> Self {
12060 self.0.request = v.into();
12061 self
12062 }
12063
12064 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12066 self.0.options = v.into();
12067 self
12068 }
12069
12070 pub async fn send(self) -> Result<crate::model::DataScanJob> {
12072 (*self.0.stub)
12073 .get_data_scan_job(self.0.request, self.0.options)
12074 .await
12075 .map(gax::response::Response::into_body)
12076 }
12077
12078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12082 self.0.request.name = v.into();
12083 self
12084 }
12085
12086 pub fn set_view<T: Into<crate::model::get_data_scan_job_request::DataScanJobView>>(
12088 mut self,
12089 v: T,
12090 ) -> Self {
12091 self.0.request.view = v.into();
12092 self
12093 }
12094 }
12095
12096 #[doc(hidden)]
12097 impl gax::options::internal::RequestBuilder for GetDataScanJob {
12098 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12099 &mut self.0.options
12100 }
12101 }
12102
12103 #[derive(Clone, Debug)]
12125 pub struct ListDataScanJobs(RequestBuilder<crate::model::ListDataScanJobsRequest>);
12126
12127 impl ListDataScanJobs {
12128 pub(crate) fn new(
12129 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12130 ) -> Self {
12131 Self(RequestBuilder::new(stub))
12132 }
12133
12134 pub fn with_request<V: Into<crate::model::ListDataScanJobsRequest>>(
12136 mut self,
12137 v: V,
12138 ) -> Self {
12139 self.0.request = v.into();
12140 self
12141 }
12142
12143 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12145 self.0.options = v.into();
12146 self
12147 }
12148
12149 pub async fn send(self) -> Result<crate::model::ListDataScanJobsResponse> {
12151 (*self.0.stub)
12152 .list_data_scan_jobs(self.0.request, self.0.options)
12153 .await
12154 .map(gax::response::Response::into_body)
12155 }
12156
12157 pub fn by_page(
12159 self,
12160 ) -> impl gax::paginator::Paginator<crate::model::ListDataScanJobsResponse, gax::error::Error>
12161 {
12162 use std::clone::Clone;
12163 let token = self.0.request.page_token.clone();
12164 let execute = move |token: String| {
12165 let mut builder = self.clone();
12166 builder.0.request = builder.0.request.set_page_token(token);
12167 builder.send()
12168 };
12169 gax::paginator::internal::new_paginator(token, execute)
12170 }
12171
12172 pub fn by_item(
12174 self,
12175 ) -> impl gax::paginator::ItemPaginator<crate::model::ListDataScanJobsResponse, gax::error::Error>
12176 {
12177 use gax::paginator::Paginator;
12178 self.by_page().items()
12179 }
12180
12181 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12185 self.0.request.parent = v.into();
12186 self
12187 }
12188
12189 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12191 self.0.request.page_size = v.into();
12192 self
12193 }
12194
12195 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12197 self.0.request.page_token = v.into();
12198 self
12199 }
12200
12201 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12203 self.0.request.filter = v.into();
12204 self
12205 }
12206 }
12207
12208 #[doc(hidden)]
12209 impl gax::options::internal::RequestBuilder for ListDataScanJobs {
12210 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12211 &mut self.0.options
12212 }
12213 }
12214
12215 #[derive(Clone, Debug)]
12233 pub struct GenerateDataQualityRules(
12234 RequestBuilder<crate::model::GenerateDataQualityRulesRequest>,
12235 );
12236
12237 impl GenerateDataQualityRules {
12238 pub(crate) fn new(
12239 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12240 ) -> Self {
12241 Self(RequestBuilder::new(stub))
12242 }
12243
12244 pub fn with_request<V: Into<crate::model::GenerateDataQualityRulesRequest>>(
12246 mut self,
12247 v: V,
12248 ) -> Self {
12249 self.0.request = v.into();
12250 self
12251 }
12252
12253 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12255 self.0.options = v.into();
12256 self
12257 }
12258
12259 pub async fn send(self) -> Result<crate::model::GenerateDataQualityRulesResponse> {
12261 (*self.0.stub)
12262 .generate_data_quality_rules(self.0.request, self.0.options)
12263 .await
12264 .map(gax::response::Response::into_body)
12265 }
12266
12267 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12271 self.0.request.name = v.into();
12272 self
12273 }
12274 }
12275
12276 #[doc(hidden)]
12277 impl gax::options::internal::RequestBuilder for GenerateDataQualityRules {
12278 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12279 &mut self.0.options
12280 }
12281 }
12282
12283 #[derive(Clone, Debug)]
12305 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
12306
12307 impl ListLocations {
12308 pub(crate) fn new(
12309 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12310 ) -> Self {
12311 Self(RequestBuilder::new(stub))
12312 }
12313
12314 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
12316 mut self,
12317 v: V,
12318 ) -> Self {
12319 self.0.request = v.into();
12320 self
12321 }
12322
12323 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12325 self.0.options = v.into();
12326 self
12327 }
12328
12329 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
12331 (*self.0.stub)
12332 .list_locations(self.0.request, self.0.options)
12333 .await
12334 .map(gax::response::Response::into_body)
12335 }
12336
12337 pub fn by_page(
12339 self,
12340 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
12341 {
12342 use std::clone::Clone;
12343 let token = self.0.request.page_token.clone();
12344 let execute = move |token: String| {
12345 let mut builder = self.clone();
12346 builder.0.request = builder.0.request.set_page_token(token);
12347 builder.send()
12348 };
12349 gax::paginator::internal::new_paginator(token, execute)
12350 }
12351
12352 pub fn by_item(
12354 self,
12355 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
12356 {
12357 use gax::paginator::Paginator;
12358 self.by_page().items()
12359 }
12360
12361 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12363 self.0.request.name = v.into();
12364 self
12365 }
12366
12367 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12369 self.0.request.filter = v.into();
12370 self
12371 }
12372
12373 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12375 self.0.request.page_size = v.into();
12376 self
12377 }
12378
12379 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12381 self.0.request.page_token = v.into();
12382 self
12383 }
12384 }
12385
12386 #[doc(hidden)]
12387 impl gax::options::internal::RequestBuilder for ListLocations {
12388 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12389 &mut self.0.options
12390 }
12391 }
12392
12393 #[derive(Clone, Debug)]
12411 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
12412
12413 impl GetLocation {
12414 pub(crate) fn new(
12415 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12416 ) -> Self {
12417 Self(RequestBuilder::new(stub))
12418 }
12419
12420 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
12422 self.0.request = v.into();
12423 self
12424 }
12425
12426 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12428 self.0.options = v.into();
12429 self
12430 }
12431
12432 pub async fn send(self) -> Result<location::model::Location> {
12434 (*self.0.stub)
12435 .get_location(self.0.request, self.0.options)
12436 .await
12437 .map(gax::response::Response::into_body)
12438 }
12439
12440 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12442 self.0.request.name = v.into();
12443 self
12444 }
12445 }
12446
12447 #[doc(hidden)]
12448 impl gax::options::internal::RequestBuilder for GetLocation {
12449 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12450 &mut self.0.options
12451 }
12452 }
12453
12454 #[derive(Clone, Debug)]
12472 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
12473
12474 impl SetIamPolicy {
12475 pub(crate) fn new(
12476 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12477 ) -> Self {
12478 Self(RequestBuilder::new(stub))
12479 }
12480
12481 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
12483 self.0.request = v.into();
12484 self
12485 }
12486
12487 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12489 self.0.options = v.into();
12490 self
12491 }
12492
12493 pub async fn send(self) -> Result<iam_v1::model::Policy> {
12495 (*self.0.stub)
12496 .set_iam_policy(self.0.request, self.0.options)
12497 .await
12498 .map(gax::response::Response::into_body)
12499 }
12500
12501 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
12505 self.0.request.resource = v.into();
12506 self
12507 }
12508
12509 pub fn set_policy<T>(mut self, v: T) -> Self
12513 where
12514 T: std::convert::Into<iam_v1::model::Policy>,
12515 {
12516 self.0.request.policy = std::option::Option::Some(v.into());
12517 self
12518 }
12519
12520 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
12524 where
12525 T: std::convert::Into<iam_v1::model::Policy>,
12526 {
12527 self.0.request.policy = v.map(|x| x.into());
12528 self
12529 }
12530
12531 pub fn set_update_mask<T>(mut self, v: T) -> Self
12533 where
12534 T: std::convert::Into<wkt::FieldMask>,
12535 {
12536 self.0.request.update_mask = std::option::Option::Some(v.into());
12537 self
12538 }
12539
12540 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12542 where
12543 T: std::convert::Into<wkt::FieldMask>,
12544 {
12545 self.0.request.update_mask = v.map(|x| x.into());
12546 self
12547 }
12548 }
12549
12550 #[doc(hidden)]
12551 impl gax::options::internal::RequestBuilder for SetIamPolicy {
12552 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12553 &mut self.0.options
12554 }
12555 }
12556
12557 #[derive(Clone, Debug)]
12575 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
12576
12577 impl GetIamPolicy {
12578 pub(crate) fn new(
12579 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12580 ) -> Self {
12581 Self(RequestBuilder::new(stub))
12582 }
12583
12584 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
12586 self.0.request = v.into();
12587 self
12588 }
12589
12590 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12592 self.0.options = v.into();
12593 self
12594 }
12595
12596 pub async fn send(self) -> Result<iam_v1::model::Policy> {
12598 (*self.0.stub)
12599 .get_iam_policy(self.0.request, self.0.options)
12600 .await
12601 .map(gax::response::Response::into_body)
12602 }
12603
12604 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
12608 self.0.request.resource = v.into();
12609 self
12610 }
12611
12612 pub fn set_options<T>(mut self, v: T) -> Self
12614 where
12615 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
12616 {
12617 self.0.request.options = std::option::Option::Some(v.into());
12618 self
12619 }
12620
12621 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
12623 where
12624 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
12625 {
12626 self.0.request.options = v.map(|x| x.into());
12627 self
12628 }
12629 }
12630
12631 #[doc(hidden)]
12632 impl gax::options::internal::RequestBuilder for GetIamPolicy {
12633 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12634 &mut self.0.options
12635 }
12636 }
12637
12638 #[derive(Clone, Debug)]
12656 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
12657
12658 impl TestIamPermissions {
12659 pub(crate) fn new(
12660 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12661 ) -> Self {
12662 Self(RequestBuilder::new(stub))
12663 }
12664
12665 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
12667 mut self,
12668 v: V,
12669 ) -> Self {
12670 self.0.request = v.into();
12671 self
12672 }
12673
12674 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12676 self.0.options = v.into();
12677 self
12678 }
12679
12680 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
12682 (*self.0.stub)
12683 .test_iam_permissions(self.0.request, self.0.options)
12684 .await
12685 .map(gax::response::Response::into_body)
12686 }
12687
12688 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
12692 self.0.request.resource = v.into();
12693 self
12694 }
12695
12696 pub fn set_permissions<T, V>(mut self, v: T) -> Self
12700 where
12701 T: std::iter::IntoIterator<Item = V>,
12702 V: std::convert::Into<std::string::String>,
12703 {
12704 use std::iter::Iterator;
12705 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
12706 self
12707 }
12708 }
12709
12710 #[doc(hidden)]
12711 impl gax::options::internal::RequestBuilder for TestIamPermissions {
12712 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12713 &mut self.0.options
12714 }
12715 }
12716
12717 #[derive(Clone, Debug)]
12739 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
12740
12741 impl ListOperations {
12742 pub(crate) fn new(
12743 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12744 ) -> Self {
12745 Self(RequestBuilder::new(stub))
12746 }
12747
12748 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
12750 mut self,
12751 v: V,
12752 ) -> Self {
12753 self.0.request = v.into();
12754 self
12755 }
12756
12757 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12759 self.0.options = v.into();
12760 self
12761 }
12762
12763 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
12765 (*self.0.stub)
12766 .list_operations(self.0.request, self.0.options)
12767 .await
12768 .map(gax::response::Response::into_body)
12769 }
12770
12771 pub fn by_page(
12773 self,
12774 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
12775 {
12776 use std::clone::Clone;
12777 let token = self.0.request.page_token.clone();
12778 let execute = move |token: String| {
12779 let mut builder = self.clone();
12780 builder.0.request = builder.0.request.set_page_token(token);
12781 builder.send()
12782 };
12783 gax::paginator::internal::new_paginator(token, execute)
12784 }
12785
12786 pub fn by_item(
12788 self,
12789 ) -> impl gax::paginator::ItemPaginator<
12790 longrunning::model::ListOperationsResponse,
12791 gax::error::Error,
12792 > {
12793 use gax::paginator::Paginator;
12794 self.by_page().items()
12795 }
12796
12797 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12799 self.0.request.name = v.into();
12800 self
12801 }
12802
12803 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12805 self.0.request.filter = v.into();
12806 self
12807 }
12808
12809 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12811 self.0.request.page_size = v.into();
12812 self
12813 }
12814
12815 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12817 self.0.request.page_token = v.into();
12818 self
12819 }
12820
12821 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
12823 self.0.request.return_partial_success = v.into();
12824 self
12825 }
12826 }
12827
12828 #[doc(hidden)]
12829 impl gax::options::internal::RequestBuilder for ListOperations {
12830 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12831 &mut self.0.options
12832 }
12833 }
12834
12835 #[derive(Clone, Debug)]
12853 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
12854
12855 impl GetOperation {
12856 pub(crate) fn new(
12857 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12858 ) -> Self {
12859 Self(RequestBuilder::new(stub))
12860 }
12861
12862 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
12864 mut self,
12865 v: V,
12866 ) -> Self {
12867 self.0.request = v.into();
12868 self
12869 }
12870
12871 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12873 self.0.options = v.into();
12874 self
12875 }
12876
12877 pub async fn send(self) -> Result<longrunning::model::Operation> {
12879 (*self.0.stub)
12880 .get_operation(self.0.request, self.0.options)
12881 .await
12882 .map(gax::response::Response::into_body)
12883 }
12884
12885 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12887 self.0.request.name = v.into();
12888 self
12889 }
12890 }
12891
12892 #[doc(hidden)]
12893 impl gax::options::internal::RequestBuilder for GetOperation {
12894 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12895 &mut self.0.options
12896 }
12897 }
12898
12899 #[derive(Clone, Debug)]
12917 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
12918
12919 impl DeleteOperation {
12920 pub(crate) fn new(
12921 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12922 ) -> Self {
12923 Self(RequestBuilder::new(stub))
12924 }
12925
12926 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
12928 mut self,
12929 v: V,
12930 ) -> Self {
12931 self.0.request = v.into();
12932 self
12933 }
12934
12935 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
12937 self.0.options = v.into();
12938 self
12939 }
12940
12941 pub async fn send(self) -> Result<()> {
12943 (*self.0.stub)
12944 .delete_operation(self.0.request, self.0.options)
12945 .await
12946 .map(gax::response::Response::into_body)
12947 }
12948
12949 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12951 self.0.request.name = v.into();
12952 self
12953 }
12954 }
12955
12956 #[doc(hidden)]
12957 impl gax::options::internal::RequestBuilder for DeleteOperation {
12958 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
12959 &mut self.0.options
12960 }
12961 }
12962
12963 #[derive(Clone, Debug)]
12981 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
12982
12983 impl CancelOperation {
12984 pub(crate) fn new(
12985 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataScanService>,
12986 ) -> Self {
12987 Self(RequestBuilder::new(stub))
12988 }
12989
12990 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
12992 mut self,
12993 v: V,
12994 ) -> Self {
12995 self.0.request = v.into();
12996 self
12997 }
12998
12999 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13001 self.0.options = v.into();
13002 self
13003 }
13004
13005 pub async fn send(self) -> Result<()> {
13007 (*self.0.stub)
13008 .cancel_operation(self.0.request, self.0.options)
13009 .await
13010 .map(gax::response::Response::into_body)
13011 }
13012
13013 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13015 self.0.request.name = v.into();
13016 self
13017 }
13018 }
13019
13020 #[doc(hidden)]
13021 impl gax::options::internal::RequestBuilder for CancelOperation {
13022 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13023 &mut self.0.options
13024 }
13025 }
13026}
13027
13028pub mod metadata_service {
13029 use crate::Result;
13030
13031 pub type ClientBuilder =
13045 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13046
13047 pub(crate) mod client {
13048 use super::super::super::client::MetadataService;
13049 pub struct Factory;
13050 impl gax::client_builder::internal::ClientFactory for Factory {
13051 type Client = MetadataService;
13052 type Credentials = gaxi::options::Credentials;
13053 async fn build(
13054 self,
13055 config: gaxi::options::ClientConfig,
13056 ) -> gax::client_builder::Result<Self::Client> {
13057 Self::Client::new(config).await
13058 }
13059 }
13060 }
13061
13062 #[derive(Clone, Debug)]
13064 pub(crate) struct RequestBuilder<R: std::default::Default> {
13065 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13066 request: R,
13067 options: gax::options::RequestOptions,
13068 }
13069
13070 impl<R> RequestBuilder<R>
13071 where
13072 R: std::default::Default,
13073 {
13074 pub(crate) fn new(
13075 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13076 ) -> Self {
13077 Self {
13078 stub,
13079 request: R::default(),
13080 options: gax::options::RequestOptions::default(),
13081 }
13082 }
13083 }
13084
13085 #[derive(Clone, Debug)]
13103 pub struct CreateEntity(RequestBuilder<crate::model::CreateEntityRequest>);
13104
13105 impl CreateEntity {
13106 pub(crate) fn new(
13107 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13108 ) -> Self {
13109 Self(RequestBuilder::new(stub))
13110 }
13111
13112 pub fn with_request<V: Into<crate::model::CreateEntityRequest>>(mut self, v: V) -> Self {
13114 self.0.request = v.into();
13115 self
13116 }
13117
13118 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13120 self.0.options = v.into();
13121 self
13122 }
13123
13124 pub async fn send(self) -> Result<crate::model::Entity> {
13126 (*self.0.stub)
13127 .create_entity(self.0.request, self.0.options)
13128 .await
13129 .map(gax::response::Response::into_body)
13130 }
13131
13132 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13136 self.0.request.parent = v.into();
13137 self
13138 }
13139
13140 pub fn set_entity<T>(mut self, v: T) -> Self
13144 where
13145 T: std::convert::Into<crate::model::Entity>,
13146 {
13147 self.0.request.entity = std::option::Option::Some(v.into());
13148 self
13149 }
13150
13151 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
13155 where
13156 T: std::convert::Into<crate::model::Entity>,
13157 {
13158 self.0.request.entity = v.map(|x| x.into());
13159 self
13160 }
13161
13162 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13164 self.0.request.validate_only = v.into();
13165 self
13166 }
13167 }
13168
13169 #[doc(hidden)]
13170 impl gax::options::internal::RequestBuilder for CreateEntity {
13171 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13172 &mut self.0.options
13173 }
13174 }
13175
13176 #[derive(Clone, Debug)]
13194 pub struct UpdateEntity(RequestBuilder<crate::model::UpdateEntityRequest>);
13195
13196 impl UpdateEntity {
13197 pub(crate) fn new(
13198 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13199 ) -> Self {
13200 Self(RequestBuilder::new(stub))
13201 }
13202
13203 pub fn with_request<V: Into<crate::model::UpdateEntityRequest>>(mut self, v: V) -> Self {
13205 self.0.request = v.into();
13206 self
13207 }
13208
13209 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13211 self.0.options = v.into();
13212 self
13213 }
13214
13215 pub async fn send(self) -> Result<crate::model::Entity> {
13217 (*self.0.stub)
13218 .update_entity(self.0.request, self.0.options)
13219 .await
13220 .map(gax::response::Response::into_body)
13221 }
13222
13223 pub fn set_entity<T>(mut self, v: T) -> Self
13227 where
13228 T: std::convert::Into<crate::model::Entity>,
13229 {
13230 self.0.request.entity = std::option::Option::Some(v.into());
13231 self
13232 }
13233
13234 pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
13238 where
13239 T: std::convert::Into<crate::model::Entity>,
13240 {
13241 self.0.request.entity = v.map(|x| x.into());
13242 self
13243 }
13244
13245 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13247 self.0.request.validate_only = v.into();
13248 self
13249 }
13250 }
13251
13252 #[doc(hidden)]
13253 impl gax::options::internal::RequestBuilder for UpdateEntity {
13254 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13255 &mut self.0.options
13256 }
13257 }
13258
13259 #[derive(Clone, Debug)]
13277 pub struct DeleteEntity(RequestBuilder<crate::model::DeleteEntityRequest>);
13278
13279 impl DeleteEntity {
13280 pub(crate) fn new(
13281 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13282 ) -> Self {
13283 Self(RequestBuilder::new(stub))
13284 }
13285
13286 pub fn with_request<V: Into<crate::model::DeleteEntityRequest>>(mut self, v: V) -> Self {
13288 self.0.request = v.into();
13289 self
13290 }
13291
13292 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13294 self.0.options = v.into();
13295 self
13296 }
13297
13298 pub async fn send(self) -> Result<()> {
13300 (*self.0.stub)
13301 .delete_entity(self.0.request, self.0.options)
13302 .await
13303 .map(gax::response::Response::into_body)
13304 }
13305
13306 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13310 self.0.request.name = v.into();
13311 self
13312 }
13313
13314 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
13318 self.0.request.etag = v.into();
13319 self
13320 }
13321 }
13322
13323 #[doc(hidden)]
13324 impl gax::options::internal::RequestBuilder for DeleteEntity {
13325 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13326 &mut self.0.options
13327 }
13328 }
13329
13330 #[derive(Clone, Debug)]
13348 pub struct GetEntity(RequestBuilder<crate::model::GetEntityRequest>);
13349
13350 impl GetEntity {
13351 pub(crate) fn new(
13352 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13353 ) -> Self {
13354 Self(RequestBuilder::new(stub))
13355 }
13356
13357 pub fn with_request<V: Into<crate::model::GetEntityRequest>>(mut self, v: V) -> Self {
13359 self.0.request = v.into();
13360 self
13361 }
13362
13363 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13365 self.0.options = v.into();
13366 self
13367 }
13368
13369 pub async fn send(self) -> Result<crate::model::Entity> {
13371 (*self.0.stub)
13372 .get_entity(self.0.request, self.0.options)
13373 .await
13374 .map(gax::response::Response::into_body)
13375 }
13376
13377 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13381 self.0.request.name = v.into();
13382 self
13383 }
13384
13385 pub fn set_view<T: Into<crate::model::get_entity_request::EntityView>>(
13387 mut self,
13388 v: T,
13389 ) -> Self {
13390 self.0.request.view = v.into();
13391 self
13392 }
13393 }
13394
13395 #[doc(hidden)]
13396 impl gax::options::internal::RequestBuilder for GetEntity {
13397 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13398 &mut self.0.options
13399 }
13400 }
13401
13402 #[derive(Clone, Debug)]
13424 pub struct ListEntities(RequestBuilder<crate::model::ListEntitiesRequest>);
13425
13426 impl ListEntities {
13427 pub(crate) fn new(
13428 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13429 ) -> Self {
13430 Self(RequestBuilder::new(stub))
13431 }
13432
13433 pub fn with_request<V: Into<crate::model::ListEntitiesRequest>>(mut self, v: V) -> Self {
13435 self.0.request = v.into();
13436 self
13437 }
13438
13439 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13441 self.0.options = v.into();
13442 self
13443 }
13444
13445 pub async fn send(self) -> Result<crate::model::ListEntitiesResponse> {
13447 (*self.0.stub)
13448 .list_entities(self.0.request, self.0.options)
13449 .await
13450 .map(gax::response::Response::into_body)
13451 }
13452
13453 pub fn by_page(
13455 self,
13456 ) -> impl gax::paginator::Paginator<crate::model::ListEntitiesResponse, gax::error::Error>
13457 {
13458 use std::clone::Clone;
13459 let token = self.0.request.page_token.clone();
13460 let execute = move |token: String| {
13461 let mut builder = self.clone();
13462 builder.0.request = builder.0.request.set_page_token(token);
13463 builder.send()
13464 };
13465 gax::paginator::internal::new_paginator(token, execute)
13466 }
13467
13468 pub fn by_item(
13470 self,
13471 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEntitiesResponse, gax::error::Error>
13472 {
13473 use gax::paginator::Paginator;
13474 self.by_page().items()
13475 }
13476
13477 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13481 self.0.request.parent = v.into();
13482 self
13483 }
13484
13485 pub fn set_view<T: Into<crate::model::list_entities_request::EntityView>>(
13489 mut self,
13490 v: T,
13491 ) -> Self {
13492 self.0.request.view = v.into();
13493 self
13494 }
13495
13496 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13498 self.0.request.page_size = v.into();
13499 self
13500 }
13501
13502 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13504 self.0.request.page_token = v.into();
13505 self
13506 }
13507
13508 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13510 self.0.request.filter = v.into();
13511 self
13512 }
13513 }
13514
13515 #[doc(hidden)]
13516 impl gax::options::internal::RequestBuilder for ListEntities {
13517 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13518 &mut self.0.options
13519 }
13520 }
13521
13522 #[derive(Clone, Debug)]
13540 pub struct CreatePartition(RequestBuilder<crate::model::CreatePartitionRequest>);
13541
13542 impl CreatePartition {
13543 pub(crate) fn new(
13544 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13545 ) -> Self {
13546 Self(RequestBuilder::new(stub))
13547 }
13548
13549 pub fn with_request<V: Into<crate::model::CreatePartitionRequest>>(mut self, v: V) -> Self {
13551 self.0.request = v.into();
13552 self
13553 }
13554
13555 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13557 self.0.options = v.into();
13558 self
13559 }
13560
13561 pub async fn send(self) -> Result<crate::model::Partition> {
13563 (*self.0.stub)
13564 .create_partition(self.0.request, self.0.options)
13565 .await
13566 .map(gax::response::Response::into_body)
13567 }
13568
13569 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13573 self.0.request.parent = v.into();
13574 self
13575 }
13576
13577 pub fn set_partition<T>(mut self, v: T) -> Self
13581 where
13582 T: std::convert::Into<crate::model::Partition>,
13583 {
13584 self.0.request.partition = std::option::Option::Some(v.into());
13585 self
13586 }
13587
13588 pub fn set_or_clear_partition<T>(mut self, v: std::option::Option<T>) -> Self
13592 where
13593 T: std::convert::Into<crate::model::Partition>,
13594 {
13595 self.0.request.partition = v.map(|x| x.into());
13596 self
13597 }
13598
13599 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
13601 self.0.request.validate_only = v.into();
13602 self
13603 }
13604 }
13605
13606 #[doc(hidden)]
13607 impl gax::options::internal::RequestBuilder for CreatePartition {
13608 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13609 &mut self.0.options
13610 }
13611 }
13612
13613 #[derive(Clone, Debug)]
13631 pub struct DeletePartition(RequestBuilder<crate::model::DeletePartitionRequest>);
13632
13633 impl DeletePartition {
13634 pub(crate) fn new(
13635 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13636 ) -> Self {
13637 Self(RequestBuilder::new(stub))
13638 }
13639
13640 pub fn with_request<V: Into<crate::model::DeletePartitionRequest>>(mut self, v: V) -> Self {
13642 self.0.request = v.into();
13643 self
13644 }
13645
13646 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13648 self.0.options = v.into();
13649 self
13650 }
13651
13652 pub async fn send(self) -> Result<()> {
13654 (*self.0.stub)
13655 .delete_partition(self.0.request, self.0.options)
13656 .await
13657 .map(gax::response::Response::into_body)
13658 }
13659
13660 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13664 self.0.request.name = v.into();
13665 self
13666 }
13667
13668 #[deprecated]
13670 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
13671 self.0.request.etag = v.into();
13672 self
13673 }
13674 }
13675
13676 #[doc(hidden)]
13677 impl gax::options::internal::RequestBuilder for DeletePartition {
13678 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13679 &mut self.0.options
13680 }
13681 }
13682
13683 #[derive(Clone, Debug)]
13701 pub struct GetPartition(RequestBuilder<crate::model::GetPartitionRequest>);
13702
13703 impl GetPartition {
13704 pub(crate) fn new(
13705 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13706 ) -> Self {
13707 Self(RequestBuilder::new(stub))
13708 }
13709
13710 pub fn with_request<V: Into<crate::model::GetPartitionRequest>>(mut self, v: V) -> Self {
13712 self.0.request = v.into();
13713 self
13714 }
13715
13716 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13718 self.0.options = v.into();
13719 self
13720 }
13721
13722 pub async fn send(self) -> Result<crate::model::Partition> {
13724 (*self.0.stub)
13725 .get_partition(self.0.request, self.0.options)
13726 .await
13727 .map(gax::response::Response::into_body)
13728 }
13729
13730 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13734 self.0.request.name = v.into();
13735 self
13736 }
13737 }
13738
13739 #[doc(hidden)]
13740 impl gax::options::internal::RequestBuilder for GetPartition {
13741 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13742 &mut self.0.options
13743 }
13744 }
13745
13746 #[derive(Clone, Debug)]
13768 pub struct ListPartitions(RequestBuilder<crate::model::ListPartitionsRequest>);
13769
13770 impl ListPartitions {
13771 pub(crate) fn new(
13772 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13773 ) -> Self {
13774 Self(RequestBuilder::new(stub))
13775 }
13776
13777 pub fn with_request<V: Into<crate::model::ListPartitionsRequest>>(mut self, v: V) -> Self {
13779 self.0.request = v.into();
13780 self
13781 }
13782
13783 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13785 self.0.options = v.into();
13786 self
13787 }
13788
13789 pub async fn send(self) -> Result<crate::model::ListPartitionsResponse> {
13791 (*self.0.stub)
13792 .list_partitions(self.0.request, self.0.options)
13793 .await
13794 .map(gax::response::Response::into_body)
13795 }
13796
13797 pub fn by_page(
13799 self,
13800 ) -> impl gax::paginator::Paginator<crate::model::ListPartitionsResponse, gax::error::Error>
13801 {
13802 use std::clone::Clone;
13803 let token = self.0.request.page_token.clone();
13804 let execute = move |token: String| {
13805 let mut builder = self.clone();
13806 builder.0.request = builder.0.request.set_page_token(token);
13807 builder.send()
13808 };
13809 gax::paginator::internal::new_paginator(token, execute)
13810 }
13811
13812 pub fn by_item(
13814 self,
13815 ) -> impl gax::paginator::ItemPaginator<crate::model::ListPartitionsResponse, gax::error::Error>
13816 {
13817 use gax::paginator::Paginator;
13818 self.by_page().items()
13819 }
13820
13821 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13825 self.0.request.parent = v.into();
13826 self
13827 }
13828
13829 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13831 self.0.request.page_size = v.into();
13832 self
13833 }
13834
13835 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13837 self.0.request.page_token = v.into();
13838 self
13839 }
13840
13841 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13843 self.0.request.filter = v.into();
13844 self
13845 }
13846 }
13847
13848 #[doc(hidden)]
13849 impl gax::options::internal::RequestBuilder for ListPartitions {
13850 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13851 &mut self.0.options
13852 }
13853 }
13854
13855 #[derive(Clone, Debug)]
13877 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
13878
13879 impl ListLocations {
13880 pub(crate) fn new(
13881 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13882 ) -> Self {
13883 Self(RequestBuilder::new(stub))
13884 }
13885
13886 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
13888 mut self,
13889 v: V,
13890 ) -> Self {
13891 self.0.request = v.into();
13892 self
13893 }
13894
13895 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
13897 self.0.options = v.into();
13898 self
13899 }
13900
13901 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
13903 (*self.0.stub)
13904 .list_locations(self.0.request, self.0.options)
13905 .await
13906 .map(gax::response::Response::into_body)
13907 }
13908
13909 pub fn by_page(
13911 self,
13912 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
13913 {
13914 use std::clone::Clone;
13915 let token = self.0.request.page_token.clone();
13916 let execute = move |token: String| {
13917 let mut builder = self.clone();
13918 builder.0.request = builder.0.request.set_page_token(token);
13919 builder.send()
13920 };
13921 gax::paginator::internal::new_paginator(token, execute)
13922 }
13923
13924 pub fn by_item(
13926 self,
13927 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
13928 {
13929 use gax::paginator::Paginator;
13930 self.by_page().items()
13931 }
13932
13933 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13935 self.0.request.name = v.into();
13936 self
13937 }
13938
13939 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13941 self.0.request.filter = v.into();
13942 self
13943 }
13944
13945 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13947 self.0.request.page_size = v.into();
13948 self
13949 }
13950
13951 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13953 self.0.request.page_token = v.into();
13954 self
13955 }
13956 }
13957
13958 #[doc(hidden)]
13959 impl gax::options::internal::RequestBuilder for ListLocations {
13960 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
13961 &mut self.0.options
13962 }
13963 }
13964
13965 #[derive(Clone, Debug)]
13983 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
13984
13985 impl GetLocation {
13986 pub(crate) fn new(
13987 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
13988 ) -> Self {
13989 Self(RequestBuilder::new(stub))
13990 }
13991
13992 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
13994 self.0.request = v.into();
13995 self
13996 }
13997
13998 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14000 self.0.options = v.into();
14001 self
14002 }
14003
14004 pub async fn send(self) -> Result<location::model::Location> {
14006 (*self.0.stub)
14007 .get_location(self.0.request, self.0.options)
14008 .await
14009 .map(gax::response::Response::into_body)
14010 }
14011
14012 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14014 self.0.request.name = v.into();
14015 self
14016 }
14017 }
14018
14019 #[doc(hidden)]
14020 impl gax::options::internal::RequestBuilder for GetLocation {
14021 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14022 &mut self.0.options
14023 }
14024 }
14025
14026 #[derive(Clone, Debug)]
14044 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
14045
14046 impl SetIamPolicy {
14047 pub(crate) fn new(
14048 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14049 ) -> Self {
14050 Self(RequestBuilder::new(stub))
14051 }
14052
14053 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
14055 self.0.request = v.into();
14056 self
14057 }
14058
14059 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14061 self.0.options = v.into();
14062 self
14063 }
14064
14065 pub async fn send(self) -> Result<iam_v1::model::Policy> {
14067 (*self.0.stub)
14068 .set_iam_policy(self.0.request, self.0.options)
14069 .await
14070 .map(gax::response::Response::into_body)
14071 }
14072
14073 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14077 self.0.request.resource = v.into();
14078 self
14079 }
14080
14081 pub fn set_policy<T>(mut self, v: T) -> Self
14085 where
14086 T: std::convert::Into<iam_v1::model::Policy>,
14087 {
14088 self.0.request.policy = std::option::Option::Some(v.into());
14089 self
14090 }
14091
14092 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
14096 where
14097 T: std::convert::Into<iam_v1::model::Policy>,
14098 {
14099 self.0.request.policy = v.map(|x| x.into());
14100 self
14101 }
14102
14103 pub fn set_update_mask<T>(mut self, v: T) -> Self
14105 where
14106 T: std::convert::Into<wkt::FieldMask>,
14107 {
14108 self.0.request.update_mask = std::option::Option::Some(v.into());
14109 self
14110 }
14111
14112 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14114 where
14115 T: std::convert::Into<wkt::FieldMask>,
14116 {
14117 self.0.request.update_mask = v.map(|x| x.into());
14118 self
14119 }
14120 }
14121
14122 #[doc(hidden)]
14123 impl gax::options::internal::RequestBuilder for SetIamPolicy {
14124 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14125 &mut self.0.options
14126 }
14127 }
14128
14129 #[derive(Clone, Debug)]
14147 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
14148
14149 impl GetIamPolicy {
14150 pub(crate) fn new(
14151 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14152 ) -> Self {
14153 Self(RequestBuilder::new(stub))
14154 }
14155
14156 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
14158 self.0.request = v.into();
14159 self
14160 }
14161
14162 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14164 self.0.options = v.into();
14165 self
14166 }
14167
14168 pub async fn send(self) -> Result<iam_v1::model::Policy> {
14170 (*self.0.stub)
14171 .get_iam_policy(self.0.request, self.0.options)
14172 .await
14173 .map(gax::response::Response::into_body)
14174 }
14175
14176 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14180 self.0.request.resource = v.into();
14181 self
14182 }
14183
14184 pub fn set_options<T>(mut self, v: T) -> Self
14186 where
14187 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
14188 {
14189 self.0.request.options = std::option::Option::Some(v.into());
14190 self
14191 }
14192
14193 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
14195 where
14196 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
14197 {
14198 self.0.request.options = v.map(|x| x.into());
14199 self
14200 }
14201 }
14202
14203 #[doc(hidden)]
14204 impl gax::options::internal::RequestBuilder for GetIamPolicy {
14205 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14206 &mut self.0.options
14207 }
14208 }
14209
14210 #[derive(Clone, Debug)]
14228 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
14229
14230 impl TestIamPermissions {
14231 pub(crate) fn new(
14232 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14233 ) -> Self {
14234 Self(RequestBuilder::new(stub))
14235 }
14236
14237 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
14239 mut self,
14240 v: V,
14241 ) -> Self {
14242 self.0.request = v.into();
14243 self
14244 }
14245
14246 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14248 self.0.options = v.into();
14249 self
14250 }
14251
14252 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
14254 (*self.0.stub)
14255 .test_iam_permissions(self.0.request, self.0.options)
14256 .await
14257 .map(gax::response::Response::into_body)
14258 }
14259
14260 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
14264 self.0.request.resource = v.into();
14265 self
14266 }
14267
14268 pub fn set_permissions<T, V>(mut self, v: T) -> Self
14272 where
14273 T: std::iter::IntoIterator<Item = V>,
14274 V: std::convert::Into<std::string::String>,
14275 {
14276 use std::iter::Iterator;
14277 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
14278 self
14279 }
14280 }
14281
14282 #[doc(hidden)]
14283 impl gax::options::internal::RequestBuilder for TestIamPermissions {
14284 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14285 &mut self.0.options
14286 }
14287 }
14288
14289 #[derive(Clone, Debug)]
14311 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
14312
14313 impl ListOperations {
14314 pub(crate) fn new(
14315 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14316 ) -> Self {
14317 Self(RequestBuilder::new(stub))
14318 }
14319
14320 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
14322 mut self,
14323 v: V,
14324 ) -> Self {
14325 self.0.request = v.into();
14326 self
14327 }
14328
14329 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14331 self.0.options = v.into();
14332 self
14333 }
14334
14335 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
14337 (*self.0.stub)
14338 .list_operations(self.0.request, self.0.options)
14339 .await
14340 .map(gax::response::Response::into_body)
14341 }
14342
14343 pub fn by_page(
14345 self,
14346 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
14347 {
14348 use std::clone::Clone;
14349 let token = self.0.request.page_token.clone();
14350 let execute = move |token: String| {
14351 let mut builder = self.clone();
14352 builder.0.request = builder.0.request.set_page_token(token);
14353 builder.send()
14354 };
14355 gax::paginator::internal::new_paginator(token, execute)
14356 }
14357
14358 pub fn by_item(
14360 self,
14361 ) -> impl gax::paginator::ItemPaginator<
14362 longrunning::model::ListOperationsResponse,
14363 gax::error::Error,
14364 > {
14365 use gax::paginator::Paginator;
14366 self.by_page().items()
14367 }
14368
14369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14371 self.0.request.name = v.into();
14372 self
14373 }
14374
14375 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14377 self.0.request.filter = v.into();
14378 self
14379 }
14380
14381 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14383 self.0.request.page_size = v.into();
14384 self
14385 }
14386
14387 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14389 self.0.request.page_token = v.into();
14390 self
14391 }
14392
14393 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14395 self.0.request.return_partial_success = v.into();
14396 self
14397 }
14398 }
14399
14400 #[doc(hidden)]
14401 impl gax::options::internal::RequestBuilder for ListOperations {
14402 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14403 &mut self.0.options
14404 }
14405 }
14406
14407 #[derive(Clone, Debug)]
14425 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
14426
14427 impl GetOperation {
14428 pub(crate) fn new(
14429 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14430 ) -> Self {
14431 Self(RequestBuilder::new(stub))
14432 }
14433
14434 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
14436 mut self,
14437 v: V,
14438 ) -> Self {
14439 self.0.request = v.into();
14440 self
14441 }
14442
14443 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14445 self.0.options = v.into();
14446 self
14447 }
14448
14449 pub async fn send(self) -> Result<longrunning::model::Operation> {
14451 (*self.0.stub)
14452 .get_operation(self.0.request, self.0.options)
14453 .await
14454 .map(gax::response::Response::into_body)
14455 }
14456
14457 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14459 self.0.request.name = v.into();
14460 self
14461 }
14462 }
14463
14464 #[doc(hidden)]
14465 impl gax::options::internal::RequestBuilder for GetOperation {
14466 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14467 &mut self.0.options
14468 }
14469 }
14470
14471 #[derive(Clone, Debug)]
14489 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
14490
14491 impl DeleteOperation {
14492 pub(crate) fn new(
14493 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14494 ) -> Self {
14495 Self(RequestBuilder::new(stub))
14496 }
14497
14498 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
14500 mut self,
14501 v: V,
14502 ) -> Self {
14503 self.0.request = v.into();
14504 self
14505 }
14506
14507 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14509 self.0.options = v.into();
14510 self
14511 }
14512
14513 pub async fn send(self) -> Result<()> {
14515 (*self.0.stub)
14516 .delete_operation(self.0.request, self.0.options)
14517 .await
14518 .map(gax::response::Response::into_body)
14519 }
14520
14521 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14523 self.0.request.name = v.into();
14524 self
14525 }
14526 }
14527
14528 #[doc(hidden)]
14529 impl gax::options::internal::RequestBuilder for DeleteOperation {
14530 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14531 &mut self.0.options
14532 }
14533 }
14534
14535 #[derive(Clone, Debug)]
14553 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
14554
14555 impl CancelOperation {
14556 pub(crate) fn new(
14557 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetadataService>,
14558 ) -> Self {
14559 Self(RequestBuilder::new(stub))
14560 }
14561
14562 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
14564 mut self,
14565 v: V,
14566 ) -> Self {
14567 self.0.request = v.into();
14568 self
14569 }
14570
14571 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14573 self.0.options = v.into();
14574 self
14575 }
14576
14577 pub async fn send(self) -> Result<()> {
14579 (*self.0.stub)
14580 .cancel_operation(self.0.request, self.0.options)
14581 .await
14582 .map(gax::response::Response::into_body)
14583 }
14584
14585 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14587 self.0.request.name = v.into();
14588 self
14589 }
14590 }
14591
14592 #[doc(hidden)]
14593 impl gax::options::internal::RequestBuilder for CancelOperation {
14594 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14595 &mut self.0.options
14596 }
14597 }
14598}
14599
14600pub mod dataplex_service {
14601 use crate::Result;
14602
14603 pub type ClientBuilder =
14617 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14618
14619 pub(crate) mod client {
14620 use super::super::super::client::DataplexService;
14621 pub struct Factory;
14622 impl gax::client_builder::internal::ClientFactory for Factory {
14623 type Client = DataplexService;
14624 type Credentials = gaxi::options::Credentials;
14625 async fn build(
14626 self,
14627 config: gaxi::options::ClientConfig,
14628 ) -> gax::client_builder::Result<Self::Client> {
14629 Self::Client::new(config).await
14630 }
14631 }
14632 }
14633
14634 #[derive(Clone, Debug)]
14636 pub(crate) struct RequestBuilder<R: std::default::Default> {
14637 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14638 request: R,
14639 options: gax::options::RequestOptions,
14640 }
14641
14642 impl<R> RequestBuilder<R>
14643 where
14644 R: std::default::Default,
14645 {
14646 pub(crate) fn new(
14647 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14648 ) -> Self {
14649 Self {
14650 stub,
14651 request: R::default(),
14652 options: gax::options::RequestOptions::default(),
14653 }
14654 }
14655 }
14656
14657 #[derive(Clone, Debug)]
14676 pub struct CreateLake(RequestBuilder<crate::model::CreateLakeRequest>);
14677
14678 impl CreateLake {
14679 pub(crate) fn new(
14680 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14681 ) -> Self {
14682 Self(RequestBuilder::new(stub))
14683 }
14684
14685 pub fn with_request<V: Into<crate::model::CreateLakeRequest>>(mut self, v: V) -> Self {
14687 self.0.request = v.into();
14688 self
14689 }
14690
14691 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14693 self.0.options = v.into();
14694 self
14695 }
14696
14697 pub async fn send(self) -> Result<longrunning::model::Operation> {
14704 (*self.0.stub)
14705 .create_lake(self.0.request, self.0.options)
14706 .await
14707 .map(gax::response::Response::into_body)
14708 }
14709
14710 pub fn poller(
14712 self,
14713 ) -> impl lro::Poller<crate::model::Lake, crate::model::OperationMetadata> {
14714 type Operation =
14715 lro::internal::Operation<crate::model::Lake, crate::model::OperationMetadata>;
14716 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14717 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14718
14719 let stub = self.0.stub.clone();
14720 let mut options = self.0.options.clone();
14721 options.set_retry_policy(gax::retry_policy::NeverRetry);
14722 let query = move |name| {
14723 let stub = stub.clone();
14724 let options = options.clone();
14725 async {
14726 let op = GetOperation::new(stub)
14727 .set_name(name)
14728 .with_options(options)
14729 .send()
14730 .await?;
14731 Ok(Operation::new(op))
14732 }
14733 };
14734
14735 let start = move || async {
14736 let op = self.send().await?;
14737 Ok(Operation::new(op))
14738 };
14739
14740 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
14741 }
14742
14743 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14747 self.0.request.parent = v.into();
14748 self
14749 }
14750
14751 pub fn set_lake_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14755 self.0.request.lake_id = v.into();
14756 self
14757 }
14758
14759 pub fn set_lake<T>(mut self, v: T) -> Self
14763 where
14764 T: std::convert::Into<crate::model::Lake>,
14765 {
14766 self.0.request.lake = std::option::Option::Some(v.into());
14767 self
14768 }
14769
14770 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
14774 where
14775 T: std::convert::Into<crate::model::Lake>,
14776 {
14777 self.0.request.lake = v.map(|x| x.into());
14778 self
14779 }
14780
14781 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14783 self.0.request.validate_only = v.into();
14784 self
14785 }
14786 }
14787
14788 #[doc(hidden)]
14789 impl gax::options::internal::RequestBuilder for CreateLake {
14790 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14791 &mut self.0.options
14792 }
14793 }
14794
14795 #[derive(Clone, Debug)]
14814 pub struct UpdateLake(RequestBuilder<crate::model::UpdateLakeRequest>);
14815
14816 impl UpdateLake {
14817 pub(crate) fn new(
14818 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14819 ) -> Self {
14820 Self(RequestBuilder::new(stub))
14821 }
14822
14823 pub fn with_request<V: Into<crate::model::UpdateLakeRequest>>(mut self, v: V) -> Self {
14825 self.0.request = v.into();
14826 self
14827 }
14828
14829 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14831 self.0.options = v.into();
14832 self
14833 }
14834
14835 pub async fn send(self) -> Result<longrunning::model::Operation> {
14842 (*self.0.stub)
14843 .update_lake(self.0.request, self.0.options)
14844 .await
14845 .map(gax::response::Response::into_body)
14846 }
14847
14848 pub fn poller(
14850 self,
14851 ) -> impl lro::Poller<crate::model::Lake, crate::model::OperationMetadata> {
14852 type Operation =
14853 lro::internal::Operation<crate::model::Lake, crate::model::OperationMetadata>;
14854 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14855 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14856
14857 let stub = self.0.stub.clone();
14858 let mut options = self.0.options.clone();
14859 options.set_retry_policy(gax::retry_policy::NeverRetry);
14860 let query = move |name| {
14861 let stub = stub.clone();
14862 let options = options.clone();
14863 async {
14864 let op = GetOperation::new(stub)
14865 .set_name(name)
14866 .with_options(options)
14867 .send()
14868 .await?;
14869 Ok(Operation::new(op))
14870 }
14871 };
14872
14873 let start = move || async {
14874 let op = self.send().await?;
14875 Ok(Operation::new(op))
14876 };
14877
14878 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
14879 }
14880
14881 pub fn set_update_mask<T>(mut self, v: T) -> Self
14885 where
14886 T: std::convert::Into<wkt::FieldMask>,
14887 {
14888 self.0.request.update_mask = std::option::Option::Some(v.into());
14889 self
14890 }
14891
14892 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14896 where
14897 T: std::convert::Into<wkt::FieldMask>,
14898 {
14899 self.0.request.update_mask = v.map(|x| x.into());
14900 self
14901 }
14902
14903 pub fn set_lake<T>(mut self, v: T) -> Self
14907 where
14908 T: std::convert::Into<crate::model::Lake>,
14909 {
14910 self.0.request.lake = std::option::Option::Some(v.into());
14911 self
14912 }
14913
14914 pub fn set_or_clear_lake<T>(mut self, v: std::option::Option<T>) -> Self
14918 where
14919 T: std::convert::Into<crate::model::Lake>,
14920 {
14921 self.0.request.lake = v.map(|x| x.into());
14922 self
14923 }
14924
14925 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
14927 self.0.request.validate_only = v.into();
14928 self
14929 }
14930 }
14931
14932 #[doc(hidden)]
14933 impl gax::options::internal::RequestBuilder for UpdateLake {
14934 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
14935 &mut self.0.options
14936 }
14937 }
14938
14939 #[derive(Clone, Debug)]
14958 pub struct DeleteLake(RequestBuilder<crate::model::DeleteLakeRequest>);
14959
14960 impl DeleteLake {
14961 pub(crate) fn new(
14962 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
14963 ) -> Self {
14964 Self(RequestBuilder::new(stub))
14965 }
14966
14967 pub fn with_request<V: Into<crate::model::DeleteLakeRequest>>(mut self, v: V) -> Self {
14969 self.0.request = v.into();
14970 self
14971 }
14972
14973 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
14975 self.0.options = v.into();
14976 self
14977 }
14978
14979 pub async fn send(self) -> Result<longrunning::model::Operation> {
14986 (*self.0.stub)
14987 .delete_lake(self.0.request, self.0.options)
14988 .await
14989 .map(gax::response::Response::into_body)
14990 }
14991
14992 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
14994 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
14995 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
14996 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
14997
14998 let stub = self.0.stub.clone();
14999 let mut options = self.0.options.clone();
15000 options.set_retry_policy(gax::retry_policy::NeverRetry);
15001 let query = move |name| {
15002 let stub = stub.clone();
15003 let options = options.clone();
15004 async {
15005 let op = GetOperation::new(stub)
15006 .set_name(name)
15007 .with_options(options)
15008 .send()
15009 .await?;
15010 Ok(Operation::new(op))
15011 }
15012 };
15013
15014 let start = move || async {
15015 let op = self.send().await?;
15016 Ok(Operation::new(op))
15017 };
15018
15019 lro::internal::new_unit_response_poller(
15020 polling_error_policy,
15021 polling_backoff_policy,
15022 start,
15023 query,
15024 )
15025 }
15026
15027 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15031 self.0.request.name = v.into();
15032 self
15033 }
15034 }
15035
15036 #[doc(hidden)]
15037 impl gax::options::internal::RequestBuilder for DeleteLake {
15038 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15039 &mut self.0.options
15040 }
15041 }
15042
15043 #[derive(Clone, Debug)]
15065 pub struct ListLakes(RequestBuilder<crate::model::ListLakesRequest>);
15066
15067 impl ListLakes {
15068 pub(crate) fn new(
15069 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15070 ) -> Self {
15071 Self(RequestBuilder::new(stub))
15072 }
15073
15074 pub fn with_request<V: Into<crate::model::ListLakesRequest>>(mut self, v: V) -> Self {
15076 self.0.request = v.into();
15077 self
15078 }
15079
15080 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15082 self.0.options = v.into();
15083 self
15084 }
15085
15086 pub async fn send(self) -> Result<crate::model::ListLakesResponse> {
15088 (*self.0.stub)
15089 .list_lakes(self.0.request, self.0.options)
15090 .await
15091 .map(gax::response::Response::into_body)
15092 }
15093
15094 pub fn by_page(
15096 self,
15097 ) -> impl gax::paginator::Paginator<crate::model::ListLakesResponse, gax::error::Error>
15098 {
15099 use std::clone::Clone;
15100 let token = self.0.request.page_token.clone();
15101 let execute = move |token: String| {
15102 let mut builder = self.clone();
15103 builder.0.request = builder.0.request.set_page_token(token);
15104 builder.send()
15105 };
15106 gax::paginator::internal::new_paginator(token, execute)
15107 }
15108
15109 pub fn by_item(
15111 self,
15112 ) -> impl gax::paginator::ItemPaginator<crate::model::ListLakesResponse, gax::error::Error>
15113 {
15114 use gax::paginator::Paginator;
15115 self.by_page().items()
15116 }
15117
15118 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15122 self.0.request.parent = v.into();
15123 self
15124 }
15125
15126 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15128 self.0.request.page_size = v.into();
15129 self
15130 }
15131
15132 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15134 self.0.request.page_token = v.into();
15135 self
15136 }
15137
15138 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15140 self.0.request.filter = v.into();
15141 self
15142 }
15143
15144 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
15146 self.0.request.order_by = v.into();
15147 self
15148 }
15149 }
15150
15151 #[doc(hidden)]
15152 impl gax::options::internal::RequestBuilder for ListLakes {
15153 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15154 &mut self.0.options
15155 }
15156 }
15157
15158 #[derive(Clone, Debug)]
15176 pub struct GetLake(RequestBuilder<crate::model::GetLakeRequest>);
15177
15178 impl GetLake {
15179 pub(crate) fn new(
15180 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15181 ) -> Self {
15182 Self(RequestBuilder::new(stub))
15183 }
15184
15185 pub fn with_request<V: Into<crate::model::GetLakeRequest>>(mut self, v: V) -> Self {
15187 self.0.request = v.into();
15188 self
15189 }
15190
15191 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15193 self.0.options = v.into();
15194 self
15195 }
15196
15197 pub async fn send(self) -> Result<crate::model::Lake> {
15199 (*self.0.stub)
15200 .get_lake(self.0.request, self.0.options)
15201 .await
15202 .map(gax::response::Response::into_body)
15203 }
15204
15205 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15209 self.0.request.name = v.into();
15210 self
15211 }
15212 }
15213
15214 #[doc(hidden)]
15215 impl gax::options::internal::RequestBuilder for GetLake {
15216 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15217 &mut self.0.options
15218 }
15219 }
15220
15221 #[derive(Clone, Debug)]
15243 pub struct ListLakeActions(RequestBuilder<crate::model::ListLakeActionsRequest>);
15244
15245 impl ListLakeActions {
15246 pub(crate) fn new(
15247 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15248 ) -> Self {
15249 Self(RequestBuilder::new(stub))
15250 }
15251
15252 pub fn with_request<V: Into<crate::model::ListLakeActionsRequest>>(mut self, v: V) -> Self {
15254 self.0.request = v.into();
15255 self
15256 }
15257
15258 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15260 self.0.options = v.into();
15261 self
15262 }
15263
15264 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
15266 (*self.0.stub)
15267 .list_lake_actions(self.0.request, self.0.options)
15268 .await
15269 .map(gax::response::Response::into_body)
15270 }
15271
15272 pub fn by_page(
15274 self,
15275 ) -> impl gax::paginator::Paginator<crate::model::ListActionsResponse, gax::error::Error>
15276 {
15277 use std::clone::Clone;
15278 let token = self.0.request.page_token.clone();
15279 let execute = move |token: String| {
15280 let mut builder = self.clone();
15281 builder.0.request = builder.0.request.set_page_token(token);
15282 builder.send()
15283 };
15284 gax::paginator::internal::new_paginator(token, execute)
15285 }
15286
15287 pub fn by_item(
15289 self,
15290 ) -> impl gax::paginator::ItemPaginator<crate::model::ListActionsResponse, gax::error::Error>
15291 {
15292 use gax::paginator::Paginator;
15293 self.by_page().items()
15294 }
15295
15296 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15300 self.0.request.parent = v.into();
15301 self
15302 }
15303
15304 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15306 self.0.request.page_size = v.into();
15307 self
15308 }
15309
15310 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15312 self.0.request.page_token = v.into();
15313 self
15314 }
15315 }
15316
15317 #[doc(hidden)]
15318 impl gax::options::internal::RequestBuilder for ListLakeActions {
15319 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15320 &mut self.0.options
15321 }
15322 }
15323
15324 #[derive(Clone, Debug)]
15343 pub struct CreateZone(RequestBuilder<crate::model::CreateZoneRequest>);
15344
15345 impl CreateZone {
15346 pub(crate) fn new(
15347 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15348 ) -> Self {
15349 Self(RequestBuilder::new(stub))
15350 }
15351
15352 pub fn with_request<V: Into<crate::model::CreateZoneRequest>>(mut self, v: V) -> Self {
15354 self.0.request = v.into();
15355 self
15356 }
15357
15358 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15360 self.0.options = v.into();
15361 self
15362 }
15363
15364 pub async fn send(self) -> Result<longrunning::model::Operation> {
15371 (*self.0.stub)
15372 .create_zone(self.0.request, self.0.options)
15373 .await
15374 .map(gax::response::Response::into_body)
15375 }
15376
15377 pub fn poller(
15379 self,
15380 ) -> impl lro::Poller<crate::model::Zone, crate::model::OperationMetadata> {
15381 type Operation =
15382 lro::internal::Operation<crate::model::Zone, crate::model::OperationMetadata>;
15383 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15384 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15385
15386 let stub = self.0.stub.clone();
15387 let mut options = self.0.options.clone();
15388 options.set_retry_policy(gax::retry_policy::NeverRetry);
15389 let query = move |name| {
15390 let stub = stub.clone();
15391 let options = options.clone();
15392 async {
15393 let op = GetOperation::new(stub)
15394 .set_name(name)
15395 .with_options(options)
15396 .send()
15397 .await?;
15398 Ok(Operation::new(op))
15399 }
15400 };
15401
15402 let start = move || async {
15403 let op = self.send().await?;
15404 Ok(Operation::new(op))
15405 };
15406
15407 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
15408 }
15409
15410 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15414 self.0.request.parent = v.into();
15415 self
15416 }
15417
15418 pub fn set_zone_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
15422 self.0.request.zone_id = v.into();
15423 self
15424 }
15425
15426 pub fn set_zone<T>(mut self, v: T) -> Self
15430 where
15431 T: std::convert::Into<crate::model::Zone>,
15432 {
15433 self.0.request.zone = std::option::Option::Some(v.into());
15434 self
15435 }
15436
15437 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
15441 where
15442 T: std::convert::Into<crate::model::Zone>,
15443 {
15444 self.0.request.zone = v.map(|x| x.into());
15445 self
15446 }
15447
15448 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15450 self.0.request.validate_only = v.into();
15451 self
15452 }
15453 }
15454
15455 #[doc(hidden)]
15456 impl gax::options::internal::RequestBuilder for CreateZone {
15457 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15458 &mut self.0.options
15459 }
15460 }
15461
15462 #[derive(Clone, Debug)]
15481 pub struct UpdateZone(RequestBuilder<crate::model::UpdateZoneRequest>);
15482
15483 impl UpdateZone {
15484 pub(crate) fn new(
15485 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15486 ) -> Self {
15487 Self(RequestBuilder::new(stub))
15488 }
15489
15490 pub fn with_request<V: Into<crate::model::UpdateZoneRequest>>(mut self, v: V) -> Self {
15492 self.0.request = v.into();
15493 self
15494 }
15495
15496 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15498 self.0.options = v.into();
15499 self
15500 }
15501
15502 pub async fn send(self) -> Result<longrunning::model::Operation> {
15509 (*self.0.stub)
15510 .update_zone(self.0.request, self.0.options)
15511 .await
15512 .map(gax::response::Response::into_body)
15513 }
15514
15515 pub fn poller(
15517 self,
15518 ) -> impl lro::Poller<crate::model::Zone, crate::model::OperationMetadata> {
15519 type Operation =
15520 lro::internal::Operation<crate::model::Zone, crate::model::OperationMetadata>;
15521 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15522 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15523
15524 let stub = self.0.stub.clone();
15525 let mut options = self.0.options.clone();
15526 options.set_retry_policy(gax::retry_policy::NeverRetry);
15527 let query = move |name| {
15528 let stub = stub.clone();
15529 let options = options.clone();
15530 async {
15531 let op = GetOperation::new(stub)
15532 .set_name(name)
15533 .with_options(options)
15534 .send()
15535 .await?;
15536 Ok(Operation::new(op))
15537 }
15538 };
15539
15540 let start = move || async {
15541 let op = self.send().await?;
15542 Ok(Operation::new(op))
15543 };
15544
15545 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
15546 }
15547
15548 pub fn set_update_mask<T>(mut self, v: T) -> Self
15552 where
15553 T: std::convert::Into<wkt::FieldMask>,
15554 {
15555 self.0.request.update_mask = std::option::Option::Some(v.into());
15556 self
15557 }
15558
15559 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15563 where
15564 T: std::convert::Into<wkt::FieldMask>,
15565 {
15566 self.0.request.update_mask = v.map(|x| x.into());
15567 self
15568 }
15569
15570 pub fn set_zone<T>(mut self, v: T) -> Self
15574 where
15575 T: std::convert::Into<crate::model::Zone>,
15576 {
15577 self.0.request.zone = std::option::Option::Some(v.into());
15578 self
15579 }
15580
15581 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
15585 where
15586 T: std::convert::Into<crate::model::Zone>,
15587 {
15588 self.0.request.zone = v.map(|x| x.into());
15589 self
15590 }
15591
15592 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
15594 self.0.request.validate_only = v.into();
15595 self
15596 }
15597 }
15598
15599 #[doc(hidden)]
15600 impl gax::options::internal::RequestBuilder for UpdateZone {
15601 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15602 &mut self.0.options
15603 }
15604 }
15605
15606 #[derive(Clone, Debug)]
15625 pub struct DeleteZone(RequestBuilder<crate::model::DeleteZoneRequest>);
15626
15627 impl DeleteZone {
15628 pub(crate) fn new(
15629 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15630 ) -> Self {
15631 Self(RequestBuilder::new(stub))
15632 }
15633
15634 pub fn with_request<V: Into<crate::model::DeleteZoneRequest>>(mut self, v: V) -> Self {
15636 self.0.request = v.into();
15637 self
15638 }
15639
15640 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15642 self.0.options = v.into();
15643 self
15644 }
15645
15646 pub async fn send(self) -> Result<longrunning::model::Operation> {
15653 (*self.0.stub)
15654 .delete_zone(self.0.request, self.0.options)
15655 .await
15656 .map(gax::response::Response::into_body)
15657 }
15658
15659 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
15661 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
15662 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15663 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15664
15665 let stub = self.0.stub.clone();
15666 let mut options = self.0.options.clone();
15667 options.set_retry_policy(gax::retry_policy::NeverRetry);
15668 let query = move |name| {
15669 let stub = stub.clone();
15670 let options = options.clone();
15671 async {
15672 let op = GetOperation::new(stub)
15673 .set_name(name)
15674 .with_options(options)
15675 .send()
15676 .await?;
15677 Ok(Operation::new(op))
15678 }
15679 };
15680
15681 let start = move || async {
15682 let op = self.send().await?;
15683 Ok(Operation::new(op))
15684 };
15685
15686 lro::internal::new_unit_response_poller(
15687 polling_error_policy,
15688 polling_backoff_policy,
15689 start,
15690 query,
15691 )
15692 }
15693
15694 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15698 self.0.request.name = v.into();
15699 self
15700 }
15701 }
15702
15703 #[doc(hidden)]
15704 impl gax::options::internal::RequestBuilder for DeleteZone {
15705 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15706 &mut self.0.options
15707 }
15708 }
15709
15710 #[derive(Clone, Debug)]
15732 pub struct ListZones(RequestBuilder<crate::model::ListZonesRequest>);
15733
15734 impl ListZones {
15735 pub(crate) fn new(
15736 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15737 ) -> Self {
15738 Self(RequestBuilder::new(stub))
15739 }
15740
15741 pub fn with_request<V: Into<crate::model::ListZonesRequest>>(mut self, v: V) -> Self {
15743 self.0.request = v.into();
15744 self
15745 }
15746
15747 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15749 self.0.options = v.into();
15750 self
15751 }
15752
15753 pub async fn send(self) -> Result<crate::model::ListZonesResponse> {
15755 (*self.0.stub)
15756 .list_zones(self.0.request, self.0.options)
15757 .await
15758 .map(gax::response::Response::into_body)
15759 }
15760
15761 pub fn by_page(
15763 self,
15764 ) -> impl gax::paginator::Paginator<crate::model::ListZonesResponse, gax::error::Error>
15765 {
15766 use std::clone::Clone;
15767 let token = self.0.request.page_token.clone();
15768 let execute = move |token: String| {
15769 let mut builder = self.clone();
15770 builder.0.request = builder.0.request.set_page_token(token);
15771 builder.send()
15772 };
15773 gax::paginator::internal::new_paginator(token, execute)
15774 }
15775
15776 pub fn by_item(
15778 self,
15779 ) -> impl gax::paginator::ItemPaginator<crate::model::ListZonesResponse, gax::error::Error>
15780 {
15781 use gax::paginator::Paginator;
15782 self.by_page().items()
15783 }
15784
15785 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15789 self.0.request.parent = v.into();
15790 self
15791 }
15792
15793 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15795 self.0.request.page_size = v.into();
15796 self
15797 }
15798
15799 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15801 self.0.request.page_token = v.into();
15802 self
15803 }
15804
15805 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15807 self.0.request.filter = v.into();
15808 self
15809 }
15810
15811 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
15813 self.0.request.order_by = v.into();
15814 self
15815 }
15816 }
15817
15818 #[doc(hidden)]
15819 impl gax::options::internal::RequestBuilder for ListZones {
15820 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15821 &mut self.0.options
15822 }
15823 }
15824
15825 #[derive(Clone, Debug)]
15843 pub struct GetZone(RequestBuilder<crate::model::GetZoneRequest>);
15844
15845 impl GetZone {
15846 pub(crate) fn new(
15847 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15848 ) -> Self {
15849 Self(RequestBuilder::new(stub))
15850 }
15851
15852 pub fn with_request<V: Into<crate::model::GetZoneRequest>>(mut self, v: V) -> Self {
15854 self.0.request = v.into();
15855 self
15856 }
15857
15858 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15860 self.0.options = v.into();
15861 self
15862 }
15863
15864 pub async fn send(self) -> Result<crate::model::Zone> {
15866 (*self.0.stub)
15867 .get_zone(self.0.request, self.0.options)
15868 .await
15869 .map(gax::response::Response::into_body)
15870 }
15871
15872 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15876 self.0.request.name = v.into();
15877 self
15878 }
15879 }
15880
15881 #[doc(hidden)]
15882 impl gax::options::internal::RequestBuilder for GetZone {
15883 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15884 &mut self.0.options
15885 }
15886 }
15887
15888 #[derive(Clone, Debug)]
15910 pub struct ListZoneActions(RequestBuilder<crate::model::ListZoneActionsRequest>);
15911
15912 impl ListZoneActions {
15913 pub(crate) fn new(
15914 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
15915 ) -> Self {
15916 Self(RequestBuilder::new(stub))
15917 }
15918
15919 pub fn with_request<V: Into<crate::model::ListZoneActionsRequest>>(mut self, v: V) -> Self {
15921 self.0.request = v.into();
15922 self
15923 }
15924
15925 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
15927 self.0.options = v.into();
15928 self
15929 }
15930
15931 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
15933 (*self.0.stub)
15934 .list_zone_actions(self.0.request, self.0.options)
15935 .await
15936 .map(gax::response::Response::into_body)
15937 }
15938
15939 pub fn by_page(
15941 self,
15942 ) -> impl gax::paginator::Paginator<crate::model::ListActionsResponse, gax::error::Error>
15943 {
15944 use std::clone::Clone;
15945 let token = self.0.request.page_token.clone();
15946 let execute = move |token: String| {
15947 let mut builder = self.clone();
15948 builder.0.request = builder.0.request.set_page_token(token);
15949 builder.send()
15950 };
15951 gax::paginator::internal::new_paginator(token, execute)
15952 }
15953
15954 pub fn by_item(
15956 self,
15957 ) -> impl gax::paginator::ItemPaginator<crate::model::ListActionsResponse, gax::error::Error>
15958 {
15959 use gax::paginator::Paginator;
15960 self.by_page().items()
15961 }
15962
15963 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15967 self.0.request.parent = v.into();
15968 self
15969 }
15970
15971 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15973 self.0.request.page_size = v.into();
15974 self
15975 }
15976
15977 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15979 self.0.request.page_token = v.into();
15980 self
15981 }
15982 }
15983
15984 #[doc(hidden)]
15985 impl gax::options::internal::RequestBuilder for ListZoneActions {
15986 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
15987 &mut self.0.options
15988 }
15989 }
15990
15991 #[derive(Clone, Debug)]
16010 pub struct CreateAsset(RequestBuilder<crate::model::CreateAssetRequest>);
16011
16012 impl CreateAsset {
16013 pub(crate) fn new(
16014 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16015 ) -> Self {
16016 Self(RequestBuilder::new(stub))
16017 }
16018
16019 pub fn with_request<V: Into<crate::model::CreateAssetRequest>>(mut self, v: V) -> Self {
16021 self.0.request = v.into();
16022 self
16023 }
16024
16025 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16027 self.0.options = v.into();
16028 self
16029 }
16030
16031 pub async fn send(self) -> Result<longrunning::model::Operation> {
16038 (*self.0.stub)
16039 .create_asset(self.0.request, self.0.options)
16040 .await
16041 .map(gax::response::Response::into_body)
16042 }
16043
16044 pub fn poller(
16046 self,
16047 ) -> impl lro::Poller<crate::model::Asset, crate::model::OperationMetadata> {
16048 type Operation =
16049 lro::internal::Operation<crate::model::Asset, crate::model::OperationMetadata>;
16050 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16051 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16052
16053 let stub = self.0.stub.clone();
16054 let mut options = self.0.options.clone();
16055 options.set_retry_policy(gax::retry_policy::NeverRetry);
16056 let query = move |name| {
16057 let stub = stub.clone();
16058 let options = options.clone();
16059 async {
16060 let op = GetOperation::new(stub)
16061 .set_name(name)
16062 .with_options(options)
16063 .send()
16064 .await?;
16065 Ok(Operation::new(op))
16066 }
16067 };
16068
16069 let start = move || async {
16070 let op = self.send().await?;
16071 Ok(Operation::new(op))
16072 };
16073
16074 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
16075 }
16076
16077 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16081 self.0.request.parent = v.into();
16082 self
16083 }
16084
16085 pub fn set_asset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16089 self.0.request.asset_id = v.into();
16090 self
16091 }
16092
16093 pub fn set_asset<T>(mut self, v: T) -> Self
16097 where
16098 T: std::convert::Into<crate::model::Asset>,
16099 {
16100 self.0.request.asset = std::option::Option::Some(v.into());
16101 self
16102 }
16103
16104 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
16108 where
16109 T: std::convert::Into<crate::model::Asset>,
16110 {
16111 self.0.request.asset = v.map(|x| x.into());
16112 self
16113 }
16114
16115 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16117 self.0.request.validate_only = v.into();
16118 self
16119 }
16120 }
16121
16122 #[doc(hidden)]
16123 impl gax::options::internal::RequestBuilder for CreateAsset {
16124 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16125 &mut self.0.options
16126 }
16127 }
16128
16129 #[derive(Clone, Debug)]
16148 pub struct UpdateAsset(RequestBuilder<crate::model::UpdateAssetRequest>);
16149
16150 impl UpdateAsset {
16151 pub(crate) fn new(
16152 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16153 ) -> Self {
16154 Self(RequestBuilder::new(stub))
16155 }
16156
16157 pub fn with_request<V: Into<crate::model::UpdateAssetRequest>>(mut self, v: V) -> Self {
16159 self.0.request = v.into();
16160 self
16161 }
16162
16163 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16165 self.0.options = v.into();
16166 self
16167 }
16168
16169 pub async fn send(self) -> Result<longrunning::model::Operation> {
16176 (*self.0.stub)
16177 .update_asset(self.0.request, self.0.options)
16178 .await
16179 .map(gax::response::Response::into_body)
16180 }
16181
16182 pub fn poller(
16184 self,
16185 ) -> impl lro::Poller<crate::model::Asset, crate::model::OperationMetadata> {
16186 type Operation =
16187 lro::internal::Operation<crate::model::Asset, crate::model::OperationMetadata>;
16188 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16189 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16190
16191 let stub = self.0.stub.clone();
16192 let mut options = self.0.options.clone();
16193 options.set_retry_policy(gax::retry_policy::NeverRetry);
16194 let query = move |name| {
16195 let stub = stub.clone();
16196 let options = options.clone();
16197 async {
16198 let op = GetOperation::new(stub)
16199 .set_name(name)
16200 .with_options(options)
16201 .send()
16202 .await?;
16203 Ok(Operation::new(op))
16204 }
16205 };
16206
16207 let start = move || async {
16208 let op = self.send().await?;
16209 Ok(Operation::new(op))
16210 };
16211
16212 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
16213 }
16214
16215 pub fn set_update_mask<T>(mut self, v: T) -> Self
16219 where
16220 T: std::convert::Into<wkt::FieldMask>,
16221 {
16222 self.0.request.update_mask = std::option::Option::Some(v.into());
16223 self
16224 }
16225
16226 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16230 where
16231 T: std::convert::Into<wkt::FieldMask>,
16232 {
16233 self.0.request.update_mask = v.map(|x| x.into());
16234 self
16235 }
16236
16237 pub fn set_asset<T>(mut self, v: T) -> Self
16241 where
16242 T: std::convert::Into<crate::model::Asset>,
16243 {
16244 self.0.request.asset = std::option::Option::Some(v.into());
16245 self
16246 }
16247
16248 pub fn set_or_clear_asset<T>(mut self, v: std::option::Option<T>) -> Self
16252 where
16253 T: std::convert::Into<crate::model::Asset>,
16254 {
16255 self.0.request.asset = v.map(|x| x.into());
16256 self
16257 }
16258
16259 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16261 self.0.request.validate_only = v.into();
16262 self
16263 }
16264 }
16265
16266 #[doc(hidden)]
16267 impl gax::options::internal::RequestBuilder for UpdateAsset {
16268 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16269 &mut self.0.options
16270 }
16271 }
16272
16273 #[derive(Clone, Debug)]
16292 pub struct DeleteAsset(RequestBuilder<crate::model::DeleteAssetRequest>);
16293
16294 impl DeleteAsset {
16295 pub(crate) fn new(
16296 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16297 ) -> Self {
16298 Self(RequestBuilder::new(stub))
16299 }
16300
16301 pub fn with_request<V: Into<crate::model::DeleteAssetRequest>>(mut self, v: V) -> Self {
16303 self.0.request = v.into();
16304 self
16305 }
16306
16307 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16309 self.0.options = v.into();
16310 self
16311 }
16312
16313 pub async fn send(self) -> Result<longrunning::model::Operation> {
16320 (*self.0.stub)
16321 .delete_asset(self.0.request, self.0.options)
16322 .await
16323 .map(gax::response::Response::into_body)
16324 }
16325
16326 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
16328 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16329 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16330 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16331
16332 let stub = self.0.stub.clone();
16333 let mut options = self.0.options.clone();
16334 options.set_retry_policy(gax::retry_policy::NeverRetry);
16335 let query = move |name| {
16336 let stub = stub.clone();
16337 let options = options.clone();
16338 async {
16339 let op = GetOperation::new(stub)
16340 .set_name(name)
16341 .with_options(options)
16342 .send()
16343 .await?;
16344 Ok(Operation::new(op))
16345 }
16346 };
16347
16348 let start = move || async {
16349 let op = self.send().await?;
16350 Ok(Operation::new(op))
16351 };
16352
16353 lro::internal::new_unit_response_poller(
16354 polling_error_policy,
16355 polling_backoff_policy,
16356 start,
16357 query,
16358 )
16359 }
16360
16361 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16365 self.0.request.name = v.into();
16366 self
16367 }
16368 }
16369
16370 #[doc(hidden)]
16371 impl gax::options::internal::RequestBuilder for DeleteAsset {
16372 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16373 &mut self.0.options
16374 }
16375 }
16376
16377 #[derive(Clone, Debug)]
16399 pub struct ListAssets(RequestBuilder<crate::model::ListAssetsRequest>);
16400
16401 impl ListAssets {
16402 pub(crate) fn new(
16403 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16404 ) -> Self {
16405 Self(RequestBuilder::new(stub))
16406 }
16407
16408 pub fn with_request<V: Into<crate::model::ListAssetsRequest>>(mut self, v: V) -> Self {
16410 self.0.request = v.into();
16411 self
16412 }
16413
16414 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16416 self.0.options = v.into();
16417 self
16418 }
16419
16420 pub async fn send(self) -> Result<crate::model::ListAssetsResponse> {
16422 (*self.0.stub)
16423 .list_assets(self.0.request, self.0.options)
16424 .await
16425 .map(gax::response::Response::into_body)
16426 }
16427
16428 pub fn by_page(
16430 self,
16431 ) -> impl gax::paginator::Paginator<crate::model::ListAssetsResponse, gax::error::Error>
16432 {
16433 use std::clone::Clone;
16434 let token = self.0.request.page_token.clone();
16435 let execute = move |token: String| {
16436 let mut builder = self.clone();
16437 builder.0.request = builder.0.request.set_page_token(token);
16438 builder.send()
16439 };
16440 gax::paginator::internal::new_paginator(token, execute)
16441 }
16442
16443 pub fn by_item(
16445 self,
16446 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAssetsResponse, gax::error::Error>
16447 {
16448 use gax::paginator::Paginator;
16449 self.by_page().items()
16450 }
16451
16452 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16456 self.0.request.parent = v.into();
16457 self
16458 }
16459
16460 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16462 self.0.request.page_size = v.into();
16463 self
16464 }
16465
16466 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16468 self.0.request.page_token = v.into();
16469 self
16470 }
16471
16472 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16474 self.0.request.filter = v.into();
16475 self
16476 }
16477
16478 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
16480 self.0.request.order_by = v.into();
16481 self
16482 }
16483 }
16484
16485 #[doc(hidden)]
16486 impl gax::options::internal::RequestBuilder for ListAssets {
16487 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16488 &mut self.0.options
16489 }
16490 }
16491
16492 #[derive(Clone, Debug)]
16510 pub struct GetAsset(RequestBuilder<crate::model::GetAssetRequest>);
16511
16512 impl GetAsset {
16513 pub(crate) fn new(
16514 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16515 ) -> Self {
16516 Self(RequestBuilder::new(stub))
16517 }
16518
16519 pub fn with_request<V: Into<crate::model::GetAssetRequest>>(mut self, v: V) -> Self {
16521 self.0.request = v.into();
16522 self
16523 }
16524
16525 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16527 self.0.options = v.into();
16528 self
16529 }
16530
16531 pub async fn send(self) -> Result<crate::model::Asset> {
16533 (*self.0.stub)
16534 .get_asset(self.0.request, self.0.options)
16535 .await
16536 .map(gax::response::Response::into_body)
16537 }
16538
16539 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16543 self.0.request.name = v.into();
16544 self
16545 }
16546 }
16547
16548 #[doc(hidden)]
16549 impl gax::options::internal::RequestBuilder for GetAsset {
16550 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16551 &mut self.0.options
16552 }
16553 }
16554
16555 #[derive(Clone, Debug)]
16577 pub struct ListAssetActions(RequestBuilder<crate::model::ListAssetActionsRequest>);
16578
16579 impl ListAssetActions {
16580 pub(crate) fn new(
16581 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16582 ) -> Self {
16583 Self(RequestBuilder::new(stub))
16584 }
16585
16586 pub fn with_request<V: Into<crate::model::ListAssetActionsRequest>>(
16588 mut self,
16589 v: V,
16590 ) -> Self {
16591 self.0.request = v.into();
16592 self
16593 }
16594
16595 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16597 self.0.options = v.into();
16598 self
16599 }
16600
16601 pub async fn send(self) -> Result<crate::model::ListActionsResponse> {
16603 (*self.0.stub)
16604 .list_asset_actions(self.0.request, self.0.options)
16605 .await
16606 .map(gax::response::Response::into_body)
16607 }
16608
16609 pub fn by_page(
16611 self,
16612 ) -> impl gax::paginator::Paginator<crate::model::ListActionsResponse, gax::error::Error>
16613 {
16614 use std::clone::Clone;
16615 let token = self.0.request.page_token.clone();
16616 let execute = move |token: String| {
16617 let mut builder = self.clone();
16618 builder.0.request = builder.0.request.set_page_token(token);
16619 builder.send()
16620 };
16621 gax::paginator::internal::new_paginator(token, execute)
16622 }
16623
16624 pub fn by_item(
16626 self,
16627 ) -> impl gax::paginator::ItemPaginator<crate::model::ListActionsResponse, gax::error::Error>
16628 {
16629 use gax::paginator::Paginator;
16630 self.by_page().items()
16631 }
16632
16633 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16637 self.0.request.parent = v.into();
16638 self
16639 }
16640
16641 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16643 self.0.request.page_size = v.into();
16644 self
16645 }
16646
16647 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16649 self.0.request.page_token = v.into();
16650 self
16651 }
16652 }
16653
16654 #[doc(hidden)]
16655 impl gax::options::internal::RequestBuilder for ListAssetActions {
16656 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16657 &mut self.0.options
16658 }
16659 }
16660
16661 #[derive(Clone, Debug)]
16680 pub struct CreateTask(RequestBuilder<crate::model::CreateTaskRequest>);
16681
16682 impl CreateTask {
16683 pub(crate) fn new(
16684 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16685 ) -> Self {
16686 Self(RequestBuilder::new(stub))
16687 }
16688
16689 pub fn with_request<V: Into<crate::model::CreateTaskRequest>>(mut self, v: V) -> Self {
16691 self.0.request = v.into();
16692 self
16693 }
16694
16695 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16697 self.0.options = v.into();
16698 self
16699 }
16700
16701 pub async fn send(self) -> Result<longrunning::model::Operation> {
16708 (*self.0.stub)
16709 .create_task(self.0.request, self.0.options)
16710 .await
16711 .map(gax::response::Response::into_body)
16712 }
16713
16714 pub fn poller(
16716 self,
16717 ) -> impl lro::Poller<crate::model::Task, crate::model::OperationMetadata> {
16718 type Operation =
16719 lro::internal::Operation<crate::model::Task, crate::model::OperationMetadata>;
16720 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16721 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16722
16723 let stub = self.0.stub.clone();
16724 let mut options = self.0.options.clone();
16725 options.set_retry_policy(gax::retry_policy::NeverRetry);
16726 let query = move |name| {
16727 let stub = stub.clone();
16728 let options = options.clone();
16729 async {
16730 let op = GetOperation::new(stub)
16731 .set_name(name)
16732 .with_options(options)
16733 .send()
16734 .await?;
16735 Ok(Operation::new(op))
16736 }
16737 };
16738
16739 let start = move || async {
16740 let op = self.send().await?;
16741 Ok(Operation::new(op))
16742 };
16743
16744 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
16745 }
16746
16747 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16751 self.0.request.parent = v.into();
16752 self
16753 }
16754
16755 pub fn set_task_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
16759 self.0.request.task_id = v.into();
16760 self
16761 }
16762
16763 pub fn set_task<T>(mut self, v: T) -> Self
16767 where
16768 T: std::convert::Into<crate::model::Task>,
16769 {
16770 self.0.request.task = std::option::Option::Some(v.into());
16771 self
16772 }
16773
16774 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
16778 where
16779 T: std::convert::Into<crate::model::Task>,
16780 {
16781 self.0.request.task = v.map(|x| x.into());
16782 self
16783 }
16784
16785 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16787 self.0.request.validate_only = v.into();
16788 self
16789 }
16790 }
16791
16792 #[doc(hidden)]
16793 impl gax::options::internal::RequestBuilder for CreateTask {
16794 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16795 &mut self.0.options
16796 }
16797 }
16798
16799 #[derive(Clone, Debug)]
16818 pub struct UpdateTask(RequestBuilder<crate::model::UpdateTaskRequest>);
16819
16820 impl UpdateTask {
16821 pub(crate) fn new(
16822 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16823 ) -> Self {
16824 Self(RequestBuilder::new(stub))
16825 }
16826
16827 pub fn with_request<V: Into<crate::model::UpdateTaskRequest>>(mut self, v: V) -> Self {
16829 self.0.request = v.into();
16830 self
16831 }
16832
16833 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16835 self.0.options = v.into();
16836 self
16837 }
16838
16839 pub async fn send(self) -> Result<longrunning::model::Operation> {
16846 (*self.0.stub)
16847 .update_task(self.0.request, self.0.options)
16848 .await
16849 .map(gax::response::Response::into_body)
16850 }
16851
16852 pub fn poller(
16854 self,
16855 ) -> impl lro::Poller<crate::model::Task, crate::model::OperationMetadata> {
16856 type Operation =
16857 lro::internal::Operation<crate::model::Task, crate::model::OperationMetadata>;
16858 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16859 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16860
16861 let stub = self.0.stub.clone();
16862 let mut options = self.0.options.clone();
16863 options.set_retry_policy(gax::retry_policy::NeverRetry);
16864 let query = move |name| {
16865 let stub = stub.clone();
16866 let options = options.clone();
16867 async {
16868 let op = GetOperation::new(stub)
16869 .set_name(name)
16870 .with_options(options)
16871 .send()
16872 .await?;
16873 Ok(Operation::new(op))
16874 }
16875 };
16876
16877 let start = move || async {
16878 let op = self.send().await?;
16879 Ok(Operation::new(op))
16880 };
16881
16882 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
16883 }
16884
16885 pub fn set_update_mask<T>(mut self, v: T) -> Self
16889 where
16890 T: std::convert::Into<wkt::FieldMask>,
16891 {
16892 self.0.request.update_mask = std::option::Option::Some(v.into());
16893 self
16894 }
16895
16896 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16900 where
16901 T: std::convert::Into<wkt::FieldMask>,
16902 {
16903 self.0.request.update_mask = v.map(|x| x.into());
16904 self
16905 }
16906
16907 pub fn set_task<T>(mut self, v: T) -> Self
16911 where
16912 T: std::convert::Into<crate::model::Task>,
16913 {
16914 self.0.request.task = std::option::Option::Some(v.into());
16915 self
16916 }
16917
16918 pub fn set_or_clear_task<T>(mut self, v: std::option::Option<T>) -> Self
16922 where
16923 T: std::convert::Into<crate::model::Task>,
16924 {
16925 self.0.request.task = v.map(|x| x.into());
16926 self
16927 }
16928
16929 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
16931 self.0.request.validate_only = v.into();
16932 self
16933 }
16934 }
16935
16936 #[doc(hidden)]
16937 impl gax::options::internal::RequestBuilder for UpdateTask {
16938 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
16939 &mut self.0.options
16940 }
16941 }
16942
16943 #[derive(Clone, Debug)]
16962 pub struct DeleteTask(RequestBuilder<crate::model::DeleteTaskRequest>);
16963
16964 impl DeleteTask {
16965 pub(crate) fn new(
16966 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
16967 ) -> Self {
16968 Self(RequestBuilder::new(stub))
16969 }
16970
16971 pub fn with_request<V: Into<crate::model::DeleteTaskRequest>>(mut self, v: V) -> Self {
16973 self.0.request = v.into();
16974 self
16975 }
16976
16977 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
16979 self.0.options = v.into();
16980 self
16981 }
16982
16983 pub async fn send(self) -> Result<longrunning::model::Operation> {
16990 (*self.0.stub)
16991 .delete_task(self.0.request, self.0.options)
16992 .await
16993 .map(gax::response::Response::into_body)
16994 }
16995
16996 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
16998 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
16999 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17000 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17001
17002 let stub = self.0.stub.clone();
17003 let mut options = self.0.options.clone();
17004 options.set_retry_policy(gax::retry_policy::NeverRetry);
17005 let query = move |name| {
17006 let stub = stub.clone();
17007 let options = options.clone();
17008 async {
17009 let op = GetOperation::new(stub)
17010 .set_name(name)
17011 .with_options(options)
17012 .send()
17013 .await?;
17014 Ok(Operation::new(op))
17015 }
17016 };
17017
17018 let start = move || async {
17019 let op = self.send().await?;
17020 Ok(Operation::new(op))
17021 };
17022
17023 lro::internal::new_unit_response_poller(
17024 polling_error_policy,
17025 polling_backoff_policy,
17026 start,
17027 query,
17028 )
17029 }
17030
17031 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17035 self.0.request.name = v.into();
17036 self
17037 }
17038 }
17039
17040 #[doc(hidden)]
17041 impl gax::options::internal::RequestBuilder for DeleteTask {
17042 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17043 &mut self.0.options
17044 }
17045 }
17046
17047 #[derive(Clone, Debug)]
17069 pub struct ListTasks(RequestBuilder<crate::model::ListTasksRequest>);
17070
17071 impl ListTasks {
17072 pub(crate) fn new(
17073 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17074 ) -> Self {
17075 Self(RequestBuilder::new(stub))
17076 }
17077
17078 pub fn with_request<V: Into<crate::model::ListTasksRequest>>(mut self, v: V) -> Self {
17080 self.0.request = v.into();
17081 self
17082 }
17083
17084 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17086 self.0.options = v.into();
17087 self
17088 }
17089
17090 pub async fn send(self) -> Result<crate::model::ListTasksResponse> {
17092 (*self.0.stub)
17093 .list_tasks(self.0.request, self.0.options)
17094 .await
17095 .map(gax::response::Response::into_body)
17096 }
17097
17098 pub fn by_page(
17100 self,
17101 ) -> impl gax::paginator::Paginator<crate::model::ListTasksResponse, gax::error::Error>
17102 {
17103 use std::clone::Clone;
17104 let token = self.0.request.page_token.clone();
17105 let execute = move |token: String| {
17106 let mut builder = self.clone();
17107 builder.0.request = builder.0.request.set_page_token(token);
17108 builder.send()
17109 };
17110 gax::paginator::internal::new_paginator(token, execute)
17111 }
17112
17113 pub fn by_item(
17115 self,
17116 ) -> impl gax::paginator::ItemPaginator<crate::model::ListTasksResponse, gax::error::Error>
17117 {
17118 use gax::paginator::Paginator;
17119 self.by_page().items()
17120 }
17121
17122 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17126 self.0.request.parent = v.into();
17127 self
17128 }
17129
17130 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17132 self.0.request.page_size = v.into();
17133 self
17134 }
17135
17136 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17138 self.0.request.page_token = v.into();
17139 self
17140 }
17141
17142 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17144 self.0.request.filter = v.into();
17145 self
17146 }
17147
17148 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
17150 self.0.request.order_by = v.into();
17151 self
17152 }
17153 }
17154
17155 #[doc(hidden)]
17156 impl gax::options::internal::RequestBuilder for ListTasks {
17157 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17158 &mut self.0.options
17159 }
17160 }
17161
17162 #[derive(Clone, Debug)]
17180 pub struct GetTask(RequestBuilder<crate::model::GetTaskRequest>);
17181
17182 impl GetTask {
17183 pub(crate) fn new(
17184 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17185 ) -> Self {
17186 Self(RequestBuilder::new(stub))
17187 }
17188
17189 pub fn with_request<V: Into<crate::model::GetTaskRequest>>(mut self, v: V) -> Self {
17191 self.0.request = v.into();
17192 self
17193 }
17194
17195 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17197 self.0.options = v.into();
17198 self
17199 }
17200
17201 pub async fn send(self) -> Result<crate::model::Task> {
17203 (*self.0.stub)
17204 .get_task(self.0.request, self.0.options)
17205 .await
17206 .map(gax::response::Response::into_body)
17207 }
17208
17209 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17213 self.0.request.name = v.into();
17214 self
17215 }
17216 }
17217
17218 #[doc(hidden)]
17219 impl gax::options::internal::RequestBuilder for GetTask {
17220 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17221 &mut self.0.options
17222 }
17223 }
17224
17225 #[derive(Clone, Debug)]
17247 pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
17248
17249 impl ListJobs {
17250 pub(crate) fn new(
17251 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17252 ) -> Self {
17253 Self(RequestBuilder::new(stub))
17254 }
17255
17256 pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
17258 self.0.request = v.into();
17259 self
17260 }
17261
17262 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17264 self.0.options = v.into();
17265 self
17266 }
17267
17268 pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
17270 (*self.0.stub)
17271 .list_jobs(self.0.request, self.0.options)
17272 .await
17273 .map(gax::response::Response::into_body)
17274 }
17275
17276 pub fn by_page(
17278 self,
17279 ) -> impl gax::paginator::Paginator<crate::model::ListJobsResponse, gax::error::Error>
17280 {
17281 use std::clone::Clone;
17282 let token = self.0.request.page_token.clone();
17283 let execute = move |token: String| {
17284 let mut builder = self.clone();
17285 builder.0.request = builder.0.request.set_page_token(token);
17286 builder.send()
17287 };
17288 gax::paginator::internal::new_paginator(token, execute)
17289 }
17290
17291 pub fn by_item(
17293 self,
17294 ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobsResponse, gax::error::Error>
17295 {
17296 use gax::paginator::Paginator;
17297 self.by_page().items()
17298 }
17299
17300 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17304 self.0.request.parent = v.into();
17305 self
17306 }
17307
17308 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17310 self.0.request.page_size = v.into();
17311 self
17312 }
17313
17314 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17316 self.0.request.page_token = v.into();
17317 self
17318 }
17319 }
17320
17321 #[doc(hidden)]
17322 impl gax::options::internal::RequestBuilder for ListJobs {
17323 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17324 &mut self.0.options
17325 }
17326 }
17327
17328 #[derive(Clone, Debug)]
17346 pub struct RunTask(RequestBuilder<crate::model::RunTaskRequest>);
17347
17348 impl RunTask {
17349 pub(crate) fn new(
17350 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17351 ) -> Self {
17352 Self(RequestBuilder::new(stub))
17353 }
17354
17355 pub fn with_request<V: Into<crate::model::RunTaskRequest>>(mut self, v: V) -> Self {
17357 self.0.request = v.into();
17358 self
17359 }
17360
17361 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17363 self.0.options = v.into();
17364 self
17365 }
17366
17367 pub async fn send(self) -> Result<crate::model::RunTaskResponse> {
17369 (*self.0.stub)
17370 .run_task(self.0.request, self.0.options)
17371 .await
17372 .map(gax::response::Response::into_body)
17373 }
17374
17375 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17379 self.0.request.name = v.into();
17380 self
17381 }
17382
17383 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17385 where
17386 T: std::iter::IntoIterator<Item = (K, V)>,
17387 K: std::convert::Into<std::string::String>,
17388 V: std::convert::Into<std::string::String>,
17389 {
17390 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17391 self
17392 }
17393
17394 pub fn set_args<T, K, V>(mut self, v: T) -> Self
17396 where
17397 T: std::iter::IntoIterator<Item = (K, V)>,
17398 K: std::convert::Into<std::string::String>,
17399 V: std::convert::Into<std::string::String>,
17400 {
17401 self.0.request.args = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17402 self
17403 }
17404 }
17405
17406 #[doc(hidden)]
17407 impl gax::options::internal::RequestBuilder for RunTask {
17408 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17409 &mut self.0.options
17410 }
17411 }
17412
17413 #[derive(Clone, Debug)]
17431 pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
17432
17433 impl GetJob {
17434 pub(crate) fn new(
17435 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17436 ) -> Self {
17437 Self(RequestBuilder::new(stub))
17438 }
17439
17440 pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
17442 self.0.request = v.into();
17443 self
17444 }
17445
17446 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17448 self.0.options = v.into();
17449 self
17450 }
17451
17452 pub async fn send(self) -> Result<crate::model::Job> {
17454 (*self.0.stub)
17455 .get_job(self.0.request, self.0.options)
17456 .await
17457 .map(gax::response::Response::into_body)
17458 }
17459
17460 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17464 self.0.request.name = v.into();
17465 self
17466 }
17467 }
17468
17469 #[doc(hidden)]
17470 impl gax::options::internal::RequestBuilder for GetJob {
17471 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17472 &mut self.0.options
17473 }
17474 }
17475
17476 #[derive(Clone, Debug)]
17494 pub struct CancelJob(RequestBuilder<crate::model::CancelJobRequest>);
17495
17496 impl CancelJob {
17497 pub(crate) fn new(
17498 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17499 ) -> Self {
17500 Self(RequestBuilder::new(stub))
17501 }
17502
17503 pub fn with_request<V: Into<crate::model::CancelJobRequest>>(mut self, v: V) -> Self {
17505 self.0.request = v.into();
17506 self
17507 }
17508
17509 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17511 self.0.options = v.into();
17512 self
17513 }
17514
17515 pub async fn send(self) -> Result<()> {
17517 (*self.0.stub)
17518 .cancel_job(self.0.request, self.0.options)
17519 .await
17520 .map(gax::response::Response::into_body)
17521 }
17522
17523 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17527 self.0.request.name = v.into();
17528 self
17529 }
17530 }
17531
17532 #[doc(hidden)]
17533 impl gax::options::internal::RequestBuilder for CancelJob {
17534 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17535 &mut self.0.options
17536 }
17537 }
17538
17539 #[derive(Clone, Debug)]
17558 pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
17559
17560 impl CreateEnvironment {
17561 pub(crate) fn new(
17562 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17563 ) -> Self {
17564 Self(RequestBuilder::new(stub))
17565 }
17566
17567 pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
17569 mut self,
17570 v: V,
17571 ) -> Self {
17572 self.0.request = v.into();
17573 self
17574 }
17575
17576 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17578 self.0.options = v.into();
17579 self
17580 }
17581
17582 pub async fn send(self) -> Result<longrunning::model::Operation> {
17589 (*self.0.stub)
17590 .create_environment(self.0.request, self.0.options)
17591 .await
17592 .map(gax::response::Response::into_body)
17593 }
17594
17595 pub fn poller(
17597 self,
17598 ) -> impl lro::Poller<crate::model::Environment, crate::model::OperationMetadata> {
17599 type Operation = lro::internal::Operation<
17600 crate::model::Environment,
17601 crate::model::OperationMetadata,
17602 >;
17603 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17604 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17605
17606 let stub = self.0.stub.clone();
17607 let mut options = self.0.options.clone();
17608 options.set_retry_policy(gax::retry_policy::NeverRetry);
17609 let query = move |name| {
17610 let stub = stub.clone();
17611 let options = options.clone();
17612 async {
17613 let op = GetOperation::new(stub)
17614 .set_name(name)
17615 .with_options(options)
17616 .send()
17617 .await?;
17618 Ok(Operation::new(op))
17619 }
17620 };
17621
17622 let start = move || async {
17623 let op = self.send().await?;
17624 Ok(Operation::new(op))
17625 };
17626
17627 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
17628 }
17629
17630 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17634 self.0.request.parent = v.into();
17635 self
17636 }
17637
17638 pub fn set_environment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
17642 self.0.request.environment_id = v.into();
17643 self
17644 }
17645
17646 pub fn set_environment<T>(mut self, v: T) -> Self
17650 where
17651 T: std::convert::Into<crate::model::Environment>,
17652 {
17653 self.0.request.environment = std::option::Option::Some(v.into());
17654 self
17655 }
17656
17657 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
17661 where
17662 T: std::convert::Into<crate::model::Environment>,
17663 {
17664 self.0.request.environment = v.map(|x| x.into());
17665 self
17666 }
17667
17668 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17670 self.0.request.validate_only = v.into();
17671 self
17672 }
17673 }
17674
17675 #[doc(hidden)]
17676 impl gax::options::internal::RequestBuilder for CreateEnvironment {
17677 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17678 &mut self.0.options
17679 }
17680 }
17681
17682 #[derive(Clone, Debug)]
17701 pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
17702
17703 impl UpdateEnvironment {
17704 pub(crate) fn new(
17705 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17706 ) -> Self {
17707 Self(RequestBuilder::new(stub))
17708 }
17709
17710 pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
17712 mut self,
17713 v: V,
17714 ) -> Self {
17715 self.0.request = v.into();
17716 self
17717 }
17718
17719 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17721 self.0.options = v.into();
17722 self
17723 }
17724
17725 pub async fn send(self) -> Result<longrunning::model::Operation> {
17732 (*self.0.stub)
17733 .update_environment(self.0.request, self.0.options)
17734 .await
17735 .map(gax::response::Response::into_body)
17736 }
17737
17738 pub fn poller(
17740 self,
17741 ) -> impl lro::Poller<crate::model::Environment, crate::model::OperationMetadata> {
17742 type Operation = lro::internal::Operation<
17743 crate::model::Environment,
17744 crate::model::OperationMetadata,
17745 >;
17746 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17747 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17748
17749 let stub = self.0.stub.clone();
17750 let mut options = self.0.options.clone();
17751 options.set_retry_policy(gax::retry_policy::NeverRetry);
17752 let query = move |name| {
17753 let stub = stub.clone();
17754 let options = options.clone();
17755 async {
17756 let op = GetOperation::new(stub)
17757 .set_name(name)
17758 .with_options(options)
17759 .send()
17760 .await?;
17761 Ok(Operation::new(op))
17762 }
17763 };
17764
17765 let start = move || async {
17766 let op = self.send().await?;
17767 Ok(Operation::new(op))
17768 };
17769
17770 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
17771 }
17772
17773 pub fn set_update_mask<T>(mut self, v: T) -> Self
17777 where
17778 T: std::convert::Into<wkt::FieldMask>,
17779 {
17780 self.0.request.update_mask = std::option::Option::Some(v.into());
17781 self
17782 }
17783
17784 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17788 where
17789 T: std::convert::Into<wkt::FieldMask>,
17790 {
17791 self.0.request.update_mask = v.map(|x| x.into());
17792 self
17793 }
17794
17795 pub fn set_environment<T>(mut self, v: T) -> Self
17799 where
17800 T: std::convert::Into<crate::model::Environment>,
17801 {
17802 self.0.request.environment = std::option::Option::Some(v.into());
17803 self
17804 }
17805
17806 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
17810 where
17811 T: std::convert::Into<crate::model::Environment>,
17812 {
17813 self.0.request.environment = v.map(|x| x.into());
17814 self
17815 }
17816
17817 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
17819 self.0.request.validate_only = v.into();
17820 self
17821 }
17822 }
17823
17824 #[doc(hidden)]
17825 impl gax::options::internal::RequestBuilder for UpdateEnvironment {
17826 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17827 &mut self.0.options
17828 }
17829 }
17830
17831 #[derive(Clone, Debug)]
17850 pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
17851
17852 impl DeleteEnvironment {
17853 pub(crate) fn new(
17854 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17855 ) -> Self {
17856 Self(RequestBuilder::new(stub))
17857 }
17858
17859 pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
17861 mut self,
17862 v: V,
17863 ) -> Self {
17864 self.0.request = v.into();
17865 self
17866 }
17867
17868 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17870 self.0.options = v.into();
17871 self
17872 }
17873
17874 pub async fn send(self) -> Result<longrunning::model::Operation> {
17881 (*self.0.stub)
17882 .delete_environment(self.0.request, self.0.options)
17883 .await
17884 .map(gax::response::Response::into_body)
17885 }
17886
17887 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
17889 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
17890 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17891 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17892
17893 let stub = self.0.stub.clone();
17894 let mut options = self.0.options.clone();
17895 options.set_retry_policy(gax::retry_policy::NeverRetry);
17896 let query = move |name| {
17897 let stub = stub.clone();
17898 let options = options.clone();
17899 async {
17900 let op = GetOperation::new(stub)
17901 .set_name(name)
17902 .with_options(options)
17903 .send()
17904 .await?;
17905 Ok(Operation::new(op))
17906 }
17907 };
17908
17909 let start = move || async {
17910 let op = self.send().await?;
17911 Ok(Operation::new(op))
17912 };
17913
17914 lro::internal::new_unit_response_poller(
17915 polling_error_policy,
17916 polling_backoff_policy,
17917 start,
17918 query,
17919 )
17920 }
17921
17922 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17926 self.0.request.name = v.into();
17927 self
17928 }
17929 }
17930
17931 #[doc(hidden)]
17932 impl gax::options::internal::RequestBuilder for DeleteEnvironment {
17933 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
17934 &mut self.0.options
17935 }
17936 }
17937
17938 #[derive(Clone, Debug)]
17960 pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
17961
17962 impl ListEnvironments {
17963 pub(crate) fn new(
17964 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
17965 ) -> Self {
17966 Self(RequestBuilder::new(stub))
17967 }
17968
17969 pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
17971 mut self,
17972 v: V,
17973 ) -> Self {
17974 self.0.request = v.into();
17975 self
17976 }
17977
17978 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
17980 self.0.options = v.into();
17981 self
17982 }
17983
17984 pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
17986 (*self.0.stub)
17987 .list_environments(self.0.request, self.0.options)
17988 .await
17989 .map(gax::response::Response::into_body)
17990 }
17991
17992 pub fn by_page(
17994 self,
17995 ) -> impl gax::paginator::Paginator<crate::model::ListEnvironmentsResponse, gax::error::Error>
17996 {
17997 use std::clone::Clone;
17998 let token = self.0.request.page_token.clone();
17999 let execute = move |token: String| {
18000 let mut builder = self.clone();
18001 builder.0.request = builder.0.request.set_page_token(token);
18002 builder.send()
18003 };
18004 gax::paginator::internal::new_paginator(token, execute)
18005 }
18006
18007 pub fn by_item(
18009 self,
18010 ) -> impl gax::paginator::ItemPaginator<crate::model::ListEnvironmentsResponse, gax::error::Error>
18011 {
18012 use gax::paginator::Paginator;
18013 self.by_page().items()
18014 }
18015
18016 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18020 self.0.request.parent = v.into();
18021 self
18022 }
18023
18024 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18026 self.0.request.page_size = v.into();
18027 self
18028 }
18029
18030 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18032 self.0.request.page_token = v.into();
18033 self
18034 }
18035
18036 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18038 self.0.request.filter = v.into();
18039 self
18040 }
18041
18042 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
18044 self.0.request.order_by = v.into();
18045 self
18046 }
18047 }
18048
18049 #[doc(hidden)]
18050 impl gax::options::internal::RequestBuilder for ListEnvironments {
18051 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18052 &mut self.0.options
18053 }
18054 }
18055
18056 #[derive(Clone, Debug)]
18074 pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
18075
18076 impl GetEnvironment {
18077 pub(crate) fn new(
18078 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18079 ) -> Self {
18080 Self(RequestBuilder::new(stub))
18081 }
18082
18083 pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
18085 self.0.request = v.into();
18086 self
18087 }
18088
18089 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18091 self.0.options = v.into();
18092 self
18093 }
18094
18095 pub async fn send(self) -> Result<crate::model::Environment> {
18097 (*self.0.stub)
18098 .get_environment(self.0.request, self.0.options)
18099 .await
18100 .map(gax::response::Response::into_body)
18101 }
18102
18103 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18107 self.0.request.name = v.into();
18108 self
18109 }
18110 }
18111
18112 #[doc(hidden)]
18113 impl gax::options::internal::RequestBuilder for GetEnvironment {
18114 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18115 &mut self.0.options
18116 }
18117 }
18118
18119 #[derive(Clone, Debug)]
18141 pub struct ListSessions(RequestBuilder<crate::model::ListSessionsRequest>);
18142
18143 impl ListSessions {
18144 pub(crate) fn new(
18145 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18146 ) -> Self {
18147 Self(RequestBuilder::new(stub))
18148 }
18149
18150 pub fn with_request<V: Into<crate::model::ListSessionsRequest>>(mut self, v: V) -> Self {
18152 self.0.request = v.into();
18153 self
18154 }
18155
18156 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18158 self.0.options = v.into();
18159 self
18160 }
18161
18162 pub async fn send(self) -> Result<crate::model::ListSessionsResponse> {
18164 (*self.0.stub)
18165 .list_sessions(self.0.request, self.0.options)
18166 .await
18167 .map(gax::response::Response::into_body)
18168 }
18169
18170 pub fn by_page(
18172 self,
18173 ) -> impl gax::paginator::Paginator<crate::model::ListSessionsResponse, gax::error::Error>
18174 {
18175 use std::clone::Clone;
18176 let token = self.0.request.page_token.clone();
18177 let execute = move |token: String| {
18178 let mut builder = self.clone();
18179 builder.0.request = builder.0.request.set_page_token(token);
18180 builder.send()
18181 };
18182 gax::paginator::internal::new_paginator(token, execute)
18183 }
18184
18185 pub fn by_item(
18187 self,
18188 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSessionsResponse, gax::error::Error>
18189 {
18190 use gax::paginator::Paginator;
18191 self.by_page().items()
18192 }
18193
18194 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18198 self.0.request.parent = v.into();
18199 self
18200 }
18201
18202 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18204 self.0.request.page_size = v.into();
18205 self
18206 }
18207
18208 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18210 self.0.request.page_token = v.into();
18211 self
18212 }
18213
18214 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18216 self.0.request.filter = v.into();
18217 self
18218 }
18219 }
18220
18221 #[doc(hidden)]
18222 impl gax::options::internal::RequestBuilder for ListSessions {
18223 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18224 &mut self.0.options
18225 }
18226 }
18227
18228 #[derive(Clone, Debug)]
18250 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
18251
18252 impl ListLocations {
18253 pub(crate) fn new(
18254 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18255 ) -> Self {
18256 Self(RequestBuilder::new(stub))
18257 }
18258
18259 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
18261 mut self,
18262 v: V,
18263 ) -> Self {
18264 self.0.request = v.into();
18265 self
18266 }
18267
18268 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18270 self.0.options = v.into();
18271 self
18272 }
18273
18274 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
18276 (*self.0.stub)
18277 .list_locations(self.0.request, self.0.options)
18278 .await
18279 .map(gax::response::Response::into_body)
18280 }
18281
18282 pub fn by_page(
18284 self,
18285 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
18286 {
18287 use std::clone::Clone;
18288 let token = self.0.request.page_token.clone();
18289 let execute = move |token: String| {
18290 let mut builder = self.clone();
18291 builder.0.request = builder.0.request.set_page_token(token);
18292 builder.send()
18293 };
18294 gax::paginator::internal::new_paginator(token, execute)
18295 }
18296
18297 pub fn by_item(
18299 self,
18300 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
18301 {
18302 use gax::paginator::Paginator;
18303 self.by_page().items()
18304 }
18305
18306 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18308 self.0.request.name = v.into();
18309 self
18310 }
18311
18312 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18314 self.0.request.filter = v.into();
18315 self
18316 }
18317
18318 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18320 self.0.request.page_size = v.into();
18321 self
18322 }
18323
18324 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18326 self.0.request.page_token = v.into();
18327 self
18328 }
18329 }
18330
18331 #[doc(hidden)]
18332 impl gax::options::internal::RequestBuilder for ListLocations {
18333 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18334 &mut self.0.options
18335 }
18336 }
18337
18338 #[derive(Clone, Debug)]
18356 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
18357
18358 impl GetLocation {
18359 pub(crate) fn new(
18360 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18361 ) -> Self {
18362 Self(RequestBuilder::new(stub))
18363 }
18364
18365 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
18367 self.0.request = v.into();
18368 self
18369 }
18370
18371 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18373 self.0.options = v.into();
18374 self
18375 }
18376
18377 pub async fn send(self) -> Result<location::model::Location> {
18379 (*self.0.stub)
18380 .get_location(self.0.request, self.0.options)
18381 .await
18382 .map(gax::response::Response::into_body)
18383 }
18384
18385 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18387 self.0.request.name = v.into();
18388 self
18389 }
18390 }
18391
18392 #[doc(hidden)]
18393 impl gax::options::internal::RequestBuilder for GetLocation {
18394 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18395 &mut self.0.options
18396 }
18397 }
18398
18399 #[derive(Clone, Debug)]
18417 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
18418
18419 impl SetIamPolicy {
18420 pub(crate) fn new(
18421 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18422 ) -> Self {
18423 Self(RequestBuilder::new(stub))
18424 }
18425
18426 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
18428 self.0.request = v.into();
18429 self
18430 }
18431
18432 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18434 self.0.options = v.into();
18435 self
18436 }
18437
18438 pub async fn send(self) -> Result<iam_v1::model::Policy> {
18440 (*self.0.stub)
18441 .set_iam_policy(self.0.request, self.0.options)
18442 .await
18443 .map(gax::response::Response::into_body)
18444 }
18445
18446 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
18450 self.0.request.resource = v.into();
18451 self
18452 }
18453
18454 pub fn set_policy<T>(mut self, v: T) -> Self
18458 where
18459 T: std::convert::Into<iam_v1::model::Policy>,
18460 {
18461 self.0.request.policy = std::option::Option::Some(v.into());
18462 self
18463 }
18464
18465 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
18469 where
18470 T: std::convert::Into<iam_v1::model::Policy>,
18471 {
18472 self.0.request.policy = v.map(|x| x.into());
18473 self
18474 }
18475
18476 pub fn set_update_mask<T>(mut self, v: T) -> Self
18478 where
18479 T: std::convert::Into<wkt::FieldMask>,
18480 {
18481 self.0.request.update_mask = std::option::Option::Some(v.into());
18482 self
18483 }
18484
18485 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18487 where
18488 T: std::convert::Into<wkt::FieldMask>,
18489 {
18490 self.0.request.update_mask = v.map(|x| x.into());
18491 self
18492 }
18493 }
18494
18495 #[doc(hidden)]
18496 impl gax::options::internal::RequestBuilder for SetIamPolicy {
18497 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18498 &mut self.0.options
18499 }
18500 }
18501
18502 #[derive(Clone, Debug)]
18520 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
18521
18522 impl GetIamPolicy {
18523 pub(crate) fn new(
18524 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18525 ) -> Self {
18526 Self(RequestBuilder::new(stub))
18527 }
18528
18529 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
18531 self.0.request = v.into();
18532 self
18533 }
18534
18535 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18537 self.0.options = v.into();
18538 self
18539 }
18540
18541 pub async fn send(self) -> Result<iam_v1::model::Policy> {
18543 (*self.0.stub)
18544 .get_iam_policy(self.0.request, self.0.options)
18545 .await
18546 .map(gax::response::Response::into_body)
18547 }
18548
18549 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
18553 self.0.request.resource = v.into();
18554 self
18555 }
18556
18557 pub fn set_options<T>(mut self, v: T) -> Self
18559 where
18560 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
18561 {
18562 self.0.request.options = std::option::Option::Some(v.into());
18563 self
18564 }
18565
18566 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
18568 where
18569 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
18570 {
18571 self.0.request.options = v.map(|x| x.into());
18572 self
18573 }
18574 }
18575
18576 #[doc(hidden)]
18577 impl gax::options::internal::RequestBuilder for GetIamPolicy {
18578 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18579 &mut self.0.options
18580 }
18581 }
18582
18583 #[derive(Clone, Debug)]
18601 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
18602
18603 impl TestIamPermissions {
18604 pub(crate) fn new(
18605 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18606 ) -> Self {
18607 Self(RequestBuilder::new(stub))
18608 }
18609
18610 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
18612 mut self,
18613 v: V,
18614 ) -> Self {
18615 self.0.request = v.into();
18616 self
18617 }
18618
18619 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18621 self.0.options = v.into();
18622 self
18623 }
18624
18625 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
18627 (*self.0.stub)
18628 .test_iam_permissions(self.0.request, self.0.options)
18629 .await
18630 .map(gax::response::Response::into_body)
18631 }
18632
18633 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
18637 self.0.request.resource = v.into();
18638 self
18639 }
18640
18641 pub fn set_permissions<T, V>(mut self, v: T) -> Self
18645 where
18646 T: std::iter::IntoIterator<Item = V>,
18647 V: std::convert::Into<std::string::String>,
18648 {
18649 use std::iter::Iterator;
18650 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
18651 self
18652 }
18653 }
18654
18655 #[doc(hidden)]
18656 impl gax::options::internal::RequestBuilder for TestIamPermissions {
18657 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18658 &mut self.0.options
18659 }
18660 }
18661
18662 #[derive(Clone, Debug)]
18684 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
18685
18686 impl ListOperations {
18687 pub(crate) fn new(
18688 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18689 ) -> Self {
18690 Self(RequestBuilder::new(stub))
18691 }
18692
18693 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
18695 mut self,
18696 v: V,
18697 ) -> Self {
18698 self.0.request = v.into();
18699 self
18700 }
18701
18702 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18704 self.0.options = v.into();
18705 self
18706 }
18707
18708 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
18710 (*self.0.stub)
18711 .list_operations(self.0.request, self.0.options)
18712 .await
18713 .map(gax::response::Response::into_body)
18714 }
18715
18716 pub fn by_page(
18718 self,
18719 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
18720 {
18721 use std::clone::Clone;
18722 let token = self.0.request.page_token.clone();
18723 let execute = move |token: String| {
18724 let mut builder = self.clone();
18725 builder.0.request = builder.0.request.set_page_token(token);
18726 builder.send()
18727 };
18728 gax::paginator::internal::new_paginator(token, execute)
18729 }
18730
18731 pub fn by_item(
18733 self,
18734 ) -> impl gax::paginator::ItemPaginator<
18735 longrunning::model::ListOperationsResponse,
18736 gax::error::Error,
18737 > {
18738 use gax::paginator::Paginator;
18739 self.by_page().items()
18740 }
18741
18742 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18744 self.0.request.name = v.into();
18745 self
18746 }
18747
18748 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18750 self.0.request.filter = v.into();
18751 self
18752 }
18753
18754 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18756 self.0.request.page_size = v.into();
18757 self
18758 }
18759
18760 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18762 self.0.request.page_token = v.into();
18763 self
18764 }
18765
18766 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
18768 self.0.request.return_partial_success = v.into();
18769 self
18770 }
18771 }
18772
18773 #[doc(hidden)]
18774 impl gax::options::internal::RequestBuilder for ListOperations {
18775 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18776 &mut self.0.options
18777 }
18778 }
18779
18780 #[derive(Clone, Debug)]
18798 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
18799
18800 impl GetOperation {
18801 pub(crate) fn new(
18802 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18803 ) -> Self {
18804 Self(RequestBuilder::new(stub))
18805 }
18806
18807 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
18809 mut self,
18810 v: V,
18811 ) -> Self {
18812 self.0.request = v.into();
18813 self
18814 }
18815
18816 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18818 self.0.options = v.into();
18819 self
18820 }
18821
18822 pub async fn send(self) -> Result<longrunning::model::Operation> {
18824 (*self.0.stub)
18825 .get_operation(self.0.request, self.0.options)
18826 .await
18827 .map(gax::response::Response::into_body)
18828 }
18829
18830 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18832 self.0.request.name = v.into();
18833 self
18834 }
18835 }
18836
18837 #[doc(hidden)]
18838 impl gax::options::internal::RequestBuilder for GetOperation {
18839 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18840 &mut self.0.options
18841 }
18842 }
18843
18844 #[derive(Clone, Debug)]
18862 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
18863
18864 impl DeleteOperation {
18865 pub(crate) fn new(
18866 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18867 ) -> Self {
18868 Self(RequestBuilder::new(stub))
18869 }
18870
18871 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
18873 mut self,
18874 v: V,
18875 ) -> Self {
18876 self.0.request = v.into();
18877 self
18878 }
18879
18880 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18882 self.0.options = v.into();
18883 self
18884 }
18885
18886 pub async fn send(self) -> Result<()> {
18888 (*self.0.stub)
18889 .delete_operation(self.0.request, self.0.options)
18890 .await
18891 .map(gax::response::Response::into_body)
18892 }
18893
18894 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18896 self.0.request.name = v.into();
18897 self
18898 }
18899 }
18900
18901 #[doc(hidden)]
18902 impl gax::options::internal::RequestBuilder for DeleteOperation {
18903 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18904 &mut self.0.options
18905 }
18906 }
18907
18908 #[derive(Clone, Debug)]
18926 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
18927
18928 impl CancelOperation {
18929 pub(crate) fn new(
18930 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataplexService>,
18931 ) -> Self {
18932 Self(RequestBuilder::new(stub))
18933 }
18934
18935 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
18937 mut self,
18938 v: V,
18939 ) -> Self {
18940 self.0.request = v.into();
18941 self
18942 }
18943
18944 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
18946 self.0.options = v.into();
18947 self
18948 }
18949
18950 pub async fn send(self) -> Result<()> {
18952 (*self.0.stub)
18953 .cancel_operation(self.0.request, self.0.options)
18954 .await
18955 .map(gax::response::Response::into_body)
18956 }
18957
18958 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18960 self.0.request.name = v.into();
18961 self
18962 }
18963 }
18964
18965 #[doc(hidden)]
18966 impl gax::options::internal::RequestBuilder for CancelOperation {
18967 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
18968 &mut self.0.options
18969 }
18970 }
18971}